Skip to content

Commit

Permalink
PKCS7: Remove one of the duplicate checks
Browse files Browse the repository at this point in the history
There are two consecutive identical checks "if (i <= 0)".
We can remove one of them to make the code clear.

CLA: trivial

Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #23741)
  • Loading branch information
JiangJias authored and t8m committed Mar 11, 2024
1 parent 1f03d33 commit 8211ca4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/pkcs7/pk7_smime.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
if (!(flags & PKCS7_NOCRL))
X509_STORE_CTX_set0_crls(cert_ctx, p7->d.sign->crl);
i = X509_verify_cert(cert_ctx);
if (i <= 0)
j = X509_STORE_CTX_get_error(cert_ctx);
if (i <= 0) {
j = X509_STORE_CTX_get_error(cert_ctx);
ERR_raise_data(ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR,
"Verify error: %s",
X509_verify_cert_error_string(j));
Expand Down

0 comments on commit 8211ca4

Please sign in to comment.