cmp_msg.c: Copy libctx and propq of CMP_CTX to newly enrolled certificate
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 12 Aug 2020 20:15:24 +0000 (22:15 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 21 Aug 2020 07:04:12 +0000 (09:04 +0200)
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11808)

crypto/cmp/cmp_msg.c

index d506e7b22bdcbce86b70d46667ad1d37ae5c6bb8..9e402c51a515acc5716ee79db2b3b389ba1c2f74 100644 (file)
@@ -19,6 +19,7 @@
 #include <openssl/crmf.h>
 #include <openssl/err.h>
 #include <openssl/x509.h>
+#include "crypto/x509.h" /* for x509_set0_libctx() */
 
 DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
 DEFINE_STACK_OF(OSSL_CMP_ITAV)
@@ -994,6 +995,8 @@ X509 *ossl_cmp_certresponse_get1_certificate(EVP_PKEY *privkey,
     }
     if (crt == NULL)
         CMPerr(0, CMP_R_CERTIFICATE_NOT_FOUND);
+    else
+        (void)x509_set0_libctx(crt, ctx->libctx, ctx->propq);
     return crt;
 }