Latest update
This commit is contained in:
+15
-3
@@ -203,9 +203,10 @@ static int get_cert_verify_tbs_data(SSL *s, unsigned char *tls13tbs,
|
||||
*hdatalen = TLS13_TBS_PREAMBLE_SIZE + hashlen;
|
||||
} else {
|
||||
size_t retlen;
|
||||
long retlen_l;
|
||||
|
||||
retlen = BIO_get_mem_data(s->s3->handshake_buffer, hdata);
|
||||
if (retlen <= 0) {
|
||||
retlen = retlen_l = BIO_get_mem_data(s->s3->handshake_buffer, hdata);
|
||||
if (retlen_l <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_GET_CERT_VERIFY_TBS_DATA,
|
||||
ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
@@ -494,7 +495,18 @@ MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
|
||||
}
|
||||
}
|
||||
|
||||
ret = MSG_PROCESS_CONTINUE_READING;
|
||||
/*
|
||||
* In TLSv1.3 on the client side we make sure we prepare the client
|
||||
* certificate after the CertVerify instead of when we get the
|
||||
* CertificateRequest. This is because in TLSv1.3 the CertificateRequest
|
||||
* comes *before* the Certificate message. In TLSv1.2 it comes after. We
|
||||
* want to make sure that SSL_get_peer_certificate() will return the actual
|
||||
* server certificate from the client_cert_cb callback.
|
||||
*/
|
||||
if (!s->server && SSL_IS_TLS13(s) && s->s3->tmp.cert_req == 1)
|
||||
ret = MSG_PROCESS_CONTINUE_PROCESSING;
|
||||
else
|
||||
ret = MSG_PROCESS_CONTINUE_READING;
|
||||
err:
|
||||
BIO_free(s->s3->handshake_buffer);
|
||||
s->s3->handshake_buffer = NULL;
|
||||
|
||||
Reference in New Issue
Block a user