diff options
| author | beck <> | 2014-04-17 13:37:50 +0000 |
|---|---|---|
| committer | beck <> | 2014-04-17 13:37:50 +0000 |
| commit | 6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd (patch) | |
| tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/srp/srp_lib.c | |
| parent | 4d13fb9c7b5ac7311d7031173c21ab0121388413 (diff) | |
| download | openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.tar.gz openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.tar.bz2 openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.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/srp/srp_lib.c')
| -rw-r--r-- | src/lib/libcrypto/srp/srp_lib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/srp/srp_lib.c b/src/lib/libcrypto/srp/srp_lib.c index 7c1dcc5111..8cc94f51db 100644 --- a/src/lib/libcrypto/srp/srp_lib.c +++ b/src/lib/libcrypto/srp/srp_lib.c | |||
| @@ -89,7 +89,7 @@ static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g) | |||
| 89 | int longg ; | 89 | int longg ; |
| 90 | int longN = BN_num_bytes(N); | 90 | int longN = BN_num_bytes(N); |
| 91 | 91 | ||
| 92 | if ((tmp = OPENSSL_malloc(longN)) == NULL) | 92 | if ((tmp = malloc(longN)) == NULL) |
| 93 | return NULL; | 93 | return NULL; |
| 94 | BN_bn2bin(N,tmp) ; | 94 | BN_bn2bin(N,tmp) ; |
| 95 | 95 | ||
| @@ -102,7 +102,7 @@ static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g) | |||
| 102 | /* use the zeros behind to pad on left */ | 102 | /* use the zeros behind to pad on left */ |
| 103 | EVP_DigestUpdate(&ctxt, tmp + longg, longN-longg); | 103 | EVP_DigestUpdate(&ctxt, tmp + longg, longN-longg); |
| 104 | EVP_DigestUpdate(&ctxt, tmp, longg); | 104 | EVP_DigestUpdate(&ctxt, tmp, longg); |
| 105 | OPENSSL_free(tmp); | 105 | free(tmp); |
| 106 | 106 | ||
| 107 | EVP_DigestFinal_ex(&ctxt, digest, NULL); | 107 | EVP_DigestFinal_ex(&ctxt, digest, NULL); |
| 108 | EVP_MD_CTX_cleanup(&ctxt); | 108 | EVP_MD_CTX_cleanup(&ctxt); |
| @@ -123,7 +123,7 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N) | |||
| 123 | 123 | ||
| 124 | longN= BN_num_bytes(N); | 124 | longN= BN_num_bytes(N); |
| 125 | 125 | ||
| 126 | if ((cAB = OPENSSL_malloc(2*longN)) == NULL) | 126 | if ((cAB = malloc(2*longN)) == NULL) |
| 127 | return NULL; | 127 | return NULL; |
| 128 | 128 | ||
| 129 | memset(cAB, 0, longN); | 129 | memset(cAB, 0, longN); |
| @@ -132,7 +132,7 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N) | |||
| 132 | EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL); | 132 | EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL); |
| 133 | EVP_DigestUpdate(&ctxt, cAB + BN_bn2bin(A,cAB+longN), longN); | 133 | EVP_DigestUpdate(&ctxt, cAB + BN_bn2bin(A,cAB+longN), longN); |
| 134 | EVP_DigestUpdate(&ctxt, cAB + BN_bn2bin(B,cAB+longN), longN); | 134 | EVP_DigestUpdate(&ctxt, cAB + BN_bn2bin(B,cAB+longN), longN); |
| 135 | OPENSSL_free(cAB); | 135 | free(cAB); |
| 136 | EVP_DigestFinal_ex(&ctxt, cu, NULL); | 136 | EVP_DigestFinal_ex(&ctxt, cu, NULL); |
| 137 | EVP_MD_CTX_cleanup(&ctxt); | 137 | EVP_MD_CTX_cleanup(&ctxt); |
| 138 | 138 | ||
| @@ -215,7 +215,7 @@ BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass) | |||
| 215 | (pass == NULL)) | 215 | (pass == NULL)) |
| 216 | return NULL; | 216 | return NULL; |
| 217 | 217 | ||
| 218 | if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL) | 218 | if ((cs = malloc(BN_num_bytes(s))) == NULL) |
| 219 | return NULL; | 219 | return NULL; |
| 220 | 220 | ||
| 221 | EVP_MD_CTX_init(&ctxt); | 221 | EVP_MD_CTX_init(&ctxt); |
| @@ -228,7 +228,7 @@ BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass) | |||
| 228 | EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL); | 228 | EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL); |
| 229 | BN_bn2bin(s,cs); | 229 | BN_bn2bin(s,cs); |
| 230 | EVP_DigestUpdate(&ctxt, cs, BN_num_bytes(s)); | 230 | EVP_DigestUpdate(&ctxt, cs, BN_num_bytes(s)); |
| 231 | OPENSSL_free(cs); | 231 | free(cs); |
| 232 | EVP_DigestUpdate(&ctxt, dig, sizeof(dig)); | 232 | EVP_DigestUpdate(&ctxt, dig, sizeof(dig)); |
| 233 | EVP_DigestFinal_ex(&ctxt, dig, NULL); | 233 | EVP_DigestFinal_ex(&ctxt, dig, NULL); |
| 234 | EVP_MD_CTX_cleanup(&ctxt); | 234 | EVP_MD_CTX_cleanup(&ctxt); |
