mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-02-19 00:39:46 +00:00
Fix RSASSA-PSS example programs
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user