summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-12-02 19:06:23 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-12-02 19:06:23 +0000
commitce69bd9a9bce3215c54eef65c719b50b532c8538 (patch)
tree6708a6a9f28af6412a63f5c2936e2b32a8cb229d
parent087a7cc6507f1f60f137bd40e57858cdc3d519d0 (diff)
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.
-rw-r--r--lib/libcrypto/evp/e_rc2.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libcrypto/evp/e_rc2.c b/lib/libcrypto/evp/e_rc2.c
index 202abc69c1c..d859ad2a15b 100644
--- a/lib/libcrypto/evp/e_rc2.c
+++ b/lib/libcrypto/evp/e_rc2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_rc2.c,v 1.24 2023/11/18 10:46:58 tb Exp $ */
+/* $OpenBSD: e_rc2.c,v 1.25 2023/12/02 19:06:22 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -383,15 +383,9 @@ rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
static int
rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
{
- int iv_len;
-
switch (type) {
case EVP_CTRL_INIT:
- data(c)->key_bits = 0;
- /* XXX - upper bound? */
- if ((iv_len = EVP_CIPHER_CTX_key_length(c)) < 0)
- return -1;
- data(c)->key_bits = iv_len * 8;
+ data(c)->key_bits = EVP_CIPHER_CTX_key_length(c) * 8;
return 1;
case EVP_CTRL_GET_RC2_KEY_BITS: