mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-03-12 17:02:58 +00:00
Change examples to use the new MD API and check ret code
This commit is contained in:
@@ -212,7 +212,11 @@ int main( void )
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_sha1( buf, (int)( p - 2 - buf ), hash );
|
||||
if( ( ret = mbedtls_sha1_ext( buf, (int)( p - 2 - buf ), hash ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_sha1_ext returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( ( ret = mbedtls_rsa_pkcs1_verify( &rsa, NULL, NULL, MBEDTLS_RSA_PUBLIC,
|
||||
MBEDTLS_MD_SHA256, 0, hash, p ) ) != 0 )
|
||||
|
||||
Reference in New Issue
Block a user