提交 9cc3e8f1 编写于 作者: E Emilia Kasper

Fix SSLv2-compatible ClientHello processing.

If the client challenge is less than 32 bytes, it is padded with leading - not trailing - zero bytes.
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 2aa815c3
......@@ -1057,7 +1057,9 @@ int ssl3_get_client_hello(SSL *s)
/* Load the client random */
i = (cl > SSL3_RANDOM_SIZE) ? SSL3_RANDOM_SIZE : cl;
memset(s->s3->client_random, 0, SSL3_RANDOM_SIZE);
if (!PACKET_peek_copy_bytes(&pkt, s->s3->client_random, i)
if (!PACKET_peek_copy_bytes(&pkt,
s->s3->client_random + SSL3_RANDOM_SIZE - i,
i)
|| !PACKET_forward(&pkt, cl)
|| PACKET_remaining(&pkt) != 0) {
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册