In the process of debugging an hand shake failure with combination of openssl 1.1.1 + openlitespeed web server, we found that there is a bug that causes handshake failure.
The handshake failure error is:
error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm
The code execution flow is:
inside tls_post_process_client_hello()
s->cert->shared_sigalgslen was set to non-zero by tls1_set_shared_sigalgs()
s->cert->cert_cb() is called to lookup new SSL_CTX based on SSL_get_servername()
- When new SSL_CTX found,
SSL_set_SSL_CTX(s, new_ctx) is called.
- inside
SSL_set_SSL_CTX(s, new_ctx) , s->cert->shared_sigalgslen was set to 0 when ssl_cert_free(ssl->cert) is called.
- later, when
tls_choose_sigalg() is called, it errors out at t1_lib.c:2646
if (i == s->cert->shared_sigalgslen) {
if (!fatalerrs)
return 1;
SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
SSL_F_TLS_CHOOSE_SIGALG,
SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM);
return 0;
}
looks like tls1_set_shared_sigalgs() need to be called again, or called between step 4 and 5 instead at step 1.
In the process of debugging an hand shake failure with combination of openssl 1.1.1 + openlitespeed web server, we found that there is a bug that causes handshake failure.
The handshake failure error is:
error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithmThe code execution flow is:
inside
tls_post_process_client_hello()s->cert->shared_sigalgslenwas set to non-zero bytls1_set_shared_sigalgs()s->cert->cert_cb()is called to lookup new SSL_CTX based onSSL_get_servername()SSL_set_SSL_CTX(s, new_ctx)is called.SSL_set_SSL_CTX(s, new_ctx),s->cert->shared_sigalgslenwas set to0whenssl_cert_free(ssl->cert)is called.tls_choose_sigalg()is called, it errors out at t1_lib.c:2646looks like
tls1_set_shared_sigalgs()need to be called again, or called between step 4 and 5 instead at step 1.