summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem_srvr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssl/statem/statem_srvr.c')
-rw-r--r--ssl/statem/statem_srvr.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index 5aa395f406..d40141d516 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -1910,15 +1910,10 @@ int tls_construct_server_hello(SSL *s, WPACKET *pkt)
|| !s->method->put_cipher_by_char(s->s3->tmp.new_cipher, pkt, &len)
|| (!SSL_IS_TLS13(s)
&& !WPACKET_put_bytes_u8(pkt, compm))
- /*
- * TODO(TLS1.3): For now we add all 1.2 and 1.3 extensions. Later
- * we will do this based on the actual protocol
- */
|| !tls_construct_extensions(s, pkt,
- EXT_TLS1_2_SERVER_HELLO
- | EXT_TLS1_3_SERVER_HELLO
- | EXT_TLS1_3_ENCRYPTED_EXTENSIONS
- | EXT_TLS1_3_CERTIFICATE, &al)) {
+ SSL_IS_TLS13(s)
+ ? EXT_TLS1_3_SERVER_HELLO
+ : EXT_TLS1_2_SERVER_HELLO, &al)) {
SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_HELLO, ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -3495,10 +3490,18 @@ MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt)
static int tls_construct_encrypted_extensions(SSL *s, WPACKET *pkt)
{
- /* TODO(TLS1.3): Zero length encrypted extensions message for now */
- if (!WPACKET_put_bytes_u16(pkt, 0)) {
+ int al;
+
+ /*
+ * TODO(TLS1.3): For now we send certificate extensions in with the
+ * encrypted extensions. Later we need to move these to the certificate
+ * message.
+ */
+ if (!tls_construct_extensions(s, pkt, EXT_TLS1_3_ENCRYPTED_EXTENSIONS
+ | EXT_TLS1_3_CERTIFICATE, &al)) {
+ ssl3_send_alert(s, SSL3_AL_FATAL, al);
SSLerr(SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS, ERR_R_INTERNAL_ERROR);
- ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
+ ssl3_send_alert(s, SSL3_AL_FATAL, al);
return 0;
}