mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 15:05:45 +01:00
Checks mbedtls_rsa_export_crt return in fuzz targets
This commit is contained in:
parent
66070bc19d
commit
7d4bd6f15f
@ -32,7 +32,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != 0 ) {
|
||||
abort();
|
||||
}
|
||||
mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP );
|
||||
if ( mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) != 0 ) {
|
||||
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 );
|
||||
|
@ -23,7 +23,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
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 );
|
||||
|
Loading…
Reference in New Issue
Block a user