Skip to content

Commit 5b6f86b

Browse files
committed
TLS 1.2 message order check: certificate before CKE
Make sure we received a Certificate message before the ClientKeyExchange when a certificate is requested. (Certificate message will be empty when client has no valid certificate.)
1 parent f7b5f00 commit 5b6f86b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/internal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18066,6 +18066,12 @@ static int SanityCheckMsgReceived(WOLFSSL* ssl, byte type)
1806618066
WOLFSSL_ERROR_VERBOSE(OUT_OF_ORDER_E);
1806718067
return OUT_OF_ORDER_E;
1806818068
}
18069+
if (!ssl->options.resuming && ssl->options.verifyPeer &&
18070+
!ssl->options.usingPSK_cipher &&
18071+
!ssl->options.usingAnon_cipher &&
18072+
!ssl->msgsReceived.got_certificate) {
18073+
return OUT_OF_ORDER_E;
18074+
}
1806918075
if (ssl->msgsReceived.got_certificate_verify||
1807018076
ssl->msgsReceived.got_change_cipher ||
1807118077
ssl->msgsReceived.got_finished) {

0 commit comments

Comments
 (0)