diff options
Diffstat (limited to 'src/lib/libssl/ssl_clnt.c')
-rw-r--r-- | src/lib/libssl/ssl_clnt.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c index 56ea99d82e..10dbe83cd5 100644 --- a/src/lib/libssl/ssl_clnt.c +++ b/src/lib/libssl/ssl_clnt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_clnt.c,v 1.22 2017/10/12 16:06:32 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_clnt.c,v 1.23 2018/02/08 11:30:30 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -813,7 +813,6 @@ ssl3_get_server_hello(SSL *s) | |||
813 | STACK_OF(SSL_CIPHER) *sk; | 813 | STACK_OF(SSL_CIPHER) *sk; |
814 | const SSL_CIPHER *cipher; | 814 | const SSL_CIPHER *cipher; |
815 | const SSL_METHOD *method; | 815 | const SSL_METHOD *method; |
816 | unsigned char *p; | ||
817 | unsigned long alg_k; | 816 | unsigned long alg_k; |
818 | size_t outlen; | 817 | size_t outlen; |
819 | int i, al, ok; | 818 | int i, al, ok; |
@@ -1011,22 +1010,31 @@ ssl3_get_server_hello(SSL *s) | |||
1011 | goto f_err; | 1010 | goto f_err; |
1012 | } | 1011 | } |
1013 | 1012 | ||
1014 | /* TLS extensions. */ | 1013 | if (!tlsext_serverhello_parse(s, &cbs, &al)) { |
1015 | p = (unsigned char *)CBS_data(&cbs); | ||
1016 | if (!ssl_parse_serverhello_tlsext(s, &p, CBS_len(&cbs), &al)) { | ||
1017 | /* 'al' set by ssl_parse_serverhello_tlsext */ | ||
1018 | SSLerror(s, SSL_R_PARSE_TLSEXT); | 1014 | SSLerror(s, SSL_R_PARSE_TLSEXT); |
1019 | goto f_err; | 1015 | goto f_err; |
1020 | } | 1016 | } |
1017 | |||
1018 | /* | ||
1019 | * Determine if we need to see RI. Strictly speaking if we want to | ||
1020 | * avoid an attack we should *always* see RI even on initial server | ||
1021 | * hello because the client doesn't see any renegotiation during an | ||
1022 | * attack. However this would mean we could not connect to any server | ||
1023 | * which doesn't support RI so for the immediate future tolerate RI | ||
1024 | * absence on initial connect only. | ||
1025 | */ | ||
1026 | if (!S3I(s)->renegotiate_seen && | ||
1027 | !(s->internal->options & SSL_OP_LEGACY_SERVER_CONNECT)) { | ||
1028 | al = SSL_AD_HANDSHAKE_FAILURE; | ||
1029 | SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); | ||
1030 | goto f_err; | ||
1031 | } | ||
1032 | |||
1021 | if (ssl_check_serverhello_tlsext(s) <= 0) { | 1033 | if (ssl_check_serverhello_tlsext(s) <= 0) { |
1022 | SSLerror(s, SSL_R_SERVERHELLO_TLSEXT); | 1034 | SSLerror(s, SSL_R_SERVERHELLO_TLSEXT); |
1023 | goto err; | 1035 | goto err; |
1024 | } | 1036 | } |
1025 | 1037 | ||
1026 | /* See if any data remains... */ | ||
1027 | if (p - CBS_data(&cbs) != CBS_len(&cbs)) | ||
1028 | goto truncated; | ||
1029 | |||
1030 | return (1); | 1038 | return (1); |
1031 | 1039 | ||
1032 | truncated: | 1040 | truncated: |