diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2014-05-22 21:56:03 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2014-05-22 21:56:03 +0000 |
commit | 79d995efcd8c701059bb4cc13607a2e4d90f1f0b (patch) | |
tree | 060469135f3458944161bad2dfe0fc07724ca996 /lib | |
parent | e4cd58f507fd46d613ab7dfd04bff18eeb5b8b95 (diff) |
Convert OPENSSL_malloc stuff back to intrinsics, a few were missed
as new stuff was brought in.
ok miod@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/evp/e_aes.c | 4 | ||||
-rw-r--r-- | lib/libcrypto/evp/e_chacha20poly1305.c | 4 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa_lib.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/libcrypto/evp/e_aes.c b/lib/libcrypto/evp/e_aes.c index 4da61b8f626..2e81495e5f4 100644 --- a/lib/libcrypto/evp/e_aes.c +++ b/lib/libcrypto/evp/e_aes.c @@ -1294,7 +1294,7 @@ aead_aes_gcm_init(EVP_AEAD_CTX *ctx, const unsigned char *key, size_t key_len, return 0; } - gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_ctx)); + gcm_ctx = malloc(sizeof(struct aead_aes_gcm_ctx)); if (gcm_ctx == NULL) return 0; @@ -1321,7 +1321,7 @@ aead_aes_gcm_cleanup(EVP_AEAD_CTX *ctx) { struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state; - OPENSSL_free(gcm_ctx); + free(gcm_ctx); } static ssize_t diff --git a/lib/libcrypto/evp/e_chacha20poly1305.c b/lib/libcrypto/evp/e_chacha20poly1305.c index 75ff7f209cc..7e32668b7fc 100644 --- a/lib/libcrypto/evp/e_chacha20poly1305.c +++ b/lib/libcrypto/evp/e_chacha20poly1305.c @@ -85,7 +85,7 @@ aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const unsigned char *key, if (key_len != sizeof(c20_ctx->key)) return 0; /* internal error - EVP_AEAD_CTX_init should catch this. */ - c20_ctx = OPENSSL_malloc(sizeof(struct aead_chacha20_poly1305_ctx)); + c20_ctx = malloc(sizeof(struct aead_chacha20_poly1305_ctx)); if (c20_ctx == NULL) return 0; @@ -101,7 +101,7 @@ aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx) { struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; OPENSSL_cleanse(c20_ctx->key, sizeof(c20_ctx->key)); - OPENSSL_free(c20_ctx); + free(c20_ctx); } static void diff --git a/lib/libcrypto/rsa/rsa_lib.c b/lib/libcrypto/rsa/rsa_lib.c index a618d70f92c..1ea5e7bc64e 100644 --- a/lib/libcrypto/rsa/rsa_lib.c +++ b/lib/libcrypto/rsa/rsa_lib.c @@ -229,7 +229,7 @@ void RSA_free(RSA *r) if (r->iqmp != NULL) BN_clear_free(r->iqmp); if (r->blinding != NULL) BN_BLINDING_free(r->blinding); if (r->mt_blinding != NULL) BN_BLINDING_free(r->mt_blinding); - if (r->bignum_data != NULL) OPENSSL_free_locked(r->bignum_data); + free(r->bignum_data); free(r); } @@ -275,7 +275,7 @@ int RSA_memory_lock(RSA *r) j=1; for (i=0; i<6; i++) j+= (*t[i])->top; - if ((p=OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL) + if ((p=reallocarray(NULL, (off+j), sizeof(BN_ULONG))) == NULL) { RSAerr(RSA_F_RSA_MEMORY_LOCK,ERR_R_MALLOC_FAILURE); return(0); |