From: Andreas Steffen Date: Thu, 21 Nov 2019 14:27:59 +0000 (+0100) Subject: openssl: Added AES_ECB support X-Git-Tag: 5.8.2rc1~11^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f44bd6fe8b995efefc3ca0875e942c1b2a16a99;p=thirdparty%2Fstrongswan.git openssl: Added AES_ECB support --- diff --git a/src/libstrongswan/plugins/openssl/openssl_crypter.c b/src/libstrongswan/plugins/openssl/openssl_crypter.c index 74beb762ec..fafb0a7bd4 100644 --- a/src/libstrongswan/plugins/openssl/openssl_crypter.c +++ b/src/libstrongswan/plugins/openssl/openssl_crypter.c @@ -211,6 +211,26 @@ openssl_crypter_t *openssl_crypter_create(encryption_algorithm_t algo, return NULL; } break; + case ENCR_AES_ECB: + switch (key_size) + { + case 0: + key_size = 16; + /* FALL */ + case 16: /* AES 128 */ + this->cipher = EVP_get_cipherbyname("aes-128-ecb"); + break; + case 24: /* AES-192 */ + this->cipher = EVP_get_cipherbyname("aes-192-ecb"); + break; + case 32: /* AES-256 */ + this->cipher = EVP_get_cipherbyname("aes-256-ecb"); + break; + default: + free(this); + return NULL; + } + break; case ENCR_CAMELLIA_CBC: switch (key_size) { diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c index 069136df0c..71369e9b10 100644 --- a/src/libstrongswan/plugins/openssl/openssl_plugin.c +++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c @@ -497,6 +497,9 @@ METHOD(plugin_t, get_features, int, PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 16), PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 24), PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 32), + PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 16), + PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 24), + PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 32), #endif #ifndef OPENSSL_NO_CAMELLIA PLUGIN_PROVIDE(CRYPTER, ENCR_CAMELLIA_CBC, 16),