Commit 6b8fa5be authored by Rich Salz's avatar Rich Salz Committed by Matt Caswell
Browse files

RT2867: des_ede3_cfb1 ignored "size in bits" flag



Code by Steve Henson. Backport to 1.0.2 from commit fe2d1491

Fixes #2346

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3364)
parent 54538204
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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,