projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd54d55
)
For CFB and OFB modes, always create the encryption key.
author
Richard Levitte
<levitte@openssl.org>
Fri, 31 May 2002 13:11:44 +0000
(13:11 +0000)
committer
Richard Levitte
<levitte@openssl.org>
Fri, 31 May 2002 13:11:44 +0000
(13:11 +0000)
crypto/evp/e_aes.c
patch
|
blob
|
history
diff --git
a/crypto/evp/e_aes.c
b/crypto/evp/e_aes.c
index 9d03a9602fddca0de33784f572682360cde0a920..c323fa28922616463d91295bd32500eb5a3487f6 100644
(file)
--- a/
crypto/evp/e_aes.c
+++ b/
crypto/evp/e_aes.c
@@
-88,7
+88,9
@@
IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY,
static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc) {
- if (enc)
+ if ((ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_CFB_MODE
+ || (ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_OFB_MODE
+ || enc)
AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data);
else
AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data);