diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index 9d03a9602f..c323fa2892 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c | |||
@@ -88,7 +88,9 @@ IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY, | |||
88 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 88 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
89 | const unsigned char *iv, int enc) { | 89 | const unsigned char *iv, int enc) { |
90 | 90 | ||
91 | if (enc) | 91 | if ((ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_CFB_MODE |
92 | || (ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_OFB_MODE | ||
93 | || enc) | ||
92 | AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | 94 | AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); |
93 | else | 95 | else |
94 | AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | 96 | AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); |