1
0
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:
Paul Bakker
2011-11-27 21:07:34 +00:00
parent 880ac7eb95
commit a3d195c41f
31 changed files with 232 additions and 119 deletions

View File

@ -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;