Fix bugs impacting fuzzing coverage

- Update ConvertDataToValidEnum to not use FuzzedDataProvider since it
  causes unexpected parsing results.
- Add OEMCryptoLicenseAPIFuzz::LoadLicenseWithGenericCryptoKeys so that
  generic crypto fuzz tests can load appropriate keys.
- Remove custom mutator from oemcrypto_generic_verify_fuzz because it
  provides minimal additional coverage.
- Refresh affected corpus files.

Merged from https://widevine-internal-review.googlesource.com/168557
Merged from https://widevine-internal-review.googlesource.com/171191
Merged from https://widevine-internal-review.googlesource.com/172170
Merged from https://widevine-internal-review.googlesource.com/172250

Change-Id: Ie676a36cbf4c12bdda9566fad3590a7b69168d9c
This commit is contained in:
Ian Benz
2023-03-21 01:45:50 +00:00
committed by Robert Shih
parent 55ef762c08
commit 57b391c8b9
300 changed files with 81 additions and 139 deletions

View File

@@ -45,9 +45,13 @@ void OEMCryptoLicenseAPIFuzz::Terminate() {
OEMCrypto_Terminate();
}
void OEMCryptoLicenseAPIFuzz::LoadLicense() {
void OEMCryptoLicenseAPIFuzz::LoadLicense(bool generic_crypto_keys) {
license_messages_.SignAndVerifyRequest();
license_messages_.CreateDefaultResponse();
if (generic_crypto_keys) {
license_messages_.CreateResponseWithGenericCryptoKeys();
} else {
license_messages_.CreateDefaultResponse();
}
license_messages_.EncryptAndSignResponse();
OEMCryptoResult sts = license_messages_.LoadResponse();
CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS);