Latest update (add quic)
This commit is contained in:
+19
-15
@@ -41,6 +41,14 @@ int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr)
|
||||
return (int)pvno;
|
||||
}
|
||||
|
||||
int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr)
|
||||
{
|
||||
if (!ossl_assert(hdr != NULL)
|
||||
|| hdr->protectionAlg == NULL)
|
||||
return NID_undef;
|
||||
return OBJ_obj2nid(hdr->protectionAlg->algorithm);
|
||||
}
|
||||
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const
|
||||
OSSL_CMP_PKIHEADER *hdr)
|
||||
{
|
||||
@@ -300,30 +308,26 @@ int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The sender name is copied from the subject of the client cert, if any,
|
||||
* or else from the subject name provided for certification requests.
|
||||
* If neither protection cert nor oldCert nor subject are given,
|
||||
* sender name is not known to the client and thus set to NULL-DN
|
||||
*/
|
||||
sender = ctx->cert != NULL ?
|
||||
X509_get_subject_name(ctx->cert) : ctx->subjectName;
|
||||
sender = ctx->cert != NULL ? X509_get_subject_name(ctx->cert) :
|
||||
ctx->oldCert != NULL ? X509_get_subject_name(ctx->oldCert) :
|
||||
ctx->subjectName;
|
||||
if (!ossl_cmp_hdr_set1_sender(hdr, sender))
|
||||
return 0;
|
||||
|
||||
/* determine recipient entry in PKIHeader */
|
||||
if (ctx->srvCert != NULL) {
|
||||
rcp = X509_get_subject_name(ctx->srvCert);
|
||||
/* set also as expected_sender of responses unless set explicitly */
|
||||
if (ctx->expected_sender == NULL && rcp != NULL
|
||||
&& !OSSL_CMP_CTX_set1_expected_sender(ctx, rcp))
|
||||
return 0;
|
||||
} else if (ctx->recipient != NULL) {
|
||||
if (ctx->recipient != NULL)
|
||||
rcp = ctx->recipient;
|
||||
} else if (ctx->issuer != NULL) {
|
||||
else if (ctx->srvCert != NULL)
|
||||
rcp = X509_get_subject_name(ctx->srvCert);
|
||||
else if (ctx->issuer != NULL)
|
||||
rcp = ctx->issuer;
|
||||
} else if (ctx->oldCert != NULL) {
|
||||
else if (ctx->oldCert != NULL)
|
||||
rcp = X509_get_issuer_name(ctx->oldCert);
|
||||
} else if (ctx->cert != NULL) {
|
||||
else if (ctx->cert != NULL)
|
||||
rcp = X509_get_issuer_name(ctx->cert);
|
||||
}
|
||||
if (!ossl_cmp_hdr_set1_recipient(hdr, rcp))
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user