summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2019-05-14 15:40:44 +0000
committerbeck <beck@openbsd.org>2019-05-14 15:40:44 +0000
commitf4c4dcdc6f4863084e254ee724b8bb9a504ccb4d (patch)
tree5ae12431acee1dada31cd25b697c3ef3ed1f92a5
parentAdd free(9) sizes to ahc(4) (diff)
downloadwireguard-openbsd-f4c4dcdc6f4863084e254ee724b8bb9a504ccb4d.tar.xz
wireguard-openbsd-f4c4dcdc6f4863084e254ee724b8bb9a504ccb4d.zip
Correct missing test to determine if length is in bytes or in bits.
Issue found by Guido Vranken <guidovranken@gmail.com> ok tedu@ tb@
-rw-r--r--lib/libcrypto/evp/e_des3.c4
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;