cmp_genm.c: Remove superfluous store_ctx != 0 check
authorTomas Mraz <tomas@openssl.org>
Wed, 16 Aug 2023 14:18:59 +0000 (16:18 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 18 Aug 2023 13:06:18 +0000 (15:06 +0200)
This really cannot be ever called with NULL store_ctx
and the check confuses Coverity.

Fixes Coverity 1538865

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21755)

crypto/cmp/cmp_genm.c

index 74ac1d4b05198176fe4ab5aabac4a4239bf1e048..97a7293db3d992e625c5a69a5b0b19a0a5eb6050 100644 (file)
@@ -180,7 +180,7 @@ int OSSL_CMP_get1_caCerts(OSSL_CMP_CTX *ctx, STACK_OF(X509) **out)
 
 static int selfsigned_verify_cb(int ok, X509_STORE_CTX *store_ctx)
 {
-    if (ok == 0 && store_ctx != NULL
+    if (ok == 0
             && X509_STORE_CTX_get_error_depth(store_ctx) == 0
             && X509_STORE_CTX_get_error(store_ctx)
             == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) {