summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-09-24 10:42:23 +0100
committerMatt Caswell <matt@openssl.org>2020-10-01 09:25:20 +0100
commitd8652be06e2778e8898453a391deb7253e1a35a2 (patch)
treefe40e22edb39642aa7ae633320c1900388f2e7ee /apps
parentaedac96c1172ca9a9efe72e027e935504b599e2f (diff)
Run the withlibctx.pl script
Automatically rename all instances of _with_libctx() to _ex() as per our coding style. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12970)
Diffstat (limited to 'apps')
-rw-r--r--apps/ca.c2
-rw-r--r--apps/cms.c19
-rw-r--r--apps/lib/apps.c18
-rw-r--r--apps/pkcs12.c3
-rw-r--r--apps/pkcs7.c2
-rw-r--r--apps/req.c3
-rw-r--r--apps/smime.c7
-rw-r--r--apps/storeutl.c4
-rw-r--r--apps/ts.c7
-rw-r--r--apps/x509.c6
10 files changed, 32 insertions, 39 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 58126b95a0..4a67d61477 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1652,7 +1652,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
BIO_printf(bio_err,
"Everything appears to be ok, creating and signing the certificate\n");
- if ((ret = X509_new_with_libctx(app_get0_libctx(), app_get0_propq())) == NULL)
+ if ((ret = X509_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
goto end;
#ifdef X509_V3
diff --git a/apps/cms.c b/apps/cms.c
index ad8f64fcaa..9312c37fc2 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -237,7 +237,7 @@ static CMS_ContentInfo *load_content_info(int informat, BIO *in, BIO **indata,
{
CMS_ContentInfo *ret, *ci;
- ret = CMS_ContentInfo_new_with_libctx(libctx, propq);
+ ret = CMS_ContentInfo_new_ex(libctx, propq);
if (ret == NULL) {
BIO_printf(bio_err, "Error allocating CMS_contentinfo\n");
return NULL;
@@ -926,15 +926,15 @@ int cms_main(int argc, char **argv)
ret = 3;
if (operation == SMIME_DATA_CREATE) {
- cms = CMS_data_create_with_libctx(in, flags, libctx, propq);
+ cms = CMS_data_create_ex(in, flags, libctx, propq);
} else if (operation == SMIME_DIGEST_CREATE) {
- cms = CMS_digest_create_with_libctx(in, sign_md, flags, libctx, propq);
+ cms = CMS_digest_create_ex(in, sign_md, flags, libctx, propq);
} else if (operation == SMIME_COMPRESS) {
cms = CMS_compress(in, -1, flags);
} else if (operation == SMIME_ENCRYPT) {
int i;
flags |= CMS_PARTIAL;
- cms = CMS_encrypt_with_libctx(NULL, in, cipher, flags, libctx, propq);
+ cms = CMS_encrypt_ex(NULL, in, cipher, flags, libctx, propq);
if (cms == NULL)
goto end;
for (i = 0; i < sk_X509_num(encerts); i++) {
@@ -999,9 +999,8 @@ int cms_main(int argc, char **argv)
goto end;
}
} else if (operation == SMIME_ENCRYPTED_ENCRYPT) {
- cms = CMS_EncryptedData_encrypt_with_libctx(in, cipher, secret_key,
- secret_keylen, flags,
- libctx, propq);
+ cms = CMS_EncryptedData_encrypt_ex(in, cipher, secret_key,
+ secret_keylen, flags, libctx, propq);
} else if (operation == SMIME_SIGN_RECEIPT) {
CMS_ContentInfo *srcms = NULL;
@@ -1029,7 +1028,7 @@ int cms_main(int argc, char **argv)
flags |= CMS_STREAM;
}
flags |= CMS_PARTIAL;
- cms = CMS_sign_with_libctx(NULL, NULL, other, in, flags, libctx, propq);
+ cms = CMS_sign_ex(NULL, NULL, other, in, flags, libctx, propq);
if (cms == NULL)
goto end;
if (econtent_type != NULL)
@@ -1416,8 +1415,8 @@ static CMS_ReceiptRequest *make_receipt_request(
} else {
rct_from = NULL;
}
- rr = CMS_ReceiptRequest_create0_with_libctx(NULL, -1, rr_allorfirst,
- rct_from, rct_to, libctx, propq);
+ rr = CMS_ReceiptRequest_create0_ex(NULL, -1, rr_allorfirst, rct_from,
+ rct_to, libctx, propq);
return rr;
err:
sk_GENERAL_NAMES_pop_free(rct_to, GENERAL_NAMES_free);
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index fa015aa4ea..decd5df7f7 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -364,7 +364,7 @@ CONF *app_load_config_bio(BIO *in, const char *filename)
CONF *conf;
int i;
- conf = NCONF_new_with_libctx(app_libctx, NULL);
+ conf = NCONF_new_ex(app_libctx, NULL);
i = NCONF_load_bio(conf, in, &errorline);
if (i > 0)
return conf;
@@ -756,8 +756,8 @@ int load_key_certs_crls(const char *uri, int maybe_stdin,
ctx = OSSL_STORE_attach(bio, "file", libctx, propq,
get_ui_method(), &uidata, NULL, NULL);
} else {
- ctx = OSSL_STORE_open_with_libctx(uri, libctx, propq, get_ui_method(),
- &uidata, NULL, NULL);
+ ctx = OSSL_STORE_open_ex(uri, libctx, propq, get_ui_method(), &uidata,
+ NULL, NULL);
}
if (ctx == NULL) {
BIO_printf(bio_err, "Could not open file or uri for loading");
@@ -1116,16 +1116,14 @@ X509_STORE *setup_verify(const char *CAfile, int noCAfile,
if (lookup == NULL)
goto end;
if (CAfile != NULL) {
- if (!X509_LOOKUP_load_file_with_libctx(lookup, CAfile,
- X509_FILETYPE_PEM,
- libctx, propq)) {
+ if (!X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM,
+ libctx, propq)) {
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
goto end;
}
} else {
- X509_LOOKUP_load_file_with_libctx(lookup, NULL,
- X509_FILETYPE_DEFAULT,
- libctx, propq);
+ X509_LOOKUP_load_file_ex(lookup, NULL, X509_FILETYPE_DEFAULT,
+ libctx, propq);
}
}
@@ -1147,7 +1145,7 @@ X509_STORE *setup_verify(const char *CAfile, int noCAfile,
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_store());
if (lookup == NULL)
goto end;
- if (!X509_LOOKUP_add_store_with_libctx(lookup, CAstore, libctx, propq)) {
+ if (!X509_LOOKUP_add_store_ex(lookup, CAstore, libctx, propq)) {
if (CAstore != NULL)
BIO_printf(bio_err, "Error loading store URI %s\n", CAstore);
goto end;
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index b0f03232a7..1432d2b930 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -897,8 +897,7 @@ static int get_cert_chain(X509 *cert, X509_STORE *store,
STACK_OF(X509) *chn = NULL;
int i = 0;
- store_ctx = X509_STORE_CTX_new_with_libctx(app_get0_libctx(),
- app_get0_propq());
+ store_ctx = X509_STORE_CTX_new_ex(app_get0_libctx(), app_get0_propq());
if (store_ctx == NULL) {
i = X509_V_ERR_UNSPECIFIED;
goto end;
diff --git a/apps/pkcs7.c b/apps/pkcs7.c
index e6ac26e6f9..9efe3aa108 100644
--- a/apps/pkcs7.c
+++ b/apps/pkcs7.c
@@ -118,7 +118,7 @@ int pkcs7_main(int argc, char **argv)
if (in == NULL)
goto end;
- p7 = PKCS7_new_with_libctx(libctx, propq);
+ p7 = PKCS7_new_ex(libctx, propq);
if (p7 == NULL) {
BIO_printf(bio_err, "unable to allocate PKCS7 object\n");
ERR_print_errors(bio_err);
diff --git a/apps/req.c b/apps/req.c
index 62abf226ac..a3abc0b7b7 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -741,8 +741,7 @@ int req_main(int argc, char **argv)
if (x509) {
EVP_PKEY *tmppkey;
X509V3_CTX ext_ctx;
- if ((x509ss = X509_new_with_libctx(app_get0_libctx(),
- app_get0_propq())) == NULL)
+ if ((x509ss = X509_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
goto end;
/* Set version to V3 */
diff --git a/apps/smime.c b/apps/smime.c
index e6d539457e..57b323cfa2 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -491,7 +491,7 @@ int smime_main(int argc, char **argv)
if (operation & SMIME_IP) {
PKCS7 *p7_in = NULL;
- p7 = PKCS7_new_with_libctx(libctx, propq);
+ p7 = PKCS7_new_ex(libctx, propq);
if (p7 == NULL) {
BIO_printf(bio_err, "Error allocating PKCS7 object\n");
goto end;
@@ -538,7 +538,7 @@ int smime_main(int argc, char **argv)
if (operation == SMIME_ENCRYPT) {
if (indef)
flags |= PKCS7_STREAM;
- p7 = PKCS7_encrypt_with_libctx(encerts, in, cipher, flags, libctx, propq);
+ p7 = PKCS7_encrypt_ex(encerts, in, cipher, flags, libctx, propq);
} else if (operation & SMIME_SIGNERS) {
int i;
/*
@@ -553,8 +553,7 @@ int smime_main(int argc, char **argv)
flags |= PKCS7_STREAM;
}
flags |= PKCS7_PARTIAL;
- p7 = PKCS7_sign_with_libctx(NULL, NULL, other, in, flags, libctx,
- propq);
+ p7 = PKCS7_sign_ex(NULL, NULL, other, in, flags, libctx, propq);
if (p7 == NULL)
goto end;
if (flags & PKCS7_NOCERTS) {
diff --git a/apps/storeutl.c b/apps/storeutl.c
index 3d9498dc46..b28c345fd3 100644
--- a/apps/storeutl.c
+++ b/apps/storeutl.c
@@ -356,8 +356,8 @@ static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
OSSL_STORE_CTX *store_ctx = NULL;
int ret = 1, items = 0;
- if ((store_ctx = OSSL_STORE_open_with_libctx(uri, libctx, propq,
- uimeth, uidata, NULL, NULL))
+ if ((store_ctx = OSSL_STORE_open_ex(uri, libctx, propq, uimeth, uidata,
+ NULL, NULL))
== NULL) {
BIO_printf(bio_err, "Couldn't open file or uri %s\n", uri);
ERR_print_errors(bio_err);
diff --git a/apps/ts.c b/apps/ts.c
index 09c586b44f..50dd263399 100644
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -980,9 +980,8 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
- if (!X509_LOOKUP_load_file_with_libctx(lookup, CAfile,
- X509_FILETYPE_PEM,
- libctx, propq)) {
+ if (!X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM, libctx,
+ propq)) {
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
goto err;
}
@@ -994,7 +993,7 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
- if (!X509_LOOKUP_load_store_with_libctx(lookup, CAstore, libctx, propq)) {
+ if (!X509_LOOKUP_load_store_ex(lookup, CAstore, libctx, propq)) {
BIO_printf(bio_err, "Error loading store URI %s\n", CAstore);
goto err;
}
diff --git a/apps/x509.c b/apps/x509.c
index 367cbf45f1..509d6e8741 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -506,8 +506,8 @@ int x509_main(int argc, char **argv)
goto end;
}
- if (!X509_STORE_set_default_paths_with_libctx(ctx, app_get0_libctx(),
- app_get0_propq())) {
+ if (!X509_STORE_set_default_paths_ex(ctx, app_get0_libctx(),
+ app_get0_propq())) {
ERR_print_errors(bio_err);
goto end;
}
@@ -605,7 +605,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_with_libctx(app_get0_libctx(), app_get0_propq())) == NULL)
+ if ((x = X509_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
goto end;
if (sno == NULL) {