summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-12-02 19:06:22 +0000
committertb <>2023-12-02 19:06:22 +0000
commitc59031441ed8b9a1ccd407cf805331ed37b8fb0d (patch)
tree1b928e03cc6db4fc25d3e8d5a23cc90df3090d0f /src/lib
parentd7c994996291e4875609e88e2210316c1e01dd88 (diff)
downloadopenbsd-c59031441ed8b9a1ccd407cf805331ed37b8fb0d.tar.gz
openbsd-c59031441ed8b9a1ccd407cf805331ed37b8fb0d.tar.bz2
openbsd-c59031441ed8b9a1ccd407cf805331ed37b8fb0d.zip
Revert a hunk of r1.23 that makes no sense
The commit was about checking EVP_CIPHER_CTX_iv_length(), but the function called here is EVP_CIPHER_CTX_key_length(). The result of the computation is still correct, the check and local variable simply make no sense.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
index 202abc69c1..d859ad2a15 100644
--- a/src/lib/libcrypto/evp/e_rc2.c
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc2.c,v 1.24 2023/11/18 10:46:58 tb Exp $ */ 1/* $OpenBSD: e_rc2.c,v 1.25 2023/12/02 19:06:22 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -383,15 +383,9 @@ rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
383static int 383static int
384rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) 384rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
385{ 385{
386 int iv_len;
387
388 switch (type) { 386 switch (type) {
389 case EVP_CTRL_INIT: 387 case EVP_CTRL_INIT:
390 data(c)->key_bits = 0; 388 data(c)->key_bits = EVP_CIPHER_CTX_key_length(c) * 8;
391 /* XXX - upper bound? */
392 if ((iv_len = EVP_CIPHER_CTX_key_length(c)) < 0)
393 return -1;
394 data(c)->key_bits = iv_len * 8;
395 return 1; 389 return 1;
396 390
397 case EVP_CTRL_GET_RC2_KEY_BITS: 391 case EVP_CTRL_GET_RC2_KEY_BITS: