Commit fbdce667 authored by Niels Möller's avatar Niels Möller

(all_symmetric_algorithms): Added aes128-cbc

and aes128-ctr.
(all_crypto_algorithms): Likewise.
(default_crypto_algorithms): Replaced aes256-cbc by aes128-ctr, as
the preferred choice.
(lookup_crypto): Added "aes128-cbc" with alias "aes-cbc", added
"aes-128-ctr" with aliases "aes", "aes128", "aes-ctr". Removed
some aliases for "aes256-cbc" and "aes256-ctr", including the old
"rijndael" alias.

Rev: src/algorithms.c:1.42
parent 2831ca26
......@@ -47,7 +47,7 @@
struct alist *
all_symmetric_algorithms()
{
return make_alist(10
return make_alist(12
#if WITH_ZLIB
+1
#endif
......@@ -55,6 +55,8 @@ all_symmetric_algorithms()
ATOM_ARCFOUR, &crypto_arcfour_algorithm,
ATOM_BLOWFISH_CBC, &crypto_blowfish_cbc_algorithm,
ATOM_TWOFISH_CBC, &crypto_twofish256_cbc_algorithm,
ATOM_AES128_CBC, &crypto_aes128_cbc_algorithm,
ATOM_AES128_CTR, &crypto_aes128_ctr_algorithm,
ATOM_AES256_CBC, &crypto_aes256_cbc_algorithm,
ATOM_AES256_CTR, &crypto_aes256_ctr_algorithm,
ATOM_SERPENT256_CBC, &crypto_serpent256_cbc_algorithm,
......@@ -92,7 +94,7 @@ struct int_list *
default_crypto_algorithms(struct alist *algorithms)
{
return filter_algorithms_l(algorithms, 4,
ATOM_AES256_CBC,
ATOM_AES128_CTR,
ATOM_3DES_CBC,
ATOM_BLOWFISH_CBC,
ATOM_ARCFOUR, -1);
......@@ -103,7 +105,9 @@ default_crypto_algorithms(struct alist *algorithms)
static struct int_list *
all_crypto_algorithms(struct alist *algorithms)
{
return filter_algorithms_l(algorithms, 8,
return filter_algorithms_l(algorithms, 10,
ATOM_AES128_CBC,
ATOM_AES128_CTR,
ATOM_AES256_CBC,
ATOM_AES256_CTR,
ATOM_3DES_CBC,
......@@ -181,9 +185,13 @@ lookup_crypto(struct alist *algorithms, const char *name, struct crypto_algorith
atom = ATOM_BLOWFISH_CBC;
else if (strcasecmp_list(name, "3des-cbc", "3des", NULL))
atom = ATOM_3DES_CBC;
else if (strcasecmp_list(name, "aes256-cbc", "aes-cbc", "aes", "rijndael", NULL))
else if (strcasecmp_list(name, "aes128-cbc", "aes-cbc", NULL))
atom = ATOM_AES128_CBC;
else if (strcasecmp_list(name, "aes128-ctr", "aes-ctr", "aes", "aes128", NULL))
atom = ATOM_AES128_CTR;
else if (strcasecmp_list(name, "aes256-cbc", NULL))
atom = ATOM_AES256_CBC;
else if (strcasecmp_list(name, "aes256-ctr", "aes-ctr", NULL))
else if (strcasecmp_list(name, "aes256-ctr", NULL))
atom = ATOM_AES256_CTR;
else if (strcasecmp_list(name, "serpent256-cbc",
"serpent-cbc", "serpent", NULL))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment