diff options
| author | jsing <> | 2021-02-20 08:19:01 +0000 |
|---|---|---|
| committer | jsing <> | 2021-02-20 08:19:01 +0000 |
| commit | 83b6cbaae70b14b5e01f0bf2e87656e5915d40ff (patch) | |
| tree | 21722f7a3cc350048980454aefaf68978e6303a7 /src | |
| parent | 76d8640e29e5c039ce8cf94023e9af82f456d36f (diff) | |
| download | openbsd-83b6cbaae70b14b5e01f0bf2e87656e5915d40ff.tar.gz openbsd-83b6cbaae70b14b5e01f0bf2e87656e5915d40ff.tar.bz2 openbsd-83b6cbaae70b14b5e01f0bf2e87656e5915d40ff.zip | |
Group HelloVerifyRequest decoding and add missing check for trailing data.
ok tb@
Diffstat (limited to 'src')
| -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; |
