Update ctr_drbg_init() usage in programs
diff --git a/programs/pkey/pk_sign.c b/programs/pkey/pk_sign.c
index 150b090..be8b513 100644
--- a/programs/pkey/pk_sign.c
+++ b/programs/pkey/pk_sign.c
@@ -81,6 +81,7 @@
size_t olen = 0;
mbedtls_entropy_init( &entropy );
+ mbedtls_ctr_drbg_init( &ctr_drbg );
mbedtls_pk_init( &pk );
if( argc != 3 )
@@ -97,11 +98,11 @@
mbedtls_printf( "\n . Seeding the random number generator..." );
fflush( stdout );
- if( ( ret = mbedtls_ctr_drbg_init( &ctr_drbg, mbedtls_entropy_func, &entropy,
+ if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy,
(const unsigned char *) pers,
strlen( pers ) ) ) != 0 )
{
- mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_init returned -0x%04x\n", -ret );
+ mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned -0x%04x\n", -ret );
goto exit;
}