diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/asn1/a_int.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.zip |
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free
Diffstat (limited to 'src/lib/libcrypto/asn1/a_int.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_int.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index 297c45a9ff..6c38ace8f9 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
@@ -194,9 +194,9 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
194 | p= *pp; | 194 | p= *pp; |
195 | pend = p + len; | 195 | pend = p + len; |
196 | 196 | ||
197 | /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it | 197 | /* We must malloc stuff, even for 0 bytes otherwise it |
198 | * signifies a missing NULL parameter. */ | 198 | * signifies a missing NULL parameter. */ |
199 | s=(unsigned char *)OPENSSL_malloc((int)len+1); | 199 | s=(unsigned char *)malloc((int)len+1); |
200 | if (s == NULL) | 200 | if (s == NULL) |
201 | { | 201 | { |
202 | i=ERR_R_MALLOC_FAILURE; | 202 | i=ERR_R_MALLOC_FAILURE; |
@@ -249,7 +249,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
249 | memcpy(s,p,(int)len); | 249 | memcpy(s,p,(int)len); |
250 | } | 250 | } |
251 | 251 | ||
252 | if (ret->data != NULL) OPENSSL_free(ret->data); | 252 | if (ret->data != NULL) free(ret->data); |
253 | ret->data=s; | 253 | ret->data=s; |
254 | ret->length=(int)len; | 254 | ret->length=(int)len; |
255 | if (a != NULL) (*a)=ret; | 255 | if (a != NULL) (*a)=ret; |
@@ -300,9 +300,9 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
300 | goto err; | 300 | goto err; |
301 | } | 301 | } |
302 | 302 | ||
303 | /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it | 303 | /* We must malloc stuff, even for 0 bytes otherwise it |
304 | * signifies a missing NULL parameter. */ | 304 | * signifies a missing NULL parameter. */ |
305 | s=(unsigned char *)OPENSSL_malloc((int)len+1); | 305 | s=(unsigned char *)malloc((int)len+1); |
306 | if (s == NULL) | 306 | if (s == NULL) |
307 | { | 307 | { |
308 | i=ERR_R_MALLOC_FAILURE; | 308 | i=ERR_R_MALLOC_FAILURE; |
@@ -319,7 +319,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
319 | p+=len; | 319 | p+=len; |
320 | } | 320 | } |
321 | 321 | ||
322 | if (ret->data != NULL) OPENSSL_free(ret->data); | 322 | if (ret->data != NULL) free(ret->data); |
323 | ret->data=s; | 323 | ret->data=s; |
324 | ret->length=(int)len; | 324 | ret->length=(int)len; |
325 | if (a != NULL) (*a)=ret; | 325 | if (a != NULL) (*a)=ret; |
@@ -343,8 +343,8 @@ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) | |||
343 | if (a->length < (int)(sizeof(long)+1)) | 343 | if (a->length < (int)(sizeof(long)+1)) |
344 | { | 344 | { |
345 | if (a->data != NULL) | 345 | if (a->data != NULL) |
346 | OPENSSL_free(a->data); | 346 | free(a->data); |
347 | if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL) | 347 | if ((a->data=(unsigned char *)malloc(sizeof(long)+1)) != NULL) |
348 | memset((char *)a->data,0,sizeof(long)+1); | 348 | memset((char *)a->data,0,sizeof(long)+1); |
349 | } | 349 | } |
350 | if (a->data == NULL) | 350 | if (a->data == NULL) |
@@ -422,7 +422,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) | |||
422 | len=((j == 0)?0:((j/8)+1)); | 422 | len=((j == 0)?0:((j/8)+1)); |
423 | if (ret->length < len+4) | 423 | if (ret->length < len+4) |
424 | { | 424 | { |
425 | unsigned char *new_data=OPENSSL_realloc(ret->data, len+4); | 425 | unsigned char *new_data=realloc(ret->data, len+4); |
426 | if (!new_data) | 426 | if (!new_data) |
427 | { | 427 | { |
428 | ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE); | 428 | ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE); |