QUIC: refactored SSL_do_handshake() handling.

No functional changes.
This commit is contained in:
Sergey Kandaurov 2020-10-29 21:50:49 +00:00
parent 1a0888aef9
commit 8ed020db75

View File

@ -3581,9 +3581,14 @@ ngx_quic_crypto_input(ngx_connection_t *c, ngx_quic_frame_t *frame, void *data)
n = SSL_do_handshake(ssl_conn); n = SSL_do_handshake(ssl_conn);
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic SSL_quic_read_level:%d SSL_quic_write_level:%d",
(int) SSL_quic_read_level(ssl_conn),
(int) SSL_quic_write_level(ssl_conn));
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_do_handshake: %d", n); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_do_handshake: %d", n);
if (n == -1) { if (n <= 0) {
sslerr = SSL_get_error(ssl_conn, n); sslerr = SSL_get_error(ssl_conn, n);
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d",
@ -3594,7 +3599,12 @@ ngx_quic_crypto_input(ngx_connection_t *c, ngx_quic_frame_t *frame, void *data)
return NGX_ERROR; return NGX_ERROR;
} }
} else if (n == 1 && !SSL_in_init(ssl_conn)) { return NGX_OK;
}
if (SSL_in_init(ssl_conn)) {
return NGX_OK;
}
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic ssl cipher:%s", SSL_get_cipher(ssl_conn)); "quic ssl cipher:%s", SSL_get_cipher(ssl_conn));
@ -3636,12 +3646,6 @@ ngx_quic_crypto_input(ngx_connection_t *c, ngx_quic_frame_t *frame, void *data)
* when the TLS handshake is confirmed * when the TLS handshake is confirmed
*/ */
ngx_quic_discard_ctx(c, ssl_encryption_handshake); ngx_quic_discard_ctx(c, ssl_encryption_handshake);
}
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic SSL_quic_read_level:%d SSL_quic_write_level:%d",
(int) SSL_quic_read_level(ssl_conn),
(int) SSL_quic_write_level(ssl_conn));
return NGX_OK; return NGX_OK;
} }