mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-20 11:11:08 +01:00
Remove rng_get from sample programs, as it is no longer required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
This commit is contained in:
@@ -2948,8 +2948,8 @@ usage:
|
||||
if (opt.ticket_rotate) {
|
||||
unsigned char kbuf[MBEDTLS_SSL_TICKET_MAX_KEY_BYTES];
|
||||
unsigned char name[MBEDTLS_SSL_TICKET_KEY_NAME_BYTES];
|
||||
if ((ret = rng_get(&rng, name, sizeof(name))) != 0 ||
|
||||
(ret = rng_get(&rng, kbuf, sizeof(kbuf))) != 0 ||
|
||||
if ((ret = mbedtls_psa_get_random(MBEDTLS_PSA_RANDOM_STATE, name, sizeof(name))) != 0 ||
|
||||
(ret = mbedtls_psa_get_random(MBEDTLS_PSA_RANDOM_STATE, kbuf, sizeof(kbuf))) != 0 ||
|
||||
(ret = mbedtls_ssl_ticket_rotate(&ticket_ctx,
|
||||
name, sizeof(name), kbuf, sizeof(kbuf),
|
||||
opt.ticket_timeout)) != 0) {
|
||||
@@ -3081,7 +3081,7 @@ usage:
|
||||
ssl_async_keys.inject_error = (opt.async_private_error < 0 ?
|
||||
-opt.async_private_error :
|
||||
opt.async_private_error);
|
||||
ssl_async_keys.f_rng = rng_get;
|
||||
ssl_async_keys.f_rng = mbedtls_psa_get_random;
|
||||
ssl_async_keys.p_rng = &rng;
|
||||
mbedtls_ssl_conf_async_private_cb(&conf,
|
||||
sign,
|
||||
|
||||
@@ -59,13 +59,6 @@ int rng_seed(rng_context_t *rng, int reproducible, const char *pers)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rng_get(void *p_rng, unsigned char *output, size_t output_len)
|
||||
{
|
||||
(void) p_rng;
|
||||
return mbedtls_psa_get_random(MBEDTLS_PSA_RANDOM_STATE,
|
||||
output, output_len);
|
||||
}
|
||||
|
||||
int key_opaque_alg_parse(const char *arg, const char **alg1, const char **alg2)
|
||||
{
|
||||
char *separator;
|
||||
|
||||
@@ -128,21 +128,6 @@ typedef struct {
|
||||
*/
|
||||
int rng_seed(rng_context_t *rng, int reproducible, const char *pers);
|
||||
|
||||
/** Generate random data.
|
||||
*
|
||||
* This function is suitable for use as the \c f_rng argument to Mbed TLS
|
||||
* library functions.
|
||||
*
|
||||
* \param p_rng The random generator context. This must be a pointer to
|
||||
* a #rng_context_t structure.
|
||||
* \param output The buffer to fill.
|
||||
* \param output_len The length of the buffer in bytes.
|
||||
*
|
||||
* \return \c 0 on success.
|
||||
* \return An Mbed TLS error code on error.
|
||||
*/
|
||||
int rng_get(void *p_rng, unsigned char *output, size_t output_len);
|
||||
|
||||
/** Parse command-line option: key_opaque_algs
|
||||
*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user