Skip to content

Commit 86dd1c4

Browse files
committed
Move callback to after ssl->peerVerifyRet is populated
1 parent 5670238 commit 86dd1c4

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/internal.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16046,13 +16046,6 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1604616046
goto exit_ppc;
1604716047
#endif
1604816048

16049-
/* Do verify callback. Don't call it on error as the callback
16050-
* will still be called later. */
16051-
if (ret != 0) {
16052-
args->leafVerifyErr = ret =
16053-
DoVerifyCallback(SSL_CM(ssl), ssl, ret, args);
16054-
}
16055-
1605616049
if (ret == 0) {
1605716050
WOLFSSL_MSG("Verified Peer's cert");
1605816051
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
@@ -16144,6 +16137,10 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1614416137
}
1614516138
#endif
1614616139

16140+
/* Do verify callback. */
16141+
args->leafVerifyErr = ret =
16142+
DoVerifyCallback(SSL_CM(ssl), ssl, ret, args);
16143+
1614716144
#if defined(__APPLE__) && defined(WOLFSSL_SYS_CA_CERTS)
1614816145
/* Disregard failure to verify peer cert, as we will verify
1614916146
* the whole chain with the native API later */
@@ -16157,8 +16154,8 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1615716154
}
1615816155
else
1615916156
#endif/*defined(__APPLE__)&& defined(WOLFSSL_SYS_CA_CERTS)*/
16160-
{
16161-
WOLFSSL_MSG("\tNo callback override available, fatal");
16157+
if (ret != 0) {
16158+
WOLFSSL_MSG("\tfatal cert error");
1616216159
args->fatal = 1;
1616316160
DoCertFatalAlert(ssl, ret);
1616416161
}

0 commit comments

Comments
 (0)