Fix warnings.

This commit is contained in:
Ben Laurie 2008-11-02 09:22:29 +00:00
parent 8da07655ee
commit d0a20cafa1
3 changed files with 14 additions and 10 deletions

View File

@ -79,7 +79,7 @@ typedef unsigned char u8;
# endif # endif
# define GETU32(p) SWAP(*((u32 *)(p))) # define GETU32(p) SWAP(*((u32 *)(p)))
# define PUTU32(p,v) (*((u32 *)(p)) = SWAP((v))) # define PUTU32(p,v) (*((u32 *)(p)) = SWAP((v)))
#elif defined(__GNUC__) && __GNUC__>=2 && (defined(__i386) || defined(__x86_64)) #elif defined(__GNUC__) && __GNUC__>=2 && (defined(__i386) || defined(__x86_64)) && !defined(PEDANTIC)
# if defined(B_ENDIAN) /* stratus.com does it */ # if defined(B_ENDIAN) /* stratus.com does it */
# define GETU32(p) (*(u32 *)(p)) # define GETU32(p) (*(u32 *)(p))
# define PUTU32(p,v) (*(u32 *)(p)=(v)) # define PUTU32(p,v) (*(u32 *)(p)=(v))

View File

@ -69,8 +69,9 @@
*/ */
unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
int passlen, unsigned char *in, int inlen, unsigned char **data, int passlen, unsigned char *in, int inlen,
int *datalen, int en_de) unsigned char **data, size_t *datalen,
int en_de)
{ {
unsigned char *out; unsigned char *out;
int outlen, i; int outlen, i;
@ -111,12 +112,13 @@ unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
*/ */
void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf) const char *pass, int passlen,
ASN1_OCTET_STRING *oct, int zbuf)
{ {
unsigned char *out; unsigned char *out;
const unsigned char *p; const unsigned char *p;
void *ret; void *ret;
int outlen; size_t outlen;
if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length, if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length,
&out, &outlen, 0)) { &out, &outlen, 0)) {
@ -147,7 +149,8 @@ void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
* if zbuf set zero encoding. * if zbuf set zero encoding.
*/ */
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
const ASN1_ITEM *it,
const char *pass, int passlen, const char *pass, int passlen,
void *obj, int zbuf) void *obj, int zbuf)
{ {

View File

@ -208,7 +208,8 @@ ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
int passlen, unsigned char *in, int inlen, int passlen, unsigned char *in, int inlen,
unsigned char **data, int *datalen, int en_de); unsigned char **data, size_t *datalen,
int en_de);
void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it,