summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 10:58:36 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 10:58:36 +0000
commita15a185d15a96c11a7059c8532442addaef3adff (patch)
tree8db477e4363da8aad41d22be09b84633c2f8fb15 /lib/libcrypto
parentc12f45c9c7dc0b3668bdb7f60219accafbaaebd0 (diff)
Add check for EVP_CIPHER_CTX_set_key_length return value
It returns 1 on success and 0 for failure, never negative value. ok jsing@ millert@ tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/cms/cms_enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/cms/cms_enc.c b/lib/libcrypto/cms/cms_enc.c
index fd2df99c6c1..ccbb6a5deb5 100644
--- a/lib/libcrypto/cms/cms_enc.c
+++ b/lib/libcrypto/cms/cms_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cms_enc.c,v 1.20 2019/08/11 11:04:18 jsing Exp $ */
+/* $OpenBSD: cms_enc.c,v 1.21 2022/01/20 10:58:35 inoguchi Exp $ */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
@@ -151,7 +151,7 @@ cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
if (ec->keylen != tkeylen) {
/* If necessary set key length */
- if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen) <= 0) {
+ if (!EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen)) {
/*
* Only reveal failure if debugging so we don't leak information
* which may be useful in MMA.