mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 22:19:05 +00:00
Change mbedtls_rsa_set_padding() signature
mbedtls_rsa_set_padding() now returns the error code MBEDTLS_ERR_RSA_INVALID_PADDING when padding parameters are invalid. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
41377d6680
commit
ea7631be1c
8 changed files with 123 additions and 44 deletions
|
|
@ -115,7 +115,13 @@ int main( int argc, char *argv[] )
|
|||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA256 );
|
||||
if( ( ret = mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ),
|
||||
MBEDTLS_RSA_PKCS_V21,
|
||||
MBEDTLS_MD_SHA256 ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! Invalid padding\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the SHA-256 hash of the input file,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,13 @@ int main( int argc, char *argv[] )
|
|||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA256 );
|
||||
if( ( ret = mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ),
|
||||
MBEDTLS_RSA_PKCS_V21,
|
||||
MBEDTLS_MD_SHA256 ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! Invalid padding\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the RSA signature from the file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue