Fix issue in dh_genprime.c where the error code returned by mbedtls_mpi_write_file() is incorrectly reported on failure
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
diff --git a/programs/pkey/dh_genprime.c b/programs/pkey/dh_genprime.c
index 51f6971..84f498e 100644
--- a/programs/pkey/dh_genprime.c
+++ b/programs/pkey/dh_genprime.c
@@ -161,8 +161,8 @@
goto exit;
}
- if( ( ret = mbedtls_mpi_write_file( "P = ", &P, 16, fout ) != 0 ) ||
- ( ret = mbedtls_mpi_write_file( "G = ", &G, 16, fout ) != 0 ) )
+ if( ( ( ret = mbedtls_mpi_write_file( "P = ", &P, 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 );
fclose( fout );