call the correct decrypt function in aes_cbc_cipher()
authorjsg <jsg@openbsd.org>
Thu, 17 Apr 2014 07:23:14 +0000 (07:23 +0000)
committerjsg <jsg@openbsd.org>
Thu, 17 Apr 2014 07:23:14 +0000 (07:23 +0000)
From:

commit e9c80e04c1a3b5a0de8e666155ab4ecb2697a77d
Author: Andy Polyakov <appro@openssl.org>
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@

lib/libcrypto/evp/e_aes.c
lib/libssl/src/crypto/evp/e_aes.c

index c7869b6..c7eaafe 100644 (file)
@@ -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;
 }
index c7869b6..c7eaafe 100644 (file)
@@ -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;
 }