From: tb Date: Sat, 2 Dec 2023 19:06:22 +0000 (+0000) Subject: Revert a hunk of r1.23 that makes no sense X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b62d6ce71f0da87ca15a1c9b2ec60e8d6cf72472;p=openbsd 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. --- 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: