Don't infinite loop on garbage server input.
else block got lost in a rewrite of this code. Change-Id: I51f1655474ec8bbd4eccb4297124e8584329444e Reviewed-on: https://boringssl-review.googlesource.com/2560 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
226a872d2f
commit
f080ecd86d
@ -381,6 +381,11 @@ static int ssl23_get_client_hello(SSL *s)
|
||||
/* Ready to switch versions. */
|
||||
s->state = SSL23_ST_SR_SWITCH_VERSION;
|
||||
}
|
||||
else
|
||||
{
|
||||
OPENSSL_PUT_ERROR(SSL, ssl23_get_client_hello, SSL_R_UNKNOWN_PROTOCOL);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return 1;
|
||||
err:
|
||||
|
@ -514,6 +514,13 @@ var testCases = []testCase{
|
||||
shouldFail: true,
|
||||
expectedError: ":HTTPS_PROXY_REQUEST:",
|
||||
},
|
||||
{
|
||||
testType: serverTest,
|
||||
name: "Garbage",
|
||||
sendPrefix: "blah",
|
||||
shouldFail: true,
|
||||
expectedError: ":UNKNOWN_PROTOCOL:",
|
||||
},
|
||||
{
|
||||
name: "SkipCipherVersionCheck",
|
||||
config: Config{
|
||||
|
Loading…
Reference in New Issue
Block a user