From: jsg Date: Thu, 17 Apr 2014 07:23:14 +0000 (+0000) Subject: call the correct decrypt function in aes_cbc_cipher() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b8aa3229b80e7acb600eed22f01aa2b70de39b0;p=openbsd call the correct decrypt function in aes_cbc_cipher() From: commit e9c80e04c1a3b5a0de8e666155ab4ecb2697a77d Author: Andy Polyakov Date: Wed Dec 18 21:42:46 2013 +0100 evp/e_[aes|camellia].c: fix typo in CBC subroutine. It worked because it was never called. Our e_camellia.c does not have this problem. ok miod@ deraadt@ --- diff --git a/lib/libcrypto/evp/e_aes.c b/lib/libcrypto/evp/e_aes.c index c7869b69efe..c7eaafe89b2 100644 --- a/lib/libcrypto/evp/e_aes.c +++ b/lib/libcrypto/evp/e_aes.c @@ -581,7 +581,7 @@ static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, else if (ctx->encrypt) CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); else - CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); + CRYPTO_cbc128_decrypt(in,out,len,&dat->ks,ctx->iv,dat->block); return 1; } diff --git a/lib/libssl/src/crypto/evp/e_aes.c b/lib/libssl/src/crypto/evp/e_aes.c index c7869b69efe..c7eaafe89b2 100644 --- a/lib/libssl/src/crypto/evp/e_aes.c +++ b/lib/libssl/src/crypto/evp/e_aes.c @@ -581,7 +581,7 @@ static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, else if (ctx->encrypt) CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); else - CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); + CRYPTO_cbc128_decrypt(in,out,len,&dat->ks,ctx->iv,dat->block); return 1; }