diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2019-05-14 15:40:45 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2019-05-14 15:40:45 +0000 |
commit | 0e1633aa5355b94cc7ddef1ed89b7edda1013111 (patch) | |
tree | ebdde816d4404251a61633620ec97a0ba04fe7b7 /lib/libcrypto/evp | |
parent | 60c3c68cf31cebda0c1b90a7d98180b21a5eda15 (diff) |
Correct missing test to determine if length is in bytes or in bits.
Issue found by Guido Vranken <guidovranken@gmail.com>
ok tedu@ tb@
Diffstat (limited to 'lib/libcrypto/evp')
-rw-r--r-- | lib/libcrypto/evp/e_des3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/evp/e_des3.c b/lib/libcrypto/evp/e_des3.c index 3cb95a8e22b..01388397633 100644 --- a/lib/libcrypto/evp/e_des3.c +++ b/lib/libcrypto/evp/e_des3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_des3.c,v 1.19 2015/10/12 06:05:52 guenther Exp $ */ +/* $OpenBSD: e_des3.c,v 1.20 2019/05/14 15:40:44 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -163,6 +163,8 @@ des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { size_t n; unsigned char c[1], d[1]; + if (!(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS)) + inl *= 8; for (n = 0; n < inl; ++n) { c[0] = (in[n/8]&(1 << (7 - n % 8))) ? 0x80 : 0; |