mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-09 08:31:33 +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))
|
||||
#endif
|
||||
{
|
||||
ret = ssl_generate_random(ssl);
|
||||
if (ret != 0) {
|
||||
MBEDTLS_SSL_DEBUG_RET(1, "Random bytes generation failed", ret);
|
||||
return ret;
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||
if (ssl->handshake->hello_retry_request_count == 0)
|
||||
#endif
|
||||
{
|
||||
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