mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-10 00:49:04 +08:00
Do not generate new random number while receiving HRR
Signed-off-by: BensonLiou <momo1208@gmail.com>
This commit is contained in:
parent
f149cd1a3a
commit
35178fe7ec
@ -797,10 +797,15 @@ static int ssl_prepare_client_hello(mbedtls_ssl_context *ssl)
|
|||||||
(ssl->handshake->cookie == NULL))
|
(ssl->handshake->cookie == NULL))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ret = ssl_generate_random(ssl);
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
if (ret != 0) {
|
if (ssl->handshake->hello_retry_request_count == 0)
|
||||||
MBEDTLS_SSL_DEBUG_RET(1, "Random bytes generation failed", ret);
|
#endif
|
||||||
return ret;
|
{
|
||||||
|
ret = ssl_generate_random(ssl);
|
||||||
|
if (ret != 0) {
|
||||||
|
MBEDTLS_SSL_DEBUG_RET(1, "Random bytes generation failed", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user