summaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-07-24 22:53:27 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-07-24 22:53:27 +1000
commit6725682d77510bf6d499957897d7be124d603f40 (patch)
tree447e5bce5607b4873f7f018df1b2e4c21a394e92 /apps/x509.c
parentae89578be2930c726d6ef56451233757a89f224f (diff)
Add X509 related libctx changes.
- In order to not add many X509_XXXX_with_libctx() functions the libctx and propq may be stored in the X509 object via a call to X509_new_with_libctx(). - Loading via PEM_read_bio_X509() or d2i_X509() should pass in a created cert using X509_new_with_libctx(). - Renamed some XXXX_ex() to XXX_with_libctx() for X509 API's. - Removed the extra parameters in check_purpose.. - X509_digest() has been modified so that it expects a const EVP_MD object() and then internally it does the fetch when it needs to (via ASN1_item_digest_with_libctx()). - Added API's that set the libctx when they load such as X509_STORE_new_with_libctx() so that the cert chains can be verified. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12153)
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/x509.c b/apps/x509.c
index c09bca37bc..d8f69c08eb 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -510,7 +510,8 @@ int x509_main(int argc, char **argv)
goto end;
}
- if (!X509_STORE_set_default_paths(ctx)) {
+ if (!X509_STORE_set_default_paths_with_libctx(ctx, app_get0_libctx(),
+ app_get0_propq())) {
ERR_print_errors(bio_err);
goto end;
}
@@ -607,7 +608,7 @@ int x509_main(int argc, char **argv)
"We need a private key to sign with, use -signkey or -CAkey or -CA <file> with private key\n");
goto end;
}
- if ((x = X509_new()) == NULL)
+ if ((x = X509_new_with_libctx(app_get0_libctx(), app_get0_propq())) == NULL)
goto end;
if (sno == NULL) {