File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17658,9 +17658,16 @@ static int ConfirmNameConstraints(Signer* signer, DecodedCert* cert)
1765817658 XMEMSET(&subjectDnsName, 0, sizeof(DNS_entry));
1765917659 switch (nameType) {
1766017660 case ASN_DNS_TYPE:
17661- /* Should it also consider CN in subject? It could use
17662- * subjectDnsName too */
1766317661 name = cert->altNames;
17662+
17663+ /* When no SAN is present, apply DNS name constraints to the
17664+ * Subject CN. */
17665+ if (cert->subjectCN != NULL && cert->altNames == NULL) {
17666+ subjectDnsName.next = NULL;
17667+ subjectDnsName.type = ASN_DNS_TYPE;
17668+ subjectDnsName.len = cert->subjectCNLen;
17669+ subjectDnsName.name = cert->subjectCN;
17670+ }
1766417671 break;
1766517672 case ASN_IP_TYPE:
1766617673 /* IP addresses are stored in altNames with type ASN_IP_TYPE */
You can’t perform that action at this time.
0 commit comments