Fix RSASSA-PSS example programs

This commit is contained in:
Manuel Pégourié-Gonnard 2014-03-10 21:55:35 +01:00
parent 83cdffc437
commit 844a4c0aef
5 changed files with 34 additions and 4 deletions

View file

@ -101,7 +101,8 @@ int main( int argc, char *argv[] )
if( ( ret = pk_parse_keyfile( &pk, argv[1], "" ) ) != 0 )
{
ret = 1;
printf( " failed\n ! Could not open '%s'\n", argv[1] );
printf( " failed\n ! Could not read key from '%s'\n", argv[1] );
printf( " ! pk_parse_public_keyfile returned %d\n\n", ret );
goto exit;
}
@ -112,6 +113,8 @@ int main( int argc, char *argv[] )
goto exit;
}
rsa_set_padding( pk_rsa( pk ), RSA_PKCS_V21, POLARSSL_MD_SHA1 );
/*
* Compute the SHA-1 hash of the input file,
* then calculate the RSA signature of the hash.

View file

@ -81,7 +81,8 @@ int main( int argc, char *argv[] )
if( ( ret = pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 )
{
printf( " failed\n ! pk_parse_public_keyfile returned %d\n\n", ret );
printf( " failed\n ! Could not read key from '%s'\n", argv[1] );
printf( " ! pk_parse_public_keyfile returned %d\n\n", ret );
goto exit;
}
@ -92,6 +93,8 @@ int main( int argc, char *argv[] )
goto exit;
}
rsa_set_padding( pk_rsa( pk ), RSA_PKCS_V21, POLARSSL_MD_SHA1 );
/*
* Extract the RSA signature from the text file
*/