Change examples to use the new MD API and check ret code
diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c
index 8bf2b1b..daa96e6 100644
--- a/programs/pkey/dh_server.c
+++ b/programs/pkey/dh_server.c
@@ -203,7 +203,11 @@
/*
* 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 );