Checks mbedtls_rsa_export_crt return in fuzz targets
diff --git a/programs/fuzz/fuzz_pubkey.c b/programs/fuzz/fuzz_pubkey.c
index 3a59125..e514958 100644
--- a/programs/fuzz/fuzz_pubkey.c
+++ b/programs/fuzz/fuzz_pubkey.c
@@ -23,7 +23,9 @@
if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != 0 ) {
abort();
}
- ret = mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP );
+ if ( mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) != MBEDTLS_ERR_RSA_BAD_INPUT_DATA ) {
+ abort();
+ }
mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q );
mbedtls_mpi_free( &D ); mbedtls_mpi_free( &E ); mbedtls_mpi_free( &DP );