From ee46dfbf2c117a9532f887b478c9c65d8f30d50c Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Wed, 19 Aug 2020 20:16:53 +0200 Subject: X509_dup: fix copying of libctx and propq using new ASN1_OP_DUP_POST cb operation Fixes #12680 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/12687) --- crypto/x509/x_x509.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crypto/x509/x_x509.c') diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c index f929fd2ae3..efcd7cd15c 100644 --- a/crypto/x509/x_x509.c +++ b/crypto/x509/x_x509.c @@ -97,6 +97,17 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, ASN1_OCTET_STRING_free(ret->distinguishing_id); break; + case ASN1_OP_DUP_POST: + { + X509 *old = exarg; + + ret->libctx = old->libctx; + ret->propq = old->propq; + } + break; + + default: + break; } return 1; -- cgit v1.2.1