From b9ecfc69dc913a3ac03b3792dfcf21ac0cb1b276 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Tue, 17 Aug 2021 04:54:31 +0000 Subject: [PATCH] Merge oemcrypto fuzz tests to sc-widevine-release branch Merge from Widevine repo of http://go/wvgerrit/131308 These tests will be released on the sc-widevine-release branch, but not as part of the initial Android S release. Change-Id: I6dae85fe72c6d09759e43c5e40bbc0776b57b089 --- .../oemcrypto/include/OEMCryptoCENC.h | 1 + .../oemcrypto/test/fuzz_tests/README.md | 34 +++- .../test/fuzz_tests/build_clusterfuzz.md | 174 ++++++++++++++++++ .../test/fuzz_tests/build_oemcrypto_fuzztests | 6 +- .../build_partner_oemcrypto_fuzztests | 15 ++ .../1970fbbb5d20902996167f3309fbd38a6850b147 | Bin 0 -> 296 bytes .../5812ad7753622d9177a1b3dd71c6c4a008ff54eb | Bin 0 -> 296 bytes .../10da8c370429a6a450d5ad0ee563653d18dbfeb8 | Bin 0 -> 140 bytes .../1ae600c50a9a0bca685d7b83004fa3135901ded2 | Bin 0 -> 204 bytes .../21d16dc13d2b8103c7943a5bd960ebc77dfefde4 | Bin 0 -> 204 bytes .../38d4821122ddf0e84dba312f444bfbef5b81cc9d | Bin 0 -> 204 bytes .../3cdf5d3cd5937b78d2560970a0ccce14fb0d0230 | Bin 0 -> 588 bytes .../3cf22dc963d6705061004cb0fad32bdebc86ffc9 | Bin 0 -> 140 bytes .../3d891464eace6f7d3c716830e6051f7e90b90610 | Bin 0 -> 140 bytes .../6f65463040c50e026e252e7544dff41babbc4604 | Bin 0 -> 140 bytes .../737cd5853708e2d2732e4c54dc944bc54d522406 | Bin 0 -> 428 bytes .../d775f9b5597e76cbf380ad74fea86c307c224309 | Bin 0 -> 140 bytes .../e9c4232d40cbc76f71220641ea9f8740bfedd306 | Bin 0 -> 204 bytes .../eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce | Bin 0 -> 140 bytes .../f6c28150e2e1a1390516a09d453d33cb9a1337b4 | Bin 0 -> 204 bytes .../1315634022 | Bin 0 -> 66 bytes .../6c6a072aa58399454ee759bac539109a20f7e97f | Bin 0 -> 188 bytes .../75ae4c5769c9568d631452df3b3702d876e4863a | Bin 0 -> 178 bytes .../9bdb356ec50807b86c807c09c780267101fd1a0b | Bin 0 -> 178 bytes .../4114e243c6726f2d6dd11baefc4ad43fbd2b3595 | Bin 0 -> 178 bytes .../424ad879ed92e646707f53a2cd963910ffbb5c08 | Bin 0 -> 188 bytes .../f5d513d7333b92263ad849759db52a0cb4f383cd | Bin 0 -> 168 bytes .../374d2a1ab0be81451653b26a0ff99c2f20351700 | Bin 0 -> 176 bytes .../7a883f7628e57eb5fe48d660fed48ac5da2f5d21 | Bin 0 -> 176 bytes .../a591b11c7ff1f45e8edb1a055a3255edb247576d | Bin 0 -> 176 bytes .../c182ac7556d1cd1ed73da74882dee807381f3ee0 | Bin 0 -> 176 bytes .../3f58051d431ac575d0b804b2d512e46d7e8b4cda | Bin 0 -> 78 bytes .../4e2fef7ad945773dd77eb37d7d08dd2368ad4b89 | Bin 0 -> 78 bytes .../6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 | Bin 0 -> 676 bytes .../7997b5673d5a9402b2f8acc43f92cdf6ad1f913d | Bin 0 -> 676 bytes .../8196b2365ca56224853dfeeddde216b4f467f0dd | Bin 0 -> 676 bytes .../81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 | Bin 0 -> 676 bytes .../0567e5f52c00fed0ad7858164434b02d8e629064 | Bin 0 -> 6648 bytes .../0f5cc252aaf43eaa1570ca07d174a0f96333c592 | Bin 0 -> 6648 bytes .../0fdcae4df7bc325099fb4b3b01a1c9290229f86c | Bin 0 -> 6648 bytes .../134a0d85fbcbe367e66d69127114bece71add806 | Bin 0 -> 6648 bytes .../1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb | Bin 0 -> 6648 bytes .../2d7246bd48ed8b68599445c98bb822c87f86acd1 | Bin 0 -> 6648 bytes .../2f64b8ffa25844924fe24678067feee9be80f4ec | Bin 0 -> 6648 bytes .../3acf30d485a4370ceb8e64785094a50b768e1ca4 | Bin 0 -> 6648 bytes .../461c08228ae6a0eaa191d24eea1823b46f4a9d67 | Bin 0 -> 6648 bytes .../4b69b92f45febc4dbf5b8fb9a216a290ba51d478 | Bin 0 -> 6648 bytes .../5db53de009652f61b1ed21ee988d0156ce287033 | Bin 0 -> 6648 bytes .../618cdf5927b2b092d9d7b5e93c30af8708270f11 | Bin 0 -> 6648 bytes .../78e527f05b03c2ecd8a0ffc2baeb5dab57088934 | Bin 0 -> 6648 bytes .../7dcdad1c2df1656678947b2009a9fcea44f4025d | Bin 0 -> 6648 bytes .../7e120b1ec852c448490b9b060a5f35deb486c360 | Bin 0 -> 6648 bytes .../7f701c0f31e68192bc8c829f343fa2326aa4d3dc | Bin 0 -> 6648 bytes .../8243212a7a7160c91e2f9717b855b568f9a34233 | Bin 0 -> 6648 bytes .../85bff933def1ce530a1febd93ef2890ed4bcdcb5 | Bin 0 -> 6648 bytes .../a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 | Bin 0 -> 6648 bytes .../b452f7b6c615035d63a9825c5c17e049f54648ef | Bin 0 -> 6648 bytes .../bb8c2201cf10fd7d24fc0c8009a44525f426b033 | Bin 0 -> 6648 bytes .../c7a7cd07925450628efa677165d403510d89bf51 | Bin 0 -> 6648 bytes ...mcrypto_load_license_fuzz-5919435528601600 | Bin 0 -> 6652 bytes ...mcrypto_load_license_fuzz-6406770604638208 | Bin 0 -> 6648 bytes .../d7014f417415314dd83162570bcafd7935875f00 | Bin 0 -> 6648 bytes .../e26757270b3d149d1ce10bef32ed0b3a5794977c | Bin 0 -> 6648 bytes .../e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 | Bin 0 -> 6648 bytes .../2f194a24b3b2f2e096403926fca6b2fda4883e7c | Bin 0 -> 4096 bytes .../4b31607722adad1f28555bc9b07cd17100a90df6 | Bin 0 -> 4096 bytes .../543f332b627f3891b3f15c6227f4f946cba81886 | Bin 0 -> 4096 bytes .../6a33ae6e95eb1b9fbf116359df679265376b308b | Bin 0 -> 4096 bytes .../a98f2da86c01706159e32fc37c1a6b2df779395a | Bin 0 -> 4096 bytes .../dc6e941489e6164e349a9dd0a80713f57645b0db | Bin 0 -> 4096 bytes .../fb7a84cdab0bff7dabb339c7fc35eb2ea3c2eb9c | Bin 0 -> 4096 bytes .../f00652aa0e80e90257bfa28a63e623a92e25d4d8 | Bin 0 -> 3992 bytes .../f2f45ab615736936405ec6c8df9ab92dbc91017b | Bin 0 -> 3992 bytes .../6ee38ff02d14cae0565cd26553cde5f898444014 | Bin 0 -> 146 bytes .../2e120b916a62c00addf137d7e7733620394009b8 | Bin 0 -> 58 bytes .../oemcrypto_deactivate_usage_entry_fuzz.cc | 30 +++ .../fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc | 8 +- .../test/fuzz_tests/oemcrypto_fuzz_helper.cc | 41 +++++ .../test/fuzz_tests/oemcrypto_fuzz_helper.h | 42 ++++- .../test/fuzz_tests/oemcrypto_fuzz_structs.h | 31 ++++ .../oemcrypto_generate_rsa_signature_fuzz.cc | 34 ++++ .../oemcrypto_generic_decrypt_fuzz.cc | 61 ++++++ .../oemcrypto_generic_encrypt_fuzz.cc | 61 ++++++ .../fuzz_tests/oemcrypto_generic_sign_fuzz.cc | 55 ++++++ .../oemcrypto_generic_verify_fuzz.cc | 67 +++++++ .../oemcrypto_load_usage_entry_fuzz.cc | 61 ++++++ .../oemcrypto_load_usage_table_header_fuzz.cc | 36 ++++ ...zz.cc => oemcrypto_opk_dispatcher_fuzz.cc} | 45 ++--- .../fuzz_tests/oemcrypto_report_usage_fuzz.cc | 46 +++++ 89 files changed, 799 insertions(+), 49 deletions(-) create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/build_clusterfuzz.md create mode 100755 libwvdrmengine/oemcrypto/test/fuzz_tests/build_partner_oemcrypto_fuzztests create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/5812ad7753622d9177a1b3dd71c6c4a008ff54eb create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10da8c370429a6a450d5ad0ee563653d18dbfeb8 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ae600c50a9a0bca685d7b83004fa3135901ded2 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38d4821122ddf0e84dba312f444bfbef5b81cc9d create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cdf5d3cd5937b78d2560970a0ccce14fb0d0230 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f65463040c50e026e252e7544dff41babbc4604 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/737cd5853708e2d2732e4c54dc944bc54d522406 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d775f9b5597e76cbf380ad74fea86c307c224309 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f6c28150e2e1a1390516a09d453d33cb9a1337b4 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generate_rsa_signature_fuzz_seed_corpus/1315634022 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/4114e243c6726f2d6dd11baefc4ad43fbd2b3595 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/424ad879ed92e646707f53a2cd963910ffbb5c08 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/f5d513d7333b92263ad849759db52a0cb4f383cd create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/3f58051d431ac575d0b804b2d512e46d7e8b4cda create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/4e2fef7ad945773dd77eb37d7d08dd2368ad4b89 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0fdcae4df7bc325099fb4b3b01a1c9290229f86c create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2d7246bd48ed8b68599445c98bb822c87f86acd1 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/461c08228ae6a0eaa191d24eea1823b46f4a9d67 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5db53de009652f61b1ed21ee988d0156ce287033 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7dcdad1c2df1656678947b2009a9fcea44f4025d create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7f701c0f31e68192bc8c829f343fa2326aa4d3dc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/85bff933def1ce530a1febd93ef2890ed4bcdcb5 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d7014f417415314dd83162570bcafd7935875f00 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/2f194a24b3b2f2e096403926fca6b2fda4883e7c create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/4b31607722adad1f28555bc9b07cd17100a90df6 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/543f332b627f3891b3f15c6227f4f946cba81886 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/6a33ae6e95eb1b9fbf116359df679265376b308b create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/a98f2da86c01706159e32fc37c1a6b2df779395a create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/dc6e941489e6164e349a9dd0a80713f57645b0db create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/fb7a84cdab0bff7dabb339c7fc35eb2ea3c2eb9c create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_renewal_fuzz_seed_corpus/f00652aa0e80e90257bfa28a63e623a92e25d4d8 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_renewal_fuzz_seed_corpus/f2f45ab615736936405ec6c8df9ab92dbc91017b create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_provisioning_request_fuzz_seed_corpus/6ee38ff02d14cae0565cd26553cde5f898444014 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_renewal_request_fuzz_seed_corpus/2e120b916a62c00addf137d7e7733620394009b8 create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc rename libwvdrmengine/oemcrypto/test/fuzz_tests/{oemcrypto_odkitee_dispatcher_fuzz.cc => oemcrypto_opk_dispatcher_fuzz.cc} (50%) create mode 100644 libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc diff --git a/libwvdrmengine/oemcrypto/include/OEMCryptoCENC.h b/libwvdrmengine/oemcrypto/include/OEMCryptoCENC.h index 0d1bba3b..628eecbd 100644 --- a/libwvdrmengine/oemcrypto/include/OEMCryptoCENC.h +++ b/libwvdrmengine/oemcrypto/include/OEMCryptoCENC.h @@ -379,6 +379,7 @@ typedef struct { typedef enum OEMCrypto_Algorithm { OEMCrypto_AES_CBC_128_NO_PADDING = 0, OEMCrypto_HMAC_SHA256 = 1, + OEMCrypto_Algorithm_MaxValue = 1, } OEMCrypto_Algorithm; /// @} diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/README.md b/libwvdrmengine/oemcrypto/test/fuzz_tests/README.md index 8c163fb1..d7413bd3 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/README.md +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/README.md @@ -1,5 +1,9 @@ # OEMCRYPTO Fuzzing +Refer to [Setting up Clusterfuzz](build_clusterfuzz.md) if you are interested +in setting up a local instance of cluster fuzz to run fuzzing on your own +OEMCrypto implementations on linux. + ## Objective * Run fuzzing on OEMCrypto public APIs on linux using google supported @@ -76,13 +80,31 @@ $ export PATH_TO_CDM_DIR=.. $ gyp --format=ninja --depth=$(pwd) oemcrypto/oemcrypto_unittests.gyp $ ninja -C out/Default/ - $ ./out/Default/oemcrypto_unittests --generate_corpus + $ mkdir oemcrypto/test/fuzz_tests/corpus/_seed_corpus + # Generate corpus by excluding buffer overflow tests. + $ ./out/Default/oemcrypto_unittests --generate_corpus \ + --gtest_filter=-"*Huge*" + ``` + +* There can be lot of duplicate corpus files that are generated from unit + tests. We can minimize the corpus files to only a subset of files that + cover unique paths within the API when run using fuzzer. Run following + command to minimize corpus. + + ```shell + $ cd /path/to/cdm/repo + # build fuzzer binaries + $ ./oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests + $ mkdir /tmp/minimized_corpus + # minimize corpus + $ ./out/Default/ -merge=1 /tmp/minimized_corpus \ + ``` -* To avoid uploading huge binary files to git repository, the corpus files - will be saved in fuzzername_seed_corpus.zip format in blockbuster project's - oemcrypto_fuzzing_corpus GCS bucket using gsutil. If you need permissions - for blockbuster project, contact widevine-engprod@google.com. +* To avoid uploading huge binary files to git repository, the minimized corpus + files will be saved in fuzzername_seed_corpus.zip format in blockbuster + project's oemcrypto_fuzzing_corpus GCS bucket using gsutil. If you need + permissions for blockbuster project, contact widevine-engprod@google.com. ```shell $ gsutil cp gs://oemcrypto_fuzzing_corpus/ \ @@ -106,7 +128,7 @@ * Build and test fuzz scripts locally using following commands. The build script builds fuzz binaries for both oemcrypto reference implementation - as well as odkitee implementation. + as well as opk implementation. ```shell $ cd PATH_TO_CDM_DIR diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/build_clusterfuzz.md b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_clusterfuzz.md new file mode 100644 index 00000000..f3a0108b --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_clusterfuzz.md @@ -0,0 +1,174 @@ +# OEMCRYPTO Fuzzing - Build clustefuzz and run fuzzing + +## Objective + +* Run fuzzing on OEMCrypto public APIs on linux by building open sourced + clusterfuzz source code in order to find security vulnerabilities. + + [Clusterfuzz][1] + +* Partners who implement OEMCrypto can follow these instructions to build + clusterfuzz, the fuzzing framework and run fuzzing using fuzzer scripts + provided by the Widevine team at Google. + +## Glossary + +* Fuzzing - Fuzzing is a methodology where random, interesting, unexpected + inputs are fed to APIs in order to crash those, thereby catching any + security vulnerabilities with the code. + +* Fuzzing engines - [libfuzzer][4], afl, honggfuzz are the actual fuzzing + engines that get the coverage information from API, use that to generate + more interesting inputs which can be passed to fuzzer. + +* Seed corpus - Fuzzing engine trying to generate interesting inputs from an + empty file is not efficient. Seed corpus is the initial input that a fuzzer + can accept and call the API with that. Fuzzing engine can then mutate this + seed corpus to generate more inputs to fuzzer. + +* Clusterfuzz - ClusterFuzz is a scalable fuzzing infrastructure that finds + security and stability issues in software. Google uses ClusterFuzz to fuzz + all Google products. Clusterfuzz provides us with the capability, tools to + upload fuzz binaries and make use of the fuzzing engines to run fuzzing, + find crashes and organizes the information. Clusterfuzz framework is open + sourced, the source code can be downloaded and framework can be built + locally or by using google cloud. + +* Fuzzing output - Fuzzing is used to pass random inputs to API in order to + ensure that API is crash resistant. We are not testing functionality via + fuzzing. Fuzz scripts run continuously until they find a crash with the API + under test. + +## Building fuzz scripts + +This section outlines the steps to build fuzz binaries that can be run +continuously using clusterfuzz. + +> **Note:** All the directories mentioned below are relative to cdm repository +> root directory. + +1. Fuzz scripts for OEMCrypto APIs are provided by the Widevine team at Google + located under `oemcrypto/test/fuzz_tests` directory. + +> **Note:** Prerequisites to run the following step are [here][10]. We also need +> to install ninja. + +2. Build a static library of your OEMCrypto implementation. + * Compile and link your OEMCrypto implementation source with + `-fsanitize=address,fuzzer` flag as per these [instructions][9] when + building a static library. + + * Run `./oemcrypto/test/fuzz_tests/build_partner_oemcrypto_fuzztests + ` script from cdm repository root + directory. + + * This will generate fuzz binaries under the `out/Default` directory. + + + +> **Note:** Alternatively, you can use your own build systems, for which you +> will need to define your own build files with the OEMCrypto fuzz source files +> included. You can find the the fuzz source files in +> `oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp` and +> `oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi`. + +3. Seed corpus for each fuzz script can be found under + `oemcrypto/test/fuzz_tests/corpus` directory. Some fuzzers are simple and do + not have seed corpus associated with them. + +4. Create a zip file `oemcrypto_fuzzers_yyyymmddhhmmss.zip` with fuzz binaries + and respective seed corpus zip files. Structure of a sample zip file with + fuzzer binaries and seed corpus would look like following: + + ``` + * fuzzerA + * fuzzerA_seed_corpus.zip + * fuzzerB + * fuzzerB_seed_corpus.zip + * fuzzerC (fuzzerC doesn't have seed corpus associated with it) + ``` + +## Building clusterfuzz + +* OEMCrypto implementation can be fuzzed by building clusterfuzz code which is + open sourced and using it to run fuzzing. Use a Linux VM to build + clusterfuzz. + +> **Note:** You may see some issues with python modules missing, please install +> those modules if you see errors. If you have multiple versions of python on +> the VM, then use `python -m pipenv shell` when you are at [this][3] +> step. + +* Follow these [instructions][2] in order to download clusterfuzz repository, + build it locally or create a continuous fuzz infrastructure setup using + google cloud. + +## Running fuzzers on local clusterfuzz instance + +* If you prefer to run fuzzing on a local machine instead of having a + production setup using google cloud, then follow these [instructions][6] to + add a job to the local clusterfuzz instance. + +> **Note:** Job name should have a fuzzing engine and sanitizer as part of it. A +> libfuzzer and asan jobs should have libfuzzer_asan in the job name. + +* Create a job e:g:`libfuzzer_asan_oemcrypto` and upload previously created + `oemcrypto_fuzzers_yyyymmddhhmmss.zip` as a custom build. Future uploads of + zip file should have a name greater than current name. Following the above + naming standard will ensure zip file names are always in ascending order. + +* Once the job is added and clusterfuzz bot is running, fuzzing should be up + and running. Results can be monitored as mentioned [here][6]. + +* On a local clusterfuzz instance, only one fuzzer is being fuzzed at a time. + +> **Note:** Fuzzing is time consuming. Finding issues as well as clusterfuzz +> regressing and fixing the issues can take time. We need fuzzing to run at +> least for a couple of weeks to have good coverage. + +## Finding fuzz crashes + +Once the clusterfuzz finds an issue, it logs crash information such as the +build, test case and stack trace for the crash. + +* Test cases tab should show the fuzz crash and test case that caused the + crash. Run `./fuzz_binary ` in order to debug the crash locally. + +More information about different types of logs is as below: + +* [Bot logs][7] will show information related to fuzzing, number of crashes + that a particular fuzzer finds, number of new crashes, number of known + crashes etc. + +* [Local GCS][8] in your clusterfuzz checkout folder will store the fuzz + binaries that are being fuzzed, seed corpus etc. + +* `local_gcs/test-fuzz-logs-bucket` will store information related to fuzz + crashes if any were found by the fuzzing engine. It will store crash + information categorized by fuzzer and by each day. It will also store test + case that caused the crash. + +* `/path/to/my-bot/clusterfuzz/log.txt` will have any log information from + fuzzer script and OEMCrypto implementation. + +## Fixing issues + +* Once you are able to debug using the crash test case, apply fix to the + implementation, create `oemcrypto_fuzzers_yyyymmddhhmmss.zip` with latest + fuzz binaries. + +* Upload the latest fuzz binary to the fuzz job that was created earlier. + Fuzzer will recognize the fix and mark the crash as fixed in test cases tab + once the regression finishes. You do not need to update crashes as fixed, + clusterfuzz will do that. + +[1]: https://google.github.io/clusterfuzz/ +[2]: https://google.github.io/clusterfuzz/getting-started/ +[3]: https://google.github.io/clusterfuzz/getting-started/prerequisites/#loading-pipenv +[4]: https://llvm.org/docs/LibFuzzer.html +[5]: https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl/ +[6]: https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl/#checking-results +[7]: https://google.github.io/clusterfuzz/getting-started/local-instance/#viewing-logs +[8]: https://google.github.io/clusterfuzz/getting-started/local-instance/#local-google-cloud-storage +[9]: https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl/#libfuzzer +[10]: https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl/#prerequisites diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests index f30cacd0..41c9b62d 100755 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests @@ -10,10 +10,10 @@ export PYTHONPATH="$PYTHONPATH:$PATH_TO_CDM_DIR/third_party" python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \ --depth=$(pwd) oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp ninja -C out/Default -# oemcrypto_odkitee_fuzztests.gypi has flags to instrument all the gyp targets +# oemcrypto_opk_fuzztests.gypi has flags to instrument all the gyp targets # with fuzzer flags. python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \ --depth=$(pwd) \ - --include=oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gypi \ - oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gyp + --include=oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi \ + oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp ninja -C out/Default \ No newline at end of file diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/build_partner_oemcrypto_fuzztests b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_partner_oemcrypto_fuzztests new file mode 100755 index 00000000..b320a8fc --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/build_partner_oemcrypto_fuzztests @@ -0,0 +1,15 @@ +#!/bin/bash +set -ex + +# For use by partners to generate fuzz binaries for their OEMCrypto +# implementation on linux. + +export CXX=clang++ +export CC=clang +export GYP_DEFINES="$GYP_DEFINES clang=1 oemcrypto_static_library=$1" +export PATH_TO_CDM_DIR=. +export PYTHONPATH="$PYTHONPATH:$PATH_TO_CDM_DIR/third_party" + +python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \ + --depth=$(pwd) oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp +ninja -C out/Default \ No newline at end of file diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 new file mode 100644 index 0000000000000000000000000000000000000000..3c2447f9bc18bbd1d1a67eb6f627fa63d0a0bb3b GIT binary patch literal 296 zcmZQzU|?7g3M62F5ypVf%#-%q|6k9*u%P=?8Au&7P`;Fzf#HJ>gx_Fv5-c7J)iw!A zBO61E`AW`=G{(TRLX!so?|>Dy literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 new file mode 100644 index 0000000000000000000000000000000000000000..f3c738d5c182c46c9066c79b0499ee5dec4c9436 GIT binary patch literal 204 zcmZQ%U|?_zV_;wf(jWk%8CuHsg2Wj%uzBnETP) Mw*V>+qtX2b04+9IT>t<8 literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 new file mode 100644 index 0000000000000000000000000000000000000000..30e88100f034feaf1c32bfdf2d3846267ab7bb9f GIT binary patch literal 140 zcmZQzU|?_z0}^P!;Cb0zkoX2P@q~Wt;ycba{9kf6_BH>;{?pYb*L61ZLew!r_3OsR U#lwt(naP|TJM&LHOq78E0Csa3rT_o{ literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 new file mode 100644 index 0000000000000000000000000000000000000000..66ff92c3df8a93cf6e458b560fa1356254b7919f GIT binary patch literal 140 zcmZQ%U|?_zV_;wg(jdSNp%@mNE!ztcXJCX1K&ggz*v0>&f`17nBaE*@?YRFF9rjW8BRbsP?|9-cIF?D9Wa0<&oIK}nb7r;-r`G(GY{pC1CxGQ2n~` Vaq%#tU}iFB$Ikpy4-;iz002S36#xJL literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 new file mode 100644 index 0000000000000000000000000000000000000000..d586f1009fe1439a68fbd3c2f8638df7c855adf1 GIT binary patch literal 204 zcmZQzU|?_z0}^P!!L)oYNPGzsnnW;m@yo?Y%J-S7<#v9Tvis-yP&Poe1gxJKs$Dle iE?yGKUI3*TvtnodsfTialo5={2xXwjqw8lvlLr7E-y4bm literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce new file mode 100644 index 0000000000000000000000000000000000000000..a7dc6140db763b9ce814b5d16502e98374a428cc GIT binary patch literal 140 zcmZQ%U|?_zV_@I{(#Sxep=d8ioPiNplz{=4_yhj&C~$GfZGaF^e%PcIKaY6d?!)rVd^H1XL}QW!dx}lY}L1QC(k{8=k+$i Nd+%{U-3SprZU9jU7Lfn| literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f new file mode 100644 index 0000000000000000000000000000000000000000..411b41ca5a2a5cf7e4965520d1f59023d63af9ef GIT binary patch literal 188 zcmV;t07L%(00000000000RjUA1qKHQ2?`4g4Gs@2UtV8V_Zx-D%mg2(+jwVHyp@dh zsOkJ=1s|U;*bKWo3~*w7Oq~~Kv2Rv;G6XQulcx3sMCzdNT9S)gfd+f_qH6thL+0z- zPj+dzC}qrGwq?>aiNmQv{JdgDw^}L`i_9y70Qq}bo79)Z?3T<3rf5n69V}LU9EP=8 qIR)tG_`iWwyDw!NymCQ`T3y1@g71D_rdQ1p6g#@B*7^1cH*s$~&ry~D literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a new file mode 100644 index 0000000000000000000000000000000000000000..dd245f4a4ddc00b1cca222904933b0b2db4fccf6 GIT binary patch literal 178 zcmV;j08Re@00000000000RjUA1qKHQ2?`4g4Gs@2UtV81ZJWNn?60@(_Rfmezi?9x zluA{Jv|QO|C{wh3MeG_J75+}A*O|BRh~s4{NSwpiF?h5>GW$E=wxdwv)R590me%*X zu-_V3iY5JtP^0o2Asy+uvY`HjEcth}>c7};Evn@aW4HVnI}t%I4T6gvyqUEmhkAf_ gsR)wr29dEWP(f$-0Iz6KxbVM0c%!9y;8r4t0d${H6aWAK literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b new file mode 100644 index 0000000000000000000000000000000000000000..ff53f68f159d0258d8fe2bba37ed9ba2913cb573 GIT binary patch literal 178 zcmV;j08Re@00000000000RjUA1qKHQ2?`4g4Gs@2UtV8_HXyT`fa^%*{7QpPTct;> zjg*qY;IF{pbl~8f7(jIOxb1rMY>C}jn>VaTJ_eul*D&hu5VaQhY;1tdsa=eqlB{i( zYG@zhx+RX}kb+gfzJS?5Vg~f)5uw6dwCEYrWdj8RV40|;A5Xscr;-Nqj@jCUR<;{A gBz%6$^aXOA%v2gJYFZ%mK!Kj-;94RS&8ga7YhK1tT>t<8 literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/4114e243c6726f2d6dd11baefc4ad43fbd2b3595 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/4114e243c6726f2d6dd11baefc4ad43fbd2b3595 new file mode 100644 index 0000000000000000000000000000000000000000..d42496e1617e7e69112fe582f495082699fa13cd GIT binary patch literal 178 zcmZQzfC5G)W)@a9b`DN1ZXRAfe%<)Ecr+maK_OugQ894|NhxU=Svh$HMI~hwRW)@D zO)YI5T|IpRLnC7oQ!{f5ODk&|TRVFPM<-_&S2uSLPcLsDUqAnVz@Xre(6I1`$f)R; z*tqzF#H8eu)U@=B%&hF3+`RmP!lL4m(z5c3%Bt#`+PeCN#-`?$*0%PJ&aUpB-oE|` L6DLicGIbgN(JL+g literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/424ad879ed92e646707f53a2cd963910ffbb5c08 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/424ad879ed92e646707f53a2cd963910ffbb5c08 new file mode 100644 index 0000000000000000000000000000000000000000..747df46b57506f42d64e5b1340b6309c28ef94ba GIT binary patch literal 188 zcmZQzfC5G)W)@a9b`DN1ZXRAfe%<)Ecr+maK_OugQ894|NhxU=Svh$HMI~hwRW)@D zO)YI5T|IpRLnC7oQ!{f5ODk&|TRVFPM<-_&S2uSLPcLsDUqAnVz@Xre(6I1`$f)R; z*tqzF#H8eu)U@=B%&hF3+`RmP!lL4m(z5c3%Bt#`+PeCN#-`?$*0%PJ&aUpB-oE|` W6DLicGIiSY88c_io-=pe`~?8MRWuR+ literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/f5d513d7333b92263ad849759db52a0cb4f383cd b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/f5d513d7333b92263ad849759db52a0cb4f383cd new file mode 100644 index 0000000000000000000000000000000000000000..4eb47bcce2e7a05cb7525a2e5d807b75e9dfefaf GIT binary patch literal 168 zcmZQzU|?VbVJ2o4RyKAHPA+a9UOs*SK_OugQ894|NhxU=Svh$HMI~hwRW)@DO)YI5 zT|IpRLnC7oQ!{f5ODk&|TRVFPM<-_&S2uSLPcLsDUqAnVz@Xre(6I1`$f)R;*tqzF z#H8eu)U@=B%&hF3+`RmP!lL4m(z5c3%Bt#`+PeCN#-`?$*0%PJ&aUpB-oE|`6DLic SGIiSY88c_io-=pe`~?7>!ZK0- literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 new file mode 100644 index 0000000000000000000000000000000000000000..561fce239d588473d524d83c007ec82eec9ec799 GIT binary patch literal 176 zcmZQzfB*$3&B(;e!pg?Z!O6wV!^_7nASfg(A}S^>At@y-BP%Dbps1v*qN=8@p{b>< zqpPQHU}$7)Vrph?VQFP;V{2#c;OOM+;_Bw^;pye=IRvK4a#r*>mR3o4)`6vnDce literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 new file mode 100644 index 0000000000000000000000000000000000000000..2f041f7076261bf210f58e1cc908fbde3a8dce64 GIT binary patch literal 176 zcmZQzU|?VbVtF720Y)Zf7FITP4o)s^9$r3v0YM>Q5m7O52}vnw8Cf}b1w|!g6;(BL z4NWa=9bG+r14AQY6H_yD3rj0&8(TYj2S+Do7gslT4^J;|A74NJfWV;OkkGL3h{&ku znAo`Zgv6xel+?8JjLfX;oZP(pg2JNWlG3vBipr|$n%cVhhQ_Amme#iRj?S*`p5DIx X2@@wxo-%dX^cgc}&7L!N-uwjsvnn!i literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d new file mode 100644 index 0000000000000000000000000000000000000000..f5dc76e42e4ed468c4b7b003ec75455ceaebd131 GIT binary patch literal 176 zcmZQzU|?VbVnrYZ0Y)Zf7FITP4o)s^9$r3v0YM>Q5m7O52}vnw8Cf}b1w|!g6;(BL z4NWa=9bG+r14AQY6H_yD3rj0&8(TYj2S+Do7gslT4^J;|A74NJfWV;OkkGL3h{&ku znAo`Zgv6xel+?8JjLfX;oZP(pg2JNWlG3vBipr|$n%cVhhQ_Amme#iRj?S*`p5DIx X2@@wxo-%dX^cgc}&7L!N-uwjsw0bgg literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 new file mode 100644 index 0000000000000000000000000000000000000000..7a2af72516431ea8de5fcef709d3c821a3d53113 GIT binary patch literal 176 zcmZQzU|?VbVg(=u0Y)Zf7FITP4o)s^9$r3v0YM>Q5m7O52}vnw8Cf}b1w|!g6;(BL z4NWa=9bG+r14AQY6H_yD3rj0&8(TYj2S+Do7gslT4^J;|A74NJfWV;OkkGL3h{&ku znAo`Zgv6xel+?8JjLfX;oZP(pg2JNWlG3vBipr|$n%cVhhQ_Amme#iRj?S*`p5DIx X2@@wxo-%dX^cgc}&7L!N-uwjsv(hqh literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/3f58051d431ac575d0b804b2d512e46d7e8b4cda b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/3f58051d431ac575d0b804b2d512e46d7e8b4cda new file mode 100644 index 0000000000000000000000000000000000000000..40d44367c8642067288b6e9314ba09e4be578ff5 GIT binary patch literal 78 zcmZo*WB>yZ2*tp_$i&RT%Er#Y$;HjX%f~MuC?qT*Dkd%=DJ3ltEX>ZXk=_+YG!U>X=QC=3joM62l)U1 literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/4e2fef7ad945773dd77eb37d7d08dd2368ad4b89 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_license_request_fuzz_seed_corpus/4e2fef7ad945773dd77eb37d7d08dd2368ad4b89 new file mode 100644 index 0000000000000000000000000000000000000000..57fbaf097b4ccbe5f886c095b53c62f0c7299234 GIT binary patch literal 78 zcmZQzWB>yZ2*tp_$i&RT%Er#Y$;HjX%f~MuC?qT*Dkd%=DJ3ltEX>ZXk=_+YG!U>X=QC=3jm=q2YCPh literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 new file mode 100644 index 0000000000000000000000000000000000000000..baf0a05cde5b5839115e7a5081da7ae855f1d16d GIT binary patch literal 676 zcmZQzKm`I&?m;vF6F=AN+_-!^w3?Fw+^)0L;8YXaFW|*w-?7%08nv!OM@F{`Q)oz4XObYv+#}_+}ZL zV=_25<4&rD@ZQIMOP=2^SiXZbYu!vns6|X@0A}7{GyoG{`RT(vz3`&u2+g?(zUMbP zaBoQ|dBhm>y=d+W`D%X|^`6_zt1I^375Q(>q1~Ht_6if!9%eKEGw%o*fQiTN4-;#g z5EsN!HYdyJx1zsxv1i-&xc;AviD>a|6Z8ETJid|W&% z3}I$TKm}lY12ldB8b1S#-+;!SfyUo~#=n5Ze}TqlfCfIyJql=i3p9QJ8b1S#-+{&l E0LH+VHvj+t literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d new file mode 100644 index 0000000000000000000000000000000000000000..4e600526090a3f5262c6080a76ef5d68f3965c6c GIT binary patch literal 676 zcmd1HkIzo6WPk%UDC-~^5P*uGO8RQ!HeL3>@uQWTQtO~nq5+tBhtL2_-2aHe)cNj42P<=~XUc~b@iB{CzWHfs zTHWKT=T6-$?0P$u-$F8C`C670PBSy@o^SPGgj&Re24LnLMguVMgJnz$D$jjVt5_HD zWqP_uY|}zN?!MT|lQfp46feDynw@K2e|p&kru@{07tL_wUmeFU3utD_2h{I(b#K&GA`Xy z{rR)i(m<}ws=u=mW;!DpfSGp)4Zy^$C0hfZp1gZ?*5%9R|4#bibyJr~cdz37d#kn! z=U@0Br@n5|7L_0D*6+iY^xa*cra6xhY7r9}fSGp~4Zy?~m#ggjx3_KLOhH*zrSFzE zyhZgxR&5MBv+kPXjU8Jb9^LdackjJRiJunc&5b?f?{tv~Y7a9SfSGp$4Zy^Ot6mBR z*(tMc70-Vtd4A(Lp~d0xhT+QDb23g!Z76?WT(b4tjlA#&6TQ|}KHw|OX=R4mqZ=O= z4+}$>SrSkI7~cSmAArWsK;t){@n@j%ccAevpz&Xz@fo0j4|9(K8s7qqAArWsK;w6y F@c|65oOA#H literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 new file mode 100644 index 0000000000000000000000000000000000000000..16a14bc7a02dc9ac8c8949f97ee1cca59b5fab1f GIT binary patch literal 676 zcmZQzKm`I&?m;vF6EACjEb^V9(y4aA*0+;>o47MO9#2^96`dii*mJ?~;emLiJEl`_ zHP}C!XuW(@-bKl3nCXmY0A}7HGyoG{zHEBcM&%b<+HX$Wy`bvb+$S@N?p_c+WBw-M zcK7Br!II2=|C4P}VrH#1Vw)buf1`;JY7r9}fSGp~4Zy?=W^FuODgP|5YJ0iTwEr_^ z9j@}vj9*rN<;_`d<{dBFnBK%)eJXsRZ+jkp1rukSmM9a{9%eKEGw%o*fQkPQ{2j2X zY}W&uPog)LGe>cjww)>qP}C4lYl^q{>$hX`#MOJ3sIkk5{t(evlDCe-kr`@_ZhTxk zEDT|0Nk9c)d;>Io02)67jo*OApMl2TfyTdp#(#mvXMhGi%smQddV_odK+|<`$Rng%)r)tu2q;9=aiwJfIFZfW*Jp22?28-OU z-AnHum$vjcnOdN{=7r;Ieq8o4p#hkAOWWUW3k>nzFYJEvU)ZN7X~zVnZ;o-D^z)zH zM?2+Li{Sp<$gUV=zGLN=^u5Qd+?>v8$mPgz6`RJI7)w9ZD`h^!gv(xLGyt>LivMNE zl8nhw>3jf3$-&zI literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 new file mode 100644 index 0000000000000000000000000000000000000000..6f71c2eb7e064b0e76eaf8ee7a455334efba9119 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^a>n%v_cOKL{Av2v)|;)qAhJ{yWP&bLs-F*@4-~hK8WP;D7ia8%S}$0)`O{z|5P! z%6q%xtdDH28&|rrP3>=wzQB6C%B^9-IsRO|o6KK@VCphnK9|y;^hZ!euWL8i1L1r?VnR(?IQ8#!^A{jUubIT;n@C-^@_|R`jB` zH!Ob1eub$s>U8r}JgDnDLyy~P?#$yUQLJzBcB@P(NIqzI(=A#`4wt>mXaHv37wfGT z=Bw`R_1OL>hhP4xxy&E&$3Z1eSHJXm-s16_B^aiz^NpBv+9K|qZ+02p{39>(s5nT4d!h4h+4S~@R7!85Z5Eu=C(GVC7fzc2c4S~@R7!3jR5U_df zP!-+Gw@vWN+&+QIcUtK3^7f7l^CKR6oILY({ocbbHR|ug`mGB7pR($l1 zQ!#gTJ@e`2OUs4E=Sm%~)U8N=ay4Ye$7T16&+F8zaoi45r}^UcVqZt=$p;#KpS&X> z$uZsA^K<#l3jwF(rf6N2KhuwHFDycs&;ZQ53%UElg?KcLLM24Gcm551{{G-BXVuM3 z!W*3)q{eR)zY9~>`MI9KTyRly9h uJ9e5+&r_af_qXd^rq6b#jEG&qE$RICryJaTs3$Kv>B{_NAJEMk>3jgS0LJbB literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 new file mode 100644 index 0000000000000000000000000000000000000000..70ed9c599bbb1493946e95834b6261daecb9429d GIT binary patch literal 6648 zcmWgOV*mpI2*qFk4S~@R7!85Z5Eu=C(GVC70h)zCA_$n7TUZ(x8iAOwc1+j3A6xkn z=6jd@4_Oy0R5M#lynoVUn~RagGdAh*ChYQuwQu@D1Ni(iV(!-8@H=fgap`us1s~t< zmU!BHQ|;cBkJp_!vy%-?fsSV~==ypZNH@Sdl7t3e_C~FmxoxLd(SrVlovYOy6Qe&K z6Z*p2lVEJ}!0HCfL&gl#M0^T2#Vde1IvBjKkk9~iN-;;!R_KBZbL}B(mnO*Zr zF7!c-)k)ELulU**cvOdE3SBv#@H31#r-yE@^WiCBS7vaze$TM?I(a@Uvwt^S|pCV~oV zTaL+2-{8x9ji^?MP$5X2#extiI@z&I`Y|bBXB~GhtX8O!1aaa3O z5PInJ4!f%|SM_r4)qbvCzACV-vRH0Uo#yWg0_qPY{PNTPuJvb8c%SvjYrkRB0qDk# GSUv#s!UHA% literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb new file mode 100644 index 0000000000000000000000000000000000000000..cab8c50243d8f18c07a90e2ab4c2f07144a0755d GIT binary patch literal 6648 zcmWgOV*mpI2*qFk={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^o)seL$wil0ijMA|;8~V5>y@(cV}%bNa!*`Z$Mp5VUsaeot0&TS z9PG6-n{M(lmif&7**fLJz6(W%_FCS!S^TSgo=SGIp%ExBH1{yS0a6^WfMG-fF!TN_ zdzYHLTyrKz_l&hYTJp>Iw^(l2SF&dJzPoe2-!2b(15N(86vmXYjg68$4a?wk0wq?n3Q<<{5{sPWsWd)3l`327c`oBWc&5&8!N6z1td;p z6fr;Sy(jPDu2h>tYs_%j3k&a2dNc$^Ltr!nMnhmU1V%$(Gz3ONU^E0qLtr!n&_iHW zaa1)w)0+y1JL*hX#5H^{th($1T_8$H2w`V z{s%O^0V6~J<{l0-z5^OR0F9r4#$SQPZ$RVkK;xf4<3pV{N{xoVXb6mkz-S1JhQMeD zjE2CF4FOoYDq!hvhDK(d0>y9ty>4fkZ;D-OJnt6&sT->;l2&`H-#Q(pt|I@o{N&7h z!@Qekw-q=VKNWm>seA3#*kwJee?os+#f4=j8=4^kqXEujL<2DMN_-LU0 zrg;6vo!#bH_a&C;?XL9cTOkzsixH;IQSqjyWvds_u=SsYTb)F5HlH*RhE#;(Wi^vG>%3b~l(ht5t=c zKLmBp7Acf_aBSyJ2kipyl1$x#I5FK`+iBeM<#E}|j0Rxly)k*IChL28yHCR1X zQ}WboqZv(ROp?z1wTJ&}3KvXWgzB*so>QLjzfjvKSbz2Hqg6c9rwcWI{$-;mq-l4_ z=rb;R;Q>C%7!85Z5Eu=C(GVC7fzc2c4S~@R7!85Z5Eu;sv=HbofBnx?+D!8k|NRw4 zEYqi=Ni*m!eX#J5Sm?9(o8N<oCoJX+xJV7Ev8kBw5g>$Qtk%npeO7TapZuzs`N hW&2M7UtirW+9vqpF{_J@UG}%T*U+aO(2XB)d;sKuwIToj literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec new file mode 100644 index 0000000000000000000000000000000000000000..7aac2f96f5e80b8cb9ddfdefb6aed64c5ab82c0f GIT binary patch literal 6648 zcmWgOV*mpI2*qFkd6fbtcf>KxGI1JL*xX#5pu{01l=X5J1o`4eb-sI{Zi zXb6mkz-S1JhQMeDjE2By2n^W}fVHb)cc09H zffNT+8v`R6fZ3a9f8XoB%4a3!hrfkuA02;Rq0yYXFL7(eubX=;OgA{kDnJcLQ0{I} z`@G_0kh1Fc@Nj{tbzj7eei!ba`_r#_ujY_Pga%;t<|O>k`r~rV+I{k()9Pz_ zW?U%C;rO%sL9ooWY0avimEiVjosrB*a82&npt~naUoP;x#p6lStWlb`AvLS?6{FLwxTs4WOYS&TByE{3`x~9m`kkueszC920n__T#b_7T%-uXb6mkz-S1JhQMeDjE2By2#kin zXb6mkz-S1dhd|J^I-hSZcbs|oH$!;YrBwmw@~a$@RzFNz=VHp)%9p;w?{S{eb=OO? zj_-Yvqk3cF!MCD3|F-WocyFKWzOMRtiCw|FZ|DAQJG(d};p9p^r|qr3o}-&L()j>z C5yfQy literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 new file mode 100644 index 0000000000000000000000000000000000000000..57edbd78644324a1c06120bebafd52c513b89e6d GIT binary patch literal 6648 zcmWgOV*mpI2*qFkby~EGz3ON zU^E0qLtr!nMnhmU1cqz~z}i)zFJm;5HuOGhhBMN=%)GU;_9}9|wTxRN`*wZLF8ipjS7)3%z$M1H?w?E6e5n`vVd{F0FZC|)JMOsh zPj(4cOWO?o=O!HIxBrkZ-}7X-sN+5dT=p`d0hoF5cl^CP?!HW|xc4~oP*C8?zIw)k zdxK_7{J8y@#`KxJ#V~c7qULdAU+Cau=|8R=E6Z-t_(f&vrORA8#S^)`W^cZZ)4$AU z0A}8nBMh2npGsbQ>y>Dj_3R8sT+PF{tfM-UJodVLQ|Q~`3{yAB=IOMFc2Xe;%VpDj zU%rpK$`cySUAkvu&jYO!&XKcr;PNjlyhrKL5Eu=C(GVC7fzc2c4S~@R7!85Z5Eu=C z(GWln0gt(y@tvFB8(sY`-MOKm{Uy5mt+e;|PQ$YbdXPMzn_&CyI|jZ;6V z5iBZt_eQ?l?KF{s1^cY-Rq#tETz+RT;dDvJmf6d19m@}xvgMnq@IJ!@IX?oP+T8nJ SEEN{Wzpwi6e{}OkIv)TRT`2ni literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 new file mode 100644 index 0000000000000000000000000000000000000000..0a09fb4f2db749e74f6dfa473dccc96b3335f4e2 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk1JL*hX#5H^{th($1T_8$H2w`V z{s%O^0V6~J<{l0xUjeGl0Zl#tjh}(WUxCJNfbwDH?Ld=1fyRegJ4%g)z-S1JhQMeD zjE2By2#kinkPQJ?yUN`++~@gB&F{8mC(##auW8mzXoor|Z3JedKZ#x-w{I#kR={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^FFC{1XI{5hn|{zj;Ji|gp5pNpj7N=F|M7Dln{ivMqzk4l|JLN4Vrfvm%U7A0A`-Y_ltH74hxL=`ev!;t8=rKc-UI&_qQ$ea=#aK zPB;MW-$j$86j!z`aGT(D+_YqyvXtF^(PeLWa!*wLXn2+MuzLrrH0UzqtoebW# zFjgXF?(ekhma|SjaoGzC?@@X*1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz8E?AaGad zVZ~gl1TT&w6^jf%OQOpQyqng+#jr2x`?N(Tzn){VS8DhmBmJC3`QomBAxBhZpZ&h7 o-b?9;gNd$+bZ~5`zRtBUoyDtbXIDrj2JTz?reGnuc_W<<0DGyt={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^21hi{25YkKIF{Wexp!USxit^7jg4joTN%bpe;XOlSaR-d65ksT|8*g*;APdm%`9ns5HJ8mG2HZ)yS-h$t%^ zo?{MESF^SnTE6%R%k=x!Z$s^Q={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^8!IpEXL$AVo`zFH`Ob=+l1yA1o*b*67rf%HS?kl~OX6Yb>q^fSLEF zjbCW_e%|T_C0^UZ4{Cd@zx(Y#;g|Dg*D9pVQ%(%DnBC;;ZPhxa?&@12FSGIq)xioSmFA!?=5Wz}rygzGbqrlMSwAYzXb& z*nd~?Doow)ru}kuH{^7;1t+H=DWW{AKGa7)ICtVuX(lg#QxVORdgtU9-iZ@X04 p)+14gsZJi2t*jcy7arHR;1gVIRcu^%T=1&jkw5d7yj;C=GLm1R6g8jh}$VuYmGl=I=n0pMb_c zfyTdq#{YoEH(-Paz}&}y#&fVBfJ zuU@TRSCNy~B(?U!rcYj9=HGDYwqz2Y)tz2nA*AK&2y5SP1#2xR(VnE3r7xxRsh-11 zY>9wUtWfsv3sX|hRXG|i%}zEn13I3m_)_X&Al(4-2-w~v1c0>{7wp^-nSJ+;)XgJX ztah!mY*=#5AnD5^iBF5ooNC|jhk3&6owDYw@TMlqB^wv-ukD{w;_MkxNrAOLH_TbJ^yABQa#^eW zw!~bhv*vR261lW|Q_T7$vsj~aKFopHd+B0PKp&d2UcvFwR=iM{7n7~n`zw-R^N^;JpaNJW^XyK z?WY50?;T&s<>MT^%=w`Dt<8Pr&A(2~xRWidD3NT9%U)PKkJ6(dFd71*Aut*OqaiRF z0;3@?8UmvsFd71bHw0enN!(kqpwm8sb>>CoR^3i?msXuv&{@V)?YsN)KX$b_ujRj| z^NF1mj4YckA=y=Q`Tf=YgYI+HZZKY(S17wDKjq(zqi1+~8?)q#?UO??^f`Wep_@0- F`2bSU{Yd}- literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 new file mode 100644 index 0000000000000000000000000000000000000000..9bed2849f509f2b62223766474eb22f38547c80c GIT binary patch literal 6648 zcmWgOV*mpI2*qFk={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^UyEPW9_c)H=w0vK0CCks(bpKRYCRAhU{cRGf-eud9E#BU{K(I1q>q^fSD)t zY59xfrWFy+;$gBM1v5Ni#G;>^+U|MmYsd2g?>qJg!qmmW#NTiw0yyOXo z-_47dYyII*-0|FZ&$Mva3k&a2dNc$^Ltr!nMnhmU1V%$(Gz3ONU^E0qLtr!n&_m#H z{7uWlPr4ihssxVnGF}ivm%sP8&y(55bBaw@Du0^4lvvCwVWACA?k?#PS`s_w$ocf6 qz29E@cPw9c_rvqLro8h%{pTyrc^XmSw=Kh1JL*hX#5H^{th($1T_8$H2w`V z{s%O^0V6~J<{l0-z5^OR0F9r4#$SQPZ$RVkK;xf4<3pV{N{xoVXb6mkz-S1JhQMeD zjE2CF4FOoYYJqd>O8)P9`^+skzE|_)m~T4tR#fIF$Fa=^6E1r8g&D)t#YeC9>Xg|$ zUFoNA<9*eh`K`+9{-;MwU%uge!vhsD`!(6ghGww9aA4qqH#-^80L;7;HRXSuft#`y zc(=E#Vg0O<#xcKnn%g6mEwP;CyQ-tqVCov~d`$VYS^9YZ>*NVtn`CEQaQi9|UjOOP zqB-8&QYM8}xa?&@12FUM%n&d-9{Rr0>`?533AM9=IXB%qk|dY6_sq?=sqfO)+Q8I3 zj{VAb{@RSo`=Y0qF(h)WnAxYev*D)5tbN=!xAAVdoPx_RA^f1H|YVR@FreY4g6 zAhXyv+%Iw23k&;EdNc$^Ltr!nMnhmU1V%$(Gz3ONU^E0qLtr!n&_f{V_ExdV0FHAV zi3JR0v(gu!%im``@#S-*(4PHsAMorbd>5_Y`)1+AMyL0;{{4z>)SG|vApgRbrjvh^ jbZyly`yY66%iVJo`zP|0p4#}v?xOF>-*eH;8|i!iRwcdw literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 new file mode 100644 index 0000000000000000000000000000000000000000..352ae2edaeffd68ef558f7d4ca6237ac87ec8753 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk$ z{0V6M6KMP!X#5Xod;_Q_VeaEV<2#`71JL*xX#5pu{021s4mAD=G(OaMqts{!jE2By z2#kinXb6mkz-R~z*${xWt8T`NZsghe`GJ+?3(2;{wngG9mv6G`Tkut{l``3TWNsZy zU6uF?7ltLu_l`eF=4T0iFWc*SX5aKQvaEbXxfpTY-k1wj3QfkR|W|$F+5dl9r`LD@zz> z1q)4blyGWU@gAn`*i((4>y2f8na!~i+uz^0;9~SPhZUE-%xC~+ zp3G})?&q%4(=!sby=9mnIN_wB>8xvge36%@u8Tcvf4Ul`E-Mf$hEtfZLC zANQ3Wa~d2hu!%Q&Ghb0fr3sh4u<#zGM?+vV1V%$(Gz3ONU^E0qLtr!nMnhmU1V%#u zJp>#=|D3E#^_i%`;b~jLx6T7yo=xO%*=hB(iC-7I*&i!!6cD$Pd+*xHP`={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^wPCwf+*50~tF?OaBA3lu;^yn^;G2;%&%f!J?-gBnd1IJ5bEZp8 zg4!$PP6!B9Pmfb%d-6S-`P*adPR8*0&wefR&dE+TGy?_3hQ8y#rk(>lTo};+%)C$P z4rM|c%CZ8p6!#bJlV&o~UvbWZ_14?(@)u70=eg$&Q>T02LruWiW&Uf{PcvHoJVr`J zB+t(__`R9NySsBfn9abHC^Lqwvt9CuPlUwiM1 z>YX_UVCwSQCO4+lWhm*qvEiS3v+hxcyP`Vkn?vE*7r s_x1x{S2#Lk9Lq_SbiQNL;(YC5CgY(Aa%HbM{{4;FQGzgOlm!X_0HoN&JOBUy literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 new file mode 100644 index 0000000000000000000000000000000000000000..02ccf56269424b74fef7466c30b53a8afac1a8ad GIT binary patch literal 6648 zcmWgOV*mpI2*qFkAkHS}NKD(f{zs01xcU7oDoKfud^Ajg_JlK|l1b2@r6^_fW5Vzw=N{T=qmyj@&$`uOL6c6AmL&pc}p{&y3mt}pqhcN+6&FZQ(? z-L8r$S)Xn%yQLo=be@529gmci5Id^93>`3gna}{tJdFzr|9DJvY zLpoo>l>S}1L0vQZf`k;H255bnHiaelW+u~ecFUI34ciWDcLltZS-3U4?yC%U+`LU_ z_IkkVWkv%qdow1V`4~~Fsjcayr@is;wK39WZ@09hEKGe-z z9G|z7@8snA`pu2pA{YLrd^kKw=7iqT(lrHW_G-ZF9i>M@U^E0qLtr!nMnhmU1V%$( zGz3ONU^E0qLjYF@eEr|H(Se)ymh8srGu;u|rReJJ$TqBXdKCPRzh?O!U-Jvi{Ji}; zUdA-1OQ{{3ej?ArY)PzixvtQU?sSWjhD)5{G%P+Qv20)Y@p7}Xi1Wp&4-M$%jdVT$ DDfPdR literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef new file mode 100644 index 0000000000000000000000000000000000000000..c708d1e6ce556178e9792446507df009c6d8dcc5 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk1JL*hX#5H^{th($1T_8$H2w`V z{s%O^0V6~J<{l0-z5^OR0F9r4#$SQPZ$RVkK;xf4<3pV{N{xoVXb6mkz-S1JhQMeD zjE2CF4FOoY%J*pV+J|rQ0>96^UD=w?{!yf5_JO8JelPc&4DnS`EcJt_^L+cO;N+xl zxi_~pImNM`uq>YY_|Fb@Oad_X#_=}$65nH#0uH$WhsoT5W_V|S}=^6A~kif234zDSflWBV_NIaB9QElk~pXo=VV*|PJ0`F8=nd0~dA6EGYVYUlQvtuG%sA`P!y~|KsrdI^>W&+R_xJoy l>)RT2`m`?Zic=o3a;8jI!&M3wIj1dYoOLt{-Mo>`2LQ$p#fbm_ literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 new file mode 100644 index 0000000000000000000000000000000000000000..8f98344fbcc9ade5a8048127d7760a48599a1042 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk1JL*hX#5H^{th($1T_8$H2w`V z{s%O^0V6~J<{l0-z5^OR0F9r4#$SQPZ$RVkK;xf4<3pV{N{xoVXb6mkz-S1JhQMeD zjE2CF4FOoYO4)sT<9-d-XD6c)16dRGI6fcRDkOE7UFFYIy|=gQ?r(>wJEstym^kay z7xVe{@{<=IU$Jffrd5-354JDVlI3{#>Gj*}WJ6PIfx(CdVCEhAHK%jw)5C8|RILhn*Xu{1IJ1nm96gDUv zz9NDiDyHuy7rZf#+U)se;Sr;i>~fJ?4K}fhYq``sSCDMdTKC9{E5J45X literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 new file mode 100644 index 0000000000000000000000000000000000000000..5442bebbed3e79e4092a3bd863b445894417f5de GIT binary patch literal 6648 zcmWgOV*mpI2*qFk={9nkmzX#5N`{t7gH0~&t^8vg_uAL_hOYBU5!Ltr!nMnhmU z1V%$(Gz5lh2*BD^2`fLZEG(K-viq}Tp4(ael$#Pq+v>BQuYdfMH_~F=<3%ua9Jzi? zO@bER*{h`9-hX)O@5gBW(w;h#qqAluw5Bk$KFdxvGynxg5O+=?km7&^3?mwVnRifs zS498+9|cp7mYucCj^HeFy?wnyqpPs=WLMtAy_+||)Rkq3K7N1oW&Q2D&9BQFnkQ{E ze7|V*S5uGojNAUqR~L)IWiJyNfSFfNsBC7ipKq&jdzwtj(OJ_O*+Y5r??0)0x^CB7 zPvL7bVCrU?CeCVN+wm~%Q0f+q4Sc^P8d()%KQpi;9NrYVUZo-hm%Yqr0A^mnWrK!= zL762R_AH)LbV27zWw`LXq;3&OwHW`CD^9M`iUfJPWVP0Ai%JTkP9g83TADdcq^F}%!0Il-D;{X5v literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 new file mode 100644 index 0000000000000000000000000000000000000000..58dc14ffc1690766e9314712a4d8bfe1c6f2cf17 GIT binary patch literal 6652 zcmWgOV*mpI2*qFkNBCn)(Jb{th($2{ir#C?95?0yLmu z_WeLpZ-6H6fX0VwCr!4w7->9XlOAuvE`L}9r!O>s&p#vPZv73v)3y_r zZkJo|@%?Uzr_DFj?p^tK-I+5x+0Yais7wZ3Urz(+23P^7ig|{cc*yMrXf$k84H8879^6fIYy&i7P4`xjcE)rE&O6&BxA1{95 z=z8xHH>MnYi_7X{5P*8w*u>NfX0_Az8||Ib7x)FdKPbb>;j?3lIo}@p{uI9_3GwU` zKedR$>;-#aw4n%#$x(VV1V%$(Gz3ONU^E0qLtwau0H|#^+D-(=F0t*zC$no_$%Q_s zu{tR_?-gJB0*~sDOra~s6Mlv<=M=F#zlW=RngRmw_GwBAtbO`H%A`(zN1SKE?q;8V zPuEl&x%cJoo);QVcAcAarF*yMc3As#b;3Inu>zfBV^_7eA}%TAt}z8#{Xfl31Qpn} z9Fv{KjmzFtGyt#oy*==`OVMQ{Pb_1ueent^_`4)lhC$}&7Hz8roimIEqKRl z)gOk$Mq$H`rzE2?hig_C?*8JjKYaeHJKIHNk^1AQ)e*nZ{hN4eYFRetkGK-2)iyJI zW|X+A{V51Nbb5!~Rhg@LIrnNmS1(@`*j8CAx2I0?_XPp<2NQnz>3`SyvnagJ`sB6W Suqgp_V@c;Hk*;Mh>Hq*E0cK4A literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 new file mode 100644 index 0000000000000000000000000000000000000000..1a0f23cf40106786464045a4a169cdfadf12c930 GIT binary patch literal 6648 zcmWgOV*mpI2*qFk0B9 zcc95nK;xf4lh-7*_QIx5USHX5}(zbUSA=kY@!1g8~0Ia>Z zVCRm=?7MfQZXVfUwQHqi!;)(TNnajGd|GVgRQrZM%oAqslr?XKH#J!<*|>OrZU2-K zXBW{a3&p-?J(yVO^s<$IEf-#U?I8XI`5b26CXe$~KU0z{;X%Ts zVmr^1g%6AU9>Ub=v0N5SUU_F>{{GT;DT}vhJ#cxmd)K|w84UY{JDOzJpX0R`8qUTh zDJih_=Y~0}mVSJ>PA+S;-K9wKRU8hGve9c>zT5crobR1_ z?_uiFmm8}on7+y0TX0j;*ROxVfwL;QTLtFXF}0??h`G%F1(&@r`$y@~5Eu=C(GVC7 zfzc2c4S~@R7!85Z5Eu=C(GVEvArR5%e(`16os`^y30spB#LUsdLn?hEPs|3XsV37C zH-7kV<@{Cs{kt}=TW-d;^4zOph4qyT><3DcJ{$6B*|({5M`pM>x?Y}`-hF+t&D`2V NgNa7J(ajs_d;ncoaN+;} literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c new file mode 100644 index 0000000000000000000000000000000000000000..d8911528a17ea420d0ec1a6c3155484faea6a355 GIT binary patch literal 6648 zcmWgOV*mpI2*qFkVfH#e#bJC2G=2aYKLL$jfyUo~#-D)3KY_-- zfyV!U#y4Pu2*BLOfyQ@0;|HMeGtl@e(D)5#{2gfg6KMPgXnX}|K*QYk15MrlP2K^G z5B2USH5vk=Aut*OqaiRF0;3@?8Ui#6fkZR_YqxAjUAXFn`4Isp&)rMju6Wa2bd@J{ z=8mt`!i;DBu(;e=2vb+K@BSOpvX5VEpZ%|>4Y?5illRhfw!FvtZ_J$)E7M)jnVoEC z26Q~r&ikSJfpi1RBS~lgW}e2!g+=)@GXJkWe2Hh#oC&jLc>R;vwCr!hRtt~!`){|SsYtrC@y4SUT1JOrZJWbZ@clLBeQl8{odQ!g zt$(eb?I^EtndTE(v++X9<-_k*GsjK-@p9A6yf9q$rlJ9udF5}*g!e{ut$4gi z_Qu|Jt?nD^!lz{9WOjs1?hW7c%}o}jZqF8#G>IP@*Q;-_m{9O$(TAqX6IRQtZ+-Zc zrA$(4Vct1h_QK+MlpYO%(GVC7fzc2c4S~@R7!85Z5Eu=C(GVECA@DSCrioSXhR9Q) zcRwG!dZq*2rHj9w^kTR<(Kkz>TsUCrDUoiaRaZCk%5Y8WHgkD(cJ?im(+={QdRtFS i+#x#a=+dLVl27q2GjaDRNpxsl&RTxyFuHjooeu!s*A_AW literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 new file mode 100644 index 0000000000000000000000000000000000000000..b54027c58647dbe9d102ecf7cfa0ec1c503d79bf GIT binary patch literal 6648 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 BMJ50M literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/543f332b627f3891b3f15c6227f4f946cba81886 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/543f332b627f3891b3f15c6227f4f946cba81886 new file mode 100644 index 0000000000000000000000000000000000000000..b3788a28757225fa1aab9e2a4dffe0ab541cc10d GIT binary patch literal 4096 zcmZQzKm`|AAp8sL5Ly6L8qPClV%fvQ$Y8+B#;Mij(e|B}k&%&=fu)IM8Bk^sP==|A zk&$6JgIPlAoxLGZS`J$ticX0T^q&%O_ug`O8=VIooSKQ@>2YCo@6`JvO=fAWn!CmC z*Yd0@C#!-F`ptiA^4)g(Ndb3%ja&BT46FaL3B3NkZ_>~8zwI(^y^~7u`KDf1DIHLdVUpAi-wQg~LV z{_SGM16kcF%+osdO;6L>6MV9nEikGhRaoMQ)!XckiP1hM_Wucvgot?KT$T2$7h7RJlORc>@R`|s$(gV_}> zIHUU5`_qL!yOvkRR5e~Ke9oXK{3tY&uXG>hVgHpUGnDwI_jcxee9=*L@g`^NWsM3| zZW;Gt)ia9QZXHvJx?nEic6>_a6X$&Qdkn_D{Zos6WfY312}!l9e}7;1z%=5MZ@wwx zs%ejG1BKh>R9@J=E#*a9YQX+8>cR4XS5EEwdbhk_2LHPi)7ax(v#NNR=lE-WWBVK% zk>h@0+Dc~e-F_z(AFMfBQL*V?alIc z$DJt&J!Zl`br0dvvQML$BWFaq*UWf!^B!+o~@-^Zk7BywtyXtL9ysAN~&! zo_u|ddc$_PlzHEcwB0nn|B%S}?zPYR-Lwh)i^P<&&UmnuBskitG?uyLB&b&eSNe{V#)W{eIgVn7%S}bqLc`g=HDy!7E-lKi#mHsj(q_j#0B^ z`2XS!ohjYdK5*$iT5lkuHU0C1S*vGrOFLICSZ@1#U+O@ym2xuPn6{d$=y3EP0Bj&su@g?in>7 zp5ED!wYu;7d=4Gyu0=ch&%KFDTya*WJ;Cd+RQ&yRwPUAiGM{uavPCNWGVyL~w_(m@ z;wpb8dgJ`^47HqJ+Bch{ba|``WUhGZTh4WJ-<`ueipHDM{>w<8m{#^8-=$>FY?;~< zYZO=H0b`;;r)I5O>9Izd059B-@+TYQQ4g>k`o zwwBF)E&-*9)7reZX|MgTHvED)udHdn=}aX{&7D@4HIARtU2YCo@6`JvO=fAWn!CmC z*Yd0@C#!-F`ptiA^4)g(Ndb3%ja&BT46FaL3B3NkZ_>~8zwI(^y^~7u`KDf1DIHLdVUpAi-wQg~LV z{_SGM16kcF%+osdO;6L>6MV9nEikGhRaoMQ)!XckiP1hM_Wucvgot?KT$T2$7h7RJlORc>@R`|s$(gV_}> zIHUU5`_qL!yOvkRR5e~Ke9oXK{3tY&uXG>hVgHpUGnDwI_jcxee9=*L@g`^NWsM3| zZW;Gt)ia9QZXHvJx?nEic6>_a6X$&Qdkn_D{Zos6WfY312}!l9e}7;1z%=5MZ@wwx zs%ejG1BKh>R9@J=E#*a9YQX+8>cR4XS5EEwdbhk_2LHPi)7ax(v#NNR=lE-WWBVK% zk>h@0+Dc~e-F_z(AFMfBQL*V?alIc z$DJt&J!Zl`br0dvvQML$BWFaq*UWf!^B!+o~@-^Zk7BywtyXtL9ysAN~&! zo_u|ddc$_PlzHEcwB0nn|B%S}?zPYR-Lwh)i^P<&&UmnuBskitG?uyLB&b&eSNe{V#)W{eIgVn7%S}bqLc`g=HDy!7E-lKi#mHsj(q_j#0B^ z`2XS!ohjYdK5*$iT5lkuHU0C1S*vGrOFLICSZ@1#U+O@ym2xuPn6{d$=y3EP0Bj&su@g?in>7 zp5ED!wYu;7d=4Gyu0=ch&%KFDTya*WJ;Cd+RQ&yRwPUAiGM{uavPCNWGVyL~w_(m@ z;wpb8dgJ`^47HqJ+Bch{ba|``WUhGZTh4WJ-<`ueipHDM{>w<8m{#^8-=$>FY?;~< zYZO=H0b`;;r)I5O>9Izd059B-@+TYQQ4g>k`o zwwBF)E&-*9)7reZX|MgTHvED)udHdn=}aX{&7D@4HIARtUfBhh+g;kjsxzywT4dz`Xggp82F0kCM?+vV1V%$(Gz3ONVAzI0mR3VE$a4V0`9fU) literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/a98f2da86c01706159e32fc37c1a6b2df779395a b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/a98f2da86c01706159e32fc37c1a6b2df779395a new file mode 100644 index 0000000000000000000000000000000000000000..dfa20e2cbe211296940adb46ae8bfddfb9f8056d GIT binary patch literal 4096 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 Go&x~fibR(H literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/fb7a84cdab0bff7dabb339c7fc35eb2ea3c2eb9c b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_provisioning_fuzz_seed_corpus/fb7a84cdab0bff7dabb339c7fc35eb2ea3c2eb9c new file mode 100644 index 0000000000000000000000000000000000000000..eacb9d2b058f5b3d57fa8201f4ce4c17bf532a9d GIT binary patch literal 4096 zcmZQzfPmlsA>aZFgnxk@LJL6U(J6x_mOV_23kPQ5?UWR}*d zxm)~xEzi1gvMTtX-~7iW-)*;_6ma*~xMhFNu=+2X!0Ye(CjDIh+b-kQJE;_(&zhf# z=ULwPmVaYYLsMbj)+L_~*`4J&wT(>(+aQj8DZfe zg=dB8-!5i6kkzfiJgsBj^fawK!6%#90;4)og(aR?z0LlZ80~XH?#rQd9C5nwKZNQR z{n@Q3VQ}l8!*9k@dggrR?v}MTxp7;S_a7)?*QuW?*B1R&UGqNk^rZJLm!oZO&xw<+ zw%o#<%aXl&w@&=|%~h;S%!~|-z>r{wt4#G=T2}d!)s_DX^WG)3npf``C*RnyX8LRU zxX>51pPyUD=!T@5U6XbDdP=w3s_u@fMP*%TVZ2OSrdsz zxXlTVGpdihKV9gvYk6f%RpZ6N=M0L%k3uu~O80Rd_Fs82Ly2#CZ)e`e7adg>Z*s<7 z)~HbBmT@muJ)^ko)-jc+3+5tj$ERdIan5(Y$6)N+KegyrMxl6`kW{<+_xE)VOd~$| z=9@CEn)b*xP`GVQ<%R9rQeL#B2JAnh9xNYt<B3UBN4Hus^y+;c7jL;2=)Enlt@^?<-_IA%OZ}_2YTmW^ z;r|ff$=BzoH*A+nnfKjD+fDQP4~d-bUi-Y?O`FiaNK7f~j0amuvU9z7sTSdeVBaP#No(R}~6Cklp4ocVO3k?w2z8+PBXoW8W!@!-2-lZ0Q_J4JlC zu&G40uifpe$PTf!TlezjOpOxT|1$X2@3+l?=_^B5hcHc5Se79kyyBJf(+!K68XMB* z7&Tjl|1aLqnbLjj1DEcj^#(Fp(?3s`wR$$Uv~%Tx<+jiF_0D;Hd#%IWl?)9#9&TQk zqdMt{@uq#ReM{8h&7J4uh?j9SDl{$h(9w0h!=L1AwEK0WBAR>75-}tNXss=g^VvTC}tO+?%+>6=!AI6TA*f#oupNJ9fGz^GP=&Tcpx26Ys`$ z8|GXluJUK1H_k85P|NwHeX}`Am&dw5=8DI@T2rt<8Iz_Sz3?!!MZg%9;k8&Q!A0+-Y@LQ<*8@`)UJ+TYbK+1!`Xw z@m@%Yb+?iDawTXg!@8Di_f0lUmy3e$73q9GsAP6iBJ7`~hVg^j%mQcty?h(xkA}cV z3W5I@MG9OVbgsSl_PxG`X4HoR(00H`3WHIYwAz<>b*1`NCg1`n730RR91 literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_renewal_fuzz_seed_corpus/f2f45ab615736936405ec6c8df9ab92dbc91017b b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_renewal_fuzz_seed_corpus/f2f45ab615736936405ec6c8df9ab92dbc91017b new file mode 100644 index 0000000000000000000000000000000000000000..263e0606ad26dfadf7fc434b312095f2a39714eb GIT binary patch literal 3992 zcmeIuF%1AP2mnD+M+_+HSpPe?pu@d^PcCAoceCbvcJ8hO2oNAZfB*pk1PBlyK;RF7 E24D06Hvj+t literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_provisioning_request_fuzz_seed_corpus/6ee38ff02d14cae0565cd26553cde5f898444014 b/libwvdrmengine/oemcrypto/test/fuzz_tests/corpus/oemcrypto_provisioning_request_fuzz_seed_corpus/6ee38ff02d14cae0565cd26553cde5f898444014 new file mode 100644 index 0000000000000000000000000000000000000000..1eb62c38ce85df92ef251f94bf2a8ab38f14c182 GIT binary patch literal 146 zcmY#jfPe@n&A`aS%)-jX&cVsW&BM#bFCZu+EFvluA!-= zt)r`_Z(wL-Y+`C=ZeeL?c?j`9}pN691>Qk2+&sK|`~reP!Xlz#;u4Zl(lWAg@(PMd$||aA>Kd8=H?ISJ literal 0 HcmV?d00001 diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc new file mode 100644 index 00000000..560a172d --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc @@ -0,0 +1,30 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include "oemcrypto_fuzz_helper.h" + +namespace wvoec { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + LicenseWithUsageEntryFuzz entry; + entry.CreateUsageTableHeader(); + // Open a session, create a usage entry. + Session* session = entry.license_messages().session(); + session->open(); + entry.InstallTestRSAKey(session); + session->GenerateNonce(); + session->CreateNewUsageEntry(); + vector encrypted_usage_header; + session->UpdateUsageEntry(&encrypted_usage_header); + // LoadLicense sets the pst for usage entry. + entry.LoadLicense(); + + OEMCrypto_DeactivateUsageEntry(session->session_id(), data, size); + session->close(); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc index 3f30ccb3..9a16086e 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc @@ -95,7 +95,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Read subsamples from fuzzed data. vector subsamples; - while (fuzzed_subsample_data.remaining_bytes() > + while (fuzzed_subsample_data.remaining_bytes() >= sizeof(OEMCrypto_SubSampleDescription)) { OEMCrypto_SubSampleDescription subsample; fuzzed_subsample_data.ConsumeData(&subsample, @@ -138,9 +138,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Copy sub sample data. sample_descriptions[i].subsamples = &subsamples[input_subsample_index]; - if (AddOverflowUX(input_subsample_index, - sample_descriptions[i].subsamples_length, - &input_subsample_index)) { + if (OPK_AddOverflowUX(input_subsample_index, + sample_descriptions[i].subsamples_length, + &input_subsample_index)) { return 0; } if (input_subsample_index > subsamples.size()) return 0; diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc index 8939f118..f76fafae 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc @@ -22,4 +22,45 @@ std::vector> SplitInput(const uint8_t* data, size_t size) { } return result; } + +void OEMCryptoLicenseAPIFuzz::LoadLicense() { + license_messages_.SignAndVerifyRequest(); + license_messages_.CreateDefaultResponse(); + license_messages_.EncryptAndSignResponse(); + OEMCryptoResult sts = license_messages_.LoadResponse(); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); +} + +void OEMCryptoProvisioningAPIFuzz::LoadProvisioning() { + provisioning_messages_.SignAndVerifyRequest(); + provisioning_messages_.CreateDefaultResponse(); + provisioning_messages_.EncryptAndSignResponse(); + OEMCryptoResult sts = provisioning_messages_.LoadResponse(); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); +} + +void LicenseWithUsageEntryFuzz::CreateUsageTableHeader() { + size_t header_buffer_length = 0; + OEMCryptoResult sts = + OEMCrypto_CreateUsageTableHeader(nullptr, &header_buffer_length); + encrypted_usage_header_.resize(header_buffer_length); + sts = OEMCrypto_CreateUsageTableHeader(encrypted_usage_header_.data(), + &header_buffer_length); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); +} + +void LicenseWithUsageEntryFuzz::LoadLicense() { + license_messages_.SignAndVerifyRequest(); + license_messages_.CreateDefaultResponse(); + license_messages_.EncryptAndSignResponse(); + OEMCryptoResult sts = license_messages_.LoadResponse(); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); +} + +void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, + OEMCryptoResult expected_status) { + if (result != expected_status) { + abort(); + } +} } // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h index 14c18f5c..2aa1f46c 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h @@ -13,6 +13,16 @@ #include "oemcrypto_session_tests_helper.h" namespace wvoec { +// Forward-declare the libFuzzer's mutator callback. Mark it weak so that +// the program links successfully even outside of --config=asan-fuzzer +// (apparently the only config in which LLVM uses our custom mutator). +extern "C" size_t LLVMFuzzerMutate(uint8_t* Data, size_t Size, size_t MaxSize) + __attribute__((weak)); + +const size_t KB = 1024; +// Maximum signature length. If fuzzed signature length is greater that this, +// this value will be used for signature length. +const size_t MAX_FUZZ_SIGNATURE_LENGTH = 5 * KB; // Initial setup to create a valid OEMCrypto state such as initializing crypto // firmware/hardware, installing golden key box etc. in order to fuzz // OEMCrypto APIs. @@ -42,12 +52,7 @@ class OEMCryptoLicenseAPIFuzz : public InitializeFuzz { Session* session() { return &session_; } - void LoadLicense() { - license_messages_.SignAndVerifyRequest(); - license_messages_.CreateDefaultResponse(); - license_messages_.EncryptAndSignResponse(); - license_messages_.LoadResponse(); - } + void LoadLicense(); private: Session session_; @@ -64,9 +69,11 @@ class OEMCryptoProvisioningAPIFuzz : public InitializeFuzz { ~OEMCryptoProvisioningAPIFuzz() { session_.close(); } + void LoadProvisioning(); ProvisioningRoundTrip& provisioning_messages() { return provisioning_messages_; } + Session* session() { return &session_; } private: Session session_; @@ -85,6 +92,25 @@ class OEMCryptoRenewalAPIFuzz : public OEMCryptoLicenseAPIFuzz { RenewalRoundTrip renewal_messages_; }; +class LicenseWithUsageEntryFuzz : public InitializeFuzz { + public: + LicenseWithUsageEntryFuzz() : license_messages_(&session_) { + license_messages_.set_pst("my_pst"); + } + + void CreateUsageTableHeader(); + LicenseRoundTrip& license_messages() { return license_messages_; } + const vector& encrypted_usage_header() { + return encrypted_usage_header_; + } + void LoadLicense(); + + private: + vector encrypted_usage_header_; + LicenseRoundTrip license_messages_; + Session session_; +}; + // Convert data to valid enum value. template void ConvertDataToValidEnum(T max_enum_value, T* t) { @@ -99,6 +125,10 @@ void RedirectStdoutToFile(); // Function to split fuzzer input using delimiter "-_^_". std::vector> SplitInput(const uint8_t* data, size_t size); +// Check the status and exit fuzzer if arguments do not match. This is usually +// called to check status of APIs which are called to setup state for fuzzers. +void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, + OEMCryptoResult expected_status); } // namespace wvoec #endif // OEMCRYPTO_FUZZ_HELPER_H_ diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h index 67dd588c..5a5febb3 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h @@ -4,6 +4,9 @@ #ifndef OEMCRYPTO_FUZZ_STRUCTS_H_ #define OEMCRYPTO_FUZZ_STRUCTS_H_ +#include "core_message_types.h" +#include "odk.h" + namespace wvoec { struct OEMCrypto_Renewal_Response_Fuzz { // Timer limits in core license response needs to be fuzzed as load renewal @@ -37,6 +40,34 @@ struct OEMCrypto_Decrypt_Cenc_Fuzz { // Sample data and subsample data are of variable length and not included in // this structure. }; + +struct OEMCrypto_Generic_Api_Fuzz { + // Corpus format is as below, let | be separator. + // cipher_mode + algorithm + iv | buffer with actual data + OEMCryptoCipherMode cipher_mode; + OEMCrypto_Algorithm algorithm; + // iv and buffer data are of variable length and not included in + // this structure. +}; + +struct OEMCrypto_Generic_Verify_Fuzz { + // Corpus format is as belowr. + // cipher_mode + algorithm + signature_length + buffer with actual data + OEMCryptoCipherMode cipher_mode; + OEMCrypto_Algorithm algorithm; + size_t signature_length; + // Buffer data is of variable length and not included in + // this structure. +}; + +struct OEMCrypto_Generate_RSA_Signature_Fuzz { + // Corpus format is as below, let | be separator. + // padding_scheme + signature_length + input buffer + RSA_Padding_Scheme padding_scheme; + size_t signature_length; + // input buffer data is of variable length and not included in + // this structure. +}; } // namespace wvoec #endif // OEMCRYPTO_FUZZ_STRUCTS_H_ \ No newline at end of file diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc new file mode 100644 index 00000000..872b302c --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc @@ -0,0 +1,34 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace wvoec { + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + if (size <= sizeof(OEMCrypto_Generate_RSA_Signature_Fuzz)) { + return 0; + } + + // Copy data to fuzzed structure. + memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); + // Creates wrapped rsa key and calls load drm private key. + static OEMCryptoLicenseAPIFuzz license_api_fuzz; + // We cannot allocate buffers of random huge lengths in memory. + // This also slows down the fuzzer. + size_t signature_length = + std::min(MAX_FUZZ_SIGNATURE_LENGTH, fuzzed_structure.signature_length); + vector signature(signature_length); + OEMCrypto_GenerateRSASignature( + license_api_fuzz.session()->session_id(), data + sizeof(fuzzed_structure), + size - sizeof(fuzzed_structure), signature.data(), &signature_length, + fuzzed_structure.padding_scheme); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc new file mode 100644 index 00000000..e36d5508 --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc @@ -0,0 +1,61 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "log.h" +#include "oemcrypto_fuzz_helper.h" +#include "oemcrypto_fuzz_structs.h" +#include "oemcrypto_types.h" + +namespace wvoec { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + // Split data using separator. + auto inputs = SplitInput(data, size); + if (inputs.size() < 2) { + return 0; + } + + OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size() < sizeof(fuzzed_structure)) { + return 0; + } + // Copy OEMCrypto_Generic_Api_Fuzz from input data. + memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); + ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + &fuzzed_structure.cipher_mode); + ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + &fuzzed_structure.algorithm); + + // Copy iv from input data. + size_t iv_size = inputs[0].size() - sizeof(fuzzed_structure); + if (iv_size == 0) { + return 0; + } + vector iv(iv_size); + memcpy(iv.data(), data + sizeof(fuzzed_structure), iv_size); + + // Copy clear buffer from input data. + vector encrypted_buffer(inputs[1].size()); + vector clear_buffer(inputs[1].size()); + memcpy(encrypted_buffer.data(), inputs[1].data(), inputs[1].size()); + + OEMCryptoLicenseAPIFuzz license_api_fuzz; + Session* session = license_api_fuzz.session(); + // Load license and call generic_decrypt API. + license_api_fuzz.LoadLicense(); + OEMCryptoResult sts = OEMCrypto_SelectKey( + session->session_id(), session->license().keys[0].key_id, + session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); + OEMCrypto_Generic_Decrypt(session->session_id(), encrypted_buffer.data(), + encrypted_buffer.size(), iv.data(), + fuzzed_structure.algorithm, clear_buffer.data()); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc new file mode 100644 index 00000000..df0a35e9 --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc @@ -0,0 +1,61 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "log.h" +#include "oemcrypto_fuzz_helper.h" +#include "oemcrypto_fuzz_structs.h" +#include "oemcrypto_types.h" + +namespace wvoec { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + // Split data using separator. + auto inputs = SplitInput(data, size); + if (inputs.size() < 2) { + return 0; + } + + OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size() < sizeof(fuzzed_structure)) { + return 0; + } + // Copy OEMCrypto_Generic_Api_Fuzz from input data. + memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); + ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + &fuzzed_structure.cipher_mode); + ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + &fuzzed_structure.algorithm); + + // Copy iv from input data. + size_t iv_size = inputs[0].size() - sizeof(fuzzed_structure); + if (iv_size == 0) { + return 0; + } + vector iv(iv_size); + memcpy(iv.data(), data + sizeof(fuzzed_structure), iv_size); + + // Copy clear buffer from input data. + vector clear_buffer(inputs[1].size()); + vector encrypted_buffer(inputs[1].size()); + memcpy(clear_buffer.data(), inputs[1].data(), inputs[1].size()); + + OEMCryptoLicenseAPIFuzz license_api_fuzz; + Session* session = license_api_fuzz.session(); + // Load license and call generic_encrypt API. + license_api_fuzz.LoadLicense(); + OEMCryptoResult sts = OEMCrypto_SelectKey( + session->session_id(), session->license().keys[0].key_id, + session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); + OEMCrypto_Generic_Encrypt( + session->session_id(), clear_buffer.data(), clear_buffer.size(), + iv.data(), fuzzed_structure.algorithm, encrypted_buffer.data()); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc new file mode 100644 index 00000000..d27415d1 --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "OEMCryptoCENC.h" +#include "log.h" +#include "oemcrypto_fuzz_helper.h" +#include "oemcrypto_fuzz_structs.h" +#include "oemcrypto_types.h" + +namespace wvoec { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { + return 0; + } + // Copy OEMCrypto_Generic_Api_Fuzz from input data. + memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); + ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + &fuzzed_structure.cipher_mode); + ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + &fuzzed_structure.algorithm); + + size_t clear_buffer_size = size - sizeof(fuzzed_structure); + if (clear_buffer_size == 0) { + return 0; + } + // Copy clear buffer from input data. + vector clear_buffer(clear_buffer_size); + memcpy(clear_buffer.data(), data + sizeof(fuzzed_structure), + clear_buffer_size); + + OEMCryptoLicenseAPIFuzz license_api_fuzz; + Session* session = license_api_fuzz.session(); + // Load license and call generic_sign API. + license_api_fuzz.LoadLicense(); + OEMCryptoResult sts = OEMCrypto_SelectKey( + session->session_id(), session->license().keys[0].key_id, + session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); + CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); + size_t signature_length = 0; + OEMCrypto_Generic_Sign(session->session_id(), clear_buffer.data(), + clear_buffer.size(), fuzzed_structure.algorithm, + nullptr, &signature_length); + vector signature(signature_length); + OEMCrypto_Generic_Sign(session->session_id(), clear_buffer.data(), + clear_buffer.size(), fuzzed_structure.algorithm, + signature.data(), &signature_length); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc new file mode 100644 index 00000000..076d3caa --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc @@ -0,0 +1,67 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include +#include + +#include "OEMCryptoCENC.h" +#include "log.h" +#include "oemcrypto_fuzz_helper.h" +#include "oemcrypto_fuzz_structs.h" +#include "oemcrypto_types.h" + +namespace wvoec { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + OEMCrypto_Generic_Verify_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { + return 0; + } + // Copy OEMCrypto_Generic_Verify_Fuzz from input data. + memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); + ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + &fuzzed_structure.cipher_mode); + ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + &fuzzed_structure.algorithm); + + size_t in_buffer_size = size - sizeof(fuzzed_structure); + if (in_buffer_size == 0) { + return 0; + } + // Copy clear buffer from input data. + vector in_buffer(in_buffer_size); + memcpy(in_buffer.data(), data + sizeof(fuzzed_structure), in_buffer_size); + + OEMCryptoLicenseAPIFuzz license_api_fuzz; + Session* session = license_api_fuzz.session(); + // Load license and call generic_verify API. + license_api_fuzz.LoadLicense(); + OEMCrypto_SelectKey(session->session_id(), session->license().keys[0].key_id, + session->license().keys[0].key_id_length, + OEMCrypto_CipherMode_CTR); + // Calculate signature for in buffer. + size_t signature_length = 0; + OEMCrypto_Generic_Sign(session->session_id(), in_buffer.data(), + in_buffer.size(), fuzzed_structure.algorithm, nullptr, + &signature_length); + vector signature(signature_length); + OEMCrypto_Generic_Sign(session->session_id(), in_buffer.data(), + in_buffer.size(), fuzzed_structure.algorithm, + signature.data(), &signature_length); + + OEMCrypto_SelectKey(session->session_id(), session->license().keys[0].key_id, + session->license().keys[0].key_id_length, + fuzzed_structure.cipher_mode); + signature_length = + std::min(MAX_FUZZ_SIGNATURE_LENGTH, fuzzed_structure.signature_length); + signature.resize(signature_length); + OEMCrypto_Generic_Verify(session->session_id(), in_buffer.data(), + in_buffer.size(), fuzzed_structure.algorithm, + signature.data(), signature_length); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc new file mode 100644 index 00000000..ed47b0b2 --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc @@ -0,0 +1,61 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace wvoec { +LicenseWithUsageEntryFuzz entry; +// The custom mutator to mutate created encrypted usage entry. +extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, + size_t max_size, unsigned int seed) { + entry.CreateUsageTableHeader(); + Session* s = entry.license_messages().session(); + s->open(); + entry.InstallTestRSAKey(s); + uint32_t usage_entry_number = 0; + memcpy(&usage_entry_number, data, sizeof(uint32_t)); + if (OEMCrypto_LoadUsageEntry(s->session_id(), usage_entry_number, + data + sizeof(uint32_t), + size - sizeof(uint32_t)) != OEMCrypto_SUCCESS) { + s->CreateNewUsageEntry(); + vector encrypted_usage_header; + s->UpdateUsageEntry(&encrypted_usage_header); + vector encrypted_usage_entry = s->encrypted_usage_entry(); + usage_entry_number = s->usage_entry_number(); + // Copy created usage entry number and usage entry to data and mutate it. + memcpy(data, &usage_entry_number, sizeof(uint32_t)); + memcpy(data + sizeof(uint32_t), encrypted_usage_entry.data(), + encrypted_usage_entry.size()); + size = sizeof(uint32_t) + encrypted_usage_entry.size(); + } + s->close(); + return LLVMFuzzerMutate(data, size, max_size); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + uint32_t usage_entry_number = 0; + if (size < sizeof(usage_entry_number)) { + return 0; + } + + memcpy(&usage_entry_number, data, sizeof(usage_entry_number)); + const uint8_t* extra_data = data + sizeof(usage_entry_number); + size_t extra_data_size = size - sizeof(usage_entry_number); + if (extra_data_size == 0) { + return 0; + } + + Session s; + s.open(); + OEMCrypto_LoadUsageEntry(s.session_id(), usage_entry_number, extra_data, + extra_data_size); + s.close(); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc new file mode 100644 index 00000000..8d3000af --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc @@ -0,0 +1,36 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace wvoec { + +// The custom mutator to mutate created encrypted usage table header. +extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, + size_t max_size, unsigned int seed) { + LicenseWithUsageEntryFuzz entry; + if (OEMCrypto_LoadUsageTableHeader(data, size) != OEMCrypto_SUCCESS) { + entry.CreateUsageTableHeader(); + if (size < entry.encrypted_usage_header().size()) { + return 0; + } + // Copy created usage table header to data and mutate it. + memcpy(data, entry.encrypted_usage_header().data(), + entry.encrypted_usage_header().size()); + size = entry.encrypted_usage_header().size(); + } + return LLVMFuzzerMutate(data, size, max_size); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + // Initialize OEMCrypto and call API. + InitializeFuzz initialize_fuzz; + OEMCrypto_LoadUsageTableHeader(data, size); + return 0; +} +} // namespace wvoec diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_odkitee_dispatcher_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc similarity index 50% rename from libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_odkitee_dispatcher_fuzz.cc rename to libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc index 1a3c770b..3fae8e6c 100644 --- a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_odkitee_dispatcher_fuzz.cc +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc @@ -1,23 +1,15 @@ #include +#include -#include "dispatcher.h" -#include "marshaller_base.h" -#include "transport_interface.h" +#include "opk_dispatcher.h" +#include "opk_init.h" +#include "tos_transport_interface.h" namespace wvoec { -void InitializeODKMessage(ODK_Message* message, uint8_t* data, size_t size) { - ODK_Message_Impl* impl = (ODK_Message_Impl*)message; - impl->base = data; - impl->size = size; - impl->capacity = size; - impl->read_offset = 0; - impl->status = MESSAGE_STATUS_OK; -} - void OpenOEMCryptoTASession() { ODK_Message request; - ODK_Message* response = NULL; + ODK_Message response; uint8_t response_buffer[0x1000]; uint8_t request_body[] = { 0x06, // TAG_UINT32 @@ -26,16 +18,13 @@ void OpenOEMCryptoTASession() { 0x00, // value (false) 0x0a // TAG_EOM }; - - InitializeODKMessage(&request, request_body, sizeof(request_body)); - - ODK_DispatchMessage(&request, &response); - if (response != NULL) ODK_Transport_DeallocateMessage(response); + request = ODK_Message_Create(request_body, sizeof(request_body)); + OPK_DispatchMessage(&request, &response); } void InitializeOEMCryptoTA() { ODK_Message init_request; - ODK_Message* init_response = NULL; + ODK_Message init_response; uint8_t response_buffer[0x1000]; uint8_t init_request_body[] = { 0x06, // TAG_UINT32 @@ -43,15 +32,13 @@ void InitializeOEMCryptoTA() { 0x0a // TAG_EOM }; - InitializeODKMessage(&init_request, init_request_body, - sizeof(init_request_body)); - - ODK_DispatchMessage(&init_request, &init_response); - if (init_response != NULL) ODK_Transport_DeallocateMessage(init_response); + init_request = + ODK_Message_Create(init_request_body, sizeof(init_request_body)); + OPK_DispatchMessage(&init_request, &init_response); } extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { - ODK_InitializeDispatcher(); + OPK_Initialize(); InitializeOEMCryptoTA(); OpenOEMCryptoTASession(); return 0; @@ -59,16 +46,14 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { ODK_Message request; - ODK_Message* response = NULL; + ODK_Message response; unsigned char response_buffer[0x1000]; uint8_t* input = new uint8_t[size]; memcpy(input, data, size); - InitializeODKMessage(&request, input, size); - - ODK_DispatchMessage(&request, &response); - if (response != NULL) ODK_Transport_DeallocateMessage(response); + request = ODK_Message_Create(input, size); + OPK_DispatchMessage(&request, &response); delete[] input; return 0; diff --git a/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc new file mode 100644 index 00000000..3b3813a8 --- /dev/null +++ b/libwvdrmengine/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc @@ -0,0 +1,46 @@ +// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include "oemcrypto_fuzz_helper.h" + +namespace wvoec { +const size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * MB; +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Redirect printf and log statements from oemcrypto functions to a file to + // reduce noise + RedirectStdoutToFile(); + + size_t pst_buffer_length = 0; + if (size <= sizeof(pst_buffer_length)) { + return 0; + } + + LicenseWithUsageEntryFuzz entry; + entry.CreateUsageTableHeader(); + // Open a session, create a usage entry. + Session* session = entry.license_messages().session(); + session->open(); + entry.InstallTestRSAKey(session); + session->GenerateNonce(); + session->CreateNewUsageEntry(); + vector encrypted_usage_header; + session->UpdateUsageEntry(&encrypted_usage_header); + // Sets pst for usage entry. + entry.LoadLicense(); + + memcpy(&pst_buffer_length, data, sizeof(pst_buffer_length)); + const uint8_t* extra_data = data + sizeof(pst_buffer_length); + size_t extra_data_size = size - sizeof(pst_buffer_length); + // We cannot allocate a huge buffer, hence limiting buffer size to + // MAX_FUZZ_PST_REPORT_BUFFER_LENGTH. + pst_buffer_length = + std::min(MAX_FUZZ_PST_REPORT_BUFFER_LENGTH, pst_buffer_length); + vector pst_report_buffer(pst_buffer_length); + // Call API with fuzzed pst_buffer_length, pst. + OEMCrypto_ReportUsage(session->session_id(), extra_data, extra_data_size, + pst_report_buffer.data(), &pst_buffer_length); + session->close(); + return 0; +} +} // namespace wvoec