Skip to content

Commit

Permalink
Continues processing cookieless client hellos for dtls1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh-dc committed Oct 16, 2023
1 parent eaee176 commit b3eebc0
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions ssl/statem/statem_srvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1618,17 +1618,6 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL_CONNECTION *s, PACKET *pkt)
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
goto err;
}
/*
* If we require cookies and this ClientHello doesn't contain one,
* just return since we do not want to allocate any memory yet.
* So check cookie length...
*/
if (SSL_get_options(SSL_CONNECTION_GET_SSL(s)) & SSL_OP_COOKIE_EXCHANGE) {
if (clienthello->dtls_cookie_len == 0) {
OPENSSL_free(clienthello);
return MSG_PROCESS_FINISHED_READING;
}
}
}

if (!PACKET_get_length_prefixed_2(pkt, &clienthello->ciphersuites)) {
Expand Down Expand Up @@ -1762,10 +1751,8 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_NOT_ON_RECORD_BOUNDARY);
goto err;
}

if (SSL_CONNECTION_IS_DTLS(s)) {
/* Empty cookie was already handled above by returning early. */
if (SSL_get_options(ssl) & SSL_OP_COOKIE_EXCHANGE) {
if ((SSL_get_options(ssl) & SSL_OP_COOKIE_EXCHANGE) && clienthello->dtls_cookie_len != 0) {
if (sctx->app_verify_cookie_cb != NULL) {
if (sctx->app_verify_cookie_cb(ssl, clienthello->dtls_cookie,
clienthello->dtls_cookie_len) == 0) {
Expand Down

0 comments on commit b3eebc0

Please sign in to comment.