-/* $OpenBSD: ssl_clnt.c,v 1.78 2021/02/07 15:26:32 jsing Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.79 2021/02/20 08:19:01 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (!CBS_get_u16(&hello_verify_request, &ssl_version))
goto truncated;
+ if (!CBS_get_u8_length_prefixed(&hello_verify_request, &cookie))
+ goto truncated;
+ if (CBS_len(&hello_verify_request) != 0)
+ goto truncated;
if (ssl_version != s->version) {
SSLerror(s, SSL_R_WRONG_SSL_VERSION);
goto f_err;
}
- if (!CBS_get_u8_length_prefixed(&hello_verify_request, &cookie))
- goto truncated;
-
if (!CBS_write_bytes(&cookie, D1I(s)->cookie,
sizeof(D1I(s)->cookie), &cookie_len)) {
D1I(s)->cookie_len = 0;