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_bitstr.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_bitstr.c')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index 63331b2e1e..34179960b8 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -60,13 +60,12 @@ #include "cryptlib.h" #include <openssl/asn1.h> -int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, size_t len) - { return M_ASN1_BIT_STRING_set(x, d, len); } +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) +{ return M_ASN1_BIT_STRING_set(x, d, len); } int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) { - int ret,j,bits; - size_t len; + int ret,j,bits,len; unsigned char *p,*d; if (a == NULL) return(0); @@ -115,7 +114,7 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) } ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, - const unsigned char **pp, size_t len) + const unsigned char **pp, long len) { ASN1_BIT_STRING *ret=NULL; const unsigned char *p; @@ -145,13 +144,13 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, if (len-- > 1) /* using one because of the bits left byte */ { - s=OPENSSL_malloc(len); + s=(unsigned char *)OPENSSL_malloc((int)len); if (s == NULL) { i=ERR_R_MALLOC_FAILURE; goto err; } - memcpy(s,p,len); + memcpy(s,p,(int)len); s[len-1]&=(0xff<<i); p+=len; } @@ -174,10 +173,9 @@ err: /* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de> */ -int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value) +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) { - int v,iv; - size_t w; + int w,v,iv; unsigned char *c; w=n/8; @@ -194,9 +192,11 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value) { if (!value) return(1); /* Don't need to set */ if (a->data == NULL) - c=OPENSSL_malloc(w+1); + c=(unsigned char *)OPENSSL_malloc(w+1); else - c=OPENSSL_realloc_clean(a->data, a->length, w+1); + c=(unsigned char *)OPENSSL_realloc_clean(a->data, + a->length, + w+1); if (c == NULL) { ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT,ERR_R_MALLOC_FAILURE); @@ -212,7 +212,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value) return(1); } -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, size_t n) +int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) { int w,v; @@ -230,7 +230,7 @@ int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, size_t n) * 'len' is the length of 'flags'. */ int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, - unsigned char *flags, size_t flags_len) + unsigned char *flags, int flags_len) { int i, ok; /* Check if there is one bit set at all. */ |