openssl: Support of AES-CFB encryption

This commit is contained in:
Andreas Steffen
2021-12-06 12:52:37 +01:00
parent dcaf9b38f3
commit 695a04d146
8 changed files with 158 additions and 3 deletions
@@ -231,6 +231,26 @@ openssl_crypter_t *openssl_crypter_create(encryption_algorithm_t algo,
return NULL;
}
break;
case ENCR_AES_CFB:
switch (key_size)
{
case 0:
key_size = 16;
/* FALL */
case 16: /* AES 128 */
this->cipher = EVP_get_cipherbyname("aes-128-cfb");
break;
case 24: /* AES-192 */
this->cipher = EVP_get_cipherbyname("aes-192-cfb");
break;
case 32: /* AES-256 */
this->cipher = EVP_get_cipherbyname("aes-256-cfb");
break;
default:
free(this);
return NULL;
}
break;
case ENCR_CAMELLIA_CBC:
switch (key_size)
{
@@ -501,6 +501,9 @@ METHOD(plugin_t, get_features, int,
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 16),
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 24),
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_ECB, 32),
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 16),
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 24),
PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 32),
#endif
#ifndef OPENSSL_NO_CAMELLIA
PLUGIN_PROVIDE(CRYPTER, ENCR_CAMELLIA_CBC, 16),