mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-04 05:35:33 +01:00
Change examples to use the new MD API and check ret code
This commit is contained in:
parent
d21d625e1f
commit
1ff60f437f
5 changed files with 28 additions and 18 deletions
|
|
@ -203,7 +203,11 @@ int main( void )
|
|||
/*
|
||||
* 5. Sign the parameters and send them
|
||||
*/
|
||||
mbedtls_sha1( buf, n, hash );
|
||||
if( ( ret = mbedtls_sha1_ext( buf, n, hash ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_sha1_ext returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
buf[n ] = (unsigned char)( rsa.len >> 8 );
|
||||
buf[n + 1] = (unsigned char)( rsa.len );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue