summaryrefslogtreecommitdiff
path: root/lib/libcrypto/evp
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 11:22:49 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 11:22:49 +0000
commit792400ee4b44f86e9f7079f9dea473bf2c557ae3 (patch)
tree3fa789b83bc771d8ba9fa97a13165884e5fb3b7e /lib/libcrypto/evp
parent93348da48946e45c0399ff325ad6be4120091bca (diff)
Add check for EVP_CIPHER_CTX_set_key_length return value
CID 21653 ok jsing@ millert@ tb@
Diffstat (limited to 'lib/libcrypto/evp')
-rw-r--r--lib/libcrypto/evp/e_rc2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcrypto/evp/e_rc2.c b/lib/libcrypto/evp/e_rc2.c
index de1b24a306d..d8c331d535f 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.12 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: e_rc2.c,v 1.13 2022/01/20 11:22:48 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -201,7 +201,8 @@ rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
return -1;
EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS,
key_bits, NULL);
- EVP_CIPHER_CTX_set_key_length(c, key_bits / 8);
+ if (!EVP_CIPHER_CTX_set_key_length(c, key_bits / 8))
+ return -1;
}
return (i);
}