From 6b8fa5be76f560c4141a1a5e09527005bd88e969 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Thu, 23 Jun 2016 10:03:50 -0400 Subject: [PATCH] RT2867: des_ede3_cfb1 ignored "size in bits" flag Code by Steve Henson. Backport to 1.0.2 from commit fe2d149119 Fixes #2346 Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/3364) --- crypto/evp/e_des3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c index 0e910d6d80..ab8126e5c9 100644 --- a/crypto/evp/e_des3.c +++ b/crypto/evp/e_des3.c @@ -212,6 +212,8 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, size_t n; unsigned char c[1], d[1]; + if (!EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) + inl *= 8; for (n = 0; n < inl; ++n) { c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0; DES_ede3_cfb_encrypt(c, d, 1, 1, -- 2.34.1