gcrypt: Added AES_ECB support

This commit is contained in:
Andreas Steffen 2019-11-24 14:05:25 +01:00 committed by Tobias Brunner
parent a46e436e29
commit b7e840af5c
2 changed files with 6 additions and 1 deletions

View File

@ -198,7 +198,9 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
gcrypt_alg = GCRY_CIPHER_BLOWFISH;
break;
case ENCR_AES_CTR:
mode = GCRY_CIPHER_MODE_CTR;
case ENCR_AES_ECB:
mode = (algo == ENCR_AES_CTR) ? GCRY_CIPHER_MODE_CTR :
GCRY_CIPHER_MODE_ECB;
/* fall */
case ENCR_AES_CBC:
switch (key_size)

View File

@ -70,6 +70,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),
/* gcrypt only supports 128 bit blowfish */
PLUGIN_PROVIDE(CRYPTER, ENCR_BLOWFISH, 16),
#ifdef HAVE_GCRY_CIPHER_CAMELLIA