diff options
author | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
commit | 6343829a391df59e46e513c84b6264ee71ad9518 (patch) | |
tree | 9823103bf5828e47081ac906203516bdc332f577 /crypto/asn1/a_int.c | |
parent | 2401debe83e8df930907a39065ebf9a54354f123 (diff) |
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.
Diffstat (limited to 'crypto/asn1/a_int.c')
-rw-r--r-- | crypto/asn1/a_int.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 7691193c51..c6fd204ae3 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -176,7 +176,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) /* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, - size_t len) + long len) { ASN1_INTEGER *ret=NULL; const unsigned char *p, *pend; @@ -196,7 +196,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it * signifies a missing NULL parameter. */ - s=OPENSSL_malloc(len+1); + s=(unsigned char *)OPENSSL_malloc((int)len+1); if (s == NULL) { i=ERR_R_MALLOC_FAILURE; @@ -246,7 +246,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, p++; len--; } - memcpy(s,p,len); + memcpy(s,p,(int)len); } if (ret->data != NULL) OPENSSL_free(ret->data); @@ -269,12 +269,12 @@ err: */ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, - size_t length) + long length) { ASN1_INTEGER *ret=NULL; const unsigned char *p; unsigned char *to,*s; - size_t len; + long len; int inf,tag,xclass; int i; @@ -302,7 +302,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it * signifies a missing NULL parameter. */ - s=OPENSSL_malloc(len+1); + s=(unsigned char *)OPENSSL_malloc((int)len+1); if (s == NULL) { i=ERR_R_MALLOC_FAILURE; @@ -316,7 +316,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, p++; len--; } - memcpy(s,p,len); + memcpy(s,p,(int)len); p+=len; } @@ -405,7 +405,7 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a) ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) { ASN1_INTEGER *ret; - size_t len,j; + int len,j; if (ai == NULL) ret=M_ASN1_INTEGER_new(); @@ -423,7 +423,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) len=((j == 0)?0:((j/8)+1)); if (ret->length < len+4) { - unsigned char *new_data=OPENSSL_realloc(ret->data, len+4U); + unsigned char *new_data=OPENSSL_realloc(ret->data, len+4); if (!new_data) { ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE); |