Latest update.
This commit is contained in:
+26
-4
@@ -20,6 +20,16 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
|
||||
DEFINE_STACK_OF(OSSL_CMP_ITAV)
|
||||
DEFINE_STACK_OF(GENERAL_NAME)
|
||||
DEFINE_STACK_OF(X509_EXTENSION)
|
||||
DEFINE_STACK_OF(OSSL_CMP_PKISI)
|
||||
DEFINE_STACK_OF(OSSL_CRMF_MSG)
|
||||
DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
|
||||
DEFINE_STACK_OF(OSSL_CRMF_CERTID)
|
||||
DEFINE_STACK_OF(ASN1_UTF8STRING)
|
||||
|
||||
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
@@ -208,7 +218,7 @@ static const X509_NAME *determine_subj(OSSL_CMP_CTX *ctx, X509 *refcert,
|
||||
static OSSL_CRMF_MSG *crm_new(OSSL_CMP_CTX *ctx, int bodytype, int rid)
|
||||
{
|
||||
OSSL_CRMF_MSG *crm = NULL;
|
||||
X509 *refcert = ctx->oldCert != NULL ? ctx->oldCert : ctx->clCert;
|
||||
X509 *refcert = ctx->oldCert != NULL ? ctx->oldCert : ctx->cert;
|
||||
/* refcert defaults to current client cert */
|
||||
EVP_PKEY *rkey = OSSL_CMP_CTX_get0_newPkey(ctx, 0);
|
||||
STACK_OF(GENERAL_NAME) *default_sans = NULL;
|
||||
@@ -574,9 +584,9 @@ int ossl_cmp_msg_gen_push1_ITAVs(OSSL_CMP_MSG *msg,
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < sk_OSSL_CMP_ITAV_num(itavs); i++) {
|
||||
if ((itav = OSSL_CMP_ITAV_dup(sk_OSSL_CMP_ITAV_value(itavs, i))) == NULL)
|
||||
return 0;
|
||||
if (!ossl_cmp_msg_gen_push0_ITAV(msg, itav)) {
|
||||
itav = OSSL_CMP_ITAV_dup(sk_OSSL_CMP_ITAV_value(itavs, i));
|
||||
if (itav == NULL
|
||||
|| !ossl_cmp_msg_gen_push0_ITAV(msg, itav)) {
|
||||
OSSL_CMP_ITAV_free(itav);
|
||||
return 0;
|
||||
}
|
||||
@@ -972,6 +982,18 @@ X509 *ossl_cmp_certresponse_get1_certificate(EVP_PKEY *privkey,
|
||||
return crt;
|
||||
}
|
||||
|
||||
int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg)
|
||||
{
|
||||
if (ctx == NULL || msg == NULL) {
|
||||
CMPerr(0, CMP_R_NULL_ARGUMENT);
|
||||
return 0;
|
||||
}
|
||||
if (!ossl_cmp_hdr_set_transactionID(ctx, msg->header))
|
||||
return 0;
|
||||
return msg->header->protectionAlg == NULL
|
||||
|| ossl_cmp_msg_protect(ctx, msg);
|
||||
}
|
||||
|
||||
OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file)
|
||||
{
|
||||
OSSL_CMP_MSG *msg = NULL;
|
||||
|
||||
Reference in New Issue
Block a user