diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-07-25 18:44:25 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-09 17:34:52 +1000 |
commit | dcc679cd99835560d75a84719ab73a70a952f035 (patch) | |
tree | 5eb189afad33c773bc6b86ce13cacbe7708951c2 /crypto/x509 | |
parent | c1669f41eab0e2d9a8c2498718d06b4cd48a9890 (diff) | |
download | openssl-dcc679cd99835560d75a84719ab73a70a952f035.tar.gz |
Add internal method x509_set0_libctx().
This should only be called during (or right after) using d2iXXX on a object that contains embedded certificate(s)
that require a non default library context. X509_new_with_libctx() should be used if possible.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11884)
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x_x509.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c index 9358c46a7f..64bf5faa83 100644 --- a/crypto/x509/x_x509.c +++ b/crypto/x509/x_x509.c @@ -133,6 +133,20 @@ int i2d_X509(const X509 *a, unsigned char **out) return ASN1_item_i2d((const ASN1_VALUE *)a, out, (X509_it())); } +/* + * This should only be used if the X509 object was embedded inside another + * asn1 object and it needs a libctx to operate. + * Use X509_new_with_libctx() instead if possible. + */ +int x509_set0_libctx(X509 *x, OPENSSL_CTX *libctx, const char *propq) +{ + if (x != NULL) { + x->libctx = libctx; + x->propq = propq; + } + return 1; +} + X509 *X509_new_with_libctx(OPENSSL_CTX *libctx, const char *propq) { X509 *cert = NULL; |