diff options
author | Sverker Eriksson <[email protected]> | 2015-12-11 18:07:47 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-12-11 18:07:47 +0100 |
commit | 32eb9d7d9f680d320f42186de67db65688cdd53f (patch) | |
tree | 79746e928d2494c66062a4f19b65985ac6c75ce4 /lib/crypto/c_src/crypto.c | |
parent | 7d9d88e9adf040a17c8ffb01b069fb2a5d125dab (diff) | |
download | otp-32eb9d7d9f680d320f42186de67db65688cdd53f.tar.gz otp-32eb9d7d9f680d320f42186de67db65688cdd53f.tar.bz2 otp-32eb9d7d9f680d320f42186de67db65688cdd53f.zip |
crypto: Support 192-bit keys for AES CBC
and deprecate aes_cbc128 and aes_cbc256 in favor of aes_cbc.
This commit is pr 832 squashed, rebased and made work on master
https://github.com/erlang/otp/pull/832/commits
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index bb2771163d..850d5bc31f 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -447,6 +447,9 @@ struct cipher_type_t cipher_types[] = {"blowfish_cfb64", &EVP_bf_cfb64}, {"blowfish_ofb64", &EVP_bf_ofb}, {"blowfish_ecb", &EVP_bf_ecb}, + {"aes_cbc", &EVP_aes_128_cbc, 16}, + {"aes_cbc", &EVP_aes_192_cbc, 24}, + {"aes_cbc", &EVP_aes_256_cbc, 32}, {"aes_cbc128", &EVP_aes_128_cbc}, {"aes_cbc256", &EVP_aes_256_cbc}, {"aes_cfb8", &EVP_aes_128_cfb8}, @@ -757,6 +760,7 @@ static void init_algorithms_types(ErlNifEnv* env) #ifdef HAVE_DES_ede3_cfb_encrypt algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "des3_cbf"); #endif + algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "aes_cbc"); algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "aes_cbc128"); algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "aes_cfb8"); algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "aes_cfb128"); |