Merge pull request #6559 from ihsinme/patch-1
dh_genprime: Fix issue where the error code returned by mbedtls_mpi_write_file() is incorrectly reported on failure
This commit is contained in:
commit
32605b24be
2 changed files with 6 additions and 2 deletions
4
ChangeLog.d/fix_dh_genprime_error_reporting.txt
Normal file
4
ChangeLog.d/fix_dh_genprime_error_reporting.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Bugfix
|
||||||
|
* Fix bug in error reporting in dh_genprime.c where upon failure,
|
||||||
|
the error code returned by mbedtls_mpi_write_file() is overwritten
|
||||||
|
and therefore not printed.
|
|
@ -157,8 +157,8 @@ int main( int argc, char **argv )
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( ret = mbedtls_mpi_write_file( "P = ", &P, 16, fout ) != 0 ) ||
|
if( ( ( ret = mbedtls_mpi_write_file( "P = ", &P, 16, fout ) ) != 0 ) ||
|
||||||
( ret = mbedtls_mpi_write_file( "G = ", &G, 16, fout ) != 0 ) )
|
( ( ret = mbedtls_mpi_write_file( "G = ", &G, 16, fout ) ) != 0 ) )
|
||||||
{
|
{
|
||||||
mbedtls_printf( " failed\n ! mbedtls_mpi_write_file returned %d\n\n", ret );
|
mbedtls_printf( " failed\n ! mbedtls_mpi_write_file returned %d\n\n", ret );
|
||||||
fclose( fout );
|
fclose( fout );
|
||||||
|
|
Loading…
Reference in a new issue