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/dh | |
| 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/dh')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/dh/dh_pmeth.c | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 02ec2d47b4..d39f4b373d 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
| @@ -168,7 +168,7 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) | |||
| 168 | 168 | ||
| 169 | err: | 169 | err: |
| 170 | if (penc) | 170 | if (penc) |
| 171 | OPENSSL_free(penc); | 171 | free(penc); |
| 172 | if (pval) | 172 | if (pval) |
| 173 | ASN1_STRING_free(pval); | 173 | ASN1_STRING_free(pval); |
| 174 | 174 | ||
| @@ -277,7 +277,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) | |||
| 277 | 277 | ||
| 278 | err: | 278 | err: |
| 279 | if (dp != NULL) | 279 | if (dp != NULL) |
| 280 | OPENSSL_free(dp); | 280 | free(dp); |
| 281 | if (params != NULL) | 281 | if (params != NULL) |
| 282 | ASN1_STRING_free(params); | 282 | ASN1_STRING_free(params); |
| 283 | if (prkey != NULL) | 283 | if (prkey != NULL) |
| @@ -353,7 +353,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, | |||
| 353 | else | 353 | else |
| 354 | ktype = "PKCS#3 DH Parameters"; | 354 | ktype = "PKCS#3 DH Parameters"; |
| 355 | 355 | ||
| 356 | m= OPENSSL_malloc(buf_len+10); | 356 | m= malloc(buf_len+10); |
| 357 | if (m == NULL) | 357 | if (m == NULL) |
| 358 | { | 358 | { |
| 359 | reason=ERR_R_MALLOC_FAILURE; | 359 | reason=ERR_R_MALLOC_FAILURE; |
| @@ -384,7 +384,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, | |||
| 384 | err: | 384 | err: |
| 385 | DHerr(DH_F_DO_DH_PRINT,reason); | 385 | DHerr(DH_F_DO_DH_PRINT,reason); |
| 386 | } | 386 | } |
| 387 | if (m != NULL) OPENSSL_free(m); | 387 | if (m != NULL) free(m); |
| 388 | return(ret); | 388 | return(ret); |
| 389 | } | 389 | } |
| 390 | 390 | ||
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index a40caaf75b..4e3d25b7e5 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
| @@ -110,7 +110,7 @@ DH *DH_new_method(ENGINE *engine) | |||
| 110 | { | 110 | { |
| 111 | DH *ret; | 111 | DH *ret; |
| 112 | 112 | ||
| 113 | ret=(DH *)OPENSSL_malloc(sizeof(DH)); | 113 | ret=(DH *)malloc(sizeof(DH)); |
| 114 | if (ret == NULL) | 114 | if (ret == NULL) |
| 115 | { | 115 | { |
| 116 | DHerr(DH_F_DH_NEW_METHOD,ERR_R_MALLOC_FAILURE); | 116 | DHerr(DH_F_DH_NEW_METHOD,ERR_R_MALLOC_FAILURE); |
| @@ -124,7 +124,7 @@ DH *DH_new_method(ENGINE *engine) | |||
| 124 | if (!ENGINE_init(engine)) | 124 | if (!ENGINE_init(engine)) |
| 125 | { | 125 | { |
| 126 | DHerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB); | 126 | DHerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB); |
| 127 | OPENSSL_free(ret); | 127 | free(ret); |
| 128 | return NULL; | 128 | return NULL; |
| 129 | } | 129 | } |
| 130 | ret->engine = engine; | 130 | ret->engine = engine; |
| @@ -138,7 +138,7 @@ DH *DH_new_method(ENGINE *engine) | |||
| 138 | { | 138 | { |
| 139 | DHerr(DH_F_DH_NEW_METHOD,ERR_R_ENGINE_LIB); | 139 | DHerr(DH_F_DH_NEW_METHOD,ERR_R_ENGINE_LIB); |
| 140 | ENGINE_finish(ret->engine); | 140 | ENGINE_finish(ret->engine); |
| 141 | OPENSSL_free(ret); | 141 | free(ret); |
| 142 | return NULL; | 142 | return NULL; |
| 143 | } | 143 | } |
| 144 | } | 144 | } |
| @@ -167,7 +167,7 @@ DH *DH_new_method(ENGINE *engine) | |||
| 167 | ENGINE_finish(ret->engine); | 167 | ENGINE_finish(ret->engine); |
| 168 | #endif | 168 | #endif |
| 169 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); | 169 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); |
| 170 | OPENSSL_free(ret); | 170 | free(ret); |
| 171 | ret=NULL; | 171 | ret=NULL; |
| 172 | } | 172 | } |
| 173 | return(ret); | 173 | return(ret); |
| @@ -203,11 +203,11 @@ void DH_free(DH *r) | |||
| 203 | if (r->g != NULL) BN_clear_free(r->g); | 203 | if (r->g != NULL) BN_clear_free(r->g); |
| 204 | if (r->q != NULL) BN_clear_free(r->q); | 204 | if (r->q != NULL) BN_clear_free(r->q); |
| 205 | if (r->j != NULL) BN_clear_free(r->j); | 205 | if (r->j != NULL) BN_clear_free(r->j); |
| 206 | if (r->seed) OPENSSL_free(r->seed); | 206 | if (r->seed) free(r->seed); |
| 207 | if (r->counter != NULL) BN_clear_free(r->counter); | 207 | if (r->counter != NULL) BN_clear_free(r->counter); |
| 208 | if (r->pub_key != NULL) BN_clear_free(r->pub_key); | 208 | if (r->pub_key != NULL) BN_clear_free(r->pub_key); |
| 209 | if (r->priv_key != NULL) BN_clear_free(r->priv_key); | 209 | if (r->priv_key != NULL) BN_clear_free(r->priv_key); |
| 210 | OPENSSL_free(r); | 210 | free(r); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | int DH_up_ref(DH *r) | 213 | int DH_up_ref(DH *r) |
diff --git a/src/lib/libcrypto/dh/dh_pmeth.c b/src/lib/libcrypto/dh/dh_pmeth.c index 5ae72b7d4c..ec4553c0a8 100644 --- a/src/lib/libcrypto/dh/dh_pmeth.c +++ b/src/lib/libcrypto/dh/dh_pmeth.c | |||
| @@ -80,7 +80,7 @@ typedef struct | |||
| 80 | static int pkey_dh_init(EVP_PKEY_CTX *ctx) | 80 | static int pkey_dh_init(EVP_PKEY_CTX *ctx) |
| 81 | { | 81 | { |
| 82 | DH_PKEY_CTX *dctx; | 82 | DH_PKEY_CTX *dctx; |
| 83 | dctx = OPENSSL_malloc(sizeof(DH_PKEY_CTX)); | 83 | dctx = malloc(sizeof(DH_PKEY_CTX)); |
| 84 | if (!dctx) | 84 | if (!dctx) |
| 85 | return 0; | 85 | return 0; |
| 86 | dctx->prime_len = 1024; | 86 | dctx->prime_len = 1024; |
| @@ -111,7 +111,7 @@ static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx) | |||
| 111 | { | 111 | { |
| 112 | DH_PKEY_CTX *dctx = ctx->data; | 112 | DH_PKEY_CTX *dctx = ctx->data; |
| 113 | if (dctx) | 113 | if (dctx) |
| 114 | OPENSSL_free(dctx); | 114 | free(dctx); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | 117 | static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) |
