aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-09-02 14:31:02 +0200
committerRaimo Niskanen <[email protected]>2016-09-02 16:01:46 +0200
commit05caf563c08b368ad5b6884ea9db3b2484953932 (patch)
treecb080469ca9e3257eadfd9e9e422df545fb7cd4e /lib/crypto/c_src
parente8057333e3beaceb6eed6b41f7aff7f2d523cb77 (diff)
downloadotp-05caf563c08b368ad5b6884ea9db3b2484953932.tar.gz
otp-05caf563c08b368ad5b6884ea9db3b2484953932.tar.bz2
otp-05caf563c08b368ad5b6884ea9db3b2484953932.zip
Add '_cfb' alias for misspelled '_cbf' cipher
Diffstat (limited to 'lib/crypto/c_src')
-rw-r--r--lib/crypto/c_src/crypto.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 25a0d3ff7b..eee1a88723 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -473,7 +473,14 @@ struct cipher_type_t cipher_types[] =
{{"des_cfb"}, {COND_NO_DES_PTR(&EVP_des_cfb8)}},
{{"des_ecb"}, {COND_NO_DES_PTR(&EVP_des_ecb)}},
{{"des_ede3_cbc"}, {COND_NO_DES_PTR(&EVP_des_ede3_cbc)}},
- {{"des_ede3_cbf"},
+ {{"des_ede3_cbf"}, /* Misspelled, retained */
+#ifdef HAVE_DES_ede3_cfb_encrypt
+ {COND_NO_DES_PTR(&EVP_des_ede3_cfb8)}
+#else
+ {NULL}
+#endif
+ },
+ {{"des_ede3_cfb"},
#ifdef HAVE_DES_ede3_cfb_encrypt
{COND_NO_DES_PTR(&EVP_des_ede3_cfb8)}
#else
@@ -757,7 +764,7 @@ static ERL_NIF_TERM algo_hash[8]; /* increase when extending the list */
static int algo_pubkey_cnt;
static ERL_NIF_TERM algo_pubkey[7]; /* increase when extending the list */
static int algo_cipher_cnt;
-static ERL_NIF_TERM algo_cipher[22]; /* increase when extending the list */
+static ERL_NIF_TERM algo_cipher[23]; /* increase when extending the list */
static void init_algorithms_types(ErlNifEnv* env)
{
@@ -798,6 +805,7 @@ static void init_algorithms_types(ErlNifEnv* env)
algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "des_ede3");
#ifdef HAVE_DES_ede3_cfb_encrypt
algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "des3_cbf");
+ algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "des3_cfb");
#endif
#endif
algo_cipher[algo_cipher_cnt++] = enif_make_atom(env, "aes_cbc");