mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
- Changed the used random function pointer to more flexible format. Renamed havege_rand() to havege_random() to prevent mistakes. Lots of changes as a consequence in library code and programs
This commit is contained in:
@ -578,8 +578,9 @@ static int ssl_encrypt_buf( ssl_context *ssl )
|
||||
/*
|
||||
* Generate IV
|
||||
*/
|
||||
for( i = 0; i < ssl->ivlen; i++ )
|
||||
ssl->iv_enc[i] = ssl->f_rng( ssl->p_rng );
|
||||
int ret = ssl->f_rng( ssl->p_rng, ssl->iv_enc, ssl->ivlen );
|
||||
if( ret != 0 )
|
||||
return( ret );
|
||||
|
||||
/*
|
||||
* Shift message for ivlen bytes and prepend IV
|
||||
@ -1796,7 +1797,7 @@ void ssl_set_verify( ssl_context *ssl,
|
||||
}
|
||||
|
||||
void ssl_set_rng( ssl_context *ssl,
|
||||
int (*f_rng)(void *),
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng )
|
||||
{
|
||||
ssl->f_rng = f_rng;
|
||||
|
Reference in New Issue
Block a user