mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
Rename internal X509_add_cert_new() to ossl_x509_add_cert_new()
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14039)
This commit is contained in:
parent
daf1300b80
commit
c1be4d617c
@ -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");
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/pkcs12.h>
|
||||
#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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user