summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-11-02 09:22:29 +0000
committerBen Laurie <ben@openssl.org>2008-11-02 09:22:29 +0000
commitd0a20cafa1ee76ae0b270e6bb6db50f18e874cf6 (patch)
tree5e901a8b15ae40b6c845fb3610d7d7a2ee5905f5 /crypto/pkcs12
parent8da07655ee528126e00e338b48e62be5845918e8 (diff)
Fix warnings.
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r--crypto/pkcs12/p12_decr.c19
-rw-r--r--crypto/pkcs12/pkcs12.h3
2 files changed, 13 insertions, 9 deletions
diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c
index 74c961a92b..93a8639cf3 100644
--- a/crypto/pkcs12/p12_decr.c
+++ b/crypto/pkcs12/p12_decr.c
@@ -69,8 +69,9 @@
*/
unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
- int passlen, unsigned char *in, int inlen, unsigned char **data,
- int *datalen, int en_de)
+ int passlen, unsigned char *in, int inlen,
+ unsigned char **data, size_t *datalen,
+ int en_de)
{
unsigned char *out;
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,
- 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;
const unsigned char *p;
void *ret;
- int outlen;
+ size_t outlen;
if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length,
&out, &outlen, 0)) {
@@ -147,9 +149,10 @@ void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
* if zbuf set zero encoding.
*/
-ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it,
- const char *pass, int passlen,
- void *obj, int zbuf)
+ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
+ const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ void *obj, int zbuf)
{
ASN1_OCTET_STRING *oct;
unsigned char *in = NULL;
@@ -164,7 +167,7 @@ ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *i
return NULL;
}
if (!PKCS12_pbe_crypt(algor, pass, passlen, in, inlen, &oct->data,
- &oct->length, 1)) {
+ &oct->length, 1)) {
PKCS12err(PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR);
OPENSSL_free(in);
return NULL;
diff --git a/crypto/pkcs12/pkcs12.h b/crypto/pkcs12/pkcs12.h
index c84606dc93..a26a73c956 100644
--- a/crypto/pkcs12/pkcs12.h
+++ b/crypto/pkcs12/pkcs12.h
@@ -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);
unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
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,
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,