From: Dr. David von Oheimb Date: Wed, 17 Feb 2021 11:29:39 +0000 (+0100) Subject: Rename internal X509_add_cert_new() to ossl_x509_add_cert_new() X-Git-Tag: openssl-3.0.0-alpha13~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1be4d617cf9435e8326ebba643aa4d7cbcb3645;p=thirdparty%2Fopenssl.git Rename internal X509_add_cert_new() to ossl_x509_add_cert_new() Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14039) --- diff --git a/crypto/cmp/cmp_protect.c b/crypto/cmp/cmp_protect.c index aa51bbaa77e..dcc0232e01f 100644 --- a/crypto/cmp/cmp_protect.c +++ b/crypto/cmp/cmp_protect.c @@ -162,7 +162,7 @@ int ossl_cmp_msg_add_extraCerts(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg) return 0; } else { /* make sure that at least our own signer cert is included first */ - if (!X509_add_cert_new(&msg->extraCerts, ctx->cert, prepend)) + if (!ossl_x509_add_cert_new(&msg->extraCerts, ctx->cert, prepend)) return 0; ossl_cmp_debug(ctx, "fallback: adding just own CMP signer cert"); } diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 8c4f252ee8a..3e2907fc161 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -627,8 +627,8 @@ STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms) for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) { cch = sk_CMS_CertificateChoices_value(*pcerts, i); if (cch->type == 0) { - if (!X509_add_cert_new(&certs, cch->d.certificate, - X509_ADD_FLAG_UP_REF)) { + if (!ossl_x509_add_cert_new(&certs, cch->d.certificate, + X509_ADD_FLAG_UP_REF)) { sk_X509_pop_free(certs, X509_free); return NULL; } diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index 57dd85d561f..b0519f3894f 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -20,7 +20,7 @@ #include "crypto/evp.h" #include "crypto/cms.h" #include "crypto/ess.h" -#include "crypto/x509.h" /* for X509_add_cert_new() */ +#include "crypto/x509.h" /* for ossl_x509_add_cert_new() */ /* CMS SignedData Utilities */ @@ -509,8 +509,8 @@ STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms) for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) { si = sk_CMS_SignerInfo_value(sinfos, i); if (si->signer != NULL) { - if (!X509_add_cert_new(&signers, si->signer, - X509_ADD_FLAG_DEFAULT)) { + if (!ossl_x509_add_cert_new(&signers, si->signer, + X509_ADD_FLAG_DEFAULT)) { sk_X509_free(signers); return NULL; } diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c index 2d4bd036ad9..40d26fb871f 100644 --- a/crypto/ocsp/ocsp_cl.c +++ b/crypto/ocsp/ocsp_cl.c @@ -77,7 +77,7 @@ int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert) return 0; if (cert == NULL) return 1; - return X509_add_cert_new(&sig->certs, cert, X509_ADD_FLAG_UP_REF); + return ossl_x509_add_cert_new(&sig->certs, cert, X509_ADD_FLAG_UP_REF); } /* diff --git a/crypto/ocsp/ocsp_local.h b/crypto/ocsp/ocsp_local.h index 1e7de1384f5..a7e6e86685f 100644 --- a/crypto/ocsp/ocsp_local.h +++ b/crypto/ocsp/ocsp_local.h @@ -7,7 +7,7 @@ * https://www.openssl.org/source/license.html */ -#include "crypto/x509.h" /* for X509_add_cert_new() */ +#include "crypto/x509.h" /* for ossl_x509_add_cert_new() */ /*- CertID ::= SEQUENCE { * hashAlgorithm AlgorithmIdentifier, diff --git a/crypto/ocsp/ocsp_srv.c b/crypto/ocsp/ocsp_srv.c index 2c8b38f723c..4a864f2d799 100644 --- a/crypto/ocsp/ocsp_srv.c +++ b/crypto/ocsp/ocsp_srv.c @@ -158,7 +158,7 @@ OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert) { - return X509_add_cert_new(&resp->certs, cert, X509_ADD_FLAG_UP_REF); + return ossl_x509_add_cert_new(&resp->certs, cert, X509_ADD_FLAG_UP_REF); } /* diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c index 9b2e8a55c51..140a690cbb6 100644 --- a/crypto/pkcs12/p12_kiss.c +++ b/crypto/pkcs12/p12_kiss.c @@ -10,7 +10,7 @@ #include #include "internal/cryptlib.h" #include -#include "crypto/x509.h" /* for X509_add_cert_new() */ +#include "crypto/x509.h" /* for ossl_x509_add_cert_new() */ /* Simplified PKCS#12 routines */ @@ -104,7 +104,7 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, } if (ca != NULL) { - if (!X509_add_cert_new(ca, x, X509_ADD_FLAG_DEFAULT)) + if (!ossl_x509_add_cert_new(ca, x, X509_ADD_FLAG_DEFAULT)) goto err; continue; } diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index baecff28fa6..95aab3368a0 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -257,7 +257,7 @@ int PKCS7_add_certificate(PKCS7 *p7, X509 *x509) return 0; } - return X509_add_cert_new(sk, x509, X509_ADD_FLAG_UP_REF); + return ossl_x509_add_cert_new(sk, x509, X509_ADD_FLAG_UP_REF); } int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl) diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index 9cf02be0cb2..c29fe3cc5f3 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -175,7 +175,7 @@ int X509_cmp(const X509 *a, const X509 *b) return rv < 0 ? -1 : rv > 0; } -int X509_add_cert_new(STACK_OF(X509) **p_sk, X509 *cert, int flags) +int ossl_x509_add_cert_new(STACK_OF(X509) **p_sk, X509 *cert, int flags) { if (*p_sk == NULL && (*p_sk = sk_X509_new_null()) == NULL) { @@ -236,7 +236,7 @@ int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, STACK_OF(X509) *certs, int j = (flags & X509_ADD_FLAG_PREPEND) == 0 ? i : n - 1 - i; /* if prepend, add certs in reverse order to keep original order */ - if (!X509_add_cert_new(p_sk, sk_X509_value(certs, j), flags)) + if (!ossl_x509_add_cert_new(p_sk, sk_X509_value(certs, j), flags)) return 0; } return 1; diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 83dddeeb3d1..f4f78eec9dc 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -281,7 +281,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) return -1; } - if (!X509_add_cert_new(&ctx->chain, ctx->cert, X509_ADD_FLAG_UP_REF)) { + if (!ossl_x509_add_cert_new(&ctx->chain, ctx->cert, X509_ADD_FLAG_UP_REF)) { ctx->error = X509_V_ERR_OUT_OF_MEM; return -1; } diff --git a/include/crypto/x509.h b/include/crypto/x509.h index 4898eeed613..809f6e328e1 100644 --- a/include/crypto/x509.h +++ b/include/crypto/x509.h @@ -318,7 +318,7 @@ int x509_init_sig_info(X509 *x); int asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *type, void *data, unsigned char *md, unsigned int *len, OSSL_LIB_CTX *libctx, const char *propq); -int X509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags); +int ossl_x509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags); int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, STACK_OF(X509) *certs, int flags);