mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-15 19:20:55 +00:00
tls12 & tls13 server: remove RNG check in write_server_hello
RNG check is added in ssl_conf_check when calling mbedtls_ssl_setup, so there is no need to check it again. Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
c83186effa
commit
197199f154
@ -2177,11 +2177,6 @@ static int ssl_write_server_hello(mbedtls_ssl_context *ssl)
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY */
|
||||
|
||||
if (ssl->conf->f_rng == NULL) {
|
||||
MBEDTLS_SSL_DEBUG_MSG(1, ("no RNG provided"));
|
||||
return MBEDTLS_ERR_SSL_NO_RNG;
|
||||
}
|
||||
|
||||
/*
|
||||
* 0 . 0 handshake type
|
||||
* 1 . 3 handshake length
|
||||
|
@ -1948,10 +1948,6 @@ static int ssl_tls13_prepare_server_hello(mbedtls_ssl_context *ssl)
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
unsigned char *server_randbytes =
|
||||
ssl->handshake->randbytes + MBEDTLS_CLIENT_HELLO_RANDOM_LEN;
|
||||
if (ssl->conf->f_rng == NULL) {
|
||||
MBEDTLS_SSL_DEBUG_MSG(1, ("no RNG provided"));
|
||||
return MBEDTLS_ERR_SSL_NO_RNG;
|
||||
}
|
||||
|
||||
if ((ret = ssl->conf->f_rng(ssl->conf->p_rng, server_randbytes,
|
||||
MBEDTLS_SERVER_HELLO_RANDOM_LEN)) != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user