提交 124f6ff4 编写于 作者: R Rainer Jung 提交者: Rich Salz

RT4304: Look for plaintext HTTP

Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 f0ff328e
......@@ -274,6 +274,21 @@ int ssl3_get_record(SSL *s)
}
if ((version >> 8) != SSL3_VERSION_MAJOR) {
if (s->first_packet) {
/* Go back to start of packet, look at the five bytes
* that we have. */
p = RECORD_LAYER_get_packet(&s->rlayer);
if (strncmp((char *)p, "GET ", 4) == 0 ||
strncmp((char *)p, "POST ", 5) == 0 ||
strncmp((char *)p, "HEAD ", 5) == 0 ||
strncmp((char *)p, "PUT ", 4) == 0) {
SSLerr(SSL_F_SSL3_GET_RECORD, SSL_R_HTTP_REQUEST);
goto err;
} else if (strncmp((char *)p, "CONNE", 5) == 0) {
SSLerr(SSL_F_SSL3_GET_RECORD, SSL_R_HTTPS_PROXY_REQUEST);
goto err;
}
}
SSLerr(SSL_F_SSL3_GET_RECORD, SSL_R_WRONG_VERSION_NUMBER);
goto err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册