summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-06-23 10:03:50 -0400
committerMatt Caswell <matt@openssl.org>2017-05-02 17:04:27 +0100
commit6b8fa5be76f560c4141a1a5e09527005bd88e969 (patch)
treeb1e33d249b0d448c823a9bd26db5f2c1826f05a6
parent54538204d870b97c751d13efeefa876bd792a44b (diff)
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 <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3364)
-rw-r--r--crypto/evp/e_des3.c2
1 files changed, 2 insertions, 0 deletions
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,