aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/cipher.c
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-03-19 14:50:00 +0100
committerHans Nilsson <[email protected]>2019-03-19 14:50:00 +0100
commit757910dbbbbd7e1b9c5e083c67112918835c271c (patch)
tree00b39d40e1c1073f37a4b2b590d37a38a355ab56 /lib/crypto/c_src/cipher.c
parent36561e14686c64a66e99e25942d66797394a825f (diff)
parent449527eb8db8b240569bbc258a3193ea448a059d (diff)
downloadotp-757910dbbbbd7e1b9c5e083c67112918835c271c.tar.gz
otp-757910dbbbbd7e1b9c5e083c67112918835c271c.tar.bz2
otp-757910dbbbbd7e1b9c5e083c67112918835c271c.zip
Merge branch 'hans/crypto/new_api/OTP-15644'
* hans/crypto/new_api/OTP-15644: (26 commits) crypto: Add FIPS testing for a couple of algorithms crypto: Sort ciphers in alphabetic order in testsuite crypto: Better error report in crypto_SUITE crypto: Wrong ifdef symbol used for ENGINE crypto: Handle EVP_CIPHER_CTX copying correctly crypto: Fix bug in ng_api crypto: Better error descriptions crypto: Fix bug for older cryptolib crypto: Fix leak for eddsa detected by Valgrind crypto: Testcase for TLS using new API crypto: Rename SSL special functions crypto: New function for SSL app crypto: Remove compat specials from crypto_init crypto: Exceptions as error return in api_ng crypto: Relocate the new api code inside the crypto.erl file crypto: Cleaning of comments + spec fixing crypto: Remove unused variables in test case crypto: Test fixes for stream api emulated by the new api crypto: Shrink aes.c,h (remove aes_ctr_stream_* funcs) crypto: Remove chacha20.c,h and rc4.c,h ...
Diffstat (limited to 'lib/crypto/c_src/cipher.c')
-rw-r--r--lib/crypto/c_src/cipher.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/crypto/c_src/cipher.c b/lib/crypto/c_src/cipher.c
index c055a62654..5c57898c50 100644
--- a/lib/crypto/c_src/cipher.c
+++ b/lib/crypto/c_src/cipher.c
@@ -98,7 +98,9 @@ static struct cipher_type_t cipher_types[] =
{{"aes_128_ctr"}, {NULL}, 16, AES_CTR_COMPAT},
{{"aes_192_ctr"}, {NULL}, 24, AES_CTR_COMPAT},
{{"aes_256_ctr"}, {NULL}, 32, AES_CTR_COMPAT},
- {{"aes_ctr"}, {NULL}, 0, AES_CTR_COMPAT},
+ {{"aes_ctr"}, {NULL}, 16, AES_CTR_COMPAT},
+ {{"aes_ctr"}, {NULL}, 24, AES_CTR_COMPAT},
+ {{"aes_ctr"}, {NULL}, 32, AES_CTR_COMPAT},
#endif
#if defined(HAVE_CHACHA20)
@@ -162,6 +164,11 @@ static void evp_cipher_ctx_dtor(ErlNifEnv* env, struct evp_cipher_ctx* ctx) {
if (ctx->ctx)
EVP_CIPHER_CTX_free(ctx->ctx);
+
+#if !defined(HAVE_EVP_AES_CTR)
+ if (ctx->env)
+ enif_free_env(ctx->env);
+#endif
}
int init_cipher_ctx(ErlNifEnv *env) {