pk_sign: fix overriding and ignoring return values

This commit is contained in:
Andrzej Kurek 2018-03-26 04:13:24 -04:00
parent 69d1b293fc
commit d959492797
2 changed files with 4 additions and 2 deletions

View file

@ -5,6 +5,8 @@ mbed TLS ChangeLog (Sorted per branch, date)
Bugfix
* Fix spurious uninitialized variable warning in cmac.c. Fix independently
contributed by Brian J Murray and David Brown.
* Fix overriding and ignoring return values when parsing and writing to
a file in pk_sign program. Found by kevlut in #1142.
Changes
* Support cmake build where Mbed TLS is a subproject. Fix

View file

@ -100,8 +100,7 @@ int main( int argc, char *argv[] )
if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "" ) ) != 0 )
{
ret = 1;
mbedtls_printf( " failed\n ! Could not open '%s'\n", argv[1] );
mbedtls_printf( " failed\n ! Could not parse '%s'\n", argv[1] );
goto exit;
}
@ -141,6 +140,7 @@ int main( int argc, char *argv[] )
if( fwrite( buf, 1, olen, f ) != olen )
{
ret = 1;
mbedtls_printf( "failed\n ! fwrite failed\n\n" );
fclose( f );
goto exit;