Avoid in-out length in dhm_calc_secret()

This commit is contained in:
Manuel Pégourié-Gonnard
2015-06-02 16:17:08 +01:00
parent f79b425226
commit 3335205a21
9 changed files with 20 additions and 28 deletions

View File

@@ -243,8 +243,7 @@ int main( void )
mbedtls_printf( "\n . Shared secret: " );
fflush( stdout );
n = dhm.len;
if( ( ret = mbedtls_dhm_calc_secret( &dhm, buf, &n,
if( ( ret = mbedtls_dhm_calc_secret( &dhm, buf, sizeof( buf ), &n,
mbedtls_ctr_drbg_random, &ctr_drbg ) ) != 0 )
{
mbedtls_printf( " failed\n ! mbedtls_dhm_calc_secret returned %d\n\n", ret );