Skip to content

Commit 233fc3e

Browse files
committed
Add missing WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY guards
1 parent 5922b5d commit 233fc3e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/internal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16460,6 +16460,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1646016460
}
1646116461
}
1646216462
else {
16463+
#ifndef WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY
1646316464
if (MatchDomainName(
1646416465
args->dCert->subjectCN,
1646516466
args->dCert->subjectCNLen,
@@ -16468,6 +16469,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1646816469
(word32)XSTRLEN(
1646916470
(const char *)ssl->buffers.domainName.buffer)
1647016471
), 0) == 0)
16472+
#endif
1647116473
{
1647216474
WOLFSSL_MSG("DomainName match on common name failed");
1647316475
ret = DOMAIN_NAME_MISMATCH;
@@ -16476,11 +16478,13 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1647616478
}
1647716479
#else /* WOLFSSL_ALL_NO_CN_IN_SAN */
1647816480
/* Old behavior. */
16481+
#ifndef WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY
1647916482
if (MatchDomainName(args->dCert->subjectCN,
1648016483
args->dCert->subjectCNLen,
1648116484
(char*)ssl->buffers.domainName.buffer,
1648216485
(ssl->buffers.domainName.buffer == NULL ? 0 :
1648316486
(word32)XSTRLEN(ssl->buffers.domainName.buffer)), 0) == 0)
16487+
#endif
1648416488
{
1648516489
WOLFSSL_MSG("DomainName match on common name failed");
1648616490
if (CheckForAltNames(args->dCert,

0 commit comments

Comments
 (0)