If the server_name extension is long enough to require two bytes to
hold the length of either field, the test suite would not decode
the length properly. Using the PACKET_ APIs would have avoided this,
but it was desired to avoid using private APIs in this part of the
test suite, to keep ourselves honest.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4318)
remaining <= 2)
return 0;
/* Extract the length of the supplied list of names. */
- len = (*(p++) << 1);
+ len = (*(p++) << 8);
len += *(p++);
if (len + 2 != remaining)
return 0;
/* Now we can finally pull out the byte array with the actual hostname. */
if (remaining <= 2)
return 0;
- len = (*(p++) << 1);
+ len = (*(p++) << 8);
len += *(p++);
if (len + 2 > remaining)
return 0;