From 6343829a391df59e46e513c84b6264ee71ad9518 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Wed, 12 Nov 2008 03:58:08 +0000 Subject: Revert the size_t modifications from HEAD that had led to more knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD. --- crypto/pkcs12/p12_decr.c | 19 ++++++++----------- crypto/pkcs12/pkcs12.h | 3 +-- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'crypto/pkcs12') diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index ddc4b7356c..ba77dbbe32 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -69,9 +69,8 @@ */ unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, - int passlen, unsigned char *in, int inlen, - unsigned char **data, size_t *datalen, - int en_de) + int passlen, unsigned char *in, int inlen, unsigned char **data, + int *datalen, int en_de) { unsigned char *out; int outlen, i; @@ -112,13 +111,12 @@ 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; - size_t outlen; + int outlen; if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length, &out, &outlen, 0)) { @@ -149,10 +147,9 @@ 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; @@ -167,7 +164,7 @@ ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, 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 2d51943e45..425274d4f7 100644 --- a/crypto/pkcs12/pkcs12.h +++ b/crypto/pkcs12/pkcs12.h @@ -208,8 +208,7 @@ 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, size_t *datalen, - int en_de); + unsigned char **data, int *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, -- cgit v1.2.3