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/rsa/rsa_eay.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/rsa/rsa_eay.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_eay.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c index 88ee2cb557..dcf0c16a8f 100644 --- a/src/lib/libcrypto/rsa/rsa_eay.c +++ b/src/lib/libcrypto/rsa/rsa_eay.c | |||
@@ -185,7 +185,7 @@ static int RSA_eay_public_encrypt(int flen, const unsigned char *from, | |||
185 | f = BN_CTX_get(ctx); | 185 | f = BN_CTX_get(ctx); |
186 | ret = BN_CTX_get(ctx); | 186 | ret = BN_CTX_get(ctx); |
187 | num=BN_num_bytes(rsa->n); | 187 | num=BN_num_bytes(rsa->n); |
188 | buf = OPENSSL_malloc(num); | 188 | buf = malloc(num); |
189 | if (!f || !ret || !buf) | 189 | if (!f || !ret || !buf) |
190 | { | 190 | { |
191 | RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE); | 191 | RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE); |
@@ -247,7 +247,7 @@ err: | |||
247 | if (buf != NULL) | 247 | if (buf != NULL) |
248 | { | 248 | { |
249 | OPENSSL_cleanse(buf,num); | 249 | OPENSSL_cleanse(buf,num); |
250 | OPENSSL_free(buf); | 250 | free(buf); |
251 | } | 251 | } |
252 | return(r); | 252 | return(r); |
253 | } | 253 | } |
@@ -366,7 +366,7 @@ static int RSA_eay_private_encrypt(int flen, const unsigned char *from, | |||
366 | f = BN_CTX_get(ctx); | 366 | f = BN_CTX_get(ctx); |
367 | ret = BN_CTX_get(ctx); | 367 | ret = BN_CTX_get(ctx); |
368 | num = BN_num_bytes(rsa->n); | 368 | num = BN_num_bytes(rsa->n); |
369 | buf = OPENSSL_malloc(num); | 369 | buf = malloc(num); |
370 | if(!f || !ret || !buf) | 370 | if(!f || !ret || !buf) |
371 | { | 371 | { |
372 | RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE); | 372 | RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE); |
@@ -484,7 +484,7 @@ err: | |||
484 | if (buf != NULL) | 484 | if (buf != NULL) |
485 | { | 485 | { |
486 | OPENSSL_cleanse(buf,num); | 486 | OPENSSL_cleanse(buf,num); |
487 | OPENSSL_free(buf); | 487 | free(buf); |
488 | } | 488 | } |
489 | return(r); | 489 | return(r); |
490 | } | 490 | } |
@@ -509,7 +509,7 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from, | |||
509 | f = BN_CTX_get(ctx); | 509 | f = BN_CTX_get(ctx); |
510 | ret = BN_CTX_get(ctx); | 510 | ret = BN_CTX_get(ctx); |
511 | num = BN_num_bytes(rsa->n); | 511 | num = BN_num_bytes(rsa->n); |
512 | buf = OPENSSL_malloc(num); | 512 | buf = malloc(num); |
513 | if(!f || !ret || !buf) | 513 | if(!f || !ret || !buf) |
514 | { | 514 | { |
515 | RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE); | 515 | RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE); |
@@ -624,7 +624,7 @@ err: | |||
624 | if (buf != NULL) | 624 | if (buf != NULL) |
625 | { | 625 | { |
626 | OPENSSL_cleanse(buf,num); | 626 | OPENSSL_cleanse(buf,num); |
627 | OPENSSL_free(buf); | 627 | free(buf); |
628 | } | 628 | } |
629 | return(r); | 629 | return(r); |
630 | } | 630 | } |
@@ -666,7 +666,7 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from, | |||
666 | f = BN_CTX_get(ctx); | 666 | f = BN_CTX_get(ctx); |
667 | ret = BN_CTX_get(ctx); | 667 | ret = BN_CTX_get(ctx); |
668 | num=BN_num_bytes(rsa->n); | 668 | num=BN_num_bytes(rsa->n); |
669 | buf = OPENSSL_malloc(num); | 669 | buf = malloc(num); |
670 | if(!f || !ret || !buf) | 670 | if(!f || !ret || !buf) |
671 | { | 671 | { |
672 | RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE); | 672 | RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE); |
@@ -729,7 +729,7 @@ err: | |||
729 | if (buf != NULL) | 729 | if (buf != NULL) |
730 | { | 730 | { |
731 | OPENSSL_cleanse(buf,num); | 731 | OPENSSL_cleanse(buf,num); |
732 | OPENSSL_free(buf); | 732 | free(buf); |
733 | } | 733 | } |
734 | return(r); | 734 | return(r); |
735 | } | 735 | } |