diff options
author | jsing <> | 2021-02-20 08:19:01 +0000 |
---|---|---|
committer | jsing <> | 2021-02-20 08:19:01 +0000 |
commit | ff8e4c1e0532f9cbbac3122e18d46a6c2f730581 (patch) | |
tree | 21722f7a3cc350048980454aefaf68978e6303a7 /src/lib | |
parent | 93e34a05ac8c1e16b54a304ae44d77e1c961484c (diff) | |
download | openbsd-ff8e4c1e0532f9cbbac3122e18d46a6c2f730581.tar.gz openbsd-ff8e4c1e0532f9cbbac3122e18d46a6c2f730581.tar.bz2 openbsd-ff8e4c1e0532f9cbbac3122e18d46a6c2f730581.zip |
Group HelloVerifyRequest decoding and add missing check for trailing data.
ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/ssl_clnt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c index 0c7bdbc776..680cafa8e5 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.78 2021/02/07 15:26:32 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_clnt.c,v 1.79 2021/02/20 08:19:01 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 | * |
@@ -812,6 +812,10 @@ ssl3_get_dtls_hello_verify(SSL *s) | |||
812 | 812 | ||
813 | if (!CBS_get_u16(&hello_verify_request, &ssl_version)) | 813 | if (!CBS_get_u16(&hello_verify_request, &ssl_version)) |
814 | goto truncated; | 814 | goto truncated; |
815 | if (!CBS_get_u8_length_prefixed(&hello_verify_request, &cookie)) | ||
816 | goto truncated; | ||
817 | if (CBS_len(&hello_verify_request) != 0) | ||
818 | goto truncated; | ||
815 | 819 | ||
816 | if (ssl_version != s->version) { | 820 | if (ssl_version != s->version) { |
817 | SSLerror(s, SSL_R_WRONG_SSL_VERSION); | 821 | SSLerror(s, SSL_R_WRONG_SSL_VERSION); |
@@ -820,9 +824,6 @@ ssl3_get_dtls_hello_verify(SSL *s) | |||
820 | goto f_err; | 824 | goto f_err; |
821 | } | 825 | } |
822 | 826 | ||
823 | if (!CBS_get_u8_length_prefixed(&hello_verify_request, &cookie)) | ||
824 | goto truncated; | ||
825 | |||
826 | if (!CBS_write_bytes(&cookie, D1I(s)->cookie, | 827 | if (!CBS_write_bytes(&cookie, D1I(s)->cookie, |
827 | sizeof(D1I(s)->cookie), &cookie_len)) { | 828 | sizeof(D1I(s)->cookie), &cookie_len)) { |
828 | D1I(s)->cookie_len = 0; | 829 | D1I(s)->cookie_len = 0; |