Allow compile-time configuration of PRNG in SSL module

Introduces MBEDTLS_SSL_CONF_RNG to allow configuring the
RNG to be used by the SSL module at compile-time.

Impact on code-size:

|  | GCC 8.2.1 | ARMC5 5.06 | ARMC6 6.12 |
| --- | --- | --- | --- |
| `libmbedtls.a` before | 23535 | 24089 | 27103 |
| `libmbedtls.a` after | 23471 | 24077 | 27045 |
| gain in Bytes | 64 | 12 | 58 |
This commit is contained in:
Hanno Becker 2019-06-13 15:39:27 +01:00
parent 1841f84c79
commit ece325c8dd
12 changed files with 153 additions and 34 deletions

View file

@ -2570,7 +2570,12 @@ int main( int argc, char *argv[] )
}
#endif
#if !defined(MBEDTLS_SSL_CONF_RNG)
mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg );
#else
mbedtls_ssl_conf_rng_ctx( &conf, &ctr_drbg );
#endif
mbedtls_ssl_conf_dbg( &conf, my_debug, stdout );
#if defined(MBEDTLS_SSL_CACHE_C)