summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7
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 /crypto/pkcs7
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 'crypto/pkcs7')
-rw-r--r--crypto/pkcs7/pk7_asn1.c2
-rw-r--r--crypto/pkcs7/pk7_doit.c13
-rw-r--r--crypto/pkcs7/pk7_mime.c9
-rw-r--r--crypto/pkcs7/pk7_smime.c22
4 files changed, 22 insertions, 24 deletions
diff --git a/crypto/pkcs7/pk7_asn1.c b/crypto/pkcs7/pk7_asn1.c
index f04e4b34ce..b0027cec2d 100644
--- a/crypto/pkcs7/pk7_asn1.c
+++ b/crypto/pkcs7/pk7_asn1.c
@@ -83,7 +83,7 @@ PKCS7 *PKCS7_new(void)
return (PKCS7 *)ASN1_item_new(ASN1_ITEM_rptr(PKCS7));
}
-PKCS7 *PKCS7_new_with_libctx(OPENSSL_CTX *libctx, const char *propq)
+PKCS7 *PKCS7_new_ex(OPENSSL_CTX *libctx, const char *propq)
{
PKCS7 *pkcs7 = PKCS7_new();
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
index bc9bfd8589..cde158d56a 100644
--- a/crypto/pkcs7/pk7_doit.c
+++ b/crypto/pkcs7/pk7_doit.c
@@ -847,8 +847,8 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
if (abuf == NULL)
goto err;
- if (!EVP_SignFinal_with_libctx(ctx_tmp, abuf, &abuflen, si->pkey,
- p7_ctx->libctx, p7_ctx->propq)) {
+ if (!EVP_SignFinal_ex(ctx_tmp, abuf, &abuflen, si->pkey,
+ p7_ctx->libctx, p7_ctx->propq)) {
OPENSSL_free(abuf);
PKCS7err(PKCS7_F_PKCS7_DATAFINAL, ERR_R_EVP_LIB);
goto err;
@@ -919,9 +919,8 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)
goto err;
}
- if (EVP_DigestSignInit_with_libctx(mctx, &pctx,
- EVP_MD_name(md), ctx->libctx, ctx->propq,
- si->pkey) <= 0)
+ if (EVP_DigestSignInit_ex(mctx, &pctx, EVP_MD_name(md), ctx->libctx,
+ ctx->propq, si->pkey) <= 0)
goto err;
/*
@@ -1171,8 +1170,8 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
goto err;
}
- i = EVP_VerifyFinal_with_libctx(mdc_tmp, os->data, os->length, pkey,
- ctx->libctx, ctx->propq);
+ i = EVP_VerifyFinal_ex(mdc_tmp, os->data, os->length, pkey, ctx->libctx,
+ ctx->propq);
if (i <= 0) {
PKCS7err(PKCS7_F_PKCS7_SIGNATUREVERIFY, PKCS7_R_SIGNATURE_FAILURE);
ret = -1;
diff --git a/crypto/pkcs7/pk7_mime.c b/crypto/pkcs7/pk7_mime.c
index 2099e8d9ef..c505b23648 100644
--- a/crypto/pkcs7/pk7_mime.c
+++ b/crypto/pkcs7/pk7_mime.c
@@ -40,11 +40,10 @@ int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags)
flags ^= SMIME_OLDMIME;
- return SMIME_write_ASN1_with_libctx(bio, (ASN1_VALUE *)p7, data, flags,
- ctype_nid, NID_undef, mdalgs,
- ASN1_ITEM_rptr(PKCS7),
- pkcs7_ctx_get0_libctx(ctx),
- pkcs7_ctx_get0_propq(ctx));
+ return SMIME_write_ASN1_ex(bio, (ASN1_VALUE *)p7, data, flags, ctype_nid,
+ NID_undef, mdalgs, ASN1_ITEM_rptr(PKCS7),
+ pkcs7_ctx_get0_libctx(ctx),
+ pkcs7_ctx_get0_propq(ctx));
}
PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7)
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c
index 3347544bb8..5cbc18c63e 100644
--- a/crypto/pkcs7/pk7_smime.c
+++ b/crypto/pkcs7/pk7_smime.c
@@ -20,14 +20,14 @@
static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
-PKCS7 *PKCS7_sign_with_libctx(X509 *signcert, EVP_PKEY *pkey,
- STACK_OF(X509) *certs, BIO *data, int flags,
- OPENSSL_CTX *libctx, const char *propq)
+PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
+ BIO *data, int flags, OPENSSL_CTX *libctx,
+ const char *propq)
{
PKCS7 *p7;
int i;
- if ((p7 = PKCS7_new_with_libctx(libctx, propq)) == NULL) {
+ if ((p7 = PKCS7_new_ex(libctx, propq)) == NULL) {
PKCS7err(0, ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -67,7 +67,7 @@ PKCS7 *PKCS7_sign_with_libctx(X509 *signcert, EVP_PKEY *pkey,
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags)
{
- return PKCS7_sign_with_libctx(signcert, pkey, certs, data, flags, NULL, NULL);
+ return PKCS7_sign_ex(signcert, pkey, certs, data, flags, NULL, NULL);
}
@@ -268,7 +268,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
/* Now verify the certificates */
p7_ctx = pkcs7_get0_ctx(p7);
- cert_ctx = X509_STORE_CTX_new_with_libctx(p7_ctx->libctx, p7_ctx->propq);
+ cert_ctx = X509_STORE_CTX_new_ex(p7_ctx->libctx, p7_ctx->propq);
if (cert_ctx == NULL)
goto err;
if (!(flags & PKCS7_NOVERIFY))
@@ -443,16 +443,16 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
/* Build a complete PKCS#7 enveloped data */
-PKCS7 *PKCS7_encrypt_with_libctx(STACK_OF(X509) *certs, BIO *in,
- const EVP_CIPHER *cipher, int flags,
- OPENSSL_CTX *libctx, const char *propq)
+PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
+ const EVP_CIPHER *cipher, int flags,
+ OPENSSL_CTX *libctx, const char *propq)
{
PKCS7 *p7;
BIO *p7bio = NULL;
int i;
X509 *x509;
- if ((p7 = PKCS7_new_with_libctx(libctx, propq)) == NULL) {
+ if ((p7 = PKCS7_new_ex(libctx, propq)) == NULL) {
PKCS7err(0, ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -489,7 +489,7 @@ PKCS7 *PKCS7_encrypt_with_libctx(STACK_OF(X509) *certs, BIO *in,
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
int flags)
{
- return PKCS7_encrypt_with_libctx(certs, in, cipher, flags, NULL, NULL);
+ return PKCS7_encrypt_ex(certs, in, cipher, flags, NULL, NULL);
}