From 3c628c8f27b3a4664522d36334d3534e0258ebff Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Tue, 11 Jul 2023 16:57:57 -0700 Subject: [PATCH] OEMCrypto v18.3 Updates to OEMCrypto API, OPK, ODK, and unit tests. See the file CHANGELOG.md for details. --- CHANGELOG.md | 55 + linux/src/file_store.cpp | 16 + linux/src/log.cpp | 2 +- oemcrypto/include/OEMCryptoCENC.h | 129 +- oemcrypto/odk/Android.bp | 1 + oemcrypto/odk/include/OEMCryptoCENCCommon.h | 8 +- oemcrypto/odk/include/core_message_features.h | 6 +- .../odk/include/core_message_serialize.h | 2 +- oemcrypto/odk/include/odk_structs.h | 47 +- .../odk/src/core_message_deserialize.cpp | 46 +- oemcrypto/odk/src/core_message_features.cpp | 2 +- oemcrypto/odk/src/core_message_serialize.cpp | 148 +- .../odk/src/core_message_serialize_proto.cpp | 28 +- oemcrypto/odk/src/odk.c | 237 +- oemcrypto/odk/src/odk_message.c | 12 +- oemcrypto/odk/src/odk_serialize.c | 295 +- oemcrypto/odk/src/odk_serialize.h | 13 +- oemcrypto/odk/src/odk_structs_priv.h | 41 +- oemcrypto/odk/src/odk_timer.c | 8 +- oemcrypto/odk/test/fuzzing/odk_fuzz.gyp | 2 +- .../odk/test/fuzzing/odk_fuzz_helper.cpp | 50 +- oemcrypto/odk/test/odk_core_message_test.cpp | 154 +- oemcrypto/odk/test/odk_golden_v16.cpp | 4132 +++++++++++++++ oemcrypto/odk/test/odk_golden_v17.cpp | 3846 ++++++++++++++ oemcrypto/odk/test/odk_golden_v18.cpp | 4574 +++++++++++++++++ oemcrypto/odk/test/odk_test.cpp | 180 +- oemcrypto/odk/test/odk_test.gypi | 3 + oemcrypto/opk/build/ree-sources.mk | 2 + oemcrypto/opk/build/tee-sources.mk | 1 + oemcrypto/opk/oemcrypto_ta/oemcrypto.c | 303 +- .../opk/oemcrypto_ta/oemcrypto_api_macros.h | 2 +- .../oemcrypto_key_control_block.c | 27 +- oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c | 1 - .../opk/oemcrypto_ta/oemcrypto_overflow.c | 10 + .../opk/oemcrypto_ta/oemcrypto_overflow.h | 8 + .../opk/oemcrypto_ta/oemcrypto_session.c | 24 +- .../opk/oemcrypto_ta/oemcrypto_usage_table.c | 12 +- .../oemcrypto_ta/wtpi/wtpi_config_interface.h | 20 - .../wtpi/wtpi_device_key_access_interface.h | 14 + .../wtpi_reference/config/default.h | 11 - .../oemcrypto_ta/wtpi_reference/cose_util.c | 117 +- .../oemcrypto_ta/wtpi_reference/crypto_util.c | 2 +- .../oemcrypto_ta/wtpi_reference/rsa_util.c | 3 +- .../oemcrypto_ta/wtpi_reference/wtpi_config.c | 9 - ...wtpi_crypto_and_key_management_layer1_hw.c | 10 + ...crypto_and_key_management_layer1_openssl.c | 17 +- .../wtpi_reference/wtpi_decrypt_sample.c | 7 +- .../wtpi_root_of_trust_layer1.c | 4 + .../wtpi_test/common/GEN_common_serializer.c | 1 - .../ree/GEN_oemcrypto_tee_test_api.c | 63 - .../wtpi_test/ree/GEN_ree_serializer.c | 122 +- .../wtpi_test/ree/GEN_ree_serializer.h | 5 - .../wtpi_test/tee/GEN_dispatcher.c | 60 +- .../wtpi_test/tee/GEN_tee_serializer.c | 115 +- .../wtpi_test/tee/GEN_tee_serializer.h | 4 - oemcrypto/opk/ports/linux/Makefile | 17 +- .../opk/ports/linux/common/posix_resources.h | 6 +- .../ports/linux/host/wtpi_unittests/Makefile | 6 +- oemcrypto/opk/ports/linux/rules.mk | 50 +- .../opk/ports/linux/ta/common/opk_config.h | 8 +- ...wtpi_crypto_and_key_management_layer2_hw.c | 3 +- oemcrypto/opk/ports/optee/Makefile | 18 +- .../optee/host/common/tos/optee_ree_tos.c | 11 +- oemcrypto/opk/ports/optee/host/rules.mk | 50 +- .../ta/common/wtpi_impl/asymmetric_key.h | 4 +- .../optee/ta/common/wtpi_impl/crypto_common.h | 4 +- .../optee/ta/common/wtpi_impl/opk_config.h | 4 +- .../optee/ta/common/wtpi_impl/sources.mk | 1 + .../ta/common/wtpi_impl/util/der_parse.h | 4 +- .../ta/common/wtpi_impl/util/device_info.c | 55 + .../ta/common/wtpi_impl/util/device_info.h | 20 + .../optee/ta/common/wtpi_impl/util/ta_log.h | 4 +- .../common/wtpi_impl/wtpi_cbor_deviceinfo.c | 44 +- .../wtpi_crypto_and_key_management_layer1.c | 2 +- .../common/wtpi_impl/wtpi_crypto_asymmetric.c | 2 - .../ta/common/wtpi_impl/wtpi_decrypt_sample.c | 3 +- .../ta/common/wtpi_impl/wtpi_provisioning_4.c | 51 +- .../opk/ports/optee/ta/oemcrypto_ta/Makefile | 2 + .../optee/ta/oemcrypto_ta/oemcrypto_ta.c | 4 +- .../opk/ports/optee/ta/oemcrypto_ta/sub.mk | 2 +- oemcrypto/opk/ports/optee/ta/rules.mk | 50 + .../opk/ports/optee/ta/wtpi_test_ta/Makefile | 2 + .../opk/ports/optee/ta/wtpi_test_ta/sub.mk | 3 + .../optee/ta/wtpi_test_ta/wtpi_test_ta.c | 4 +- oemcrypto/opk/ports/trusty/ta/README.md | 4 +- .../trusty/ta/reference/clang-tidy-inc.mk | 61 + .../trusty/ta/reference/include/opk_config.h | 4 +- .../interface_impls/wtpi_crypto_asymmetric.c | 374 -- .../interface_impls/wtpi_provisioning_4.c | 4 +- .../ta/reference/liboemcrypto/Application.mk | 2 + .../trusty/ta/reference/liboemcrypto/build.sh | 15 +- .../liboemcrypto/liboemcrypto-inc.mk | 12 +- .../opk/ports/trusty/ta/reference/rules.mk | 4 +- .../ports/trusty/ta/reference/secure_buffer.c | 4 +- .../ports/trusty/ta/reference/widevine_app.c | 2 - .../common/GEN_common_serializer.c | 1 - .../common/include/marshaller_base.h | 2 - .../common/include/opk_serialization_base.h | 2 +- .../opk/serialization/ree/GEN_oemcrypto_api.c | 68 +- .../serialization/ree/GEN_ree_serializer.c | 69 +- .../serialization/ree/GEN_ree_serializer.h | 10 +- .../opk/serialization/ree/ree_special_cases.c | 37 + .../opk/serialization/ree/ree_special_cases.h | 6 + .../opk/serialization/ree/special_case_apis.c | 34 + .../opk/serialization/tee/GEN_dispatcher.c | 45 +- .../serialization/tee/GEN_tee_serializer.c | 56 +- .../serialization/tee/GEN_tee_serializer.h | 10 +- .../tee/special_case_request_handlers.c | 48 + .../tee/special_case_request_handlers.h | 25 + oemcrypto/opk/serialization/tee/tee.gyp | 1 + .../opk/serialization/tee/tee_special_cases.c | 36 +- .../opk/serialization/tee/tee_special_cases.h | 5 + oemcrypto/opk/serialization/tee/tee_version.c | 30 +- oemcrypto/opk/setup.sh | 5 +- oemcrypto/test/GEN_api_lock_file.c | 3 + oemcrypto/test/common.mk | 2 + .../0c7e14c42a24845ff54356b92cc20a3f9e2e6498 | Bin 280 -> 0 bytes .../23ef7d98cdd44b07f7a582b24e44984a835aeb59 | Bin 0 -> 280 bytes .../b02efc63fc06ecac3df93523d2318ec8a67e8d21 | Bin 0 -> 280 bytes .../d936772829ba7bfac4b239053fcb7a622ff81203 | Bin 280 -> 0 bytes .../f8b4afb2db6344296026dad1cd863f04bab5f6b0 | Bin 0 -> 280 bytes .../fb094d421ad8099a07a15ae71060746b5ebcb129 | Bin 280 -> 0 bytes .../0020aada9920cca0f1ca3bba3835c57ba1b64722 | Bin 162 -> 0 bytes .../01940cb7d91a0378062e3c34c6959c08cc64bfa7 | Bin 128 -> 0 bytes .../0285ab6852dc82c1adee1ef77a6573df480161d7 | Bin 0 -> 368 bytes .../03705943a03b55af8796a85ef076751c1a35dab3 | Bin 0 -> 512 bytes .../03ddc96089c172b96ea359aa658b103e711b0824 | Bin 512 -> 0 bytes .../04124cff8b8ddc8f4f245b86f054d21bf6bf1118 | Bin 512 -> 0 bytes .../04f3c6813639af694f3b8752798ddff9bbfa5fea | Bin 0 -> 122 bytes .../0554387fba557ee5ad1222e62162d23733e507aa | Bin 162 -> 0 bytes ... 080308d9a78045272feb864835800f3c963e4110} | Bin 368 -> 368 bytes .../09064c11a50f1e5a7e3e561495aa4148c425ee41 | Bin 0 -> 288 bytes .../096509f3e835e6235b48d6fb33ce73093f2996dc | Bin 0 -> 162 bytes .../0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 | Bin 0 -> 122 bytes .../0b63f772494b90196d295375968a8da7f71add8c | Bin 162 -> 0 bytes .../0ffae4ac0412685f5278d748bf45f78c25dbed10 | Bin 122 -> 0 bytes .../10e69df82df7df7a5d3cffe390d5073a37527c78 | Bin 0 -> 368 bytes .../1121c84038be5099dc3ce3d2d69d5e8d0b094c98 | Bin 0 -> 406 bytes .../114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d | Bin 0 -> 288 bytes ... 11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5} | Bin 288 -> 288 bytes .../11c19b2cc104b1cf85422685340d5e917498ee16 | Bin 0 -> 852 bytes .../120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 | Bin 0 -> 341 bytes .../137d434df4e17271af719ad678e7e74edc284f18 | Bin 406 -> 0 bytes .../13bdd5f2dbf82567a92c2a30b9ef2310a02af361 | Bin 368 -> 0 bytes ... 14e06e7cea4686bdd83742f7f9d7b111c7b9aa21} | Bin 368 -> 368 bytes .../151941252771d6c9173ee1397d457db28bc20059 | Bin 0 -> 406 bytes .../1522db2eb65a0eafe367151d77b3a4dbfe65bee4 | Bin 0 -> 128 bytes .../1539088d12d235bba441c8fb46b54d839110cc38 | Bin 406 -> 0 bytes ... 161778100a4dcf30cb49fe57d0ed8cd55a1230ca} | Bin 288 -> 288 bytes ... 180835f71f4a9bfde27b61579c2a3a6d8d8e78ef} | Bin 852 -> 852 bytes .../188bc9339e5b42687067e26369840c9eca20703f | Bin 852 -> 0 bytes .../1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 | Bin 0 -> 341 bytes .../1b40e1b853761bf6db5deac7df38532d8199aee5 | Bin 341 -> 0 bytes .../1ba27988b89d8936e9237fb758059df1bc3ac36a | Bin 0 -> 288 bytes .../1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 | Bin 0 -> 512 bytes .../1be21d7100f97ffba5b208ee5715d2f7531f383b | Bin 0 -> 128 bytes ... 1efe003a4fc59c06e4e40756025e59753418e53e} | Bin 341 -> 341 bytes .../2001ea8811ed0ce164b49879561918ef3b43a78c | Bin 288 -> 0 bytes ... 2032071963b1e60dac0ccd91cbd564e3c9e26a63} | Bin 512 -> 512 bytes .../21f47f867c422f05c68997e44f395bf6d6d0c4b3 | Bin 0 -> 128 bytes .../249806515cd342087c40b0d529e68ea01e1b128e | Bin 0 -> 122 bytes .../27c685d38645723287ce2a36cf338aa3126ca787 | Bin 0 -> 122 bytes .../2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 | Bin 0 -> 512 bytes .../2aba87702e45624da9e76eb525b469231c67d5cf | Bin 341 -> 0 bytes .../2bacc4d5c23a6eedcf6781480e31a36022ca5962 | Bin 128 -> 0 bytes .../2d611b2f63d41a650304b2b6712496b8392c2659 | Bin 341 -> 0 bytes ... 2dce8534f57150afe93ca38282a60e6db0d0f7ab} | Bin 368 -> 368 bytes ... 2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0} | Bin 852 -> 852 bytes .../2e7e7652ce6f56d00ab740749d65a886172ad01a | Bin 0 -> 341 bytes .../308ecc136d6de9918abf890eef199d04df5bb2bb | Bin 341 -> 0 bytes .../30bc1ad7affa6c1e83b008e02d3d78e765b27a6c | Bin 0 -> 368 bytes .../3131b2f1c4628f9a979eb6f01861d75382f7273d | Bin 162 -> 0 bytes ... 31bff9cf9d33d5cb82882a4f4a9ec3565123cba3} | Bin 406 -> 406 bytes .../31cf7b90c83d6d4f1373d967fc7e230b13707cad | Bin 0 -> 162 bytes ... 325cc084469713e200c0af60c74292f395da6064} | Bin 368 -> 368 bytes .../337fde52cf8682af547dd23d8c0c4f47d41e168b | Bin 0 -> 128 bytes .../34aed6ffd3161dc96341772a0b081095fed4821a | Bin 512 -> 0 bytes .../34d51b3476208e187a14dbbea713c48e72eaca35 | Bin 162 -> 0 bytes .../35fe27def9bffe7aaca02f2d326b1109bd2c53e2 | Bin 512 -> 0 bytes ... 366aef68845adf6f2e1bcc4bc4928ff2e301aa06} | Bin 368 -> 368 bytes .../36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e | Bin 128 -> 0 bytes .../372062024cbde403d2c135674db50d3013718eca | Bin 0 -> 368 bytes .../38f06ab2029f7317904acba919fabdf25edc02ff | Bin 512 -> 0 bytes .../3abaedec5d45b91330b60a338f56906218ca1cbc | Bin 406 -> 0 bytes .../3c522e95e036fbedf884b59caba80f4d4a5eb9a9 | Bin 0 -> 162 bytes .../3cab0134e48bd02f3262515075806ebc5502b0cc | Bin 368 -> 0 bytes ... 3db0d75cfdb383714d6bb3c1d7ededaed2123be1} | Bin 512 -> 512 bytes ... 403143beed32fa7cd4255ff9153515713447605d} | Bin 406 -> 406 bytes .../4191139fe9afc02615ba9159bd3d35b6d6a7d073 | Bin 122 -> 0 bytes ... 42105d003732a222e40d25c877bd182983d1d07e} | Bin 852 -> 852 bytes .../4227fd95d3dc45067dc19e80c31eaf293c8afbee | Bin 852 -> 0 bytes .../437e26ba4817162fda786201e9f9348e8badf9fe | Bin 0 -> 341 bytes .../446ee48d8665b10ab1c51b4bb98c832d9fbd9d3a | Bin 128 -> 0 bytes .../456ce34099fe25289e165eaa1f93a94b8c0beee9 | Bin 0 -> 341 bytes .../4609e29ba8ece69cc08f7d93093768d9d3d959e4 | Bin 122 -> 0 bytes .../478e8789ac549a52ab303897c03676879ba014e2 | Bin 368 -> 0 bytes .../48bc8352918a8225afcb7c6990a9d68983fb22db | Bin 0 -> 341 bytes .../494214feb44b57cb9e592c1ed220e87e0809db86 | Bin 852 -> 0 bytes .../4a188fb2e329657694813f19d00d2634818ba22b | Bin 128 -> 0 bytes .../4a1e8694a2a9ef8f55364a473c3160a15b7e979e | Bin 0 -> 341 bytes ... 4badb31c370b762025e980d3d0e6e90dc0c4b22a} | Bin 368 -> 368 bytes .../4bda3ac6a2ed0e63735181845273e44ee096a02d | Bin 0 -> 368 bytes .../4be9a6a1a463c1babc2fc82de8b855c622227200 | Bin 0 -> 341 bytes ... 4c4b4ac81d0444b917c445c46f568e1ade6eebc8} | Bin 368 -> 368 bytes .../4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f | Bin 0 -> 512 bytes .../4e6ba7bcb6b209ae89e33fca8b04458f21983df0 | Bin 512 -> 0 bytes .../4e751fabb40fc3d2cd82d80acda4a60d3bffda45 | Bin 122 -> 0 bytes .../52c1fe05c67dd4caae0cc36ac41024600474e775 | Bin 0 -> 162 bytes .../541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 | Bin 368 -> 0 bytes .../565383265f1550107176113eb22943ad2178a731 | Bin 0 -> 288 bytes ... 569fe4adef9b529c33facecf2b14c320cebd820d} | Bin 512 -> 512 bytes .../5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 | Bin 406 -> 0 bytes .../584cafd42a17936992f68b152b2a7af0ac5695bb | Bin 0 -> 512 bytes .../58750d3a6ae389e16bab9c8a5eb8f444d4822a56 | Bin 368 -> 0 bytes ... 59ac68c41431dc78942624816ddaf1c9284b90a1} | Bin 512 -> 512 bytes .../59ca33a53cdcd43ca7bcfa317e6baa9e9274d5c4 | Bin 122 -> 0 bytes .../5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a | Bin 122 -> 0 bytes .../5c3a4b2851af7350171172b52b354049b77be5d5 | Bin 0 -> 406 bytes .../5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 | Bin 512 -> 0 bytes .../5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 | Bin 852 -> 0 bytes ... 5d15891a80d8172de682be6dace7f5bb300e4d36} | Bin 512 -> 512 bytes .../5f77b862460a773e87eca1a72d6ec68ed3a6b9db | Bin 122 -> 0 bytes .../6240d30abd265d95c08193edecbc06900eafbc92 | Bin 341 -> 0 bytes .../62a11e2f3482935ce23d81fa268c0094d5ad58e6 | Bin 288 -> 0 bytes .../649a785d4fa52fc0db4d90d51b084353ad1e6f6d | Bin 0 -> 406 bytes .../64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 | Bin 0 -> 512 bytes ... 65d11e1a8031645bd1bd1a21e1f1fa24e048999c} | Bin 406 -> 406 bytes .../6708bf88a56c292dd3c45abaa0e99314c4fddd9f | Bin 0 -> 122 bytes .../69ba9c487a8b2d6c4812a9a39d9e069265be4afa | Bin 341 -> 0 bytes .../69dd5d28b00400a20a1887ab5b655c4bb468f70f | Bin 0 -> 162 bytes .../6af75aec999c45b84de4d3247f791f1a63c4afe9 | Bin 341 -> 0 bytes .../6d020263a43603c5caa8f3274ed65dfc90e467d0 | Bin 0 -> 122 bytes .../6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 | Bin 288 -> 0 bytes ... 6f63549f4969ebcf0d8504159519f9b20cb259aa} | Bin 288 -> 288 bytes ... 70daf8991859146fff0f147d190594f07b2952b3} | Bin 368 -> 368 bytes ... 733b4e9024aa0f32227da45a08b12d0715ed0834} | Bin 406 -> 406 bytes .../73606d355e70125052bd75183dc0fbc658238788 | Bin 122 -> 0 bytes .../736dde51d09a2c4ff85d7b559d08176c951b07c8 | Bin 162 -> 0 bytes .../7530e1b5149d2f3931560cbecfa27895179fd279 | Bin 162 -> 0 bytes .../7691d3426449d4e2262b58f6be2c1018cd6d2e5f | Bin 341 -> 0 bytes .../790c61aca1614bd78a71ffd715b0498d2518dcd8 | Bin 122 -> 0 bytes .../7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 | Bin 0 -> 406 bytes .../7af21f77c85a086490b6447bcd70b2844b68101c | Bin 368 -> 0 bytes .../7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa | Bin 0 -> 852 bytes .../7c440058b109a6456c50bfc87cbbebd0360e51a0 | Bin 288 -> 0 bytes .../7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 | Bin 162 -> 0 bytes .../7e55089df762082a4d8d905f5cb1ef27d976eb38 | Bin 512 -> 0 bytes .../80a95f4446f5e696769fc1e738a6b9166f8880b3 | Bin 0 -> 122 bytes .../81dbdffe5f44dcae32cd958cbe8f3f451819d07a | Bin 128 -> 0 bytes .../82b8a9f56e65b3e2af929c4d62d95e7768850eb4 | Bin 128 -> 0 bytes .../82d659133954be19147475562b9ca11f4bcf2056 | Bin 0 -> 852 bytes ... 840a171b28b5c4d7b7b52d71a9926c8ad516fc0d} | Bin 368 -> 368 bytes .../8483cbe550b4c9343c3361935bc8d3a7c30b3ece | Bin 341 -> 0 bytes .../84c5d943ba95108d4072c7843df631bcbd177391 | Bin 341 -> 0 bytes .../84ff4cce4c529e07e5b68e143d54a665c5969534 | Bin 0 -> 128 bytes .../86638a56e2496c3c8cd2750db9b912956daaed1f | Bin 122 -> 0 bytes .../8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a | Bin 0 -> 368 bytes .../87bc4b02fd7544d306e8db2629ee73fda0e4d581 | Bin 0 -> 368 bytes .../87e457fd00f48571ecc482ca7ff96e3375869ac3 | Bin 0 -> 122 bytes .../8b15a9c75b3043040a90f28e84de28e436e023d7 | Bin 512 -> 0 bytes .../8b7a5c18731be9ba1c9d836667ec007a4169de23 | Bin 0 -> 162 bytes .../8d47cedfb8c23677b10651e05645ab8b1835b6c1 | Bin 0 -> 162 bytes .../8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa | Bin 852 -> 0 bytes .../8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 | Bin 0 -> 512 bytes ... 8f55993eb44bc293d662c18a407f915f03df1e9d} | Bin 512 -> 512 bytes .../901e4c6087322b69946ec8dd8d9fa401eebc826f | Bin 162 -> 0 bytes ... 903baaa085161d75d34d28dc743227c85f2f5b47} | Bin 406 -> 406 bytes .../905f7519227f6a03890b23f2d4fa1808912c1709 | Bin 0 -> 512 bytes .../950e3521352f0c27063a87618a490346f0a3c2f4 | Bin 512 -> 0 bytes .../96831b586053575d609e63674190dc3219b9a003 | Bin 0 -> 162 bytes .../96f9058e89bd44446e8f3e9f2eb62585668591f1 | Bin 0 -> 512 bytes .../970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 | Bin 0 -> 128 bytes .../97a3724c855e142691e1084ef45f02f614a032f4 | Bin 0 -> 512 bytes .../988fc98ea6e4416b30e99ab39cd70813dd9ff828 | Bin 0 -> 122 bytes .../9985d0be5ab329aaff9e18758af5cf7c2373b7f0 | Bin 0 -> 512 bytes .../9a0b17f115defca3c9b789ea768168d18497bead | Bin 0 -> 406 bytes .../9b75f20679a2ba1ef2163893322a81fe6c54a0cd | Bin 0 -> 128 bytes .../9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad | Bin 0 -> 341 bytes .../9df1116c393c752cd6640ae70709774d6bb96f37 | Bin 368 -> 0 bytes .../9e09a35f73eab1946a6b0db676e913c41222942a | Bin 852 -> 0 bytes .../9f05626c0ea01489c75f0493ec02c973098a3d41 | Bin 162 -> 0 bytes .../9f7fefbfe661e56b0c07e931851389b041692567 | Bin 0 -> 341 bytes .../9fa54bed19e057df5194cf2232117e86d3b6dc0b | Bin 0 -> 128 bytes .../a0cf2b857c3f281595d4eae2b0a95dfeac5659ce | Bin 288 -> 0 bytes .../a0d791df464e8a918a4995759714b191f9a2930e | Bin 0 -> 512 bytes .../a24f216f0ae2ae501bdd21cc9766ad46d51dce9f | Bin 0 -> 368 bytes .../a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe | Bin 0 -> 368 bytes .../a667500363948869dfc72acbd781e14d0dcfd56c | Bin 0 -> 368 bytes .../a8a356518396fa5b41de3c2e9359b1a906c8ce12 | Bin 0 -> 512 bytes .../a94aa8ced89b824652465e60330e474dc5a5ac15 | Bin 406 -> 0 bytes .../a99f51d8c51e9e70c6f5ef45702379aace415853 | Bin 368 -> 0 bytes .../a9d9462a602e9e54ebe86ad523a4cf509202239b | Bin 0 -> 162 bytes .../aacbeaf7eadf2c9354f8b5cef48604212008eb33 | Bin 0 -> 288 bytes .../ac592ee43e003afa088bb5effbdc4679476e06a5 | Bin 512 -> 0 bytes .../ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 | Bin 0 -> 368 bytes .../ade91aa40b8684929b4f3fe13632a09335f0767c | Bin 288 -> 0 bytes ... adfd0ced22d4b14d9472dd39ef6ada4137180844} | Bin 368 -> 368 bytes ... ae4904456f7c98fa460127cad5722629eaf375b7} | Bin 288 -> 288 bytes .../b0405d219290369a7507d9a9a4096209855ece5b | Bin 122 -> 0 bytes .../b0671a9ca0688908c35b0197bda0ff7cd91a7802 | Bin 0 -> 368 bytes .../b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d | Bin 128 -> 0 bytes .../b147ac2fd9218077a901f82afcbbbd71a032be28 | Bin 0 -> 341 bytes .../b33349107da622826c0de5883dfd2bc8adfb51f5 | Bin 288 -> 0 bytes .../b3ae974d2558a81d2ce7f10caacced4f1f47c533 | Bin 0 -> 122 bytes ... b428deb46505b6dddd37f4e68312096200804f1c} | Bin 852 -> 852 bytes .../b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 | Bin 0 -> 852 bytes .../b53b0c974f3296788ed15885cdd393c19eaa833a | Bin 0 -> 162 bytes .../b572c5d6854c1a5048682c66e8856e9d36e7432d | Bin 0 -> 406 bytes ... b7360deec7bff31dae35d0dbdd8de5d275f1191a} | Bin 288 -> 288 bytes .../ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 | Bin 0 -> 288 bytes .../baf88bf2463826c84b748aabdce12a406870f43a | Bin 341 -> 0 bytes .../bc08741066ebc87d7d46ef6a5984971ae6186fa2 | Bin 0 -> 162 bytes .../bd2a9a445ebf80d33d947a94ef007d9da69fdd63 | Bin 128 -> 0 bytes .../be836532b3c69821faecb2ee70da56687e442c36 | Bin 852 -> 0 bytes .../c04f75d30fdacb872a5bd369634ee4de4267661e | Bin 512 -> 0 bytes .../c195fa7da39afc1bf330ae04bce401bb200b5aef | Bin 0 -> 128 bytes .../c2ab467b1f82ebbb4a595a34ed4688640acd67db | Bin 162 -> 0 bytes .../c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 | Bin 512 -> 0 bytes .../c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 | Bin 0 -> 162 bytes .../c46552eb7f6937cb598ae6ffc76964f7ae2364bc | Bin 162 -> 0 bytes .../c5ebff5a561cbc77637919c5235a95246c755c15 | Bin 162 -> 0 bytes .../c613e9ab2b629c7b897975460e5c33e8ac1a2232 | Bin 128 -> 0 bytes .../c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 | Bin 0 -> 512 bytes .../ca9956ae8e38e999ec3c5113d8b05888aad6ce25 | Bin 0 -> 162 bytes .../cad65bde385d438eac3f1b3b54d9735c3ea1c475 | Bin 0 -> 122 bytes .../cb295c43921dc4bad7ea292e4b5dae704a18bc1f | Bin 0 -> 341 bytes .../cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c | Bin 0 -> 341 bytes .../cd0ed0742b01b47f64707b0ceae55e4bddc8a53e | Bin 341 -> 0 bytes .../d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 | Bin 122 -> 0 bytes .../d32eb599a72c10c702179987c3bf9162c44e1a96 | Bin 0 -> 128 bytes .../d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 | Bin 0 -> 122 bytes .../d4be74f6acbd8a4ee481ce49a35659f7f3549e06 | Bin 0 -> 162 bytes .../d53171a36056241ea76c8ae089770d740241ab4b | Bin 0 -> 128 bytes .../d5cf79b024f393643248821250f7042caa74b33e | Bin 406 -> 0 bytes .../d6210463c5504048832ec428987ae12196879dbf | Bin 0 -> 368 bytes .../d7041c3322321256350b0295456d933798b89c3b | Bin 0 -> 288 bytes .../d7c21613ad6684dc73e1515178d0cfcbffea1df2 | Bin 368 -> 0 bytes .../d7ef40b0ea62d59bc4c8d1525aa3ee0ca5444532 | Bin 122 -> 0 bytes .../d8569cb9f35686a68ea12980ffcf452f9fceb5aa | Bin 0 -> 852 bytes ... d8e9a0bc4f923e9276f3d46b82662735a9a29ef5} | Bin 368 -> 368 bytes .../d9833213bb3e03d7894ffb4016188d4afc4411b4 | Bin 341 -> 0 bytes .../da19453351c3c97a6638c6459d5e6d52530ef2b0 | Bin 0 -> 368 bytes .../dacb7f933d8091949eb58a1d4742d63852b4940d | Bin 0 -> 852 bytes .../db05326428a371755ad51eacbdce730d9fdfeb4e | Bin 0 -> 512 bytes .../db83511a3ced2c03600163abf429f3a68a2c419d | Bin 128 -> 0 bytes .../dc30a02c1536990acb36cb29373edbc7ad6637cd | Bin 0 -> 288 bytes .../dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f | Bin 512 -> 0 bytes .../dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d | Bin 0 -> 128 bytes .../e0282b8026051307d6821f4214fd732a82d2ca14 | Bin 0 -> 128 bytes .../e0a42c3dd45b6b2b1af036784202c319ca10f146 | Bin 0 -> 122 bytes .../e1542bc7ccdc101ae6a8051e6460fd5005097f79 | Bin 128 -> 0 bytes .../e1d142ea43c04e41b757f01d8987dd6af069a463 | Bin 368 -> 0 bytes .../e3e502902e40348546d1352eaba467591b3df7f4 | Bin 406 -> 0 bytes .../e43bf4879aa0837380a0d93342b30a193c4af677 | Bin 162 -> 0 bytes .../e564ac5e15a78f795629ab31a8a88e91898095a1 | Bin 368 -> 0 bytes .../e751c0f21a9ebccab51d453d0fe32f249e632070 | Bin 368 -> 0 bytes .../e7d4d0e761252d3de02e3d5c9f98cbc4920ff445 | Bin 368 -> 0 bytes .../e8216eb21330e411b6aca3fd6803bb61a7808483 | Bin 512 -> 0 bytes .../e9019d481211e8c40574ccc15907bd89922381e6 | Bin 0 -> 368 bytes .../e914b2a8555bb893176180e01044325cfc2f8bf1 | Bin 406 -> 0 bytes .../e974276349af1ab8387631f597bfba994bd5da9c | Bin 0 -> 852 bytes .../eb533db3c1a3fb6e75363004769aab5a45dedddb | Bin 0 -> 512 bytes ... ee63e1eec358c118f02bc9a0f426cd9df72fabf1} | Bin 512 -> 512 bytes .../ef880a270034e0f210254f3f3574bca5cfe13b54 | Bin 128 -> 0 bytes .../f0950c0364b9ab5aa1aa584c183098f262817088 | Bin 128 -> 0 bytes .../f2b4023c8bafb4c2423751ee5e070eca4026c050 | Bin 288 -> 0 bytes .../f2db36b7af0430c073936a17a9005dc45265ff3b | Bin 0 -> 406 bytes .../f31d50d032713c24334c3ca21cffc16c5fa2cc0a | Bin 406 -> 0 bytes .../f4432c2a09512441123fd68f6ee3ede217067444 | Bin 512 -> 0 bytes .../f61ea517b82990485bff8a973a91a717d1a6bf94 | Bin 122 -> 0 bytes .../f64d8aac4b4c11f8226965fa11a2cfb4295f7987 | Bin 0 -> 122 bytes .../f85ac377234f5f7b4b15ace9365eefae27881876 | Bin 0 -> 128 bytes .../f860eb559bcb2592b50273cf176aab4c624ab387 | Bin 288 -> 0 bytes .../f8eec32608e9d330b3973576735646427a6731f8 | Bin 0 -> 512 bytes .../fb655444ed95def5326f642c7ac3a6a7e7cae5de | Bin 0 -> 406 bytes .../fba13dc4063739e6d3b1651a742cfb80e5053fdf | Bin 0 -> 288 bytes .../fd63517f1edf14196b80b795c08995f3a4cdbd35 | Bin 0 -> 368 bytes ... feabcbfd6a97b797941d0989be77e8156a75a02e} | Bin 852 -> 852 bytes .../ffc43d4749a49d8db8fb96d498a34bbb62af2e0e | Bin 512 -> 0 bytes .../02e3dc401871be9b4fcbf6dfd658842567ca7c1c | Bin 0 -> 178 bytes .../6c6a072aa58399454ee759bac539109a20f7e97f | Bin 188 -> 0 bytes .../75ae4c5769c9568d631452df3b3702d876e4863a | Bin 178 -> 0 bytes .../9bdb356ec50807b86c807c09c780267101fd1a0b | Bin 178 -> 0 bytes .../9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc | Bin 0 -> 188 bytes .../b0b757465797a5e49307b325481c338ddb591afa | Bin 0 -> 188 bytes .../d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 | Bin 0 -> 188 bytes .../898b59f382a227ba7f3977fabeecce928a1c8f33 | Bin 0 -> 188 bytes .../94dde36e88bca50f24c228c5e5e9811c711a1b49 | Bin 0 -> 168 bytes ... 080255be6f3f6d8f95f8779116af43da3c7c7fe1} | Bin 204 -> 204 bytes .../3f4491c53865cf9d8975423626980c1a5d547dae | Bin 0 -> 204 bytes .../401f966cf4d9f594cd993c9e429833ae2b298f2b | Bin 0 -> 205 bytes .../44c74993d4832e49d818af03c8469ceb6482802f | Bin 0 -> 204 bytes .../6a7338ef51621a3936d362be039348682d3f42bc | Bin 0 -> 204 bytes .../7196add7d06e51a0b6a583581f81dac29df69f7b | Bin 0 -> 204 bytes ... 76a08035bc9c0772c895b73439a9d19d84737744} | Bin 203 -> 203 bytes .../78c3819333632152791a0a58eacbd67ca19abc4e | Bin 0 -> 204 bytes .../814054a30f7cdc10e4d83e48e6a5b00becf46cf1 | Bin 0 -> 205 bytes .../8c4ea32a7996921e51ec7717035f2826eb9d0853 | Bin 0 -> 204 bytes .../9628ef383581ef1f7591d4316fd75276959c2cab | Bin 0 -> 204 bytes .../9b80edcb955ebf5d52f0e9c754a51aafd03a032d | Bin 0 -> 204 bytes .../a5c27f614414c51fafa12bbc298f061d111ac5dd | Bin 0 -> 204 bytes .../a6873ce79ac837648b62cf89f6c568706ac00c99 | Bin 0 -> 204 bytes .../b93ff0791e1995e5014d1b717afda122e6ade75f | Bin 0 -> 204 bytes .../c179fc48504dbe00aa946d65d71e2a0165423b2f | Bin 0 -> 203 bytes .../cf7792686f978e3b5c6105d97a3a7c9837368f0d | Bin 0 -> 204 bytes .../e007898e3ade64f83149acb974f39b00ed05cde4 | Bin 0 -> 204 bytes .../04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 | Bin 0 -> 772 bytes .../0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c | Bin 0 -> 772 bytes .../1bac9ff28790816e80d3f7f2c87f72c3d5485987 | Bin 0 -> 772 bytes .../1c2e50d75ca628b62b3b05ffe17dcb0bd815074d | Bin 0 -> 772 bytes .../26dd022e20552f6c36def4f19eed5954e9ecbf08 | Bin 0 -> 772 bytes .../2b900789bbacbb6581ce5eb82cb32c845b74ac01 | Bin 0 -> 772 bytes .../2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc | Bin 0 -> 772 bytes .../3063b747267c41526835726740e2752b0efd277a | Bin 0 -> 772 bytes .../46e509ae9a53927b3c36f04c17cc4bffb9d63619 | Bin 0 -> 772 bytes .../4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe | Bin 0 -> 772 bytes .../4e8535ce0b1c5294f35d4f957effef1532ac6560 | Bin 0 -> 772 bytes .../54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a | Bin 0 -> 772 bytes .../5d798c32f5c1e458077509799531cca5ac956343 | Bin 0 -> 772 bytes .../6008f01a62c84227dab6dd3187b4107465ebca14 | Bin 0 -> 772 bytes .../60d8d9532b4dae783871f1befc1a71da4caa8405 | Bin 0 -> 772 bytes .../60df090dd8440f5b29c173fc04e6ac4fd83fcfbf | Bin 0 -> 772 bytes .../67eb049639b91a7ad90147c323f4494d21ad92af | Bin 0 -> 772 bytes .../6aeafb823a606e97ab896a5fde5b2e771b1ddd86 | Bin 0 -> 772 bytes .../6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 | Bin 676 -> 0 bytes .../714731f02b06f331811f54cd92dede72377d6e7e | Bin 0 -> 772 bytes .../72a401ddc314e9cdf3cd79080610a57cfedc47ad | Bin 0 -> 772 bytes .../7997b5673d5a9402b2f8acc43f92cdf6ad1f913d | Bin 676 -> 0 bytes .../8196b2365ca56224853dfeeddde216b4f467f0dd | Bin 676 -> 0 bytes .../81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 | Bin 676 -> 0 bytes .../81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 | Bin 0 -> 772 bytes .../8479d72571edf5016e1ea108d9fe5cde9aefb212 | Bin 0 -> 772 bytes .../92ebd373b454fa4569a884216e0382de5505a629 | Bin 0 -> 772 bytes .../93cd53951a9d66d88c5f67223becf152b59fcbdc | Bin 0 -> 772 bytes .../9808dd01e64b4afef70b73e36c4b535dd1cc66c5 | Bin 0 -> 772 bytes .../a5c1794fbf1849e99591df8932fdd396605e9738 | Bin 0 -> 772 bytes .../a5df528e8b43462969b8b861342a1d61a0974275 | Bin 0 -> 772 bytes .../ae43d3634880e8325da476ab4544faaff31d3165 | Bin 0 -> 772 bytes .../b64e63f278751a31b4bb63044b680811b0f6bcc9 | Bin 0 -> 772 bytes .../bd1b8656218819db11065037bc8681fd2a113bf3 | Bin 0 -> 772 bytes .../bd5fb0e7e72fb293d516857246e3b94941b76517 | Bin 0 -> 772 bytes .../d6350f4e6eaff1726c48e6b283bbeae4f5b30468 | Bin 0 -> 772 bytes .../dd618d63065009c9812b2834e623ae90cd363c1a | Bin 0 -> 772 bytes .../debf636b4ae4c2b7ce3a14e866777e4a1bc10594 | Bin 0 -> 772 bytes .../e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 | Bin 0 -> 772 bytes .../e4913cf245772fc597307400caa868f3da21a8f6 | Bin 0 -> 772 bytes .../e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 | Bin 0 -> 772 bytes .../eb9d4867ea92f1abccb3495e9976bbd297df3f82 | Bin 0 -> 772 bytes .../0567e5f52c00fed0ad7858164434b02d8e629064 | Bin 6648 -> 0 bytes ... 06ae1005d93d4a19b67d090a020ae37db54e6e3e} | Bin 6648 -> 4288 bytes .../0f5cc252aaf43eaa1570ca07d174a0f96333c592 | Bin 6648 -> 0 bytes .../0fdcae4df7bc325099fb4b3b01a1c9290229f86c | Bin 6648 -> 0 bytes .../1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb | Bin 6648 -> 0 bytes .../2d7246bd48ed8b68599445c98bb822c87f86acd1 | Bin 6648 -> 0 bytes .../2f64b8ffa25844924fe24678067feee9be80f4ec | Bin 6648 -> 0 bytes .../3acf30d485a4370ceb8e64785094a50b768e1ca4 | Bin 6648 -> 0 bytes .../461c08228ae6a0eaa191d24eea1823b46f4a9d67 | Bin 6648 -> 0 bytes .../4b69b92f45febc4dbf5b8fb9a216a290ba51d478 | Bin 6648 -> 0 bytes .../5891055a8932cac4c24862377ab912ff6d775247 | Bin 0 -> 4288 bytes .../592f446db007b4db2d056983a7bb098bf021babe | Bin 0 -> 4288 bytes .../5db53de009652f61b1ed21ee988d0156ce287033 | Bin 6648 -> 0 bytes .../642df2594991f9b5720fce364d0001d8c56d3a89 | Bin 0 -> 4288 bytes .../6449230f671fe77b73dc6e0d40f542c0720628f2 | Bin 0 -> 4288 bytes .../78e527f05b03c2ecd8a0ffc2baeb5dab57088934 | Bin 6648 -> 0 bytes .../7e120b1ec852c448490b9b060a5f35deb486c360 | Bin 6648 -> 0 bytes .../7f701c0f31e68192bc8c829f343fa2326aa4d3dc | Bin 6648 -> 0 bytes ... 81d43836885e32dc8c2b187cb9545bd5c01dfef5} | Bin 6648 -> 4288 bytes .../8243212a7a7160c91e2f9717b855b568f9a34233 | Bin 6648 -> 0 bytes .../85bff933def1ce530a1febd93ef2890ed4bcdcb5 | Bin 6648 -> 0 bytes .../8aeedd64cffd1f59badda7c7e62150d0e7ed4065 | Bin 0 -> 4288 bytes .../903224efa0cc5213ac2aefdf1191d05c703343f6 | Bin 0 -> 4288 bytes .../a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 | Bin 6648 -> 0 bytes .../a3ea4b0c65a01f18d11ad39862b9ef501ed25423 | Bin 0 -> 4288 bytes .../a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 | Bin 0 -> 4288 bytes .../b26b7f292dee13cf6e0366f48ea199ee86a0c201 | Bin 0 -> 4288 bytes .../b452f7b6c615035d63a9825c5c17e049f54648ef | Bin 6648 -> 0 bytes .../bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff | Bin 0 -> 4288 bytes .../bb8c2201cf10fd7d24fc0c8009a44525f426b033 | Bin 6648 -> 0 bytes .../bd3c74122b8b6ba809feaa063c0e0caf081def4d | Bin 0 -> 4288 bytes ... bea0876bed5520626024667d4f9dc0a4f485aa76} | Bin 6648 -> 4288 bytes ... c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5} | Bin 6648 -> 4288 bytes .../c7a7cd07925450628efa677165d403510d89bf51 | Bin 6648 -> 0 bytes .../c862e8c9d33f4b01c20a9dc77849e5c5856f2474 | Bin 0 -> 4288 bytes .../c96ae0dca69ceb11a79855a19786a559d6b255e3 | Bin 0 -> 4288 bytes ...mcrypto_load_license_fuzz-5919435528601600 | Bin 6652 -> 0 bytes ... d0a0d8d0c842875b97e89957095af3c71f7e9744} | Bin 6648 -> 4288 bytes .../d7014f417415314dd83162570bcafd7935875f00 | Bin 6648 -> 0 bytes .../df85865da57cab1bcbf9a081b850c3c8525098f6 | Bin 0 -> 4288 bytes .../e44281948ed00f87ec981eb880561d983c0c16c3 | Bin 0 -> 4288 bytes .../e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 | Bin 6648 -> 0 bytes .../ecffb38d73f504442070cf4f754d9d2cd87a87d7 | Bin 0 -> 4288 bytes .../ef6f1be8c575823ab46f6cf0e38717809d180301 | Bin 0 -> 4288 bytes .../f0d0117a070069c19108d17b834c6aa44ba11ab2 | Bin 0 -> 4288 bytes .../fa7ec04e797198608d77692abd2c13e98e6e6d28 | Bin 0 -> 4288 bytes .../fuzz_tests/oemcrypto_copy_buffer_fuzz.cc | 32 +- ...te_and_remove_entitled_key_session_fuzz.cc | 40 +- .../oemcrypto_deactivate_usage_entry_fuzz.cc | 27 +- .../fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc | 58 +- .../fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc | 73 + .../test/fuzz_tests/oemcrypto_fuzz_helper.cc | 52 +- .../test/fuzz_tests/oemcrypto_fuzz_helper.h | 153 +- .../test/fuzz_tests/oemcrypto_fuzztests.gypi | 2 +- ...ypto_generate_certificate_key_pair_fuzz.cc | 95 + .../oemcrypto_generate_rsa_signature_fuzz.cc | 27 +- .../oemcrypto_generate_signature.cc | 37 - .../oemcrypto_generic_decrypt_fuzz.cc | 59 +- .../oemcrypto_generic_encrypt_fuzz.cc | 59 +- .../fuzz_tests/oemcrypto_generic_sign_fuzz.cc | 52 +- .../oemcrypto_generic_verify_fuzz.cc | 153 +- ...mcrypto_get_boot_certificate_chain_fuzz.cc | 41 + .../oemcrypto_get_device_information_fuzz.cc | 31 + ...ypto_get_device_signed_csr_payload_fuzz.cc | 50 + .../oemcrypto_get_key_handle_fuzz.cc | 47 + .../fuzz_tests/oemcrypto_get_random_fuzz.cc | 24 + .../oemcrypto_install_oem_private_key_fuzz.cc | 30 +- .../oemcrypto_license_request_fuzz.cc | 23 +- ...mcrypto_load_entitled_content_keys_fuzz.cc | 33 +- .../fuzz_tests/oemcrypto_load_license_fuzz.cc | 21 +- .../oemcrypto_load_provisioning_fuzz.cc | 15 +- .../fuzz_tests/oemcrypto_load_renewal_fuzz.cc | 36 +- .../oemcrypto_load_usage_entry_fuzz.cc | 56 +- .../oemcrypto_load_usage_table_header_fuzz.cc | 17 +- .../oemcrypto_move_usage_entry_fuzz.cc | 36 +- .../oemcrypto_opk_dispatcher_fuzz.cc | 6 +- .../fuzz_tests/oemcrypto_opk_fuzztests.gyp | 295 +- .../fuzz_tests/oemcrypto_opk_fuzztests.gypi | 5 +- .../oemcrypto_provisioning_request_fuzz.cc | 23 +- .../oemcrypto_query_key_control_fuzz.cc | 43 + .../oemcrypto_renewal_request_fuzz.cc | 22 +- .../fuzz_tests/oemcrypto_report_usage_fuzz.cc | 56 +- .../oemcrypto_reuse_usage_entry_fuzz.cc | 33 +- ...emcrypto_shrink_usage_table_header_fuzz.cc | 37 +- .../partner_oemcrypto_fuzztests.gyp | 271 +- .../partner_oemcrypto_fuzztests.gypi | 2 +- oemcrypto/test/oec_device_features.cpp | 23 +- oemcrypto/test/oec_session_util.cpp | 233 +- oemcrypto/test/oec_session_util.h | 72 +- oemcrypto/test/oemcrypto_basic_test.cpp | 5 +- oemcrypto/test/oemcrypto_cast_test.cpp | 977 ++++ oemcrypto/test/oemcrypto_cast_test.h | 228 + .../test/oemcrypto_corpus_generator_helper.h | 2 +- .../test/oemcrypto_generic_crypto_test.cpp | 577 +++ oemcrypto/test/oemcrypto_license_test.cpp | 166 + oemcrypto/test/oemcrypto_license_test.h | 50 +- .../test/oemcrypto_provisioning_test.cpp | 367 +- oemcrypto/test/oemcrypto_provisioning_test.h | 57 +- oemcrypto/test/oemcrypto_security_test.cpp | 27 + .../test/oemcrypto_session_tests_helper.cpp | 41 + .../test/oemcrypto_session_tests_helper.h | 2 + oemcrypto/test/oemcrypto_test.cpp | 2275 +------- oemcrypto/test/oemcrypto_test_android.cpp | 3 + oemcrypto/test/oemcrypto_unittests.gypi | 2 + oemcrypto/test/oemcrypto_usage_table_test.cpp | 37 +- oemcrypto/test/oemcrypto_usage_table_test.h | 42 - oemcrypto/util/src/oemcrypto_oem_cert.cpp | 4 +- oemcrypto/util/src/oemcrypto_rsa_key.cpp | 6 +- util/include/error_string_util.h | 11 - util/include/file_store.h | 1 + util/include/string_format.h | 5 + util/src/error_string_util.cpp | 171 - util/src/string_format.cpp | 23 +- util/test/file_store_unittest.cpp | 8 + util/test/test_sleep.cpp | 13 + util/test/test_sleep.h | 7 +- 564 files changed, 18757 insertions(+), 5276 deletions(-) create mode 100644 oemcrypto/odk/test/odk_golden_v16.cpp create mode 100644 oemcrypto/odk/test/odk_golden_v17.cpp create mode 100644 oemcrypto/odk/test/odk_golden_v18.cpp create mode 100644 oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c create mode 100644 oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h create mode 100644 oemcrypto/opk/ports/optee/ta/rules.mk create mode 100644 oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk delete mode 100644 oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c create mode 100644 oemcrypto/opk/serialization/tee/special_case_request_handlers.c create mode 100644 oemcrypto/opk/serialization/tee/special_case_request_handlers.h delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0020aada9920cca0f1ca3bba3835c57ba1b64722 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04124cff8b8ddc8f4f245b86f054d21bf6bf1118 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{0c3f5ede5008d158e079e71b676179175fcaf451 => 080308d9a78045272feb864835800f3c963e4110} (75%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{00d8703220de64723c9508d6fad24e9caca9b67c => 11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5} (55%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{02485b2bb1c97020e704aed055050a00d02362db => 14e06e7cea4686bdd83742f7f9d7b111c7b9aa21} (75%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{2dd14c72951c6ee8245c7e8d77a15eaec5d9839a => 161778100a4dcf30cb49fe57d0ed8cd55a1230ca} (55%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{634cbe7377cbd3358e239c185ccb6a4a78be3f27 => 180835f71f4a9bfde27b61579c2a3a6d8d8e78ef} (77%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/188bc9339e5b42687067e26369840c9eca20703f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{53a0b89316eedbd09f44336f493067c223d3afa0 => 1efe003a4fc59c06e4e40756025e59753418e53e} (75%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{1262bc5f3f1ecc414e8e21861e9d200c3b775e87 => 2032071963b1e60dac0ccd91cbd564e3c9e26a63} (79%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2d611b2f63d41a650304b2b6712496b8392c2659 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{bf813f09576ef5dc365d4fae65be63a3c14c2de0 => 2dce8534f57150afe93ca38282a60e6db0d0f7ab} (93%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{638c5864a20d1ca04ad06d3a77181479f477ee91 => 2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0} (77%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/308ecc136d6de9918abf890eef199d04df5bb2bb create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{bcf58b9cf74875a7b938460b19e703876c2b3067 => 31bff9cf9d33d5cb82882a4f4a9ec3565123cba3} (60%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{d77fa923d5ec1c125ca9347d1f97b24995737806 => 325cc084469713e200c0af60c74292f395da6064} (75%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34aed6ffd3161dc96341772a0b081095fed4821a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34d51b3476208e187a14dbbea713c48e72eaca35 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{4a5bc3e146138236be11224681b998194ec1ff9a => 366aef68845adf6f2e1bcc4bc4928ff2e301aa06} (75%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cab0134e48bd02f3262515075806ebc5502b0cc rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{236647fd79907186bba5d42ebcc90e62ea632872 => 3db0d75cfdb383714d6bb3c1d7ededaed2123be1} (79%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{3cd9a833ced641a1716ca14082589ce7ce2cbbb0 => 403143beed32fa7cd4255ff9153515713447605d} (60%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{97034a7defd7d47912f2353de7e816382562f038 => 42105d003732a222e40d25c877bd182983d1d07e} (77%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/446ee48d8665b10ab1c51b4bb98c832d9fbd9d3a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/494214feb44b57cb9e592c1ed220e87e0809db86 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 => 4badb31c370b762025e980d3d0e6e90dc0c4b22a} (93%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{348418909f835c0728dd2317f5117ec38fc1be08 => 4c4b4ac81d0444b917c445c46f568e1ade6eebc8} (75%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e751fabb40fc3d2cd82d80acda4a60d3bffda45 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{1094990c3689bc731ba000f7c144920750d254e3 => 569fe4adef9b529c33facecf2b14c320cebd820d} (79%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/58750d3a6ae389e16bab9c8a5eb8f444d4822a56 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 => 59ac68c41431dc78942624816ddaf1c9284b90a1} (79%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ca33a53cdcd43ca7bcfa317e6baa9e9274d5c4 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{4d0abf7562348a077076a31f67dab240996227e6 => 5d15891a80d8172de682be6dace7f5bb300e4d36} (79%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5f77b862460a773e87eca1a72d6ec68ed3a6b9db delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{1e148e9501ed59f5274e01ae905b2bf5db81ef79 => 65d11e1a8031645bd1bd1a21e1f1fa24e048999c} (60%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6af75aec999c45b84de4d3247f791f1a63c4afe9 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{67cd7db5d431fb1c35f96b0e8ce416d61cbfaa8b => 6f63549f4969ebcf0d8504159519f9b20cb259aa} (55%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{2a0036c5d91f99392a7c334090fcbab08a6fcdb1 => 70daf8991859146fff0f147d190594f07b2952b3} (93%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{b3554fe52837e96c0477f59c4574925959fa73b8 => 733b4e9024aa0f32227da45a08b12d0715ed0834} (60%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/73606d355e70125052bd75183dc0fbc658238788 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7530e1b5149d2f3931560cbecfa27895179fd279 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7691d3426449d4e2262b58f6be2c1018cd6d2e5f delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/790c61aca1614bd78a71ffd715b0498d2518dcd8 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7c440058b109a6456c50bfc87cbbebd0360e51a0 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7e55089df762082a4d8d905f5cb1ef27d976eb38 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{74395b056ddfc22160234e4a4616bf87e2159eda => 840a171b28b5c4d7b7b52d71a9926c8ad516fc0d} (93%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{596a7741bc1da115af7b9a5d9a38fdf109b7fcfc => 8f55993eb44bc293d662c18a407f915f03df1e9d} (79%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{17cf1e48c441638a2874088ac78b42e8c4cca286 => 903baaa085161d75d34d28dc743227c85f2f5b47} (60%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9df1116c393c752cd6640ae70709774d6bb96f37 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f05626c0ea01489c75f0493ec02c973098a3d41 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a94aa8ced89b824652465e60330e474dc5a5ac15 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ade91aa40b8684929b4f3fe13632a09335f0767c rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{c87d77a256014f0e9f443230be3cadf84b842da5 => adfd0ced22d4b14d9472dd39ef6ada4137180844} (52%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{2748bf06f5a71cc5f30fae9f957e537f39b2aa77 => ae4904456f7c98fa460127cad5722629eaf375b7} (55%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0405d219290369a7507d9a9a4096209855ece5b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b33349107da622826c0de5883dfd2bc8adfb51f5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{22e370faf486d5e245dcc33671bbf15910a5e91e => b428deb46505b6dddd37f4e68312096200804f1c} (77%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{892a862becababdcb28d2a893f3a2ce01abc16e4 => b7360deec7bff31dae35d0dbdd8de5d275f1191a} (55%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/baf88bf2463826c84b748aabdce12a406870f43a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bd2a9a445ebf80d33d947a94ef007d9da69fdd63 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c04f75d30fdacb872a5bd369634ee4de4267661e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7ef40b0ea62d59bc4c8d1525aa3ee0ca5444532 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{06703ef82d4a6446b3f0008ab5240a8007769563 => d8e9a0bc4f923e9276f3d46b82662735a9a29ef5} (75%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1542bc7ccdc101ae6a8051e6460fd5005097f79 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e751c0f21a9ebccab51d453d0fe32f249e632070 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e7d4d0e761252d3de02e3d5c9f98cbc4920ff445 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf => ee63e1eec358c118f02bc9a0f426cd9df72fabf1} (79%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ef880a270034e0f210254f3f3574bca5cfe13b54 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f0950c0364b9ab5aa1aa584c183098f262817088 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2b4023c8bafb4c2423751ee5e070eca4026c050 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/{adab987e21e9838b02e500658ea0818a18ac0403 => feabcbfd6a97b797941d0989be77e8156a75a02e} (77%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/{d1ef093f11c8e8c42da35501230bb7030067602e => 080255be6f3f6d8f95f8779116af43da3c7c7fe1} (71%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/{a94b2e9c5f7896643f5405d040cddacb15f8866a => 76a08035bc9c0772c895b73439a9d19d84737744} (71%) create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/{618cdf5927b2b092d9d7b5e93c30af8708270f11 => 06ae1005d93d4a19b67d090a020ae37db54e6e3e} (53%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0fdcae4df7bc325099fb4b3b01a1c9290229f86c delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2d7246bd48ed8b68599445c98bb822c87f86acd1 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/461c08228ae6a0eaa191d24eea1823b46f4a9d67 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5891055a8932cac4c24862377ab912ff6d775247 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5db53de009652f61b1ed21ee988d0156ce287033 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/642df2594991f9b5720fce364d0001d8c56d3a89 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/6449230f671fe77b73dc6e0d40f542c0720628f2 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7f701c0f31e68192bc8c829f343fa2326aa4d3dc rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/{134a0d85fbcbe367e66d69127114bece71add806 => 81d43836885e32dc8c2b187cb9545bd5c01dfef5} (54%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/85bff933def1ce530a1febd93ef2890ed4bcdcb5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b26b7f292dee13cf6e0366f48ea199ee86a0c201 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/{7dcdad1c2df1656678947b2009a9fcea44f4025d => bea0876bed5520626024667d4f9dc0a4f485aa76} (54%) rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/{e26757270b3d149d1ce10bef32ed0b3a5794977c => c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5} (54%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 rename oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/{clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 => d0a0d8d0c842875b97e89957095af3c71f7e9744} (54%) delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d7014f417415314dd83162570bcafd7935875f00 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e44281948ed00f87ec981eb880561d983c0c16c3 delete mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ecffb38d73f504442070cf4f754d9d2cd87a87d7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc delete mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc create mode 100644 oemcrypto/test/oemcrypto_cast_test.cpp create mode 100644 oemcrypto/test/oemcrypto_cast_test.h create mode 100644 oemcrypto/test/oemcrypto_generic_crypto_test.cpp delete mode 100644 util/include/error_string_util.h delete mode 100644 util/src/error_string_util.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index c553551..72cdac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,61 @@ [TOC] +## [Version 18.3][v18.3] + +Version 18.3 includes a major feature (Cast with Provisioning 4.0) and various +minor changes. Version 18.2 was an internal version bump for the ODK that +included changes used by the provisioning server. Since we keep the ODK and OPK +version numbers in sync, the OPK version effectively skipped 18.2. + +## Cast with Provisioning 4.0 + +The OPK now supports devices that wish to act as cast receivers while using +Provisioning 4.0. Previously, only devices using Provisioning 2.0 or devices +with factory provisioned certs could do this. These changes span the OPK, CDM, +and provisioning server code. + +The OPK changes are included in this release. The CDM changes are part of +Android U. The provisioning server changes are live on Widevine staging servers, +and will be pushed to production by August 2023. + +## OP-TEE port changes + +- Added CSR and DeviceInformation implementations for Provisioning 4.0. +- Bugfix: REE->TEE message shared memory was sized based on the incoming request +length, yet the response could be larger than the request and crash the TA if it +did not fit in the nearest page boundary. Fixed by setting the shared memory +size to the maximum allowed and passing in the request size as a separate +TEE_Param. + +## Other changes + +- Updated BoringSSL dependency to +https://boringssl.googlesource.com/boringssl/+/e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 +- Removed WTPI_MaxBufferSizeForDecrypt() and WTPI_ApplyCGMS() from +wtpi_config_interface.h. These functions are not called by any of the OPK code. +- Updated the documentation for WTPI_GetDeviceKey() to be clearer. +- Added new optional fields to OEMCrypto_BuildInformation() output. +- Removed v15 functions OEMCrypto_LoadKeys() and OEMCrypto_RefreshKeys(), which +were replaced by OEMCrypto_LoadLicense() and OEMCrypto_LoadRenewal() in v16. +- Three new optional fields have been added to OEMCrypto_BuildInformation() +output JSON: `git_commit` and `build_timestamp`, and `ree` information. +- OEMCrypto_GenerateCertificateKeyPair() documentation has been improved to be +clearer. +- New function OEMCrypto_FactoryInstallBCCSignature() added to OEMCrypto API. +Not implemented in OPK. +- OPK can be used with license servers that send more than `MAX_NUM_KEYS` in the +license response. The client-side value of `MAX_NUM_KEYS` must be changed in +`odk/include/odk_target.h` to match the server's value. This is only intended +for closed network systems. + +## Known issues + +- CdmOtaKeyboxTest.BasicTest may fail due to server issues +- The ODK renewal clock is not correctly checked for all circumstances. This +will be changed in v19 since the existing implementation is already in +production devices. + ## [Version 18.1][v18.1] OEMCrypto V18.0 consisted of header files only. This release includes tests and diff --git a/linux/src/file_store.cpp b/linux/src/file_store.cpp index 66d163f..8164409 100644 --- a/linux/src/file_store.cpp +++ b/linux/src/file_store.cpp @@ -176,6 +176,22 @@ bool FileSystem::Exists(const std::string& path) { return res; } +bool FileSystem::Exists(const std::string& path, int* errno_value) { + struct stat buf; + int error = 0; + int res = stat(path.c_str(), &buf) == 0; + if (!res) { + error = errno; + if (error == ENOENT) { + LOGI("stat failed: ENOENT"); + } else { + LOGE("stat failed: %d, %s", error, strerror(error)); + } + } + if (errno_value != nullptr) *errno_value = error; + return res; +} + bool FileSystem::Remove(const std::string& path) { if (IsDirectory(path)) { // Handle directory deletion diff --git a/linux/src/log.cpp b/linux/src/log.cpp index 14d0d8d..1e688c6 100644 --- a/linux/src/log.cpp +++ b/linux/src/log.cpp @@ -25,7 +25,7 @@ void InitLogging() { // set by jenkins (http://go/wvbuild), so that we have more details when the // build breaks. const char* verbose_env = getenv("VERBOSE_LOG"); - if (verbose_env && !strncmp(verbose_env, "yes", 3)) { + if (verbose_env && strncmp(verbose_env, "yes", 3) == 0) { g_cutoff = CDM_LOG_VERBOSE; } } diff --git a/oemcrypto/include/OEMCryptoCENC.h b/oemcrypto/include/OEMCryptoCENC.h index 87eb1f6..99e0f61 100644 --- a/oemcrypto/include/OEMCryptoCENC.h +++ b/oemcrypto/include/OEMCryptoCENC.h @@ -3,7 +3,7 @@ // License Agreement. /** - * @mainpage OEMCrypto API v18.1 + * @mainpage OEMCrypto API v18.3 * * OEMCrypto is the low level library implemented by the OEM to provide key and * content protection, usually in a separate secure memory or process space. The @@ -712,6 +712,7 @@ typedef enum OEMCrypto_SignatureHashAlgorithm { #define OEMCrypto_GetSignatureHashAlgorithm _oecc139 #define OEMCrypto_EnterTestMode _oecc140 #define OEMCrypto_GetDeviceSignedCsrPayload _oecc141 +#define OEMCrypto_FactoryInstallBCCSignature _oecc142 // clang-format on /// @addtogroup initcontrol @@ -2996,6 +2997,41 @@ OEMCryptoResult OEMCrypto_WrapKeyboxOrOEMCert( OEMCryptoResult OEMCrypto_InstallKeyboxOrOEMCert(const uint8_t* keybox_or_cert, size_t keybox_or_cert_length); +/** + * Install a factory generated signature for the BCC. This is for devices that + * use Provisioning 4.0, with the signing option in the factory. With the + * signing option, the BCC is extracted from the device in the factory. Instead + * of being uploaded to the Widevine server, the BCC is signed by a certificate + * that the manufacturer shares with Widevine. The signature is then installed + * on the device is a secure location. The signature must not be erased during + * factory reset. + * + * This signature should be returned as `addition_signature` in a call to the + * function `OEMCrypto_GetBootCertificateChain()`. + * + * Devices that do not support Provisioning 4.0, or only support Provisioning + * 4.0 Option 1 should return OEMCrypto_ERROR_NOT_IMPLEMENTED. + * + * + * @param[in] signature: pointer to data as input + * @param[in] signature_length: length of the data in bytes + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INSUFFICIENT_RESOURCES + * @retval OEMCrypto_ERROR_NOT_IMPLEMENTED + * @retval OEMCrypto_ERROR_SYSTEM_INVALIDATED + * + * @threading + * This is an "Initialization and Termination Function" and will not be + * called simultaneously with any other function, as if the CDM holds a write + * lock on the OEMCrypto system. + * + * @version + * This method is new in API version 18.3. + */ +OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature(const uint8_t* signature, + size_t signature_length); + /** * This function is for OEMCrypto to tell the layer above what provisioning * method it uses: keybox or OEM certificate. @@ -3314,6 +3350,22 @@ uint32_t OEMCrypto_MinorAPIVersion(void); * While not required, the following top level fields are recommended: * - "implementer" [string]: Name of company or entity that provides OEMCrypto. * Important if not SOC vendor. + * - "git_commit" [string]: Git commit hash of the code repository that + * produced the TA build. Useful for implementers to distinguish the state of + * different TA builds. + * - "build_timestamp" [string]: ISO 8601 formatted timestamp of the time the + * TA was compiled, eg "YYYY-MM-DDTHH:MM:SS" + * + * While not required, another optional top level struct can be added to the + * build information string to provide information about liboemcrypto.so: + * - "ree" { + * - "liboemcrypto_ver" [string]: liboemcrypto.so version in string format + * eg "2.15.0+tag". Note that this is separate from the "ta_ver" field + * above, since this section is specific to the liboemcrypto.so binary. + * - "git_commit" [string]: git hash of code that compiled liboemcrypto.so + * - "build_timestamp" [string]: ISO 8601 timestamp for when + * liboemcrypto.so was built + * } * * The JSON string can contain other values, structs, arrays, etc in addition to * the above, if desired. @@ -4812,11 +4864,71 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * key is supposed to be certified by the server. The private key is wrapped * with the encryption key so it can be stored in the file system. * - * If an OEM private key is unavailable, the request is assumed for OEM + * The |public_key_signature| output is formatted differently depending + * on whether or not an OEM private key has been loaded. + * + * If an OEM private key is unavailable, the request is assumed to be for OEM * certificate provisioning. In this case, the public key is signed by the - * device private key. If an OEM private key is available, the request is - * assumed for DRM certificate provisioning and the public key is signed by the - * OEM private key. + * device private key. The format of |public_key_signature| in this case is a + * COSE_Sign1 CBOR array. The format is described in RFC 8152 Section 4.2 and + * 4.4, as well as Android IRemotelyProvisionedComponent.aidl (under + * "SignedData") + * + * ~~~ + * |public_key_signature|: COSE_Sign1 CBOR array + * [ + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * unprotected: {}, + * payload: bstr .cbor Data / nil, + * signature: bstr ; PureEd25519(priv_key, Sig_structure) / + * ; ECDSA(priv_key, Sig_structure) + * ] + * ~~~ + * + * Notes: + * 1. The payload field in the COSE_Sign1 struct is the public key generated + * by OEMCrypto_GenerateCertificateKeyPair + * 2. The signature field in the COSE_Sign1 struct is the concatenation of the + * (R,S) values from the EC/Ed signature. If either R or S is smaller than + * the key size, it is left-padded with 0 to match the key size as + * described in RFC 8152. This signature is not DER encoded. + * 3. The signature is generated by calling the selected EC signing function + * (PureEd25519 or one of the supported ECDSA algorithms) on + * `Sig_structure`, which is a CBOR array described below. The payload + * field in Sig_structure is the same as the payload in the above + * COSE_Sign1 CBOR array. + * + * ~~~ + * Sig_structure: CBOR array + * [ + * context: "Signature1", + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * external_aad: bstr .size 0, + * payload: bstr .cbor Data / nil, + * ] + * ~~~ + * + * If an OEM private key is available, the request is assumed to be for DRM + * certificate provisioning and the public key is signed by the OEM private key. + * If the OEM private key is an RSA key, then |public_key_signature| is the raw + * output of the RSA sign operation with RSASSA-PSS padding. If the OEM private + * key is an ECC key, then |public_key_signature| is the ASN.1 DER-encoded (R,S) + * signature as specified in RFC 3279 2.2.3. + * + * After this function completes successfully, the session will hold a private + * key and will be ready for a call to + * OEMCrypto_PrepAndSignProvisioningRequest(). In particular, when this + * function is used to generate a DRM Certificate key pair, the session will be + * ready to sign a provisioning request with the DRM Cert private key. When this + * function is used to generate an OEM Certificate key pair, the session will be + * ready to sign a provisioning request with the OEM Cert private key. + * + * The public key shall be an ASN.1 DER-encoded SubjectPublicKeyInfo as + * specified in RFC 5280. Widevine recommends ECC keys for Provisioning 4.0, but + * an RSA key may also be used. If the key is an RSA key, then the encoding + * should use "rsaEncryption" (OID 1.2.840.113549.1.1.1), and not RSASSA-PSS. * * @param[in] session: session id. * @param[out] public_key: pointer to the buffer that receives the public key @@ -4825,11 +4937,8 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * @param[in,out] public_key_length: on input, size of the caller's public_key * buffer. On output, the number of bytes written into the buffer. * @param[out] public_key_signature: pointer to the buffer that receives the - * signature of the public key. - * If an OEM private key is unavailable: it is signed by the device private - * key. The signature must be in COSE_SIGN1 format as specified in RFC 8152. - * If an OEM private key is available: it is signed by the OEM private key. - * The signature must be raw signature bytes. + * signature of the public key. The format depends on whether an OEM private + * key has been loaded. * @param[in,out] public_key_signature_length: on input, size of the caller's * public_key_signature buffer. On output, the number of bytes written into * the buffer. diff --git a/oemcrypto/odk/Android.bp b/oemcrypto/odk/Android.bp index 92646bc..544c838 100644 --- a/oemcrypto/odk/Android.bp +++ b/oemcrypto/odk/Android.bp @@ -38,6 +38,7 @@ cc_library_static { proprietary: true, owner: "widevine", + min_sdk_version: "UpsideDownCake", } // ---------------------------------------------------------------- diff --git a/oemcrypto/odk/include/OEMCryptoCENCCommon.h b/oemcrypto/odk/include/OEMCryptoCENCCommon.h index 97989aa..a4e5438 100644 --- a/oemcrypto/odk/include/OEMCryptoCENCCommon.h +++ b/oemcrypto/odk/include/OEMCryptoCENCCommon.h @@ -156,8 +156,8 @@ typedef enum OEMCrypto_TimerDelayBase { } OEMCrypto_TimerDelayBase; /** - * Used to indicate a substring of a signed message in OEMCrypto_LoadKeys and - * other functions which must verify that a parameter is contained within a + * Used to indicate a substring of a signed message in ODK_ParseLicense + * and other functions which must verify that a parameter is contained within a * signed message. */ typedef struct { @@ -223,7 +223,7 @@ typedef struct { /** * Points to the relevant fields for a content key. The fields are extracted - * from the License Response message offered to OEMCrypto_LoadKeys(). Each + * from the License Response message offered to ODK_ParseLicense(). Each * field points to one of the components of the key. Key data, key control, * and both IV fields are 128 bits (16 bytes): * @param key_id: the unique id of this key. @@ -240,7 +240,7 @@ typedef struct { * the content key from the key_data field. * * The memory for the OEMCrypto_KeyObject fields is allocated and freed - * by the caller of OEMCrypto_LoadKeys(). + * by the caller of ODK_ParseLicense(). */ typedef struct { OEMCrypto_Substring key_id; diff --git a/oemcrypto/odk/include/core_message_features.h b/oemcrypto/odk/include/core_message_features.h index 6e210d6..1365dd8 100644 --- a/oemcrypto/odk/include/core_message_features.h +++ b/oemcrypto/odk/include/core_message_features.h @@ -26,9 +26,9 @@ struct CoreMessageFeatures { // This is the published version of the ODK Core Message library. The default // behavior is for the server to restrict messages to at most this version - // number. The default is 17.2. - uint32_t maximum_major_version = 17; - uint32_t maximum_minor_version = 2; + // number. The default is 18.3. + uint32_t maximum_major_version = 18; + uint32_t maximum_minor_version = 3; bool operator==(const CoreMessageFeatures &other) const; bool operator!=(const CoreMessageFeatures &other) const { diff --git a/oemcrypto/odk/include/core_message_serialize.h b/oemcrypto/odk/include/core_message_serialize.h index 765d292..a76b79f 100644 --- a/oemcrypto/odk/include/core_message_serialize.h +++ b/oemcrypto/odk/include/core_message_serialize.h @@ -39,7 +39,7 @@ using oemcrypto_core_message::features::CoreMessageFeatures; * [out] oemcrypto_core_message */ bool CreateCoreLicenseResponse(const CoreMessageFeatures& features, - const ODK_ParsedLicense& parsed_lic, + const ODK_Packing_ParsedLicense& parsed_lic, const ODK_LicenseRequest& core_request, const std::string& core_request_sha256, std::string* oemcrypto_core_message); diff --git a/oemcrypto/odk/include/odk_structs.h b/oemcrypto/odk/include/odk_structs.h index 8a2b8ee..1debc12 100644 --- a/oemcrypto/odk/include/odk_structs.h +++ b/oemcrypto/odk/include/odk_structs.h @@ -16,10 +16,10 @@ extern "C" { /* The version of this library. */ #define ODK_MAJOR_VERSION 18 -#define ODK_MINOR_VERSION 1 +#define ODK_MINOR_VERSION 3 /* ODK Version string. Date changed automatically on each release. */ -#define ODK_RELEASE_DATE "ODK v18.1 2023-02-25" +#define ODK_RELEASE_DATE "ODK v18.3 2023-07-07" /* The lowest version number for an ODK message. */ #define ODK_FIRST_VERSION 16 @@ -97,7 +97,8 @@ typedef struct { * * @param time_of_license_request_signed: Time that the license request was * signed, based on OEMCrypto's system clock. This value shall be stored - * and reloaded with usage entry as time_of_license_received. + * and reloaded with usage entry as time_of_license_received. This is + * also used to track the start of the rental clock time. * @param time_of_first_decrypt: Time of the first decrypt or call select key, * based on OEMCrypto's system clock. This is 0 if the license has not * been used to decrypt any data. This value shall be stored and reloaded @@ -246,6 +247,46 @@ typedef struct { OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; } ODK_ParsedLicense; +/** + * The parsed license structure contains information from the license + * message. The function ODK_ParseLicense will fill in the fields of this + * message. All substrings are contained within the message body. + * + * @param enc_mac_keys_iv: IV for decrypting new mac_key. Size is 128 bits. + * @param enc_mac_keys: encrypted mac_keys for generating new mac_keys. Size is + * 512 bits. + * @param pst: the Provider Session Token. + * @param srm_restriction_data: optional data specifying the minimum SRM + * version. + * @param license_type: specifies if the license contains content keys or + * entitlement keys. + * @param nonce_required: indicates if the license requires a nonce. + * @param timer_limits: time limits of the for the license. + * @param watermarking: specifies if device supports watermarking. + * @param dtcp2_required: specifies if device supports DTCP. + * @param renewal_delay_base: what time the timer starting is based off of. + * @param key_array_length: number of keys present. + * @param key_array: set of keys to be installed. This is a pointer to an array + * to allow packing a number of keys greater than |ODK_MAX_NUM_KEYS|. + * + * @version + * This struct changed in API version 18. + */ +typedef struct { + OEMCrypto_Substring enc_mac_keys_iv; + OEMCrypto_Substring enc_mac_keys; + OEMCrypto_Substring pst; + OEMCrypto_Substring srm_restriction_data; + OEMCrypto_LicenseType license_type; + bool nonce_required; + ODK_TimerLimits timer_limits; + uint32_t watermarking; + OEMCrypto_DTCP2_CMI_Packet dtcp2_required; + OEMCrypto_TimerDelayBase renewal_delay_base; + uint32_t key_array_length; + OEMCrypto_KeyObject* key_array; +} ODK_Packing_ParsedLicense; + /** * The parsed provisioning structure contains information from the license * message. The function ODK_ParseProvisioning will fill in the fields of diff --git a/oemcrypto/odk/src/core_message_deserialize.cpp b/oemcrypto/odk/src/core_message_deserialize.cpp index 5c8054f..30e68c4 100644 --- a/oemcrypto/odk/src/core_message_deserialize.cpp +++ b/oemcrypto/odk/src/core_message_deserialize.cpp @@ -162,44 +162,26 @@ bool CoreRenewalRequestFromMessage(const std::string& oemcrypto_core_message, bool CoreProvisioningRequestFromMessage( const std::string& oemcrypto_core_message, ODK_ProvisioningRequest* core_provisioning_request) { - // We can't tell if V18 format or older. Need to partially parse in order - // to get the nonce values, which will tell us. + // Need to partially parse in order to get the nonce values, which will tell + // us the major/minor version ODK_NonceValues nonce; if (!GetNonceFromMessage(oemcrypto_core_message, &nonce)) return false; if (nonce.api_major_version == 18) { - // Proceed with V18 types - const auto unpacker = Unpack_ODK_PreparedProvisioningRequest; + // Use special case unpacker for v18.0 + const auto unpacker = nonce.api_minor_version == 0 + ? Unpack_ODK_PreparedProvisioningRequestV180 + : Unpack_ODK_PreparedProvisioningRequest; ODK_PreparedProvisioningRequest prepared_provision = {}; + if (!ParseRequest(ODK_Provisioning_Request_Type, oemcrypto_core_message, core_provisioning_request, &prepared_provision, unpacker)) { - // check for edge case: initial v18 message which is 4 bytes smaller and - // has 0's in the message counter struct - const uint8_t* buf = - reinterpret_cast(oemcrypto_core_message.c_str()); - const size_t buf_length = oemcrypto_core_message.size(); + return false; + } - if (!(buf_length + 4 == ODK_PROVISIONING_REQUEST_SIZE)) { - return false; - } - - // Expected zero padding. Size is the new ODK Provisioning Request (core - // message + const uint32_t + the rest) without the core message and const - // uint32_t. - uint8_t zeros[ODK_PROVISIONING_REQUEST_SIZE - 4 - ODK_CORE_MESSAGE_SIZE] = - {0}; - - // Compare zeros against the old Provisioning Request (core message + the - // rest). - if (memcmp(zeros, buf + ODK_CORE_MESSAGE_SIZE, sizeof(zeros)) != 0) { - return false; - } - - memset(&prepared_provision.counter_info, 0, - sizeof(prepared_provision.counter_info)); - } else if (!CopyCounterInfo(&core_provisioning_request->counter_info, - &prepared_provision.counter_info)) { + if (!CopyCounterInfo(&core_provisioning_request->counter_info, + &prepared_provision.counter_info)) { return false; } } else { @@ -219,7 +201,7 @@ bool CoreProvisioningRequestFromMessage( if (device_id_length > 0) { uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {}; if (memcmp(zero, device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length)) { + ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { return false; } core_provisioning_request->device_id.assign( @@ -251,7 +233,7 @@ bool CoreProvisioning40RequestFromMessage( } uint8_t zero[ODK_DEVICE_INFO_LEN_MAX] = {}; if (memcmp(zero, device_info + device_info_length, - ODK_DEVICE_INFO_LEN_MAX - device_info_length)) { + ODK_DEVICE_INFO_LEN_MAX - device_info_length) != 0) { return false; } core_provisioning_request->device_info.assign( @@ -276,7 +258,7 @@ bool CoreRenewedProvisioningRequestFromMessage( } uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {}; if (memcmp(zero, device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length)) { + ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { return false; } core_provisioning_request->device_id.assign( diff --git a/oemcrypto/odk/src/core_message_features.cpp b/oemcrypto/odk/src/core_message_features.cpp index b8bcb9e..b8cae56 100644 --- a/oemcrypto/odk/src/core_message_features.cpp +++ b/oemcrypto/odk/src/core_message_features.cpp @@ -28,7 +28,7 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures( features.maximum_minor_version = 2; // 17.2 break; case 18: - features.maximum_minor_version = 1; // 18.0 + features.maximum_minor_version = 3; // 18.3 break; default: features.maximum_minor_version = 0; diff --git a/oemcrypto/odk/src/core_message_serialize.cpp b/oemcrypto/odk/src/core_message_serialize.cpp index 8f28a3f..5edd352 100644 --- a/oemcrypto/odk/src/core_message_serialize.cpp +++ b/oemcrypto/odk/src/core_message_serialize.cpp @@ -25,14 +25,13 @@ namespace { * computing the API version of the response. * * Template arguments: - * T: struct to be deserialized by odk * S: kdo input struct */ -template +template bool CreateResponseHeader(const CoreMessageFeatures& features, ODK_MessageType message_type, ODK_CoreMessage* response_header, - const S& core_request, T& response) { + const S& core_request) { // Bad major version. if ((features.maximum_major_version > ODK_MAJOR_VERSION) || (features.maximum_major_version == ODK_MAJOR_VERSION && @@ -68,11 +67,10 @@ bool CreateResponseHeader(const CoreMessageFeatures& features, * * Template arguments: * T: struct to be deserialized by odk - * S: kdo input struct * P: auto-generated serializing function for |T| */ -template -bool CreateResponse(ODK_MessageType message_type, const S& core_request, +template +bool CreateResponse(ODK_MessageType message_type, std::string* oemcrypto_core_message, ODK_CoreMessage* response_header, T& response, const P& packer) { @@ -118,118 +116,25 @@ bool CopyDeviceId(const ODK_ProvisioningRequest& src, } // namespace bool CreateCoreLicenseResponse(const CoreMessageFeatures& features, - const ODK_ParsedLicense& parsed_lic, + const ODK_Packing_ParsedLicense& parsed_lic, const ODK_LicenseRequest& core_request, const std::string& core_request_sha256, std::string* oemcrypto_core_message) { - ODK_LicenseResponse license_response{ - {}, const_cast(&parsed_lic)}; + ODK_Packing_LicenseResponse license_response{ + {}, const_cast(&parsed_lic), {}}; if (!CreateResponseHeader(features, ODK_License_Response_Type, - &license_response.core_message, core_request, - license_response)) { - return false; - } - if (ODK_MAX_NUM_KEYS < license_response.parsed_license->key_array_length) { + &license_response.core_message, core_request)) { return false; } if (license_response.core_message.nonce_values.api_major_version == 16) { - ODK_LicenseResponseV16 license_response_v16; - license_response_v16.request.core_message = license_response.core_message; - license_response_v16.parsed_license.enc_mac_keys_iv = - license_response.parsed_license->enc_mac_keys_iv; - license_response_v16.parsed_license.enc_mac_keys = - license_response.parsed_license->enc_mac_keys; - license_response_v16.parsed_license.pst = - license_response.parsed_license->pst; - license_response_v16.parsed_license.srm_restriction_data = - license_response.parsed_license->srm_restriction_data; - license_response_v16.parsed_license.license_type = - license_response.parsed_license->license_type; - license_response_v16.parsed_license.nonce_required = - license_response.parsed_license->nonce_required; - license_response_v16.parsed_license.timer_limits = - license_response.parsed_license->timer_limits; - license_response_v16.parsed_license.key_array_length = - license_response.parsed_license->key_array_length; - uint32_t i; - for (i = 0; i < license_response_v16.parsed_license.key_array_length && - i < license_response.parsed_license->key_array_length; - i++) { - license_response_v16.parsed_license.key_array[i] = - license_response.parsed_license->key_array[i]; - } - if (core_request_sha256.size() != sizeof(license_response_v16.request_hash)) + if (core_request_sha256.size() != sizeof(license_response.request_hash)) return false; - memcpy(license_response_v16.request_hash, core_request_sha256.data(), - sizeof(license_response_v16.request_hash)); - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, - &license_response_v16.request.core_message, - license_response_v16, Pack_ODK_LicenseResponseV16); - } else if (license_response.core_message.nonce_values.api_major_version == - 17) { - ODK_LicenseResponseV17 license_response_v17; - ODK_ParsedLicenseV17* dest = &license_response_v17.parsed_license; - ODK_ParsedLicense src = *license_response.parsed_license; - license_response_v17.request.core_message = license_response.core_message; - dest->enc_mac_keys_iv = src.enc_mac_keys_iv; - dest->enc_mac_keys = src.enc_mac_keys; - dest->pst = src.pst; - dest->srm_restriction_data = src.srm_restriction_data; - dest->license_type = src.license_type; - dest->nonce_required = src.nonce_required; - dest->timer_limits = src.timer_limits; - dest->watermarking = src.watermarking; - dest->dtcp2_required.dtcp2_required = src.dtcp2_required.dtcp2_required; - dest->dtcp2_required.cmi_descriptor_0.id = - src.dtcp2_required.cmi_descriptor_0.id; - dest->dtcp2_required.cmi_descriptor_0.extension = - src.dtcp2_required.cmi_descriptor_0.extension; - dest->dtcp2_required.cmi_descriptor_0.length = - src.dtcp2_required.cmi_descriptor_0.length; - dest->dtcp2_required.cmi_descriptor_0.data = - src.dtcp2_required.cmi_descriptor_0.data; - dest->dtcp2_required.cmi_descriptor_1.id = - src.dtcp2_required.cmi_descriptor_1.id; - dest->dtcp2_required.cmi_descriptor_1.extension = - src.dtcp2_required.cmi_descriptor_1.extension; - dest->dtcp2_required.cmi_descriptor_1.length = - src.dtcp2_required.cmi_descriptor_1.length; - dest->dtcp2_required.cmi_descriptor_1.data[0] = - src.dtcp2_required.cmi_descriptor_1.data[0]; - dest->dtcp2_required.cmi_descriptor_1.data[1] = - src.dtcp2_required.cmi_descriptor_1.data[1]; - dest->dtcp2_required.cmi_descriptor_1.data[2] = - src.dtcp2_required.cmi_descriptor_1.data[2]; - dest->dtcp2_required.cmi_descriptor_2.id = - src.dtcp2_required.cmi_descriptor_2.id; - dest->dtcp2_required.cmi_descriptor_2.extension = - src.dtcp2_required.cmi_descriptor_2.extension; - dest->dtcp2_required.cmi_descriptor_2.length = - src.dtcp2_required.cmi_descriptor_2.length; - dest->dtcp2_required.cmi_descriptor_2.data[0] = - src.dtcp2_required.cmi_descriptor_2.data[0]; - dest->dtcp2_required.cmi_descriptor_2.data[1] = - src.dtcp2_required.cmi_descriptor_2.data[1]; - dest->dtcp2_required.cmi_descriptor_2.data[2] = - src.dtcp2_required.cmi_descriptor_2.data[2]; - dest->key_array_length = src.key_array_length; - uint32_t i; - for (i = 0; i < dest->key_array_length && i < src.key_array_length; i++) { - dest->key_array[i] = src.key_array[i]; - } - if (core_request_sha256.size() != sizeof(license_response_v17.request_hash)) - return false; - memcpy(license_response_v17.request_hash, core_request_sha256.data(), - sizeof(license_response_v17.request_hash)); - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, - &license_response_v17.request.core_message, - license_response_v17, Pack_ODK_LicenseResponseV17); + memcpy(license_response.request_hash, core_request_sha256.data(), + sizeof(license_response.request_hash)); } - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, &license_response.core_message, - license_response, Pack_ODK_LicenseResponse); + return CreateResponse(ODK_License_Response_Type, oemcrypto_core_message, + &license_response.core_message, license_response, + Pack_ODK_LicenseResponse); } bool CreateCoreRenewalResponse(const CoreMessageFeatures& features, @@ -241,11 +146,10 @@ bool CreateCoreRenewalResponse(const CoreMessageFeatures& features, renewal_response.renewal_duration_seconds = renewal_duration_seconds; if (!CreateResponseHeader(features, ODK_Renewal_Response_Type, &renewal_response.request.core_message, - core_request, renewal_response)) { + core_request)) { return false; } - return CreateResponse(ODK_Renewal_Response_Type, core_request, - oemcrypto_core_message, + return CreateResponse(ODK_Renewal_Response_Type, oemcrypto_core_message, &renewal_response.request.core_message, renewal_response, Pack_ODK_RenewalResponse); } @@ -257,8 +161,7 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, ODK_ProvisioningResponse prov_response{ {}, const_cast(&parsed_prov)}; if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, - &prov_response.core_message, core_request, - prov_response)) { + &prov_response.core_message, core_request)) { return false; } @@ -269,15 +172,15 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, } prov_response_v16.request.core_message = prov_response.core_message; prov_response_v16.parsed_provisioning = prov_response.parsed_provisioning; - return CreateResponse(ODK_Provisioning_Response_Type, core_request, + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, &prov_response_v16.request.core_message, prov_response_v16, Pack_ODK_ProvisioningResponseV16); } - return CreateResponse(ODK_Provisioning_Response_Type, core_request, - oemcrypto_core_message, &prov_response.core_message, - prov_response, Pack_ODK_ProvisioningResponse); + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, + Pack_ODK_ProvisioningResponse); } bool CreateCoreProvisioning40Response( @@ -286,13 +189,12 @@ bool CreateCoreProvisioning40Response( std::string* oemcrypto_core_message) { ODK_Provisioning40Response prov_response = {}; if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, - &prov_response.core_message, core_request, - prov_response)) { + &prov_response.core_message, core_request)) { return false; } - return CreateResponse(ODK_Provisioning_Response_Type, core_request, - oemcrypto_core_message, &prov_response.core_message, - prov_response, Pack_ODK_Provisioning40Response); + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, + Pack_ODK_Provisioning40Response); } } // namespace serialize diff --git a/oemcrypto/odk/src/core_message_serialize_proto.cpp b/oemcrypto/odk/src/core_message_serialize_proto.cpp index 78b20fb..61c5031 100644 --- a/oemcrypto/odk/src/core_message_serialize_proto.cpp +++ b/oemcrypto/odk/src/core_message_serialize_proto.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "core_message_serialize.h" #include "license_protocol.pb.h" @@ -83,7 +84,8 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, return false; } - ODK_ParsedLicense parsed_lic{}; + ODK_Packing_ParsedLicense parsed_lic{}; + std::vector key_array; bool any_content = false; bool any_entitlement = false; @@ -110,12 +112,8 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, } else { any_content = true; } - if (parsed_lic.key_array_length >= ODK_MAX_NUM_KEYS) { - return false; - } - uint32_t& n = parsed_lic.key_array_length; - parsed_lic.key_array[n++] = - KeyContainerToOecKey(serialized_license, k, uses_padding); + key_array.push_back( + KeyContainerToOecKey(serialized_license, k, uses_padding)); break; } default: { @@ -147,6 +145,19 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, } parsed_lic.nonce_required = nonce_required; const auto& policy = lic.policy(); + switch (policy.initial_renewal_delay_base()) { + case video_widevine::License_Policy::LICENSE_LOAD: + parsed_lic.renewal_delay_base = OEMCrypto_License_Load; + break; + case video_widevine::License_Policy::FIRST_DECRYPT: + parsed_lic.renewal_delay_base = OEMCrypto_First_Decrypt; + break; + case video_widevine::License_Policy::TIMER_DELAY_BASE_UNSPECIFIED: + case video_widevine::License_Policy::LICENSE_START: + default: + parsed_lic.renewal_delay_base = OEMCrypto_License_Start; + break; + } ODK_TimerLimits& timer_limits = parsed_lic.timer_limits; timer_limits.soft_enforce_rental_duration = policy.soft_enforce_rental_duration(); @@ -160,6 +171,9 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, policy.renewal_delay_seconds() + policy.renewal_recovery_duration_seconds(); + parsed_lic.key_array = key_array.data(); + parsed_lic.key_array_length = static_cast(key_array.size()); + return CreateCoreLicenseResponse(features, parsed_lic, core_request, core_request_sha256, oemcrypto_core_message); } diff --git a/oemcrypto/odk/src/odk.c b/oemcrypto/odk/src/odk.c index db6f510..3ade4a7 100644 --- a/oemcrypto/odk/src/odk.c +++ b/oemcrypto/odk/src/odk.c @@ -9,6 +9,7 @@ #include #include +#include "odk_message.h" #include "odk_overflow.h" #include "odk_serialize.h" #include "odk_structs.h" @@ -45,12 +46,23 @@ static OEMCryptoResult ODK_PrepareRequest( * message buffer has been correctly initialized by the caller. */ switch (message_type) { case ODK_License_Request_Type: { - core_message->message_length = ODK_LICENSE_REQUEST_SIZE; - if (sizeof(ODK_PreparedLicenseRequest) > prepared_request_buffer_length) { - return ODK_ERROR_CORE_MESSAGE; + if (nonce_values->api_major_version > 17) { + core_message->message_length = ODK_LICENSE_REQUEST_SIZE; + if (sizeof(ODK_PreparedLicenseRequest) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedLicenseRequest( + &msg, (ODK_PreparedLicenseRequest*)prepared_request_buffer); + } else { + core_message->message_length = ODK_LICENSE_REQUEST_SIZE_V17; + if (sizeof(ODK_PreparedLicenseRequestV17) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedLicenseRequestV17( + &msg, (ODK_PreparedLicenseRequestV17*)prepared_request_buffer); } - Pack_ODK_PreparedLicenseRequest( - &msg, (ODK_PreparedLicenseRequest*)prepared_request_buffer); break; } case ODK_Renewal_Request_Type: { @@ -63,13 +75,23 @@ static OEMCryptoResult ODK_PrepareRequest( break; } case ODK_Provisioning_Request_Type: { - core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE; - if (sizeof(ODK_PreparedProvisioningRequest) > - prepared_request_buffer_length) { - return ODK_ERROR_CORE_MESSAGE; + if (nonce_values->api_major_version > 17) { + core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE; + if (sizeof(ODK_PreparedProvisioningRequest) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedProvisioningRequest( + &msg, (ODK_PreparedProvisioningRequest*)prepared_request_buffer); + } else { + core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE_V17; + if (sizeof(ODK_PreparedProvisioningRequestV17) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedProvisioningRequestV17( + &msg, (ODK_PreparedProvisioningRequestV17*)prepared_request_buffer); } - Pack_ODK_PreparedProvisioningRequest( - &msg, (ODK_PreparedProvisioningRequest*)prepared_request_buffer); break; } case ODK_Provisioning40_Request_Type: { @@ -186,12 +208,19 @@ OEMCryptoResult ODK_PrepareCoreLicenseRequest( counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - ODK_PreparedLicenseRequest license_request = {0}; - memcpy(&license_request.counter_info, counter_info, - sizeof(license_request.counter_info)); - return ODK_PrepareRequest( - message, message_length, core_message_size, ODK_License_Request_Type, - nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequest)); + if (nonce_values->api_major_version > 17) { + ODK_PreparedLicenseRequest license_request = {0}; + memcpy(&license_request.counter_info, counter_info, + sizeof(license_request.counter_info)); + return ODK_PrepareRequest( + message, message_length, core_message_size, ODK_License_Request_Type, + nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequest)); + } else { + ODK_PreparedLicenseRequestV17 license_request = {0}; + return ODK_PrepareRequest( + message, message_length, core_message_size, ODK_License_Request_Type, + nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequestV17)); + } } OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message, @@ -250,14 +279,22 @@ OEMCryptoResult ODK_PrepareCoreProvisioningRequest( counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - ODK_PreparedProvisioningRequest provisioning_request = {0}; - memcpy(&provisioning_request.counter_info, counter_info, - sizeof(ODK_MessageCounterInfo)); + if (nonce_values->api_major_version > 17) { + ODK_PreparedProvisioningRequest provisioning_request = {0}; + memcpy(&provisioning_request.counter_info, counter_info, + sizeof(ODK_MessageCounterInfo)); - return ODK_PrepareRequest(message, message_length, core_message_length, - ODK_Provisioning_Request_Type, nonce_values, - &provisioning_request, - sizeof(ODK_PreparedProvisioningRequest)); + return ODK_PrepareRequest(message, message_length, core_message_length, + ODK_Provisioning_Request_Type, nonce_values, + &provisioning_request, + sizeof(ODK_PreparedProvisioningRequest)); + } else { + ODK_PreparedProvisioningRequestV17 provisioning_request = {0}; + return ODK_PrepareRequest(message, message_length, core_message_length, + ODK_Provisioning_Request_Type, nonce_values, + &provisioning_request, + sizeof(ODK_PreparedProvisioningRequestV17)); + } } OEMCryptoResult ODK_PrepareCoreProvisioning40Request( @@ -342,132 +379,12 @@ OEMCryptoResult ODK_ParseLicense( ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length); ODK_Message_SetSize(&msg, core_message_length); - if (nonce_values->api_major_version == 16) { - ODK_LicenseResponseV16 license_response_v16 = {0}; - Unpack_ODK_LicenseResponseV16(&msg, &license_response_v16); - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } + Unpack_ODK_LicenseResponse(&msg, &license_response); - // Need to manually set parsed_license fields to - // license_response_v16.parsed_license field values since - // license_response_v16 is no longer a pointer so parsed_license doesn't get - // updated during the unpacking. - parsed_license->enc_mac_keys_iv = - license_response_v16.parsed_license.enc_mac_keys_iv; - parsed_license->enc_mac_keys = - license_response_v16.parsed_license.enc_mac_keys; - parsed_license->pst = license_response_v16.parsed_license.pst; - parsed_license->srm_restriction_data = - license_response_v16.parsed_license.srm_restriction_data; - parsed_license->license_type = - license_response_v16.parsed_license.license_type; - parsed_license->nonce_required = - license_response_v16.parsed_license.nonce_required; - parsed_license->timer_limits = - license_response_v16.parsed_license.timer_limits; - parsed_license->key_array_length = - license_response_v16.parsed_license.key_array_length; - uint32_t i; - for (i = 0; i < parsed_license->key_array_length; i++) { - parsed_license->key_array[i] = - license_response_v16.parsed_license.key_array[i]; - } - // Set fields not used in V16 to default values. - parsed_license->watermarking = 0; - parsed_license->dtcp2_required.dtcp2_required = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.id = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.length = 1; - parsed_license->dtcp2_required.cmi_descriptor_0.data = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.id = 1; - parsed_license->dtcp2_required.cmi_descriptor_1.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.length = 3; - parsed_license->dtcp2_required.cmi_descriptor_1.data[0] = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.data[1] = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.data[2] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.id = 2; - parsed_license->dtcp2_required.cmi_descriptor_2.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.length = 3; - parsed_license->dtcp2_required.cmi_descriptor_2.data[0] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.data[1] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.data[2] = 0; - license_response.core_message = license_response_v16.request.core_message; - parsed_license->renewal_delay_base = 0; - } else if (nonce_values->api_major_version == 17) { - ODK_LicenseResponseV17 license_response_v17 = {0}; - Unpack_ODK_LicenseResponseV17(&msg, &license_response_v17); - - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } - - ODK_ParsedLicenseV17 src = license_response_v17.parsed_license; - - // Need to manually set parsed_license fields to - // license_response_v17.parsed_license field values since - // license_response_v17 is no longer a pointer so parsed_license doesn't get - // updated during the unpacking. - parsed_license->enc_mac_keys_iv = src.enc_mac_keys_iv; - parsed_license->enc_mac_keys = src.enc_mac_keys; - parsed_license->pst = src.pst; - parsed_license->srm_restriction_data = src.srm_restriction_data; - parsed_license->license_type = src.license_type; - parsed_license->nonce_required = src.nonce_required; - parsed_license->timer_limits = src.timer_limits; - parsed_license->watermarking = src.watermarking; - parsed_license->dtcp2_required.dtcp2_required = - src.dtcp2_required.dtcp2_required; - parsed_license->dtcp2_required.cmi_descriptor_0.id = - src.dtcp2_required.cmi_descriptor_0.id; - parsed_license->dtcp2_required.cmi_descriptor_0.extension = - src.dtcp2_required.cmi_descriptor_0.extension; - parsed_license->dtcp2_required.cmi_descriptor_0.length = - src.dtcp2_required.cmi_descriptor_0.length; - parsed_license->dtcp2_required.cmi_descriptor_0.data = - src.dtcp2_required.cmi_descriptor_0.data; - parsed_license->dtcp2_required.cmi_descriptor_1.id = - src.dtcp2_required.cmi_descriptor_1.id; - parsed_license->dtcp2_required.cmi_descriptor_1.extension = - src.dtcp2_required.cmi_descriptor_1.extension; - parsed_license->dtcp2_required.cmi_descriptor_1.length = - src.dtcp2_required.cmi_descriptor_1.length; - parsed_license->dtcp2_required.cmi_descriptor_1.data[0] = - src.dtcp2_required.cmi_descriptor_1.data[0]; - parsed_license->dtcp2_required.cmi_descriptor_1.data[1] = - src.dtcp2_required.cmi_descriptor_1.data[1]; - parsed_license->dtcp2_required.cmi_descriptor_1.data[2] = - src.dtcp2_required.cmi_descriptor_1.data[2]; - parsed_license->dtcp2_required.cmi_descriptor_2.id = - src.dtcp2_required.cmi_descriptor_2.id; - parsed_license->dtcp2_required.cmi_descriptor_2.extension = - src.dtcp2_required.cmi_descriptor_2.extension; - parsed_license->dtcp2_required.cmi_descriptor_2.length = - src.dtcp2_required.cmi_descriptor_2.length; - parsed_license->dtcp2_required.cmi_descriptor_2.data[0] = - src.dtcp2_required.cmi_descriptor_2.data[0]; - parsed_license->dtcp2_required.cmi_descriptor_2.data[1] = - src.dtcp2_required.cmi_descriptor_2.data[1]; - parsed_license->dtcp2_required.cmi_descriptor_2.data[2] = - src.dtcp2_required.cmi_descriptor_2.data[2]; - parsed_license->key_array_length = src.key_array_length; - uint32_t i; - for (i = 0; i < parsed_license->key_array_length; i++) { - parsed_license->key_array[i] = src.key_array[i]; - } - // Set fields not used in V17 to default values. - parsed_license->renewal_delay_base = 0; - license_response.core_message = license_response_v17.request.core_message; - } else { - Unpack_ODK_LicenseResponse(&msg, &license_response); - - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } + if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || + ODK_Message_GetOffset(&msg) != core_message_length) { + return ODK_ERROR_CORE_MESSAGE; } /* If the license has a provider session token (pst), then OEMCrypto should @@ -494,6 +411,12 @@ OEMCryptoResult ODK_ParseLicense( nonce_values->nonce = license_response.core_message.nonce_values.nonce; nonce_values->session_id = license_response.core_message.nonce_values.session_id; + /* Start the rental clock if not already started for reloading an offline + * license without a nonce. */ + if (!parsed_license->nonce_required && + clock_values->time_of_license_request_signed == 0) { + clock_values->time_of_license_request_signed = system_time_seconds; + } } bool license_load = (parsed_license->renewal_delay_base == OEMCrypto_License_Load); @@ -548,10 +471,14 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, */ /* If a renewal request is lost in transit, we should throw it out and create * a new one. We use the timestamp to make sure we have the latest request. - * We only do this if playback has already started. This allows us to reload - * an offline license and also reload a renewal before starting playback. + * We only do this if a renewal has been requested for this session. This + * allows us to reload an offline license and also reload a renewal from a + * previous session before starting playback. + * TODO: b/290249855 - This is reversed. It should be "!=" instead of "<". + * We will not fix this in the current release, because it is already in + * production code. Instead, this will be fixed in v19. */ - if (clock_values->timer_status != ODK_CLOCK_TIMER_STATUS_LICENSE_LOADED && + if (clock_values->time_of_renewal_request > 0 && clock_values->time_of_renewal_request < renewal_response.request.playback_time) { return ODK_STALE_RENEWAL; @@ -603,14 +530,6 @@ OEMCryptoResult ODK_ParseProvisioning( device_id_length) != 0) { return ODK_ERROR_CORE_MESSAGE; } - - const uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {0}; - /* check bytes beyond device_id_length are 0 */ - if (crypto_memcmp( - zero, provisioning_response.request.device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { - return ODK_ERROR_CORE_MESSAGE; - } } else { // v18 ODK_ProvisioningResponse provisioning_response = {0}; diff --git a/oemcrypto/odk/src/odk_message.c b/oemcrypto/odk/src/odk_message.c index df29d23..7cc05c0 100644 --- a/oemcrypto/odk/src/odk_message.c +++ b/oemcrypto/odk/src/odk_message.c @@ -8,20 +8,13 @@ #include #include +#include "odk_assert.h" #include "odk_message_priv.h" -/* - * C11 defines static_assert in assert.h. If it is available, force a compile - * time error if the abstract ODK_Message struct size does not match its - * implementation. If static_assert is not available, the runtime assert in - * InitMessage will catch the mismatch at the time a message is initialized. - */ -#ifdef static_assert -static_assert( +odk_static_assert( sizeof(ODK_Message) >= sizeof(ODK_Message_Impl), "sizeof(ODK_Message) is too small. You can increase " "SIZE_OF_ODK_MESSAGE_IMPL in odk_message.h to make it large enough."); -#endif /* * Create a message structure that references a separate data buffer. An @@ -34,7 +27,6 @@ static_assert( * unchanged by this function. */ ODK_Message ODK_Message_Create(uint8_t* buffer, size_t capacity) { - assert(sizeof(ODK_Message) >= sizeof(ODK_Message_Impl)); ODK_Message message; ODK_Message_Impl* message_impl = (ODK_Message_Impl*)&message; message_impl->base = buffer; diff --git a/oemcrypto/odk/src/odk_serialize.c b/oemcrypto/odk/src/odk_serialize.c index 3d45035..eec0266 100644 --- a/oemcrypto/odk/src/odk_serialize.c +++ b/oemcrypto/odk/src/odk_serialize.c @@ -47,7 +47,8 @@ static void Pack_ODK_TimerLimits(ODK_Message* msg, ODK_TimerLimits const* obj) { } static void Pack_ODK_ParsedLicense(ODK_Message* msg, - ODK_ParsedLicense const* obj) { + ODK_Packing_ParsedLicense const* obj, + const ODK_NonceValues* nonce_values) { /* hand-coded */ if (obj->key_array_length > ODK_MAX_NUM_KEYS) { ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); @@ -60,89 +61,31 @@ static void Pack_ODK_ParsedLicense(ODK_Message* msg, Pack_enum(msg, obj->license_type); Pack_bool(msg, &obj->nonce_required); Pack_ODK_TimerLimits(msg, &obj->timer_limits); - Pack_uint32_t(msg, &obj->watermarking); - Pack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + if (nonce_values->api_major_version >= 17) { + Pack_uint32_t(msg, &obj->watermarking); + Pack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); + if (obj->dtcp2_required.dtcp2_required) { + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + } } - Pack_enum(msg, obj->renewal_delay_base); - Pack_uint32_t(msg, &obj->key_array_length); - size_t i; - for (i = 0; i < (size_t)obj->key_array_length; i++) { - Pack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); + if (nonce_values->api_major_version >= 18) { + Pack_enum(msg, obj->renewal_delay_base); } -} - -static void Pack_ODK_ParsedLicenseV17(ODK_Message* msg, - ODK_ParsedLicenseV17 const* obj) { - /* hand-coded */ - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; - } - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); - Pack_OEMCrypto_Substring(msg, &obj->pst); - Pack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - Pack_enum(msg, obj->license_type); - Pack_bool(msg, &obj->nonce_required); - Pack_ODK_TimerLimits(msg, &obj->timer_limits); - Pack_uint32_t(msg, &obj->watermarking); - Pack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); - } - Pack_uint32_t(msg, &obj->key_array_length); - size_t i; - for (i = 0; i < (size_t)obj->key_array_length; i++) { - Pack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); - } -} - -static void Pack_ODK_ParsedLicenseV16(ODK_Message* msg, - ODK_ParsedLicenseV16 const* obj) { - /* hand-coded */ - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; - } - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); - Pack_OEMCrypto_Substring(msg, &obj->pst); - Pack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - Pack_enum(msg, obj->license_type); - Pack_bool(msg, &obj->nonce_required); - Pack_ODK_TimerLimits(msg, &obj->timer_limits); Pack_uint32_t(msg, &obj->key_array_length); size_t i; for (i = 0; i < (size_t)obj->key_array_length; i++) { @@ -229,22 +172,14 @@ void Pack_ODK_PreparedRenewedProvisioningRequest( /* @@ kdo serialize */ void Pack_ODK_LicenseResponse(ODK_Message* msg, - ODK_LicenseResponse const* obj) { + ODK_Packing_LicenseResponse const* obj) { Pack_ODK_CoreMessage(msg, &obj->core_message); - Pack_ODK_ParsedLicense(msg, (const ODK_ParsedLicense*)obj->parsed_license); -} - -void Pack_ODK_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17 const* obj) { - Pack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Pack_ODK_ParsedLicenseV17(msg, &obj->parsed_license); -} - -void Pack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16 const* obj) { - Pack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Pack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - PackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + Pack_ODK_ParsedLicense(msg, + (const ODK_Packing_ParsedLicense*)obj->parsed_license, + &obj->core_message.nonce_values); + if ((&obj->core_message.nonce_values)->api_major_version == 16) { + PackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + } } void Pack_ODK_RenewalResponse(ODK_Message* msg, @@ -307,7 +242,8 @@ static void Unpack_ODK_TimerLimits(ODK_Message* msg, ODK_TimerLimits* obj) { Unpack_uint64_t(msg, &obj->initial_renewal_duration_seconds); } -static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj) { +static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj, + const ODK_NonceValues* nonce_values) { Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); Unpack_OEMCrypto_Substring(msg, &obj->pst); @@ -315,123 +251,31 @@ static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj) { Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); Unpack_bool(msg, &obj->nonce_required); Unpack_ODK_TimerLimits(msg, &obj->timer_limits); - Unpack_uint32_t(msg, &obj->watermarking); - Unpack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); - } else { - obj->dtcp2_required.dtcp2_required = 0; - obj->dtcp2_required.cmi_descriptor_0.id = 0; - obj->dtcp2_required.cmi_descriptor_0.extension = 0; - obj->dtcp2_required.cmi_descriptor_0.length = 0; - obj->dtcp2_required.cmi_descriptor_0.data = 0; - obj->dtcp2_required.cmi_descriptor_1.id = 0; - obj->dtcp2_required.cmi_descriptor_1.extension = 0; - obj->dtcp2_required.cmi_descriptor_1.length = 0; - obj->dtcp2_required.cmi_descriptor_1.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[2] = 0; - obj->dtcp2_required.cmi_descriptor_2.id = 0; - obj->dtcp2_required.cmi_descriptor_2.extension = 0; - obj->dtcp2_required.cmi_descriptor_2.length = 0; - obj->dtcp2_required.cmi_descriptor_2.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[2] = 0; + if (nonce_values->api_major_version >= 17) { + Unpack_uint32_t(msg, &obj->watermarking); + Unpack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); + if (obj->dtcp2_required.dtcp2_required) { + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + } } - Unpack_OEMCrypto_TimerDelayBase(msg, &obj->renewal_delay_base); - Unpack_uint32_t(msg, &obj->key_array_length); - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; + if (nonce_values->api_major_version >= 18) { + Unpack_OEMCrypto_TimerDelayBase(msg, &obj->renewal_delay_base); } - uint32_t i; - for (i = 0; i < obj->key_array_length; i++) { - Unpack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); - } -} - -static void Unpack_ODK_ParsedLicenseV17(ODK_Message* msg, - ODK_ParsedLicenseV17* obj) { - Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); - Unpack_OEMCrypto_Substring(msg, &obj->pst); - Unpack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); - Unpack_bool(msg, &obj->nonce_required); - Unpack_ODK_TimerLimits(msg, &obj->timer_limits); - Unpack_uint32_t(msg, &obj->watermarking); - Unpack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); - } else { - obj->dtcp2_required.dtcp2_required = 0; - obj->dtcp2_required.cmi_descriptor_0.id = 0; - obj->dtcp2_required.cmi_descriptor_0.extension = 0; - obj->dtcp2_required.cmi_descriptor_0.length = 0; - obj->dtcp2_required.cmi_descriptor_0.data = 0; - obj->dtcp2_required.cmi_descriptor_1.id = 0; - obj->dtcp2_required.cmi_descriptor_1.extension = 0; - obj->dtcp2_required.cmi_descriptor_1.length = 0; - obj->dtcp2_required.cmi_descriptor_1.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[2] = 0; - obj->dtcp2_required.cmi_descriptor_2.id = 0; - obj->dtcp2_required.cmi_descriptor_2.extension = 0; - obj->dtcp2_required.cmi_descriptor_2.length = 0; - obj->dtcp2_required.cmi_descriptor_2.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[2] = 0; - } - Unpack_uint32_t(msg, &obj->key_array_length); - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; - } - uint32_t i; - for (i = 0; i < obj->key_array_length; i++) { - Unpack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); - } -} - -static void Unpack_ODK_ParsedLicenseV16(ODK_Message* msg, - ODK_ParsedLicenseV16* obj) { - Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); - Unpack_OEMCrypto_Substring(msg, &obj->pst); - Unpack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); - Unpack_bool(msg, &obj->nonce_required); - Unpack_ODK_TimerLimits(msg, &obj->timer_limits); Unpack_uint32_t(msg, &obj->key_array_length); if (obj->key_array_length > ODK_MAX_NUM_KEYS) { ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); @@ -494,6 +338,12 @@ void Unpack_ODK_PreparedProvisioningRequest( Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); } +void Unpack_ODK_PreparedProvisioningRequestV180( + ODK_Message* msg, ODK_PreparedProvisioningRequest* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); + Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + void Unpack_ODK_PreparedProvisioningRequestV17( ODK_Message* msg, ODK_PreparedProvisioningRequestV17* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); @@ -527,20 +377,11 @@ void Unpack_ODK_PreparedCommonRequest(ODK_Message* msg, void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); - Unpack_ODK_ParsedLicense(msg, obj->parsed_license); -} - -void Unpack_ODK_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17* obj) { - Unpack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Unpack_ODK_ParsedLicenseV17(msg, &obj->parsed_license); -} - -void Unpack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16* obj) { - Unpack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Unpack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - UnpackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + Unpack_ODK_ParsedLicense(msg, obj->parsed_license, + &obj->core_message.nonce_values); + if ((&obj->core_message.nonce_values)->api_major_version == 16) { + UnpackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + } } void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj) { diff --git a/oemcrypto/odk/src/odk_serialize.h b/oemcrypto/odk/src/odk_serialize.h index db9e2f6..1ec74b6 100644 --- a/oemcrypto/odk/src/odk_serialize.h +++ b/oemcrypto/odk/src/odk_serialize.h @@ -34,10 +34,6 @@ void Pack_ODK_PreparedRenewedProvisioningRequest( /* odk unpack */ void Unpack_ODK_CoreMessage(ODK_Message* msg, ODK_CoreMessage* obj); void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj); -void Unpack_ODK_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17* obj); -void Unpack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16* obj); void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj); void Unpack_ODK_ProvisioningResponse(ODK_Message* msg, ODK_ProvisioningResponse* obj); @@ -47,11 +43,8 @@ void Unpack_ODK_Provisioning40Response(ODK_Message* msg, ODK_Provisioning40Response* obj); /* kdo pack */ -void Pack_ODK_LicenseResponse(ODK_Message* msg, const ODK_LicenseResponse* obj); -void Pack_ODK_LicenseResponseV17(ODK_Message* msg, - const ODK_LicenseResponseV17* obj); -void Pack_ODK_LicenseResponseV16(ODK_Message* msg, - const ODK_LicenseResponseV16* obj); +void Pack_ODK_LicenseResponse(ODK_Message* msg, + const ODK_Packing_LicenseResponse* obj); void Pack_ODK_RenewalResponse(ODK_Message* msg, const ODK_RenewalResponse* obj); void Pack_ODK_ProvisioningResponse(ODK_Message* msg, const ODK_ProvisioningResponse* obj); @@ -69,6 +62,8 @@ void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg, ODK_PreparedRenewalRequest* obj); void Unpack_ODK_PreparedProvisioningRequest( ODK_Message* msg, ODK_PreparedProvisioningRequest* obj); +void Unpack_ODK_PreparedProvisioningRequestV180( + ODK_Message* msg, ODK_PreparedProvisioningRequest* obj); void Unpack_ODK_PreparedProvisioningRequestV17( ODK_Message* msg, ODK_PreparedProvisioningRequestV17* obj); void Unpack_ODK_PreparedProvisioning40Request( diff --git a/oemcrypto/odk/src/odk_structs_priv.h b/oemcrypto/odk/src/odk_structs_priv.h index b20cc72..5306a4b 100644 --- a/oemcrypto/odk/src/odk_structs_priv.h +++ b/oemcrypto/odk/src/odk_structs_priv.h @@ -85,48 +85,17 @@ typedef struct { ODK_CoreMessage core_message; } ODK_PreparedCommonRequest; -typedef struct { - OEMCrypto_Substring enc_mac_keys_iv; - OEMCrypto_Substring enc_mac_keys; - OEMCrypto_Substring pst; - OEMCrypto_Substring srm_restriction_data; - OEMCrypto_LicenseType license_type; - bool nonce_required; - ODK_TimerLimits timer_limits; - uint32_t key_array_length; - OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; -} ODK_ParsedLicenseV16; - -typedef struct { - OEMCrypto_Substring enc_mac_keys_iv; - OEMCrypto_Substring enc_mac_keys; - OEMCrypto_Substring pst; - OEMCrypto_Substring srm_restriction_data; - OEMCrypto_LicenseType license_type; - bool nonce_required; - ODK_TimerLimits timer_limits; - uint32_t watermarking; - OEMCrypto_DTCP2_CMI_Packet dtcp2_required; - uint32_t key_array_length; - OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; -} ODK_ParsedLicenseV17; - typedef struct { ODK_CoreMessage core_message; ODK_ParsedLicense* parsed_license; + uint8_t request_hash[ODK_SHA256_HASH_SIZE]; } ODK_LicenseResponse; typedef struct { - ODK_PreparedLicenseRequestV17 request; - ODK_ParsedLicenseV17 parsed_license; + ODK_CoreMessage core_message; + ODK_Packing_ParsedLicense* parsed_license; uint8_t request_hash[ODK_SHA256_HASH_SIZE]; -} ODK_LicenseResponseV17; - -typedef struct { - ODK_PreparedLicenseRequestV17 request; - ODK_ParsedLicenseV16 parsed_license; - uint8_t request_hash[ODK_SHA256_HASH_SIZE]; -} ODK_LicenseResponseV16; +} ODK_Packing_LicenseResponse; typedef struct { ODK_PreparedRenewalRequest request; @@ -154,8 +123,10 @@ typedef struct { // ../test/odk_test.cpp for validations of each of the defined request sizes. #define ODK_CORE_MESSAGE_SIZE 20u #define ODK_LICENSE_REQUEST_SIZE 90u +#define ODK_LICENSE_REQUEST_SIZE_V17 20u #define ODK_RENEWAL_REQUEST_SIZE 28u #define ODK_PROVISIONING_REQUEST_SIZE 94u +#define ODK_PROVISIONING_REQUEST_SIZE_V17 88u #define ODK_PROVISIONING40_REQUEST_SIZE 862u #define ODK_RENEWED_PROVISIONING_REQUEST_SIZE 1694u #define ODK_MESSAGECOUNTERINFO_SIZE 70u diff --git a/oemcrypto/odk/src/odk_timer.c b/oemcrypto/odk/src/odk_timer.c index 1b09551..6994532 100644 --- a/oemcrypto/odk/src/odk_timer.c +++ b/oemcrypto/odk/src/odk_timer.c @@ -254,11 +254,6 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits, if (timer_limits == NULL || clock_values == NULL || nonce_values == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } - /* Check that the API version passed in from OEMCrypto matches the version of - * this ODK library. */ - if (api_major_version != ODK_MAJOR_VERSION) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } timer_limits->soft_enforce_rental_duration = false; timer_limits->soft_enforce_playback_duration = false; timer_limits->earliest_playback_start_seconds = 0; @@ -268,7 +263,7 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits, ODK_InitializeClockValues(clock_values, 0); - nonce_values->api_major_version = ODK_MAJOR_VERSION; + nonce_values->api_major_version = api_major_version; nonce_values->api_minor_version = ODK_MINOR_VERSION; nonce_values->nonce = 0; nonce_values->session_id = session_id; @@ -300,6 +295,7 @@ OEMCryptoResult ODK_InitializeClockValues(ODK_ClockValues* clock_values, clock_values->time_of_license_request_signed = system_time_seconds; clock_values->time_of_first_decrypt = 0; clock_values->time_of_last_decrypt = 0; + clock_values->time_of_renewal_request = 0; clock_values->time_when_timer_expires = 0; clock_values->timer_status = ODK_CLOCK_TIMER_STATUS_LICENSE_NOT_LOADED; clock_values->status = kUnused; diff --git a/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp b/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp index 7602e0a..694e3ac 100644 --- a/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp +++ b/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp @@ -23,7 +23,7 @@ '-Wno-error=cast-qual', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', '-g3', '-O0', '-fsanitize=fuzzer,address,undefined', diff --git a/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp b/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp index ad20cb7..04905f1 100644 --- a/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp +++ b/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp @@ -4,8 +4,11 @@ #include "fuzzing/odk_fuzz_helper.h" #include +#include +#include "core_message_types.h" #include "odk.h" +#include "odk_attributes.h" #include "odk_structs.h" namespace oemcrypto_core_message { @@ -41,7 +44,8 @@ OEMCryptoResult odk_serialize_LicenseRequest( const ODK_LicenseRequest& core_license_request UNUSED, const ODK_NonceValues* nonce_values) { // TODO(mattfedd): hook up counters to fuzzer - const ODK_MessageCounterInfo counter_info = {0}; + const ODK_MessageCounterInfo counter_info = {0, 0, 0, 0, 0, + 0, 0, {0}, {0}, {0}}; return ODK_PrepareCoreLicenseRequest(out, SIZE_MAX, size, nonce_values, &counter_info); } @@ -58,10 +62,11 @@ OEMCryptoResult odk_serialize_RenewalRequest( OEMCryptoResult odk_serialize_ProvisioningRequest( const void* in UNUSED, uint8_t* out, size_t* size, - const ODK_ProvisioningRequest& core_provisioning, + const ODK_ProvisioningRequest& core_provisioning UNUSED, const ODK_NonceValues* nonce_values) { // TODO(mattfedd): hook up counters to fuzzer - const ODK_MessageCounterInfo counter_info = {0}; + const ODK_MessageCounterInfo counter_info = {0, 0, 0, 0, 0, + 0, 0, {0}, {0}, {0}}; return ODK_PrepareCoreProvisioningRequest(out, SIZE_MAX, size, nonce_values, &counter_info); } @@ -123,13 +128,32 @@ bool kdo_serialize_LicenseResponse(const ODK_ParseLicense_Args* args, const ODK_ParsedLicense& parsed_lic, std::string* oemcrypto_core_message) { const auto& nonce_values = args->nonce_values; - ODK_LicenseRequest core_request{nonce_values.api_minor_version, - nonce_values.api_major_version, - nonce_values.nonce, nonce_values.session_id}; + const ODK_MessageCounter counter_info = {0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; + ODK_LicenseRequest core_request{ + nonce_values.api_minor_version, nonce_values.api_major_version, + nonce_values.nonce, nonce_values.session_id, counter_info}; std::string core_request_sha_256( reinterpret_cast(args->request_hash), ODK_SHA256_HASH_SIZE); + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = parsed_lic.enc_mac_keys_iv; + parsed_license.enc_mac_keys = parsed_lic.enc_mac_keys; + parsed_license.pst = parsed_lic.pst; + parsed_license.srm_restriction_data = parsed_lic.srm_restriction_data; + parsed_license.license_type = parsed_lic.license_type; + parsed_license.nonce_required = parsed_lic.nonce_required; + parsed_license.timer_limits = parsed_lic.timer_limits; + parsed_license.watermarking = parsed_lic.watermarking; + parsed_license.dtcp2_required = parsed_lic.dtcp2_required; + parsed_license.renewal_delay_base = parsed_lic.renewal_delay_base; + parsed_license.key_array_length = parsed_lic.key_array_length; + std::vector key_array; + size_t i; + for (i = 0; i < parsed_lic.key_array_length; i++) { + key_array.push_back(parsed_lic.key_array[i]); + } + parsed_license.key_array = key_array.data(); return serialize::CreateCoreLicenseResponse( - CoreMessageFeatures::kDefaultFeatures, parsed_lic, core_request, + CoreMessageFeatures::kDefaultFeatures, parsed_license, core_request, core_request_sha_256, oemcrypto_core_message); } @@ -155,11 +179,17 @@ bool kdo_serialize_ProvisioningResponse( if (args->device_id_length > sizeof(args->device_id)) { return false; } + const ODK_MessageCounter counter_info = {0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; ODK_ProvisioningRequest core_request{ - nonce_values.api_minor_version, nonce_values.api_major_version, - nonce_values.nonce, nonce_values.session_id, + nonce_values.api_minor_version, + nonce_values.api_major_version, + nonce_values.nonce, + nonce_values.session_id, std::string(reinterpret_cast(args->device_id), - args->device_id_length)}; + args->device_id_length), + 0, + "", + counter_info}; return serialize::CreateCoreProvisioningResponse( CoreMessageFeatures::kDefaultFeatures, parsed_prov, core_request, oemcrypto_core_message); diff --git a/oemcrypto/odk/test/odk_core_message_test.cpp b/oemcrypto/odk/test/odk_core_message_test.cpp index 2ed15d4..db476ad 100644 --- a/oemcrypto/odk/test/odk_core_message_test.cpp +++ b/oemcrypto/odk/test/odk_core_message_test.cpp @@ -2,11 +2,15 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include #include +#include #include #include "OEMCryptoCENCCommon.h" #include "core_message_deserialize.h" +#include "core_message_features.h" +#include "core_message_serialize_proto.h" #include "core_message_types.h" #include "gtest/gtest.h" #include "odk.h" @@ -18,6 +22,9 @@ using oemcrypto_core_message::ODK_CommonRequest; using oemcrypto_core_message::ODK_ProvisioningRequest; using oemcrypto_core_message::deserialize::CoreCommonRequestFromMessage; using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; TEST(CoreMessageTest, RenwalRequest) { std::string oem = @@ -69,40 +76,121 @@ TEST(CoreMessageTest, ParseCoreCommonRequestFromMessage) { EXPECT_EQ(odk_common_request.session_id, 1); } -// Make sure that the first version of the V18 provisioning request (no hidden -// 4-byte value, all 0s in message counter struct) will still parse with current -// v18 code. -TEST(CoreMessageTest, ProvisionRequestRoundtrip_V18_Initial) { - std::vector should_pass = { - // Pulled from ODKTest provision round trip, extra 4 bytes removed - "000000050000005e00000012deadbeefcafebabe000000000000000000000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - // Same thing but v17 in nonce. Almost like testing on the v17 server (but - // not quite since the v17 parsing code has been slightly changed anyway) - "000000050000005e00000011deadbeefcafebabe000000000000000000000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - }; +struct TestParameters_18V0 { + std::string message; + uint16_t expected_api_minor_version; + uint16_t expected_api_major_version; + uint32_t expected_nonce; + uint32_t expected_session_id; + uint64_t expected_master_generation_number; +}; - ODK_ProvisioningRequest request; - for (auto& tc : should_pass) { - ASSERT_TRUE(CoreProvisioningRequestFromMessage(absl::HexStringToBytes(tc), - &request)); - } - - // Fail cases have non-zero values after the bytes interpreted as length - std::vector should_fail = { - // Change a 0 to a 1 in the message counter - "000000050000005e00000012deadbeefcafebabe000000000000000100000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - }; - - for (auto& tc : should_fail) { - ASSERT_FALSE(CoreProvisioningRequestFromMessage(absl::HexStringToBytes(tc), - &request)); - } +void PrintTo(const TestParameters_18V0& p, std::ostream* os) { + *os << "request = " << p.message << ", expected : {version = v" + << p.expected_api_major_version << "." << p.expected_api_minor_version + << ", nonce = " << p.expected_nonce + << ", session_id = " << p.expected_session_id + << ", master_generation_number = " << p.expected_master_generation_number + << "}"; } +class ProvisioningRoundTripTest_18V0 + : public ::testing::Test, + public ::testing::WithParamInterface {}; + +// Make sure that the first version of the V18 provisioning request (no hidden +// 4-byte value, all 0s in message counter struct) will still parse with +// current v18 code. This test is in this file rather than odk_test.cpp +// because of the use of absl::HexStringToBytes +TEST_P(ProvisioningRoundTripTest_18V0, ProvisioningRoundtrip) { + TestParameters_18V0 tc = GetParam(); + + ODK_ProvisioningRequest request; + + // Make sure we can parse the request + ASSERT_TRUE(CoreProvisioningRequestFromMessage( + absl::HexStringToBytes(tc.message), &request)); + EXPECT_EQ(request.api_minor_version, tc.expected_api_minor_version); + EXPECT_EQ(request.api_major_version, tc.expected_api_major_version); + EXPECT_EQ(request.nonce, tc.expected_nonce); + EXPECT_EQ(request.session_id, tc.expected_session_id); + + if (request.api_major_version >= 18) { + EXPECT_EQ(request.counter_info.master_generation_number, + tc.expected_master_generation_number); + } + + // Make sure we can create a response from that request with the same core + // message + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + std::string serialized_provisioning_resp; + video_widevine::ProvisioningResponse provisioning_response; + provisioning_response.set_device_certificate("device_certificate"); + provisioning_response.set_device_rsa_key("device_rsa_key"); + provisioning_response.set_device_rsa_key_iv("device_rsa_key_iv"); + if (!provisioning_response.SerializeToString(&serialized_provisioning_resp)) { + FAIL() << "Cannot set up prov response"; + } + std::string oemcrypto_core_message; + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, serialized_provisioning_resp, request, + OEMCrypto_RSA_Private_Key, &oemcrypto_core_message)); + + // Extract core message from generated prov response and match values with + // request + ODK_CommonRequest odk_common_request; + ASSERT_TRUE(CoreCommonRequestFromMessage(oemcrypto_core_message, + &odk_common_request)); + EXPECT_EQ(odk_common_request.message_type, 6u); + EXPECT_EQ(odk_common_request.nonce, tc.expected_nonce); + EXPECT_EQ(odk_common_request.session_id, tc.expected_session_id); +} + +std::vector TestCases() { + return std::vector{ + // Source: ODKTest ProvisionRequestRoundtrip running on v18.0 ODK checkout + {"000000050000005a00000012deadbeefcafebabe12345678abcdffff0000000c0000003" + "200000154001200000004ffffffffffffffffffffffffffffffffdddddddddddddddddd" + "ddddddddddddddeeeeeeeeeeeeeeeeeeeeeeee", + 0, 18, 0xdeadbeef, 0xcafebabe, 0x12345678abcdffff}, + // same as previous request, but replace counter info with all 0s + {"000000050000005a00000012deadbeefcafebabe0000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xdeadbeef, 0xcafebabe, 0x0}, + // Source: ODKTest ProvisionRequestRoundtrip running on v17.2 ODK checkout + {"000000050000005800020011deadbeefcafebabe00000020fffffffffffffffffffffff" + "fffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000" + "0000000000000000000000000000000000", + 2, 17, 0xdeadbeef, 0xcafebabe, 0x0}, + // Source: ODKTest ProvisionRequestRoundtrip running on v18.2 ODK checkout + {"000000050000005e00020012deadbeefcafebabe0000004012345678abcdffff0000000" + "c0000003200000154001200020004ffffffffffffffffffffffffffffffffdddddddddd" + "ddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeee", + 2, 18, 0xdeadbeef, 0xcafebabe, 0x12345678abcdffff}, + // Source: CDM unit tests on oemcrypto-v18 internal commit 5c77383 (pre + // v18.0 -> v18.1 ODK bump) + {"000000050000005a00000012b85dfa09000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xb85dfa09, 0x0, 0x0}, + // Same as above but non-zero counter info + {"000000050000005a00000012b85dfa09000000001000000000000001000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xb85dfa09, 0x0, 0x1000000000000001}, + // Source: CDM unit tests on oemcrypto-v18 internal commit fc46827a (post + // v18.0 -> v18.1 ODK bump) + {"000000050000005e000100127c8ac703000000000000004000000000000000000000000" + "00000000000000000001200010000746573740000000000000000000000007465737400" + "0000000000000000000000000000000000000000000000", + 1, 18, 0x7c8ac703, 0x0, 0x0}, + }; +} + +INSTANTIATE_TEST_SUITE_P(ProvisioningRoundTripTests_18V0, + ProvisioningRoundTripTest_18V0, + ::testing::ValuesIn(TestCases())); + } // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_golden_v16.cpp b/oemcrypto/odk/test/odk_golden_v16.cpp new file mode 100644 index 0000000..2e80b0a --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v16.cpp @@ -0,0 +1,4132 @@ +// Copyright 2023 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" + +namespace wvodk_test { + +namespace { + +using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::ODK_RenewalRequest; + +using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize::CreateCoreLicenseResponseFromProto; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; +using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; + +class ODKGoldenProvisionV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_ProvisioningRequest core_provisioning_request; + EXPECT_TRUE(CoreProvisioningRequestFromMessage(core_request_, + &core_provisioning_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, provisioning_response_, core_provisioning_request, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_LicenseRequest core_license_request; + EXPECT_TRUE( + CoreLicenseRequestFromMessage(core_request_, &core_license_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreLicenseResponseFromProto( + features, serialized_license_, core_license_request, + core_request_sha256_, nonce_required_, uses_padding_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + bool nonce_required_ = true; + bool uses_padding_ = true; + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_RenewalRequest core_renewal_request; + EXPECT_TRUE( + CoreRenewalRequestFromMessage(core_request_, &core_renewal_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreRenewalResponse(features, core_renewal_request, + renewal_duration_seconds_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + uint64_t renewal_duration_seconds_; + std::string core_request_; + std::string core_response_; + std::string renewal_; +}; + +// README (for ODK maintainers): Set the environment variable +// DUMP_GOLDEN_DATA="yes" +// Then set the environment variable GTEST_FILTER to the test you want to run. +// Run the script for the platform we want. E.g. run_fake_l1_tests, +// run_prov30_tests or run_prov40_tests. Look for the autogenerated code in +// $CDM_DIR/out/testbed/debug/*_data.cpp. If you are updating the ODK library, +// and you have to change the code above, then you're fine. If you have to +// change the code below then there is probably a backwards compatibility +// problem. + +////////////////////////////////////////////////////////////////////// +// Provisioning tests. +// One provisioning example from fake-l1 (with keybox) and one +// from prov30. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV16, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x04, 0x00, + 0x10, 0x57, 0x32, 0xd5, 0x9a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x04, 0x00, 0x10, + 0x57, 0x32, 0xd5, 0x9a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0x1b, 0x3b, 0x96, 0x96, 0x44, 0x40, 0x39, 0x09, 0x20, + 0xee, 0x78, 0x96, 0x7e, 0xe0, 0x07, 0xfb, 0x8a, 0xb8, 0x22, 0x22, 0x06, + 0x96, 0xfa, 0x5d, 0x9b, 0x00, 0xac, 0x16, 0x90, 0x3e, 0xae, 0xa3, 0xfb, + 0xd2, 0x0c, 0xa0, 0x5d, 0x4e, 0xbf, 0xff, 0xe1, 0x7e, 0x55, 0x52, 0x50, + 0xad, 0x47, 0xeb, 0xe5, 0x0d, 0xb7, 0xca, 0x14, 0xa8, 0xdf, 0x31, 0x6c, + 0xf3, 0x2d, 0x35, 0x31, 0x31, 0xee, 0x26, 0xa5, 0xa9, 0x3f, 0x4e, 0xcd, + 0xe4, 0x52, 0x15, 0x49, 0x33, 0xfc, 0x8f, 0x27, 0x23, 0x60, 0x48, 0xe0, + 0x1c, 0x64, 0xc3, 0xf8, 0x13, 0x9f, 0x69, 0xb2, 0x6b, 0x80, 0xb5, 0x48, + 0x42, 0x8f, 0x45, 0xc4, 0x28, 0x79, 0xf1, 0x33, 0xa9, 0x54, 0x76, 0x93, + 0xcc, 0x77, 0x7f, 0x5e, 0x37, 0x5e, 0xa6, 0xd3, 0x02, 0xcc, 0x57, 0x44, + 0xab, 0x73, 0x55, 0x78, 0x2b, 0x26, 0x05, 0xc1, 0x13, 0xa9, 0xf5, 0xc3, + 0x7d, 0x70, 0x95, 0x24, 0x98, 0x46, 0xee, 0x5c, 0x80, 0xbf, 0xff, 0xc6, + 0x81, 0x7c, 0xb9, 0xd0, 0x4a, 0xbf, 0xcd, 0x96, 0x8c, 0x39, 0xf2, 0xfd, + 0x0f, 0x60, 0xfd, 0x3b, 0xe4, 0x62, 0x09, 0x10, 0xb1, 0x85, 0x5e, 0x38, + 0xcf, 0x69, 0x85, 0x9b, 0x5d, 0x56, 0x0b, 0x45, 0xb3, 0x40, 0xe5, 0x30, + 0xed, 0xb0, 0x3c, 0x0c, 0x90, 0x08, 0xd4, 0xae, 0xf5, 0xa6, 0x13, 0xb6, + 0x57, 0x85, 0x08, 0x96, 0x56, 0x47, 0x7d, 0xc1, 0x62, 0xd9, 0xfe, 0x27, + 0xca, 0x2b, 0x75, 0x24, 0x78, 0x0d, 0xf5, 0x07, 0x7f, 0xb8, 0x6c, 0xcf, + 0x8a, 0xff, 0xfd, 0x1e, 0x09, 0xef, 0xfb, 0x28, 0x28, 0x9e, 0x95, 0x8d, + 0xdc, 0xcd, 0x9b, 0x3b, 0xb9, 0x8f, 0xc2, 0x71, 0x4f, 0xf2, 0x50, 0x6e, + 0x06, 0xb9, 0x61, 0x8e, 0xb9, 0x97, 0xce, 0xb5, 0x41, 0x6f, 0x9c, 0xdf, + 0x37, 0xb5, 0x2f, 0x8b, 0x36, 0x62, 0x4c, 0x99, 0x94, 0x6b, 0x22, 0xb7, + 0x3d, 0xf4, 0xe5, 0x1a, 0x3b, 0x3b, 0x32, 0x08, 0x28, 0xdb, 0x66, 0xcb, + 0x27, 0x93, 0x94, 0x46, 0xe7, 0x3a, 0xe6, 0xcb, 0xfd, 0x8a, 0xd4, 0x31, + 0x17, 0xa4, 0x72, 0x1a, 0x78, 0x8c, 0xad, 0xd4, 0x2e, 0xa3, 0xf9, 0x34, + 0x69, 0x39, 0xdf, 0xab, 0x85, 0x6d, 0xad, 0xbf, 0x52, 0x79, 0x1d, 0xf7, + 0x5d, 0x24, 0x5c, 0x4c, 0x14, 0x29, 0x66, 0x9b, 0xec, 0x37, 0x3f, 0x28, + 0xab, 0x89, 0x92, 0x14, 0xaa, 0x83, 0x63, 0x95, 0x95, 0x73, 0x72, 0x16, + 0x63, 0xe6, 0x13, 0x60, 0x19, 0x27, 0xbf, 0xa5, 0x95, 0xdd, 0xad, 0xf4, + 0xe1, 0x5c, 0x93, 0x47, 0xa1, 0xaf, 0x3b, 0x4f, 0x08, 0x4a, 0x9d, 0x63, + 0x8d, 0x33, 0x2a, 0x34, 0xe7, 0xa7, 0xa9, 0x67, 0xac, 0xec, 0x74, 0xee, + 0xff, 0x40, 0x24, 0x3d, 0x9d, 0x28, 0xe4, 0xdf, 0x6d, 0xdb, 0x69, 0xac, + 0x21, 0x90, 0x8d, 0x1e, 0x94, 0xa1, 0x95, 0xd9, 0xe7, 0x48, 0xb4, 0xd7, + 0xad, 0x29, 0xf8, 0x07, 0xc6, 0xbe, 0x1b, 0xd9, 0xe6, 0x2c, 0x20, 0xd3, + 0x33, 0x88, 0xd1, 0xb0, 0xe9, 0x63, 0xb1, 0x9c, 0x2f, 0x08, 0xeb, 0x59, + 0x37, 0xd9, 0x65, 0x4e, 0x53, 0xf1, 0x8e, 0xdb, 0x30, 0x3d, 0xf4, 0xa7, + 0xbe, 0xfe, 0x3c, 0xc5, 0x5c, 0xf1, 0x50, 0x5d, 0x1f, 0x29, 0x00, 0xec, + 0x17, 0x20, 0xed, 0x24, 0x29, 0xd8, 0xee, 0xe0, 0xc5, 0x13, 0x9d, 0x77, + 0xa4, 0x8d, 0x00, 0x96, 0xba, 0x58, 0x54, 0x00, 0x52, 0x3f, 0xce, 0x64, + 0x39, 0x5c, 0x64, 0x9b, 0x4c, 0x77, 0x3e, 0x4c, 0x6d, 0xfe, 0xe3, 0xf7, + 0xeb, 0x8b, 0xa0, 0xfc, 0x6e, 0x19, 0xe0, 0xeb, 0xed, 0x8b, 0x6e, 0x5f, + 0x6d, 0x2c, 0xb2, 0x3a, 0xae, 0xca, 0x85, 0x38, 0x7f, 0xb9, 0xd0, 0xf6, + 0x0a, 0x11, 0x10, 0x5a, 0x48, 0x58, 0x30, 0x0c, 0x2e, 0xb4, 0x84, 0xf2, + 0x92, 0x8e, 0xe1, 0x12, 0x42, 0x06, 0x81, 0x03, 0x7f, 0x18, 0x38, 0xfc, + 0xc1, 0x7c, 0xed, 0x67, 0x08, 0x86, 0xb1, 0xbb, 0xa7, 0xdb, 0x00, 0xfa, + 0x59, 0xfa, 0xea, 0xb5, 0x30, 0x5d, 0x4d, 0x8f, 0xff, 0xc3, 0xb1, 0x5f, + 0x7e, 0xcb, 0x2d, 0x7c, 0xe4, 0x32, 0x07, 0x7c, 0x38, 0xe8, 0xe5, 0x29, + 0x3c, 0xe4, 0x7e, 0xc8, 0xbc, 0x6f, 0x25, 0xcf, 0xbb, 0x2e, 0xb3, 0x75, + 0xf0, 0x6e, 0x49, 0x3a, 0x70, 0x8f, 0x5c, 0xcf, 0x22, 0x61, 0x70, 0x3c, + 0x0b, 0xe9, 0xfd, 0x51, 0xc0, 0xe9, 0x37, 0x67, 0x61, 0xd8, 0x75, 0xc3, + 0x0a, 0x09, 0xac, 0xd9, 0xe1, 0x83, 0xa4, 0xec, 0x63, 0x81, 0x47, 0x61, + 0xe1, 0x1e, 0xe1, 0xa9, 0xac, 0xe4, 0x37, 0x12, 0x4e, 0xf7, 0xdc, 0xd9, + 0xee, 0x33, 0x75, 0x93, 0x9b, 0xbe, 0x25, 0xb9, 0x71, 0x78, 0x7f, 0xb8, + 0xda, 0x0b, 0x8d, 0xd9, 0x29, 0x85, 0x16, 0x35, 0x23, 0x31, 0x53, 0x96, + 0x3b, 0x58, 0xb9, 0xf6, 0xcc, 0x95, 0x92, 0x1a, 0x5b, 0xf4, 0xb2, 0xac, + 0x8f, 0x23, 0x1a, 0x31, 0xd6, 0xd9, 0x2a, 0xd6, 0x5c, 0xeb, 0xca, 0x6f, + 0x57, 0x58, 0x0c, 0xa8, 0x23, 0x55, 0xa3, 0x6c, 0xc4, 0x82, 0x9d, 0x07, + 0x8b, 0xec, 0xe1, 0x55, 0xa2, 0xc7, 0x02, 0x8d, 0x3f, 0x58, 0xcb, 0x5f, + 0x16, 0x13, 0xaf, 0x1e, 0xe8, 0xc3, 0xbd, 0x8a, 0x94, 0xad, 0xec, 0xe1, + 0x12, 0x55, 0xd5, 0x72, 0x61, 0xfa, 0xa1, 0x6a, 0xfb, 0xfb, 0x4b, 0xdd, + 0x2a, 0x0c, 0x39, 0x50, 0xff, 0x0b, 0x58, 0x44, 0x0b, 0x93, 0x34, 0xa6, + 0x05, 0x43, 0x28, 0xd8, 0x6c, 0xd0, 0xc9, 0x5d, 0xf6, 0xaf, 0x74, 0x7c, + 0xc7, 0xc0, 0x45, 0xfc, 0x5a, 0x27, 0xc8, 0x7b, 0x39, 0xab, 0x41, 0x1a, + 0x00, 0x43, 0xcc, 0x4e, 0x57, 0xb2, 0xba, 0x98, 0xd2, 0x49, 0xab, 0xe7, + 0xf4, 0x0b, 0x0c, 0x00, 0x8a, 0x1e, 0x9e, 0x61, 0x86, 0xec, 0xb8, 0x15, + 0x1e, 0x7f, 0x85, 0xf3, 0xba, 0xce, 0x04, 0xf3, 0x60, 0x96, 0xd3, 0x08, + 0x54, 0x51, 0xcc, 0x28, 0xac, 0x37, 0x98, 0x01, 0xac, 0xdc, 0xf1, 0x43, + 0xcc, 0x35, 0xfe, 0xde, 0x62, 0x4e, 0x7c, 0x7b, 0xb6, 0xe1, 0xea, 0x22, + 0x35, 0x6c, 0x8a, 0x9a, 0x7e, 0xc6, 0x8a, 0x77, 0xa9, 0x8d, 0x97, 0x5a, + 0xb3, 0x0f, 0xfb, 0x31, 0x1b, 0x39, 0x28, 0x7d, 0x08, 0x66, 0x1b, 0x0d, + 0xf1, 0x38, 0x24, 0x8b, 0x6e, 0x23, 0xdf, 0xa4, 0xf0, 0x1c, 0xad, 0xc6, + 0x48, 0xa8, 0x99, 0xdd, 0x9a, 0xe3, 0x2e, 0xcc, 0xd3, 0x4d, 0x93, 0x81, + 0x35, 0x07, 0xae, 0x4d, 0xeb, 0xfe, 0x0c, 0x4a, 0x4d, 0x66, 0x4a, 0x39, + 0x1c, 0x92, 0x85, 0x2a, 0x59, 0x0c, 0x81, 0x00, 0xb5, 0x9c, 0xd4, 0x34, + 0xac, 0x53, 0xd8, 0xbd, 0x90, 0xcc, 0x44, 0x44, 0x42, 0xf1, 0x0d, 0x3b, + 0xf5, 0x28, 0xc4, 0xf9, 0xc1, 0x40, 0x79, 0x95, 0xcc, 0x36, 0x05, 0x4c, + 0x2d, 0x64, 0x8d, 0xbf, 0xf8, 0x42, 0x81, 0x94, 0xdf, 0x16, 0xf9, 0x11, + 0xeb, 0xe1, 0x46, 0xdc, 0x15, 0xb3, 0x52, 0x02, 0xb6, 0xef, 0x6a, 0x9d, + 0xcb, 0x21, 0x5c, 0xb4, 0xec, 0x74, 0x7e, 0x27, 0xd7, 0x94, 0x9e, 0xd7, + 0x6b, 0x82, 0xc0, 0x55, 0x74, 0x0e, 0x05, 0xb2, 0xcc, 0xe5, 0xc6, 0x1f, + 0x09, 0x9a, 0x28, 0x41, 0x54, 0x46, 0xc8, 0x06, 0xf7, 0x28, 0xa0, 0xb1, + 0x84, 0x98, 0x7f, 0xcf, 0x7c, 0x9e, 0x32, 0x7e, 0x9a, 0xd3, 0x8e, 0x42, + 0x6a, 0x93, 0x45, 0x52, 0x8f, 0x8a, 0x43, 0x77, 0x23, 0x1f, 0x44, 0x74, + 0x97, 0x69, 0x61, 0xa2, 0x8a, 0x83, 0xf4, 0x2a, 0x82, 0xbf, 0xd5, 0x42, + 0x71, 0x49, 0x70, 0xf7, 0xb9, 0xa5, 0x3b, 0x1b, 0xe0, 0x9d, 0x23, 0xbf, + 0x27, 0x7f, 0xdf, 0xe9, 0xf6, 0x30, 0x4b, 0xc4, 0x77, 0xce, 0x59, 0x21, + 0xe4, 0xea, 0x10, 0x74, 0x91, 0xf1, 0xcc, 0x57, 0x69, 0xb3, 0x7e, 0xbc, + 0xd1, 0xfd, 0xdc, 0xd3, 0x6a, 0xdd, 0xd3, 0xd1, 0xec, 0x3b, 0x20, 0x1d, + 0xb7, 0x77, 0xe7, 0x07, 0x26, 0xfa, 0x17, 0x6d, 0xc0, 0x98, 0xcb, 0x78, + 0xe3, 0x99, 0xf0, 0x0e, 0xc3, 0xdf, 0xcb, 0xce, 0x67, 0x56, 0xe9, 0xed, + 0xe3, 0x31, 0xf7, 0x6f, 0x4c, 0x69, 0x8c, 0x70, 0xed, 0x9a, 0x21, 0x44, + 0x45, 0xde, 0xd0, 0x78, 0x51, 0xc5, 0x5f, 0x79, 0x49, 0x77, 0x38, 0x14, + 0x8b, 0xff, 0x2b, 0x7b, 0xe3, 0x42, 0x0a, 0xf8, 0x8a, 0x63, 0x71, 0x65, + 0x15, 0x3a, 0x07, 0x2f, 0xcb, 0x43, 0x75, 0xea, 0xcf, 0xad, 0x15, 0x43, + 0x40, 0x62, 0x5b, 0x31, 0x26, 0x44, 0x4a, 0x6e, 0x96, 0xae, 0x31, 0xb7, + 0x3a, 0xc3, 0x2a, 0x04, 0xaa, 0x42, 0x23, 0x18, 0x01, 0xa3, 0xa1, 0x5a, + 0x3f, 0x2c, 0x0d, 0x7d, 0x63, 0xce, 0x0c, 0xf2, 0x76, 0x0e, 0x1a, 0xbb, + 0x41, 0xfc, 0xda, 0x39, 0x67, 0x7b, 0x95, 0x20, 0x7e, 0x8e, 0x80, 0xb0, + 0x97, 0xbb, 0xc0, 0xe4, 0xcb, 0xd6, 0x67, 0x52, 0x3c, 0x86, 0x7b, 0x0b, + 0x01, 0x13, 0x9c, 0xc2, 0x55, 0xe9, 0x5c, 0x5d, 0x9f, 0x27, 0x6b, 0xee, + 0xa5, 0xd3, 0xe2, 0x12, 0x94, 0xe1, 0xda, 0x1c, 0x91, 0xe0, 0x57, 0xe2, + 0x01, 0x79, 0x54, 0x31, 0x64, 0x86, 0xc9, 0x8f, 0x8e, 0x8b, 0xad, 0x1b, + 0x17, 0x55, 0x29, 0xd8, 0x64, 0xd9, 0xed, 0x12, 0x6e, 0x02, 0x9c, 0x12, + 0x10, 0x14, 0xf2, 0x0f, 0x97, 0x27, 0x97, 0x03, 0xee, 0x45, 0xfc, 0x77, + 0xf7, 0xf9, 0x32, 0x2a, 0x3d, 0x1a, 0xa8, 0x0b, 0x0a, 0xeb, 0x03, 0x08, + 0x02, 0x12, 0x10, 0x7c, 0xb4, 0x9f, 0x98, 0x7a, 0x63, 0x5e, 0x1e, 0x0a, + 0x52, 0x18, 0x46, 0x94, 0x58, 0x2d, 0x6e, 0x18, 0x8b, 0x8e, 0x86, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xc5, 0xc3, 0x6b, 0x93, 0xa8, 0x1d, 0x66, 0xa4, 0xdf, 0xaf, 0x17, + 0xde, 0x95, 0x15, 0x57, 0x53, 0x69, 0x66, 0x20, 0x2f, 0x09, 0x3f, 0xaa, + 0x5b, 0xcf, 0x01, 0x35, 0x1c, 0x92, 0x2e, 0x08, 0xbd, 0x9e, 0x5c, 0xdd, + 0x29, 0xa7, 0xad, 0x7d, 0xca, 0x9d, 0x50, 0x61, 0xfe, 0xc5, 0xa9, 0xc5, + 0x04, 0x8e, 0x64, 0x9d, 0x48, 0x0f, 0xaf, 0x50, 0xa6, 0x1c, 0x51, 0x64, + 0xbe, 0xf9, 0x13, 0xbc, 0xf8, 0x7f, 0x13, 0x5b, 0x52, 0x8e, 0x21, 0x62, + 0x33, 0xd8, 0xb2, 0x4f, 0xab, 0xb1, 0x9e, 0xc6, 0xd8, 0xc6, 0x83, 0x6a, + 0x47, 0x98, 0xa8, 0x76, 0x2b, 0x75, 0xa0, 0x41, 0x56, 0xe6, 0xa4, 0xd9, + 0x26, 0x1f, 0x3f, 0x4c, 0x18, 0xb0, 0xd4, 0xd9, 0x81, 0xec, 0x72, 0xed, + 0x86, 0xf5, 0x36, 0x92, 0xdf, 0xeb, 0x71, 0x94, 0xbd, 0x4a, 0x01, 0x25, + 0xe3, 0x2a, 0x3a, 0x74, 0x60, 0x6c, 0x94, 0x4d, 0x7f, 0x8a, 0x58, 0x18, + 0x5e, 0xdc, 0x62, 0xf5, 0x4c, 0xb1, 0x67, 0x47, 0xc5, 0x1d, 0xde, 0x4e, + 0x8b, 0xd8, 0x60, 0x5d, 0xb9, 0xe6, 0x9a, 0xb4, 0xc4, 0x20, 0xbd, 0xc8, + 0x71, 0x28, 0x60, 0xe0, 0xd7, 0x76, 0x25, 0xd8, 0x57, 0xe6, 0x96, 0x8a, + 0x4c, 0x61, 0xb5, 0x60, 0x23, 0xff, 0xbc, 0x7c, 0x03, 0xce, 0xab, 0xad, + 0xa7, 0x5d, 0xeb, 0xb6, 0xc5, 0x96, 0xe1, 0x13, 0xad, 0x57, 0xd9, 0x81, + 0x92, 0x04, 0x9c, 0x53, 0x5e, 0x05, 0x69, 0xf4, 0x66, 0xd7, 0x55, 0xfb, + 0x14, 0x25, 0xd2, 0x6d, 0xf6, 0x3d, 0x8d, 0x1a, 0x79, 0x41, 0xae, 0xa2, + 0xe9, 0x69, 0xbc, 0x13, 0xe1, 0xbb, 0xc9, 0x99, 0x63, 0x03, 0x10, 0x9d, + 0x7e, 0xcf, 0xc3, 0xe9, 0xdb, 0x34, 0xdd, 0x5f, 0x40, 0xd1, 0x83, 0x26, + 0x5b, 0x89, 0x05, 0xc4, 0xea, 0xa6, 0x13, 0x7c, 0x50, 0xb2, 0x2d, 0x3a, + 0xd9, 0xd0, 0xbd, 0x1d, 0xab, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x52, 0xaa, 0x01, 0x08, 0x01, 0x10, 0x00, + 0x1a, 0x81, 0x01, 0x04, 0x0f, 0x67, 0xa1, 0x95, 0xf6, 0x14, 0xb4, 0x73, + 0x19, 0xf1, 0x56, 0x2c, 0xcd, 0x7d, 0x8b, 0x59, 0x9c, 0xd4, 0x78, 0xca, + 0x7f, 0x56, 0xe4, 0x85, 0xe8, 0x2c, 0xa5, 0xa6, 0xb9, 0xd6, 0x8a, 0xa3, + 0x40, 0xb3, 0xc5, 0xc4, 0x37, 0xac, 0x52, 0x2b, 0x23, 0x48, 0x9e, 0x9b, + 0x29, 0x92, 0x70, 0x3e, 0xda, 0xa1, 0x9c, 0x9e, 0x93, 0xf2, 0x18, 0x2b, + 0x7a, 0x34, 0x89, 0x71, 0x1b, 0x46, 0x85, 0x5b, 0x1b, 0x34, 0xb9, 0xd9, + 0x16, 0x5d, 0x64, 0x4a, 0x5f, 0x22, 0xa5, 0x2c, 0x53, 0x25, 0x30, 0x89, + 0xcd, 0x42, 0x09, 0x89, 0xbd, 0xe6, 0xb1, 0xb2, 0x18, 0x24, 0xc2, 0xfb, + 0xa5, 0xa8, 0xd6, 0x93, 0x13, 0x4c, 0xeb, 0x1b, 0x40, 0xd3, 0x95, 0x09, + 0xcc, 0x7d, 0x96, 0x9d, 0x66, 0xf7, 0x5c, 0xdd, 0x71, 0x44, 0x1e, 0xa0, + 0x5c, 0x54, 0x6a, 0xf2, 0x3d, 0xaf, 0x46, 0x4f, 0x4a, 0x63, 0x40, 0xd5, + 0x22, 0x20, 0x48, 0xe7, 0x2e, 0x9f, 0xfd, 0x5e, 0x7a, 0x8f, 0x43, 0x96, + 0xdb, 0x01, 0xbe, 0xcf, 0xc4, 0x9a, 0x6f, 0xf6, 0x5b, 0x4e, 0x29, 0x5d, + 0x5b, 0x6d, 0x0a, 0x84, 0x88, 0xdb, 0xaf, 0x99, 0x66, 0xd7, 0x12, 0x80, + 0x02, 0x83, 0x54, 0x90, 0x9d, 0x0d, 0x96, 0x49, 0xb2, 0x68, 0x7c, 0x3f, + 0xe5, 0x6b, 0xa5, 0x9a, 0x96, 0xf1, 0xdf, 0x2d, 0xbe, 0x9a, 0x78, 0x20, + 0xbc, 0xdc, 0x67, 0xc0, 0x5a, 0xa2, 0x8f, 0xf7, 0x74, 0xf9, 0x33, 0x9e, + 0x45, 0x87, 0x7a, 0x73, 0x9c, 0x6b, 0xc0, 0x0a, 0x3e, 0xdb, 0x77, 0xdf, + 0xe9, 0xf0, 0x83, 0xe1, 0x2e, 0xf7, 0xf3, 0xd3, 0x3a, 0xf1, 0x20, 0x14, + 0xe4, 0x9a, 0x89, 0xb5, 0x39, 0x02, 0xf4, 0xb6, 0xbe, 0x6c, 0x2c, 0xee, + 0x00, 0xb4, 0x5e, 0x07, 0x40, 0x45, 0xfb, 0x47, 0xf4, 0xc6, 0xff, 0x02, + 0xaa, 0xcb, 0x1e, 0x88, 0xe1, 0xcd, 0xcc, 0x7b, 0x40, 0x6f, 0x53, 0xfc, + 0xd7, 0x12, 0x27, 0x5d, 0x6d, 0x56, 0xf1, 0x97, 0x65, 0xd5, 0x45, 0xd9, + 0x1e, 0x8f, 0x7e, 0x7d, 0xa1, 0x86, 0x45, 0x59, 0x2e, 0x12, 0xf3, 0x29, + 0x49, 0x3b, 0x22, 0x31, 0xee, 0xe3, 0x3e, 0x47, 0x4d, 0xfe, 0xf3, 0xf6, + 0x98, 0xa2, 0xcb, 0x47, 0xe8, 0x41, 0xf7, 0xb3, 0x74, 0x5c, 0xfb, 0xa3, + 0x0a, 0xab, 0x64, 0x40, 0xc5, 0x65, 0x50, 0x2d, 0x36, 0x30, 0xf9, 0xf3, + 0xa2, 0xf6, 0xb2, 0xb5, 0x0c, 0x09, 0x3b, 0x56, 0xeb, 0x05, 0x2b, 0x56, + 0x18, 0xd4, 0xaa, 0x5d, 0xef, 0x11, 0x66, 0x1a, 0x08, 0xe3, 0x26, 0x6c, + 0x2e, 0x6d, 0x63, 0x04, 0x2a, 0x58, 0x78, 0x3d, 0x63, 0xae, 0x76, 0xfc, + 0x0b, 0x7d, 0x06, 0x91, 0xfa, 0xb2, 0x62, 0x3d, 0x2b, 0x44, 0xc0, 0xbc, + 0x75, 0x79, 0xdb, 0xae, 0x62, 0xae, 0x58, 0xe2, 0x2b, 0x45, 0xc2, 0x80, + 0xcc, 0x2b, 0x38, 0x7a, 0xdf, 0x43, 0xf3, 0x57, 0xfe, 0xb2, 0xf0, 0x77, + 0x37, 0x21, 0xcb, 0x98, 0xed, 0xd0, 0x4f, 0x92, 0x78, 0xeb, 0x04, 0xab, + 0x7d, 0xbb, 0x47, 0x6d, 0x64, 0xa2, 0x0a, 0x83, 0x58, 0xdf, 0xad, 0xc8, + 0x0f, 0x44, 0x76, 0x4a, 0x20, 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, + 0x01, 0x12, 0x10, 0x65, 0x80, 0x2c, 0x9b, 0x62, 0x5e, 0x5a, 0x31, 0x9c, + 0x33, 0xdc, 0x1c, 0xb7, 0xc3, 0xc6, 0xd4, 0x18, 0xe3, 0xa5, 0xbd, 0xd0, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xb8, 0x05, 0x02, 0x04, 0x3c, 0x2a, 0x8a, 0x0f, 0xd8, 0xd2, 0x5c, + 0x61, 0x3e, 0x1e, 0x3e, 0x3b, 0x5e, 0x34, 0x9f, 0x33, 0x2f, 0x04, 0x51, + 0x6a, 0x75, 0x10, 0xd3, 0x80, 0x21, 0xa5, 0x62, 0x9b, 0x9a, 0xa0, 0x27, + 0xae, 0xad, 0x3c, 0x75, 0x9b, 0x7a, 0xfe, 0x70, 0xbe, 0xd6, 0x5f, 0x3d, + 0xf6, 0x86, 0x0f, 0xf5, 0xeb, 0x60, 0xb9, 0x83, 0xa3, 0xff, 0xa3, 0x3f, + 0xde, 0x06, 0xf3, 0xb7, 0x30, 0x14, 0xdf, 0xc8, 0x45, 0xab, 0x37, 0x1c, + 0x66, 0x00, 0x56, 0x2e, 0x9d, 0x90, 0x4f, 0x84, 0x2b, 0x8b, 0xa4, 0xa5, + 0xd9, 0x20, 0x0f, 0xfa, 0x3e, 0xd4, 0x5d, 0x70, 0x55, 0x20, 0xa5, 0xc3, + 0x72, 0xa8, 0x89, 0xf9, 0xe3, 0x14, 0x38, 0x62, 0x34, 0xc6, 0x89, 0x7a, + 0xe6, 0x55, 0x85, 0x1f, 0xcd, 0x9a, 0xdb, 0x4e, 0xf9, 0x12, 0x6c, 0x78, + 0x38, 0x6e, 0xa9, 0x3b, 0xcb, 0x25, 0xba, 0x3e, 0xc4, 0x75, 0xc5, 0x5c, + 0x60, 0x8e, 0x77, 0x1c, 0x76, 0x3a, 0xb0, 0x25, 0x06, 0xf9, 0xb0, 0x72, + 0x52, 0xd6, 0xab, 0xf7, 0xea, 0x64, 0xb1, 0xeb, 0xde, 0x7b, 0x95, 0xc6, + 0x40, 0x76, 0x90, 0x53, 0x3b, 0xd6, 0x89, 0x0b, 0x92, 0x74, 0xc1, 0x60, + 0x66, 0xf7, 0x4f, 0xc4, 0x01, 0xea, 0x35, 0x5f, 0x0a, 0x02, 0x10, 0x68, + 0x14, 0xd4, 0x9b, 0xf0, 0xc8, 0x9e, 0x6e, 0x1f, 0x8d, 0xb2, 0xa4, 0x78, + 0x41, 0xcd, 0x0d, 0xad, 0x79, 0x32, 0x96, 0xa1, 0x07, 0xc3, 0x62, 0x23, + 0x40, 0x4f, 0x2b, 0xf1, 0xfc, 0xa1, 0x6f, 0xd0, 0xa4, 0xb9, 0x82, 0x63, + 0x4d, 0xb6, 0x24, 0x07, 0xf8, 0xf1, 0x4a, 0xca, 0xe3, 0xb0, 0x5a, 0x03, + 0x8b, 0xd3, 0xe4, 0xbb, 0xba, 0xe4, 0x39, 0x1b, 0xbf, 0xa7, 0xa4, 0x7f, + 0xb9, 0xd0, 0x1d, 0xe8, 0x57, 0xea, 0x88, 0xe5, 0xe3, 0x6e, 0xe3, 0x6e, + 0x24, 0x58, 0x59, 0xfc, 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x12, 0x80, 0x03, 0x7e, 0x06, 0x58, 0x1a, 0x01, 0x91, 0x84, 0xab, + 0x57, 0x2a, 0xfd, 0xca, 0xdd, 0xd0, 0x3f, 0x16, 0x1c, 0xe6, 0x82, 0x00, + 0xf8, 0xe6, 0xf8, 0xad, 0x16, 0x19, 0x47, 0x36, 0x0b, 0xc8, 0xd4, 0x9c, + 0x0d, 0x68, 0x00, 0x9b, 0x1c, 0x46, 0x44, 0xf9, 0xb3, 0xf3, 0xfb, 0x6d, + 0xdf, 0xd9, 0x2e, 0xf9, 0x2d, 0xe6, 0x2d, 0x41, 0xd4, 0x59, 0xd2, 0x9d, + 0x81, 0xbf, 0xae, 0xf3, 0x97, 0x0a, 0x3a, 0x39, 0xd2, 0x5b, 0x26, 0x62, + 0xec, 0xb0, 0x3b, 0x2d, 0xa7, 0xb6, 0x83, 0x02, 0xfa, 0xa6, 0xdd, 0x98, + 0xd9, 0x5a, 0x14, 0x3c, 0xc8, 0xc1, 0xcb, 0x6a, 0xdd, 0xa7, 0x6d, 0x2e, + 0xe9, 0xc3, 0x72, 0x3f, 0xaf, 0x95, 0xa2, 0x9c, 0xdc, 0x3e, 0x96, 0x8b, + 0x68, 0x21, 0xa9, 0x1c, 0x05, 0x1c, 0xa2, 0x80, 0xa8, 0x66, 0x69, 0x71, + 0x0a, 0x1a, 0xd7, 0xa4, 0x4b, 0xf9, 0x21, 0x80, 0x27, 0x46, 0x0d, 0xf6, + 0x94, 0xe2, 0xe9, 0x27, 0x03, 0x96, 0xdf, 0x22, 0x19, 0x63, 0xf2, 0x1e, + 0xe6, 0xaa, 0x22, 0x0a, 0x5e, 0xe4, 0xa4, 0xd0, 0xfe, 0xb3, 0xd5, 0x3e, + 0xb5, 0x73, 0x2f, 0x8f, 0x91, 0xe9, 0xa9, 0x6b, 0x3b, 0x8b, 0xe2, 0x84, + 0xc5, 0x13, 0x39, 0xea, 0x28, 0x4d, 0x4d, 0x0e, 0xdd, 0x55, 0xb6, 0xad, + 0x56, 0xf7, 0x41, 0x64, 0x20, 0xe0, 0x5e, 0x05, 0x9f, 0x97, 0x34, 0xa9, + 0x6b, 0xe2, 0x5a, 0xa4, 0x45, 0x60, 0xdb, 0xa8, 0xc3, 0x87, 0x55, 0xa4, + 0x2a, 0x82, 0xbd, 0x7f, 0x88, 0xed, 0xd1, 0x9d, 0xf3, 0x46, 0xa6, 0x67, + 0xb3, 0x3b, 0x81, 0x14, 0xc7, 0x6a, 0x88, 0x38, 0xc4, 0x23, 0xd8, 0x24, + 0xa5, 0x0b, 0x23, 0x25, 0x1a, 0x08, 0x81, 0x36, 0xd6, 0xe8, 0xf4, 0x75, + 0x29, 0x9d, 0x2a, 0xfd, 0x46, 0xce, 0xa5, 0x1b, 0x5c, 0xbd, 0xf7, 0x89, + 0xa5, 0x72, 0x12, 0x5c, 0xd2, 0x4f, 0xbb, 0x81, 0x3b, 0x38, 0x7a, 0x10, + 0xcd, 0x2a, 0x30, 0xe3, 0x44, 0x76, 0x34, 0xab, 0x34, 0x08, 0xf9, 0x6b, + 0x9c, 0xf3, 0xd9, 0x88, 0x96, 0xd4, 0x05, 0xf3, 0xf5, 0x40, 0xd9, 0xc5, + 0x79, 0x62, 0x76, 0x0f, 0xcd, 0x17, 0x7c, 0xdd, 0x10, 0x1e, 0xb8, 0xa4, + 0x14, 0x8b, 0x9c, 0x29, 0xce, 0xd5, 0xea, 0xd6, 0x45, 0xa9, 0x5b, 0x69, + 0x8f, 0x1c, 0xdc, 0x6e, 0x1d, 0xb6, 0x67, 0x8b, 0x85, 0x07, 0x41, 0x86, + 0x08, 0x0d, 0x68, 0xd1, 0x3c, 0xd3, 0x7e, 0x07, 0xb1, 0x6d, 0xe3, 0x70, + 0xcd, 0x9a, 0xfb, 0x9b, 0x25, 0x56, 0x4a, 0x73, 0xa3, 0x0e, 0x2a, 0xf8, + 0x08, 0x5e, 0xa3, 0x7d, 0x31, 0x0c, 0x47, 0x4f, 0x0e, 0x67, 0xac, 0x00, + 0xca, 0x99, 0x2a, 0x52, 0x96, 0xfa, 0xed, 0xad, 0x7a, 0xa0, 0x6e, 0xcd, + 0x79, 0x0f, 0x1e, 0x3d, 0x42, 0x65, 0x58, 0xfa, 0x98, 0x38, 0x3e, 0x3c, + 0xd2, 0xed, 0x48, 0x30, 0x22, 0x04, 0x9a, 0xd5, 0x32, 0x57, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +TEST_F(ODKGoldenProvisionV16, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x04, 0x00, + 0x10, 0x9f, 0x93, 0xae, 0xf4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x04, 0x00, 0x10, + 0x9f, 0x93, 0xae, 0xf4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x09, 0xec, 0x00, 0x00, 0x01, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0x55, 0x0b, 0x58, 0xb0, 0x83, 0x56, 0x14, 0xbe, 0xe7, + 0xaa, 0x78, 0x00, 0x55, 0xab, 0xb9, 0x64, 0x31, 0x13, 0x61, 0x9a, 0x4e, + 0xc5, 0x29, 0x07, 0x01, 0x3f, 0xef, 0xe9, 0x7f, 0x3e, 0x62, 0x95, 0xbc, + 0x3c, 0xe5, 0x87, 0xde, 0xc2, 0x24, 0xad, 0x2e, 0x34, 0xa8, 0x9c, 0x0b, + 0x0c, 0x93, 0x5e, 0xa0, 0xaa, 0x56, 0x85, 0x9f, 0x14, 0xbd, 0xf8, 0x11, + 0x81, 0x49, 0x32, 0xb1, 0x64, 0x20, 0xb2, 0x33, 0xfd, 0xb6, 0x7a, 0x61, + 0xdf, 0xec, 0x9a, 0xf6, 0x54, 0x7e, 0x66, 0x97, 0x85, 0xe9, 0x12, 0xaf, + 0x82, 0x5a, 0xae, 0x48, 0xe8, 0xb3, 0xfa, 0xa1, 0x93, 0x92, 0x09, 0x6c, + 0x1e, 0x12, 0x12, 0x4a, 0x33, 0xe5, 0x1e, 0x80, 0x53, 0xce, 0xfa, 0x87, + 0x9c, 0xe0, 0xfb, 0xdd, 0x55, 0x1a, 0x51, 0x81, 0xa7, 0x3d, 0xe4, 0xd5, + 0xf1, 0x69, 0x43, 0x5f, 0x4b, 0xf9, 0xb0, 0x42, 0x46, 0x44, 0x1a, 0x93, + 0x74, 0x2c, 0x83, 0x17, 0x82, 0xb4, 0xf4, 0x85, 0x86, 0xf6, 0xfe, 0x3d, + 0x57, 0xf8, 0x7b, 0x33, 0x8e, 0x42, 0xbc, 0x48, 0x24, 0x03, 0xc5, 0xfd, + 0x97, 0x47, 0xe3, 0x73, 0xab, 0x2d, 0x79, 0x14, 0xc3, 0x3f, 0x20, 0xc4, + 0x02, 0xbf, 0x23, 0x24, 0x28, 0x05, 0x43, 0x09, 0x59, 0x91, 0x98, 0xed, + 0xcb, 0xeb, 0x8b, 0xca, 0xa5, 0x04, 0x2f, 0x8b, 0xf8, 0xa0, 0xaa, 0x42, + 0x61, 0x61, 0x24, 0x69, 0x6c, 0x04, 0xdc, 0xb5, 0x99, 0x4c, 0x9b, 0x3d, + 0x3a, 0x2c, 0x84, 0xcb, 0x14, 0x5a, 0x55, 0x10, 0xd7, 0x94, 0x17, 0x97, + 0xd9, 0xfe, 0x61, 0xfb, 0xd0, 0x2a, 0xac, 0xb9, 0xb5, 0x0e, 0xc7, 0x5d, + 0x94, 0x76, 0xcb, 0x31, 0xd8, 0xa8, 0x4e, 0x16, 0x0c, 0x04, 0xee, 0x64, + 0x9b, 0x18, 0x2e, 0x1b, 0xf5, 0xb6, 0x38, 0x8f, 0xd8, 0x5e, 0x96, 0x2e, + 0xd7, 0x5b, 0x50, 0x77, 0xdc, 0x5e, 0x12, 0x60, 0x40, 0x39, 0x51, 0x8b, + 0x73, 0x9f, 0xb5, 0x88, 0x30, 0x9d, 0xac, 0x8e, 0x3b, 0x5e, 0x75, 0x34, + 0x9c, 0x2d, 0x74, 0xa2, 0x60, 0x2a, 0x1f, 0x35, 0x4f, 0xbd, 0x3e, 0x21, + 0xc4, 0x8f, 0xdf, 0x54, 0x25, 0x2d, 0x92, 0x7f, 0xfb, 0x56, 0x8f, 0x18, + 0xc0, 0xcb, 0xc7, 0x64, 0xec, 0x88, 0x25, 0x3f, 0xb5, 0xd6, 0x27, 0x6c, + 0x2a, 0x10, 0x9f, 0x0e, 0x0e, 0x1d, 0xef, 0xb1, 0x53, 0x81, 0x96, 0xb4, + 0x4c, 0x15, 0xed, 0x2e, 0x46, 0xc5, 0x5e, 0x2f, 0xa3, 0x12, 0x5f, 0x47, + 0x37, 0x85, 0x45, 0xa5, 0x05, 0x39, 0xc4, 0xb3, 0xc2, 0x69, 0x59, 0xc0, + 0xe8, 0x87, 0x88, 0xca, 0xd4, 0xc7, 0xcc, 0xea, 0x18, 0x5b, 0xa9, 0xe9, + 0x34, 0x68, 0x5e, 0x7b, 0x6c, 0x42, 0xcd, 0xd1, 0xd9, 0xd0, 0x36, 0x1d, + 0xe7, 0x8d, 0xc8, 0xb2, 0x3c, 0x76, 0x7d, 0x9a, 0xac, 0x42, 0x29, 0x80, + 0x05, 0x53, 0x09, 0xce, 0xe8, 0x08, 0x8d, 0x3d, 0x0f, 0x5f, 0x90, 0xed, + 0xcd, 0x1d, 0xd2, 0x5d, 0x47, 0xad, 0x59, 0xc4, 0x54, 0x5d, 0x76, 0x66, + 0x72, 0x0d, 0xd7, 0xbc, 0x28, 0x89, 0x6b, 0xc8, 0x38, 0x45, 0x3f, 0x43, + 0x84, 0xb7, 0x09, 0xff, 0xf0, 0xc3, 0xb3, 0x68, 0x1c, 0x4c, 0x72, 0x75, + 0xf7, 0x0a, 0x9a, 0x77, 0x73, 0xe1, 0xfd, 0xeb, 0x40, 0x2c, 0x7c, 0x4c, + 0x6e, 0x8b, 0x61, 0x32, 0xcd, 0x91, 0xd4, 0x4e, 0xb6, 0xec, 0xdb, 0x51, + 0xb6, 0x3d, 0x3a, 0xcf, 0x53, 0x23, 0x07, 0xc0, 0x08, 0x66, 0x4b, 0x49, + 0x40, 0x25, 0x27, 0x18, 0x4f, 0xdf, 0x25, 0x68, 0x1c, 0x53, 0x63, 0x1d, + 0x51, 0x54, 0x4f, 0xd8, 0x2b, 0x70, 0x7b, 0x5c, 0xf6, 0xb9, 0x8c, 0xae, + 0x5b, 0x29, 0x41, 0x35, 0x94, 0x25, 0x44, 0x99, 0x49, 0xdc, 0x35, 0xa9, + 0x68, 0x32, 0x67, 0x17, 0x73, 0xa0, 0xea, 0x7c, 0x06, 0xd1, 0xe6, 0xd6, + 0xe8, 0xb1, 0x5b, 0x65, 0xff, 0x8f, 0xcd, 0x81, 0x4c, 0x00, 0x87, 0x46, + 0xd6, 0x25, 0x60, 0x39, 0x14, 0x61, 0x5f, 0x6f, 0x7a, 0xda, 0xd7, 0x1c, + 0x7b, 0x40, 0xd3, 0x11, 0x98, 0x78, 0xf4, 0xea, 0x75, 0xd9, 0x30, 0xdf, + 0x38, 0x8d, 0x3f, 0x6e, 0x7d, 0x35, 0xd5, 0x81, 0xf3, 0x5e, 0x49, 0x91, + 0x54, 0x33, 0x67, 0x33, 0x66, 0x9e, 0xe0, 0x6a, 0x97, 0xdd, 0x37, 0x97, + 0x43, 0xcd, 0x87, 0xff, 0x22, 0x37, 0x6e, 0x8a, 0xf9, 0xda, 0xea, 0x0d, + 0x90, 0x56, 0x2f, 0xd6, 0xe5, 0x24, 0xb6, 0xae, 0x34, 0x2a, 0x5d, 0x68, + 0x61, 0x2c, 0xb1, 0xed, 0x09, 0x65, 0x32, 0x1b, 0x4c, 0x96, 0x16, 0xdc, + 0x09, 0xc4, 0xc7, 0x33, 0x98, 0xe8, 0xe2, 0x30, 0x42, 0x55, 0x5f, 0xdf, + 0x87, 0x5e, 0xf6, 0xd4, 0x12, 0x30, 0x7e, 0x09, 0x54, 0xe7, 0x4f, 0x75, + 0x48, 0xf6, 0x82, 0x08, 0x27, 0xf5, 0x86, 0x34, 0xd8, 0x0d, 0x95, 0xcd, + 0xdb, 0xaf, 0xcd, 0xff, 0xd4, 0x69, 0xd4, 0x0f, 0x08, 0xdd, 0x46, 0x1a, + 0x74, 0x5f, 0x4d, 0x55, 0xf2, 0x92, 0xef, 0x27, 0x6d, 0x6d, 0x50, 0xdb, + 0x48, 0xae, 0x0a, 0x5a, 0x6f, 0xd0, 0x87, 0x78, 0x18, 0x4d, 0x94, 0x85, + 0x2e, 0x1e, 0x20, 0x5d, 0xe2, 0x79, 0xc2, 0xdc, 0x0b, 0xdc, 0x9f, 0xbf, + 0xb3, 0xa7, 0xa4, 0xbd, 0xc9, 0x6b, 0x80, 0x43, 0x7a, 0x9f, 0xf5, 0x7d, + 0x07, 0x57, 0xa9, 0x17, 0xde, 0xbb, 0x76, 0xfb, 0x23, 0x93, 0x53, 0xb2, + 0xfe, 0xa8, 0xe5, 0x72, 0xe1, 0xcd, 0xa0, 0x64, 0x5b, 0x04, 0xa5, 0x36, + 0x98, 0xc8, 0x95, 0x02, 0x0e, 0x64, 0x90, 0x91, 0xa7, 0x09, 0xca, 0xe8, + 0xe4, 0xb1, 0x94, 0x89, 0x94, 0x79, 0x70, 0xb2, 0xec, 0xde, 0x8a, 0xef, + 0xd4, 0xf9, 0x6e, 0x25, 0xc8, 0x7b, 0x60, 0xe2, 0x5f, 0x4b, 0xb8, 0x9f, + 0x12, 0x30, 0x4a, 0x47, 0x4e, 0xb3, 0x41, 0x4a, 0x8a, 0xf7, 0xbc, 0x7d, + 0xc1, 0xca, 0xb2, 0x34, 0x17, 0xd6, 0xd7, 0x68, 0x82, 0x4d, 0x1d, 0x9b, + 0x74, 0xda, 0x22, 0xaa, 0x56, 0x48, 0x32, 0x06, 0x70, 0x4a, 0x45, 0x3c, + 0x4d, 0x05, 0x25, 0xf2, 0x4b, 0x3d, 0xb2, 0x8c, 0x13, 0xe1, 0x74, 0xd3, + 0x6f, 0x92, 0xd2, 0xbd, 0x3d, 0x46, 0x57, 0xae, 0x65, 0x75, 0x26, 0xbb, + 0xd2, 0x0b, 0xb6, 0x12, 0x6b, 0x29, 0x51, 0x03, 0x15, 0x7f, 0x72, 0x5f, + 0x07, 0x09, 0xa2, 0x90, 0xbd, 0x78, 0x78, 0x7d, 0x9f, 0xb3, 0x04, 0x61, + 0xb8, 0x03, 0xb9, 0xea, 0xbf, 0x5c, 0xd0, 0x84, 0xee, 0x74, 0xb2, 0xfa, + 0xe3, 0xbf, 0x5e, 0xfb, 0x85, 0x89, 0xe6, 0x0f, 0xa1, 0xd6, 0x68, 0x73, + 0xaa, 0x36, 0x90, 0x8b, 0xf1, 0x19, 0x07, 0x74, 0xbd, 0x5f, 0x88, 0x5a, + 0x8d, 0x88, 0xfe, 0xde, 0xac, 0x29, 0xff, 0x73, 0x95, 0x9d, 0xfd, 0x4b, + 0x91, 0x9d, 0x39, 0x23, 0x61, 0x0a, 0x84, 0x5a, 0x89, 0x47, 0xb8, 0xd9, + 0x30, 0xcc, 0x6b, 0xd0, 0xfe, 0x62, 0xe2, 0x6e, 0xf7, 0x63, 0xcb, 0x5d, + 0x26, 0xf5, 0x8f, 0x29, 0x06, 0x4f, 0x03, 0xbe, 0x76, 0x3a, 0x32, 0xe3, + 0x44, 0xbb, 0x0f, 0x91, 0xe9, 0x90, 0x70, 0x41, 0xfd, 0x5b, 0x7c, 0x97, + 0x2e, 0x60, 0x54, 0xfe, 0xde, 0x6f, 0x54, 0x1e, 0x68, 0x99, 0x58, 0xd1, + 0xef, 0x87, 0x9a, 0xe1, 0x53, 0x6c, 0x16, 0xbf, 0x05, 0x56, 0xf6, 0xb3, + 0xdb, 0x73, 0x43, 0x86, 0xa2, 0xa6, 0xe1, 0x0d, 0xb9, 0xee, 0x2a, 0xa0, + 0x80, 0x11, 0x1e, 0x20, 0x7a, 0xe7, 0xf1, 0x70, 0x37, 0x31, 0xaa, 0xa1, + 0x95, 0x37, 0x00, 0xeb, 0x32, 0x3d, 0x45, 0x4d, 0xbd, 0x57, 0x1a, 0xcb, + 0x8f, 0x36, 0xd9, 0xd6, 0xac, 0x25, 0xe5, 0x38, 0xb8, 0x17, 0xf9, 0x9e, + 0x44, 0xab, 0xde, 0xb0, 0xe5, 0x03, 0xfb, 0xa7, 0x17, 0x18, 0x56, 0x87, + 0xae, 0xc6, 0xfa, 0x15, 0xbe, 0xcf, 0x48, 0x48, 0x28, 0x74, 0xd9, 0x5a, + 0x4a, 0x06, 0x83, 0x13, 0xb9, 0x15, 0x3d, 0x52, 0x44, 0x47, 0x00, 0x93, + 0x25, 0x41, 0x7b, 0x61, 0x75, 0x89, 0x8c, 0xf1, 0xf5, 0xbd, 0x3d, 0x75, + 0x35, 0xf6, 0x26, 0xce, 0xcd, 0x78, 0xda, 0x46, 0xf6, 0x41, 0xe8, 0xf0, + 0x81, 0xe0, 0xaa, 0x0e, 0x9e, 0xdf, 0x61, 0xea, 0x50, 0x74, 0xe2, 0xa2, + 0x34, 0x47, 0x85, 0x8d, 0x26, 0x5c, 0x35, 0x8e, 0x20, 0x25, 0xf1, 0x1e, + 0x4f, 0x8c, 0xd3, 0xd3, 0x21, 0xe8, 0x8d, 0x00, 0x00, 0x28, 0x1a, 0x6d, + 0x57, 0x67, 0xf4, 0x94, 0xbc, 0x24, 0x6c, 0x62, 0x7e, 0xbd, 0xb0, 0x0f, + 0x53, 0xd0, 0x4d, 0xaf, 0x49, 0x73, 0x62, 0xbc, 0x5c, 0xf7, 0x8b, 0x7e, + 0x14, 0xad, 0x94, 0xdb, 0x21, 0xd5, 0xc9, 0x6c, 0x32, 0x2e, 0x10, 0xbc, + 0x93, 0xd4, 0x91, 0xf3, 0x1b, 0xa9, 0x51, 0xcc, 0x5e, 0x37, 0x41, 0xda, + 0x46, 0x48, 0xa0, 0xf6, 0x4d, 0x8b, 0xdc, 0x3d, 0x3d, 0x4a, 0x7a, 0xcf, + 0xfd, 0x25, 0x25, 0x96, 0x9a, 0x60, 0x6c, 0x59, 0xb0, 0x24, 0x96, 0xb5, + 0xab, 0xc4, 0xda, 0xff, 0xdd, 0x1a, 0x26, 0x96, 0x52, 0x73, 0xab, 0x2a, + 0xd2, 0x44, 0x15, 0x2a, 0x68, 0x76, 0xdf, 0x95, 0x43, 0x08, 0xdf, 0x08, + 0x16, 0x46, 0xa1, 0x19, 0x47, 0xb8, 0x40, 0x97, 0x9a, 0x20, 0x35, 0x75, + 0x20, 0xda, 0x3a, 0x72, 0xe5, 0xfc, 0xcc, 0x52, 0x4a, 0x34, 0x4d, 0x12, + 0x10, 0x21, 0x5e, 0x5c, 0x13, 0xd3, 0x63, 0x2a, 0xbe, 0x0f, 0x46, 0x0b, + 0xe9, 0x62, 0x44, 0x59, 0x05, 0x1a, 0xfb, 0x09, 0x0a, 0xbe, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x35, 0x7f, 0x7a, 0xfa, 0x7d, 0x33, 0x42, 0x33, 0x1c, + 0x8c, 0xd1, 0x07, 0xdd, 0xc7, 0x5a, 0x96, 0x18, 0x91, 0x8d, 0x86, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xa9, 0x95, 0xe6, 0x30, 0x45, 0x01, 0x73, 0xab, 0x29, 0x01, 0x12, + 0xa5, 0x63, 0x4d, 0x25, 0xc3, 0xca, 0xfc, 0x14, 0x0b, 0xd7, 0x06, 0xcf, + 0x9f, 0x22, 0x38, 0xc0, 0x09, 0x5d, 0x10, 0xfc, 0x2d, 0xb1, 0xcf, 0x27, + 0x6d, 0x37, 0x63, 0x78, 0xe7, 0x54, 0x95, 0xac, 0xd6, 0xd0, 0x1f, 0xc5, + 0xdb, 0x19, 0x8a, 0xf8, 0xa8, 0x3e, 0x52, 0x9e, 0x65, 0x97, 0xb0, 0xe3, + 0x8b, 0x64, 0xae, 0x7b, 0x78, 0x69, 0x90, 0x98, 0xe9, 0x4f, 0x8f, 0x01, + 0xeb, 0xec, 0x18, 0xbe, 0x19, 0x32, 0x82, 0xa0, 0x05, 0x58, 0xfa, 0xba, + 0x29, 0x73, 0x01, 0xf4, 0xb4, 0x00, 0xc7, 0x6c, 0xb0, 0x62, 0xf1, 0x30, + 0xb8, 0xeb, 0x3c, 0x7a, 0x5c, 0x5b, 0xb2, 0xc5, 0xcf, 0x3c, 0x55, 0x65, + 0x09, 0x72, 0xc0, 0x52, 0xa0, 0x2e, 0x32, 0xaa, 0x96, 0x52, 0x51, 0x4e, + 0x4d, 0x86, 0x62, 0x34, 0xfd, 0x2b, 0x78, 0x64, 0xb4, 0xa0, 0x1e, 0xb7, + 0xe2, 0x01, 0xa1, 0x0c, 0xc5, 0x31, 0xe7, 0xb6, 0x7e, 0x2a, 0xa9, 0xa9, + 0xf7, 0x57, 0x60, 0xa5, 0xb7, 0x39, 0x85, 0xd6, 0xb5, 0x1a, 0xae, 0xba, + 0xf8, 0x11, 0xeb, 0xb1, 0x95, 0xe4, 0xb5, 0xae, 0xd4, 0x00, 0xc9, 0x6b, + 0x10, 0x5c, 0xaf, 0xe8, 0x36, 0xd5, 0xe1, 0x47, 0xfa, 0x89, 0x42, 0xe9, + 0x12, 0x4a, 0x1d, 0xf0, 0x16, 0x65, 0x41, 0x29, 0x2e, 0x42, 0x07, 0xe3, + 0x42, 0xf6, 0x9c, 0xed, 0xd1, 0xa9, 0x5d, 0x10, 0xdd, 0x86, 0xc6, 0xd2, + 0xe2, 0x1a, 0xe4, 0xa8, 0xd9, 0xb7, 0xcf, 0xce, 0x6c, 0x2e, 0x00, 0x1e, + 0xa7, 0x9c, 0x36, 0x84, 0x50, 0x92, 0x87, 0xbb, 0x62, 0xd5, 0x33, 0x44, + 0x61, 0x6f, 0x95, 0x57, 0x17, 0xf0, 0x37, 0xf5, 0x99, 0x7a, 0xce, 0xf6, + 0x1f, 0xdd, 0x67, 0x87, 0xec, 0xad, 0xc7, 0x76, 0x32, 0x0b, 0x83, 0x12, + 0x4f, 0xaa, 0xa4, 0x67, 0x0b, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x12, 0x80, 0x02, 0x0d, 0x38, 0xb8, 0x44, + 0x8b, 0xd0, 0x35, 0x1b, 0x5c, 0xda, 0x4c, 0x50, 0xcf, 0x10, 0x3b, 0x29, + 0x95, 0xb2, 0x98, 0x34, 0xfa, 0xcb, 0x50, 0x34, 0xce, 0x10, 0x47, 0xa8, + 0x3d, 0xaa, 0xa1, 0xbc, 0x84, 0xd6, 0x6f, 0x8b, 0x3b, 0xf5, 0xe3, 0xef, + 0x9a, 0x67, 0xaf, 0x8d, 0xd7, 0x10, 0x15, 0x5f, 0x8d, 0x9b, 0x6a, 0x0d, + 0x98, 0xb1, 0x2f, 0x2d, 0x7a, 0xbd, 0x57, 0xe5, 0x39, 0x1a, 0xb5, 0x54, + 0x42, 0x18, 0x30, 0x7d, 0x44, 0xbd, 0xc7, 0x6a, 0xa6, 0x5c, 0x46, 0x2a, + 0x3e, 0xef, 0x45, 0x3c, 0xd1, 0xdc, 0x7e, 0xa4, 0xfd, 0x86, 0x40, 0x19, + 0xe6, 0x87, 0x5e, 0xf0, 0x9d, 0xb6, 0x4d, 0xa0, 0xb9, 0x6d, 0xc1, 0xd5, + 0x91, 0x7b, 0x35, 0xae, 0x31, 0x18, 0xb7, 0x51, 0x84, 0x62, 0x26, 0x57, + 0x90, 0x74, 0x59, 0x11, 0x0d, 0xf2, 0xe8, 0x0b, 0x9f, 0xc3, 0x0e, 0x91, + 0xd6, 0xc6, 0xbe, 0x23, 0xe2, 0x75, 0x3f, 0x61, 0x91, 0x0a, 0x6c, 0xb4, + 0x9f, 0x9f, 0x20, 0x70, 0xdf, 0x80, 0xb8, 0x5d, 0x06, 0x4c, 0x84, 0x96, + 0xf3, 0xde, 0x66, 0x76, 0x96, 0x46, 0xe3, 0xf9, 0xb6, 0xee, 0x3a, 0x7f, + 0x21, 0x3a, 0x77, 0x6a, 0xd9, 0xa4, 0x6b, 0x32, 0xc9, 0x33, 0x0d, 0x61, + 0xa5, 0x60, 0xc8, 0xd8, 0xc3, 0x20, 0x15, 0x77, 0xe5, 0x17, 0xfd, 0x33, + 0xc1, 0xa2, 0x00, 0xd1, 0x67, 0x45, 0x24, 0x8e, 0xaa, 0x8a, 0x23, 0x29, + 0xbc, 0x3d, 0x9d, 0x0b, 0x82, 0x69, 0x06, 0xc3, 0x9f, 0xab, 0x8d, 0x4e, + 0x60, 0xaf, 0x26, 0xc0, 0xcc, 0xc7, 0x3a, 0x16, 0x9e, 0xe9, 0x06, 0x9a, + 0xa2, 0xe2, 0x2a, 0x4c, 0xcf, 0x7d, 0xd6, 0x0d, 0x29, 0x1b, 0x57, 0x6e, + 0x4b, 0x15, 0x8d, 0x1c, 0xd9, 0x1f, 0x00, 0x15, 0x07, 0x53, 0x96, 0xcf, + 0x26, 0xca, 0xe7, 0x19, 0x30, 0xf8, 0x2c, 0x5e, 0x05, 0xbe, 0x50, 0x68, + 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, 0x01, 0x12, 0x10, 0x6b, 0x99, + 0x4c, 0x4a, 0x94, 0x73, 0x2e, 0x0c, 0x81, 0xca, 0xcc, 0x34, 0x71, 0xcf, + 0x8a, 0x63, 0x18, 0xe1, 0xa7, 0xbd, 0xd0, 0x05, 0x22, 0x8e, 0x02, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbc, 0xfa, 0x43, 0x1b, + 0xaa, 0xbb, 0xd9, 0xb7, 0x5b, 0xb8, 0xec, 0xf6, 0xf0, 0xb6, 0xb1, 0xa6, + 0xc3, 0xd1, 0x45, 0xb8, 0x6e, 0x40, 0x85, 0xa0, 0xcf, 0x24, 0x68, 0x91, + 0xc2, 0x45, 0x8d, 0x4e, 0xf2, 0x42, 0x9e, 0xaa, 0x72, 0xed, 0x86, 0xdc, + 0xfb, 0x85, 0x29, 0x3f, 0x90, 0xb0, 0xc5, 0x12, 0x4e, 0x42, 0x0b, 0xce, + 0xfa, 0x0f, 0x83, 0x1a, 0x4c, 0xe9, 0xc9, 0xc1, 0x0b, 0x12, 0xeb, 0xc7, + 0xc5, 0x1a, 0xd5, 0xa1, 0x8d, 0x26, 0x6d, 0x78, 0x87, 0x2d, 0xc2, 0x63, + 0x84, 0x6c, 0x5e, 0x78, 0xd8, 0x0a, 0x78, 0x68, 0xc2, 0x82, 0x40, 0x0a, + 0xf7, 0x02, 0x63, 0x97, 0xec, 0x1c, 0x08, 0x91, 0x2b, 0xc2, 0xa7, 0xe9, + 0x17, 0xb8, 0x7b, 0x84, 0xed, 0xdc, 0x5c, 0x6c, 0x11, 0x38, 0xb4, 0x18, + 0xff, 0x11, 0x32, 0xd4, 0x34, 0x48, 0xc0, 0xa0, 0x47, 0x2d, 0x81, 0xe2, + 0xb6, 0x41, 0xe9, 0xd4, 0x5a, 0xf1, 0x75, 0x3d, 0x94, 0xf7, 0xb7, 0xf6, + 0x3b, 0x35, 0x78, 0x9c, 0x72, 0x7b, 0x12, 0xe0, 0x73, 0xd9, 0x92, 0x3d, + 0x23, 0xe6, 0xa2, 0x50, 0x95, 0xcc, 0xbc, 0x8b, 0xef, 0xa3, 0x09, 0x85, + 0x85, 0xb8, 0x74, 0xa8, 0x10, 0xab, 0x0a, 0x18, 0x35, 0x7d, 0x27, 0x5c, + 0x6a, 0x52, 0x0e, 0x5b, 0xb9, 0xa9, 0x2c, 0xee, 0xdf, 0x6e, 0xa3, 0x49, + 0xbf, 0x32, 0x3a, 0x6a, 0xe2, 0x72, 0xe4, 0xdd, 0x6f, 0xfb, 0x89, 0xf3, + 0xdf, 0xa6, 0x4a, 0x52, 0x8a, 0x9d, 0xd5, 0x49, 0x04, 0x33, 0xd2, 0xa2, + 0xca, 0x74, 0x3b, 0x2c, 0x34, 0xf1, 0x12, 0x2f, 0x85, 0xc3, 0x3c, 0x4f, + 0x73, 0x1f, 0x2c, 0x8a, 0xd2, 0x6f, 0xa4, 0xb7, 0x91, 0xf9, 0x5f, 0x79, + 0x04, 0x9c, 0x69, 0xe6, 0x62, 0xab, 0x15, 0x91, 0x23, 0x0e, 0x62, 0xbc, + 0x80, 0x1f, 0x97, 0x5f, 0x33, 0xe7, 0x33, 0x9e, 0x91, 0xf6, 0xdc, 0xfb, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, 0x3d, 0x12, 0x80, 0x03, 0x0e, + 0x78, 0x2b, 0x14, 0x53, 0x5c, 0x82, 0x9a, 0x00, 0x8d, 0x49, 0x18, 0x5e, + 0x21, 0xb6, 0xfb, 0xeb, 0xa7, 0xee, 0x10, 0x26, 0x75, 0x6f, 0xcd, 0x45, + 0xe8, 0x64, 0x72, 0x56, 0x9e, 0x39, 0x3d, 0x7e, 0x6a, 0x70, 0x5d, 0xf1, + 0x4a, 0xc0, 0x23, 0x66, 0x07, 0x04, 0x4c, 0x8d, 0x18, 0xf7, 0xa7, 0xc5, + 0xc3, 0x18, 0x3f, 0x72, 0xf4, 0xfd, 0xad, 0xb5, 0xc6, 0x8b, 0x77, 0x2e, + 0x20, 0xfb, 0xe4, 0x7b, 0xef, 0x79, 0xef, 0xcd, 0x7f, 0x21, 0x9c, 0x32, + 0xcf, 0xf4, 0xc8, 0xee, 0xfa, 0x81, 0x38, 0x7e, 0x36, 0xec, 0xdd, 0x29, + 0x94, 0xc3, 0xb7, 0x25, 0x6e, 0x77, 0x90, 0x81, 0xbe, 0x6c, 0x16, 0x75, + 0x83, 0x33, 0x41, 0x78, 0x74, 0xb3, 0x54, 0xa4, 0xe6, 0x1c, 0x95, 0xa2, + 0x1c, 0x2b, 0x93, 0x6c, 0xb7, 0xd3, 0x37, 0x31, 0x57, 0xa8, 0x95, 0xce, + 0x0e, 0x16, 0xc0, 0xbb, 0x4e, 0x23, 0xca, 0x23, 0x2a, 0x66, 0x4c, 0xe5, + 0xac, 0xc3, 0x0a, 0xe3, 0x31, 0x32, 0x53, 0xad, 0x2c, 0x70, 0x1d, 0x5a, + 0x20, 0x27, 0xf2, 0x6f, 0x0c, 0x53, 0x7b, 0x71, 0x77, 0x94, 0x5c, 0x28, + 0xc3, 0xf3, 0x3e, 0x48, 0x5f, 0x1a, 0xa2, 0x18, 0xf3, 0x53, 0xb4, 0xa5, + 0x3c, 0xb1, 0x9c, 0x67, 0x39, 0x68, 0x8d, 0xfa, 0x96, 0x8f, 0x6f, 0xdd, + 0x29, 0x35, 0xbc, 0x2c, 0x0d, 0xe5, 0xd7, 0xff, 0x25, 0x2d, 0xcd, 0x3f, + 0xdc, 0xb9, 0xa0, 0xaf, 0x5a, 0x41, 0x3c, 0xce, 0xa9, 0xab, 0x75, 0xee, + 0xf2, 0xbe, 0xee, 0xa8, 0x3b, 0x29, 0xaf, 0x07, 0xbf, 0x84, 0xbd, 0xdd, + 0xe3, 0x83, 0x42, 0xd5, 0x40, 0x8d, 0x39, 0xcf, 0x4d, 0xa9, 0xa3, 0x0c, + 0xd8, 0xbc, 0xfc, 0x32, 0xa5, 0x03, 0x63, 0x22, 0x82, 0xde, 0x3d, 0x1d, + 0xd9, 0x54, 0xd8, 0xcc, 0x57, 0x10, 0x8b, 0xbe, 0xc3, 0xae, 0x52, 0xbc, + 0xaf, 0x17, 0x62, 0xe7, 0x9f, 0x42, 0x75, 0xb8, 0x92, 0x7f, 0x61, 0xd8, + 0x08, 0x57, 0x40, 0x10, 0x2c, 0x85, 0x96, 0x97, 0x48, 0x14, 0xde, 0xb0, + 0x5f, 0xf9, 0xc6, 0xde, 0xfc, 0x25, 0x9c, 0x4d, 0x6e, 0x52, 0x54, 0xf0, + 0xa2, 0xa5, 0xfc, 0x32, 0x45, 0x75, 0x94, 0xbe, 0xe9, 0x57, 0x2a, 0xb8, + 0x6e, 0xab, 0x0f, 0xf5, 0x0c, 0x9a, 0xf9, 0x29, 0x06, 0x65, 0x54, 0xd8, + 0x93, 0x98, 0x3a, 0x5c, 0x71, 0x52, 0x0d, 0xf3, 0x4b, 0xc4, 0xc5, 0xbd, + 0x34, 0xb3, 0x58, 0xcf, 0x83, 0x94, 0xf0, 0x60, 0xb7, 0x91, 0x56, 0xff, + 0x21, 0x7d, 0x03, 0xeb, 0xc9, 0x09, 0x0c, 0x45, 0x6d, 0xa0, 0xaa, 0xd3, + 0x58, 0xc6, 0xea, 0x9d, 0x2c, 0xfc, 0xd3, 0x0a, 0x43, 0x62, 0x66, 0x4d, + 0xdc, 0x25, 0xe2, 0x7f, 0x7e, 0x39, 0x33, 0x82, 0x97, 0x30, 0xfe, 0xdd, + 0x4d, 0x64, 0x56, 0xff, 0xf1, 0x76, 0xc2, 0x78, 0x0b, 0xce, 0xb3, 0x22, + 0x04, 0xf4, 0xae, 0x93, 0x9f, 0x2a, 0x80, 0x02, 0x37, 0x6c, 0x07, 0x7f, + 0x9f, 0x8b, 0xca, 0x0e, 0xea, 0x0d, 0xe4, 0x29, 0x16, 0x0b, 0x7b, 0xd9, + 0x6a, 0xc3, 0xa7, 0xa6, 0xc6, 0xfa, 0x51, 0x14, 0xb9, 0x84, 0xa7, 0x84, + 0xbf, 0xc6, 0x8b, 0x6d, 0xc9, 0xf6, 0x38, 0xc4, 0x3e, 0x63, 0xdf, 0xf9, + 0x9f, 0x55, 0x45, 0xe2, 0xb4, 0x5e, 0x54, 0xf2, 0x88, 0x0d, 0x00, 0x8b, + 0x21, 0x19, 0x2e, 0x10, 0x2d, 0x3c, 0x28, 0x19, 0x6a, 0x8c, 0x2a, 0xef, + 0x1a, 0xc1, 0x94, 0x79, 0x29, 0xe5, 0xc6, 0x27, 0x92, 0x64, 0xc6, 0x59, + 0x5e, 0x04, 0x65, 0xf2, 0x20, 0x00, 0x2e, 0xaf, 0x65, 0xa2, 0x88, 0xf9, + 0x64, 0x80, 0xe1, 0x47, 0xe9, 0xaa, 0x9c, 0x6a, 0x20, 0xf4, 0xed, 0xbe, + 0x03, 0x51, 0x7c, 0xe4, 0x6b, 0x51, 0xc7, 0x3d, 0x48, 0x3e, 0x0d, 0xe0, + 0x27, 0x2a, 0x3a, 0xe6, 0x7a, 0x37, 0xa7, 0x07, 0x63, 0x8e, 0x93, 0x9a, + 0x92, 0x8c, 0xdb, 0xf0, 0x88, 0xc7, 0xac, 0xc7, 0xba, 0x47, 0x71, 0xb2, + 0xd8, 0xff, 0x04, 0xa3, 0xf8, 0x3a, 0xa6, 0x70, 0xbf, 0x45, 0x45, 0x5c, + 0x97, 0x1b, 0xf1, 0x48, 0xd4, 0x5f, 0xdd, 0xb3, 0xb2, 0x6c, 0x3e, 0xba, + 0xa1, 0x8e, 0x6d, 0x59, 0xd5, 0xb2, 0x01, 0xf5, 0xf5, 0x4c, 0xae, 0x7c, + 0xf3, 0xb5, 0xc6, 0x61, 0x1c, 0xd8, 0x10, 0x1f, 0x9a, 0xc1, 0x3b, 0x8f, + 0xb1, 0x28, 0x9b, 0x41, 0x47, 0xb5, 0x97, 0x9e, 0xc3, 0x5c, 0xe6, 0x14, + 0x3f, 0x54, 0xc6, 0x17, 0xc6, 0x50, 0xd0, 0xa7, 0x37, 0xc1, 0x00, 0x89, + 0x52, 0xc3, 0x25, 0x08, 0x4e, 0x7b, 0xd9, 0x66, 0x37, 0xfa, 0x76, 0x05, + 0x10, 0x99, 0xae, 0x4d, 0xc6, 0x6a, 0x14, 0x77, 0x28, 0x35, 0x15, 0x97, + 0x5b, 0x29, 0x73, 0x5c, 0x6d, 0x21, 0xfa, 0x2a, 0x52, 0xcc, 0xe9, 0x03, + 0x3c, 0xc8, 0x40, 0xa5, 0xb2, 0x17, 0x28, 0x5f, 0x9e, 0xd0, 0x91, 0xe1, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf5, 0xa0, 0xec, 0x80, 0x00, 0x00, 0x00, 0x08, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x04, 0x00, 0x10, + 0xf5, 0xa0, 0xec, 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x43, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x21, 0x00, 0x00, 0x00, 0x20, + 0xdd, 0xe0, 0xee, 0x17, 0xa1, 0xc8, 0xbf, 0xa3, 0x70, 0x90, 0x3e, 0xe7, + 0x4a, 0xf6, 0x02, 0x32, 0x78, 0x72, 0x06, 0x9a, 0x70, 0x4d, 0xfd, 0x14, + 0x04, 0x5d, 0xb3, 0xee, 0x90, 0x6e, 0x18, 0x4b, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x31, 0x33, 0x44, 0x43, 0x39, 0x42, 0x38, 0x45, + 0x35, 0x36, 0x33, 0x35, 0x39, 0x45, 0x37, 0x32, 0x30, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x33, 0x44, 0x43, 0x39, 0x42, 0x38, 0x45, 0x35, 0x36, + 0x33, 0x35, 0x39, 0x45, 0x37, 0x32, 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x92, 0xbf, 0x5e, 0x8e, 0x95, 0x68, 0xcb, 0x04, 0xe7, 0x3a, 0xaa, 0x2b, + 0xcb, 0x2e, 0x3d, 0x93, 0x1a, 0x50, 0x43, 0x99, 0x90, 0x18, 0x73, 0x90, + 0xd5, 0xbd, 0xd2, 0xa5, 0x8d, 0x0d, 0x9c, 0x78, 0x88, 0xf6, 0xc3, 0xb2, + 0xa1, 0xdc, 0x08, 0xab, 0x8c, 0x17, 0x31, 0x0d, 0xc6, 0xa4, 0x72, 0xd4, + 0xf4, 0xc6, 0x26, 0x7a, 0xd2, 0xb0, 0x36, 0xcc, 0x1e, 0x6c, 0xe6, 0x93, + 0xc5, 0x11, 0x7f, 0x1a, 0x94, 0x07, 0x18, 0xb8, 0xed, 0x3a, 0xc6, 0x94, + 0xc9, 0xd8, 0x24, 0x5b, 0x75, 0x70, 0xeb, 0x50, 0x4f, 0xd3, 0x1e, 0xbe, + 0x9f, 0x79, 0x52, 0x33, 0xa3, 0x23, 0xeb, 0x1c, 0xef, 0x53, 0xfd, 0x86, + 0xf5, 0x98, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0x1b, 0x44, 0x5b, 0xbe, 0xfd, 0x78, 0xd8, 0x77, 0x65, + 0xa7, 0xf1, 0xc1, 0x7d, 0x81, 0xdd, 0x5b, 0x1a, 0x20, 0x8d, 0xe3, 0xa1, + 0x2c, 0x78, 0x92, 0xdc, 0x04, 0xcc, 0xd2, 0x2c, 0xcb, 0x0c, 0x8d, 0x63, + 0xa1, 0xdd, 0x11, 0x83, 0xb8, 0x68, 0x94, 0xf5, 0x2b, 0xbe, 0x41, 0xf4, + 0x3f, 0x69, 0x26, 0x9b, 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x94, 0x16, 0x5d, 0x21, 0x3e, 0xe5, 0xbf, 0x51, 0x71, 0xfe, 0x0e, + 0xaf, 0x00, 0xe3, 0x56, 0x46, 0x41, 0x8d, 0x60, 0x8f, 0x30, 0xbe, 0x94, + 0xee, 0x1c, 0x1d, 0xb7, 0x6f, 0x53, 0xaa, 0x93, 0x6d, 0x12, 0x10, 0x48, + 0x35, 0x34, 0x82, 0x21, 0xe5, 0x00, 0x3d, 0x50, 0x67, 0x6b, 0xf9, 0x93, + 0xa8, 0xea, 0x2b, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xdd, 0xe0, 0xee, 0x17, 0xa1, 0xc8, 0xbf, 0xa3, 0x70, 0x90, 0x3e, + 0xe7, 0x4a, 0xf6, 0x02, 0x32, 0x78, 0x72, 0x06, 0x9a, 0x70, 0x4d, + 0xfd, 0x14, 0x04, 0x5d, 0xb3, 0xee, 0x90, 0x6e, 0x18, 0x4b, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = false; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xe7, 0x13, 0x78, 0x95, 0x00, 0x00, 0x00, 0x0b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x04, 0x00, 0x10, + 0xe7, 0x13, 0x78, 0x95, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2d, 0x00, 0x00, 0x00, 0x20, + 0xb3, 0x6c, 0xbc, 0x52, 0x2c, 0xed, 0x63, 0xdb, 0x21, 0x5b, 0x09, 0xcf, + 0x31, 0xe3, 0xc9, 0x00, 0x26, 0x09, 0x08, 0xd0, 0xe9, 0x6f, 0xb6, 0xdd, + 0x3c, 0x30, 0x6b, 0x86, 0x8a, 0xbd, 0x4b, 0xf9, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x43, 0x44, 0x33, 0x31, 0x46, 0x30, 0x46, 0x41, + 0x44, 0x43, 0x41, 0x39, 0x35, 0x45, 0x37, 0x41, 0x30, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x44, 0x33, 0x31, 0x46, 0x30, 0x46, 0x41, 0x44, 0x43, + 0x41, 0x39, 0x35, 0x45, 0x37, 0x41, 0x30, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x49, 0x4b, 0x20, 0x84, 0x52, 0xe6, + 0x3f, 0x63, 0xc2, 0xd6, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0xc6, 0x60, 0x20, 0x63, 0x8d, 0x31, 0x3d, 0x4c, 0x4a, 0xaa, 0xa6, 0x5e, + 0xec, 0x42, 0xdb, 0xf7, 0x1a, 0x50, 0x56, 0x27, 0x79, 0x84, 0x07, 0xce, + 0xa6, 0xfd, 0x9e, 0xdd, 0xf1, 0x42, 0x7d, 0x1d, 0x44, 0x1f, 0x12, 0x48, + 0xe2, 0x4d, 0xc1, 0xc7, 0xfc, 0x7a, 0x3e, 0x1f, 0xb0, 0xb4, 0x30, 0xe8, + 0x64, 0x7e, 0xcf, 0xdc, 0xff, 0x60, 0xb9, 0xfa, 0x83, 0xff, 0xdb, 0xf7, + 0x8c, 0x76, 0xa6, 0x93, 0xc0, 0x80, 0x86, 0xc8, 0x57, 0xc6, 0xae, 0x8f, + 0x95, 0x92, 0x45, 0x97, 0x03, 0xdd, 0x70, 0x5e, 0xb8, 0x53, 0x0b, 0x9a, + 0x62, 0x5f, 0x82, 0xbc, 0x9a, 0x94, 0x9f, 0xb9, 0x42, 0x5a, 0xfc, 0x6c, + 0x30, 0x9d, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0xad, 0xb3, 0xd4, 0x23, 0x0c, 0xbe, 0x91, 0x94, 0x87, + 0xe3, 0x5c, 0xf5, 0x92, 0x2e, 0x9e, 0xcf, 0x1a, 0x20, 0x75, 0x3b, 0x5b, + 0x48, 0x7f, 0x45, 0x6f, 0x89, 0x12, 0xa1, 0xa2, 0x42, 0xf4, 0xfe, 0x19, + 0x24, 0xaf, 0x7f, 0x2d, 0x8c, 0x06, 0x8d, 0xf1, 0x84, 0x77, 0x22, 0xe4, + 0x0f, 0xe7, 0x85, 0xbc, 0xac, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xb7, 0x46, 0x7c, 0x37, 0x8b, 0xf9, 0xca, 0xc6, 0x80, 0xde, 0xc4, + 0xad, 0x33, 0x71, 0xd4, 0xcf, 0x8f, 0x6c, 0x49, 0xd3, 0xc7, 0x38, 0x1e, + 0xa3, 0x35, 0x11, 0x7d, 0xb1, 0x03, 0x4b, 0xf4, 0xec, 0x12, 0x10, 0x98, + 0x7a, 0x5a, 0x06, 0xf5, 0xc5, 0x2e, 0xba, 0xa5, 0x15, 0x15, 0xb2, 0xc2, + 0xef, 0x91, 0xb6, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xb3, 0x6c, 0xbc, 0x52, 0x2c, 0xed, 0x63, 0xdb, 0x21, 0x5b, 0x09, + 0xcf, 0x31, 0xe3, 0xc9, 0x00, 0x26, 0x09, 0x08, 0xd0, 0xe9, 0x6f, + 0xb6, 0xdd, 0x3c, 0x30, 0x6b, 0x86, 0x8a, 0xbd, 0x4b, 0xf9, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb6, 0x1d, 0x85, 0xc2, 0x00, 0x00, 0x00, 0x0e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x04, 0x00, 0x10, + 0xb6, 0x1d, 0x85, 0xc2, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, + 0x00, 0x00, 0x00, 0x20, 0x66, 0x9c, 0x2c, 0x8f, 0xe5, 0x50, 0x66, 0x1c, + 0xa7, 0xb7, 0xd5, 0x50, 0xc9, 0x06, 0xbd, 0x40, 0xb7, 0x35, 0x3d, 0x46, + 0xa7, 0x2d, 0x09, 0xcd, 0x16, 0x4b, 0x25, 0x19, 0xaf, 0x64, 0x37, 0x8f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x37, 0x41, 0x33, 0x30, 0x30, 0x34, 0x46, 0x36, + 0x34, 0x35, 0x41, 0x34, 0x38, 0x38, 0x41, 0x35, 0x30, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x41, 0x33, 0x30, 0x30, 0x34, 0x46, 0x36, 0x34, 0x35, + 0x41, 0x34, 0x38, 0x38, 0x41, 0x35, 0x30, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x73, 0xc1, 0xa5, 0xa6, 0xda, 0x47, + 0x74, 0x7a, 0x86, 0xcc, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x47, 0x52, 0xef, 0x4b, 0x0e, 0xda, 0x94, 0xbe, 0x90, 0xa9, 0x92, 0x5a, + 0x04, 0x2a, 0xca, 0xee, 0x1a, 0x50, 0x77, 0xce, 0xe5, 0xd8, 0x5d, 0xbf, + 0x52, 0x2f, 0xe4, 0xcd, 0x29, 0x87, 0x72, 0xc2, 0xb4, 0x82, 0xd1, 0x5c, + 0xd0, 0x9d, 0x9a, 0xa2, 0x89, 0x78, 0xb0, 0x6b, 0xf6, 0x77, 0x16, 0x1c, + 0xaf, 0xb8, 0x96, 0xb3, 0xac, 0x8d, 0x94, 0xbe, 0x85, 0x81, 0xc6, 0x04, + 0x71, 0xa8, 0xb7, 0x59, 0xd5, 0x91, 0x7d, 0x10, 0x20, 0xfe, 0x3d, 0xb3, + 0x6a, 0x1e, 0xf5, 0x6f, 0x9a, 0x97, 0x74, 0xa6, 0xcd, 0x39, 0x40, 0x09, + 0x3e, 0x12, 0x6c, 0xe1, 0x7c, 0xab, 0xd2, 0x94, 0xfb, 0xc1, 0x62, 0xf3, + 0x85, 0x86, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0xb4, 0xbd, 0x15, 0x1c, 0xa8, 0x0f, 0xf9, 0xae, 0x20, + 0x0b, 0xcd, 0xf1, 0xd2, 0x6a, 0x64, 0x2b, 0x1a, 0x20, 0xa2, 0xb9, 0xc0, + 0x01, 0xc8, 0x5f, 0x56, 0x55, 0x62, 0x47, 0x39, 0xc3, 0x5d, 0x02, 0x65, + 0x35, 0xfd, 0x61, 0xdb, 0xd0, 0xd9, 0x64, 0x35, 0x33, 0xc8, 0xaf, 0xd5, + 0x87, 0xa9, 0xa3, 0xe3, 0xf8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xad, 0x3d, 0x88, 0x90, 0x38, 0x69, 0x6c, 0x81, 0x08, 0x4f, 0xb1, + 0xa8, 0x3c, 0xa9, 0xab, 0xe4, 0xcb, 0x8b, 0xe5, 0xb7, 0x99, 0x0c, 0x39, + 0x58, 0x32, 0xaf, 0xe9, 0x6c, 0x50, 0xa0, 0xe1, 0xca, 0x12, 0x10, 0xa3, + 0xd8, 0xf9, 0xaa, 0xdb, 0xb9, 0x5c, 0xe7, 0x68, 0x0d, 0x1b, 0x97, 0xa2, + 0x61, 0xde, 0xfe, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x12, 0x10, 0x5d, 0x69, 0xdb, 0x6e, 0x3c, 0x33, 0xc1, 0x50, + 0x82, 0x9d, 0x34, 0x89, 0x06, 0x4e, 0xbc, 0xca, 0x1a, 0x20, 0x4c, 0x42, + 0xe7, 0x3e, 0x04, 0x56, 0xcb, 0xe0, 0xba, 0x69, 0x85, 0x5a, 0x37, 0x26, + 0xed, 0xaa, 0xe3, 0x8e, 0x86, 0x8a, 0x51, 0x53, 0x02, 0xf4, 0x7d, 0xd6, + 0x51, 0x55, 0xb8, 0xc3, 0xf2, 0x0c, 0x20, 0x02, 0x28, 0x05, 0x42, 0x34, + 0x0a, 0x20, 0xd8, 0x75, 0x0d, 0x0c, 0xc9, 0xed, 0x8d, 0x8d, 0x7a, 0x75, + 0xe4, 0x10, 0xa3, 0x17, 0x06, 0xb4, 0xb8, 0xab, 0x93, 0x0f, 0xb3, 0xe4, + 0x86, 0xae, 0xc8, 0x91, 0xd4, 0x9a, 0xbe, 0x53, 0x2c, 0x51, 0x12, 0x10, + 0x39, 0x21, 0x26, 0x26, 0xc1, 0x63, 0x34, 0x5f, 0xeb, 0x6a, 0x9d, 0x4a, + 0x1d, 0x8e, 0x14, 0x62, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x66, 0x9c, 0x2c, 0x8f, 0xe5, 0x50, 0x66, 0x1c, 0xa7, 0xb7, 0xd5, + 0x50, 0xc9, 0x06, 0xbd, 0x40, 0xb7, 0x35, 0x3d, 0x46, 0xa7, 0x2d, + 0x09, 0xcd, 0x16, 0x4b, 0x25, 0x19, 0xaf, 0x64, 0x37, 0x8f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x88, 0xb0, 0x57, 0x9c, 0x00, 0x00, 0x00, 0x11, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x88, 0xb0, 0x57, 0x9c, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xcf, 0x93, 0x33, 0x09, 0xe6, 0xa9, 0x5b, 0xae, + 0xc3, 0xf0, 0x71, 0x53, 0xc0, 0x55, 0x78, 0xb6, 0x68, 0x50, 0x30, 0xbe, + 0xac, 0x4b, 0x6e, 0x8b, 0x3e, 0x25, 0x7e, 0xea, 0xfb, 0x90, 0x00, 0x9a, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x35, 0x34, 0x35, 0x42, 0x44, 0x41, 0x38, 0x30, + 0x44, 0x46, 0x32, 0x45, 0x41, 0x30, 0x45, 0x43, 0x30, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x34, 0x35, 0x42, 0x44, 0x41, 0x38, 0x30, 0x44, 0x46, + 0x32, 0x45, 0x41, 0x30, 0x45, 0x43, 0x30, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x28, 0x40, 0x00, 0x48, 0xaa, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xda, 0x6b, + 0x41, 0xc8, 0x8b, 0x78, 0x6d, 0x83, 0x43, 0x30, 0x7e, 0x4a, 0xff, 0xe6, + 0xef, 0xc8, 0x1a, 0x50, 0x32, 0xe9, 0xe6, 0x7e, 0x8c, 0x43, 0x04, 0x23, + 0x09, 0xe2, 0x05, 0x2b, 0x63, 0x44, 0x74, 0xf8, 0x3d, 0xc1, 0x59, 0x06, + 0x6b, 0x77, 0xf3, 0xb5, 0x05, 0x38, 0x82, 0x4c, 0x09, 0x60, 0x3d, 0xa6, + 0xde, 0x1a, 0x4e, 0xe8, 0xf4, 0x68, 0x70, 0x58, 0xef, 0x53, 0x21, 0x99, + 0x56, 0xcc, 0xc7, 0xa3, 0xda, 0x3c, 0x2a, 0x58, 0xe4, 0x91, 0x28, 0xa1, + 0x51, 0xe6, 0xbd, 0xf1, 0x9c, 0x31, 0xa4, 0x20, 0x69, 0x3f, 0xc9, 0xfb, + 0xbb, 0x36, 0x9e, 0xaf, 0x92, 0xa3, 0xc1, 0x64, 0x7f, 0x6f, 0xb3, 0x7f, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x5b, 0xa9, 0xfe, 0xf9, 0x43, 0x67, 0xaf, 0x15, 0xf2, 0x70, 0x82, + 0xd7, 0x31, 0x2c, 0xfe, 0xef, 0x1a, 0x20, 0x5d, 0x1f, 0xc1, 0x9c, 0x27, + 0xd6, 0x97, 0x50, 0x0e, 0x13, 0x84, 0x63, 0x19, 0x7d, 0x03, 0x99, 0xf0, + 0x84, 0x22, 0x89, 0x48, 0xb7, 0x09, 0x63, 0xfc, 0xab, 0xe0, 0x07, 0x52, + 0x94, 0xb8, 0xf2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x50, + 0xeb, 0x1d, 0x9f, 0x11, 0xd4, 0x27, 0xe8, 0x5d, 0x84, 0xda, 0xf0, 0xda, + 0x72, 0xe6, 0x2a, 0xc2, 0xf8, 0x24, 0x04, 0x8f, 0xd4, 0x48, 0xc2, 0x46, + 0x18, 0x76, 0xba, 0x44, 0x14, 0xdb, 0x09, 0x12, 0x10, 0x36, 0x77, 0x48, + 0xc9, 0x4d, 0x2e, 0x25, 0xa0, 0x73, 0x61, 0xc4, 0x39, 0xba, 0x40, 0xa5, + 0x77, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x8e, 0x62, 0xdf, 0xf9, 0x3b, 0xf3, 0xb3, 0xa2, 0x4b, 0x5c, + 0xda, 0x14, 0xbc, 0xc7, 0xec, 0xee, 0x1a, 0x20, 0x2a, 0x8e, 0x34, 0xd8, + 0x17, 0x87, 0x8f, 0x74, 0xff, 0x73, 0xb3, 0x0c, 0x3f, 0xc8, 0x37, 0x03, + 0x5b, 0xc4, 0x39, 0x82, 0x00, 0x7a, 0x52, 0x8f, 0x43, 0xfe, 0x95, 0x5d, + 0x67, 0x2c, 0x0d, 0xfc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xa7, 0x00, 0xfc, 0x43, 0xd8, 0xf2, 0xcb, 0xac, 0x55, 0x66, 0x98, 0xa9, + 0x0a, 0xd0, 0x96, 0xc1, 0x4d, 0x1f, 0xc3, 0x1d, 0x46, 0xfc, 0xf3, 0xcb, + 0xf3, 0x2e, 0xc3, 0xec, 0x0c, 0x87, 0x7f, 0x09, 0x12, 0x10, 0x8b, 0x1f, + 0xe8, 0x6b, 0x40, 0xf0, 0xfc, 0x86, 0x9c, 0x65, 0xab, 0x24, 0x29, 0x69, + 0x49, 0xeb, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x8f, 0x21, 0x3a, 0xe6, 0x29, 0xf5, 0xb2, 0x81, 0x3d, + 0x9a, 0xe8, 0xd2, 0xfb, 0x5e, 0x37, 0xcc, 0x1a, 0x20, 0x9d, 0xc7, 0x6f, + 0xc1, 0xb8, 0xc8, 0x9a, 0xcd, 0x06, 0x63, 0x20, 0x64, 0x96, 0x2e, 0x21, + 0xc2, 0xf8, 0x31, 0xbf, 0x25, 0xa8, 0xad, 0xb1, 0x3b, 0x80, 0xb4, 0xb8, + 0x7e, 0x20, 0x63, 0xb7, 0x10, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x22, 0x41, 0xd5, 0x85, 0x2a, 0x1d, 0xd5, 0x80, 0xb0, 0xab, 0x0f, + 0x56, 0x6c, 0xcd, 0xbb, 0x9c, 0x3d, 0x15, 0xc6, 0x50, 0xa3, 0x7a, 0xa6, + 0xa3, 0xf4, 0xc7, 0xa1, 0x83, 0x41, 0x93, 0x34, 0x11, 0x12, 0x10, 0xc9, + 0xcc, 0x7e, 0x99, 0x25, 0xa8, 0x1d, 0x75, 0x10, 0x7a, 0xd6, 0x90, 0x15, + 0xee, 0xb0, 0xe7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbf, 0x1b, 0x1a, 0xd3, 0xc8, 0xfd, 0x56, 0x71, + 0x29, 0xf5, 0x95, 0xcf, 0x67, 0x2a, 0x8a, 0x4b, 0x1a, 0x20, 0x69, 0x32, + 0x4d, 0xce, 0xdf, 0xc1, 0xc2, 0xe8, 0xe5, 0x55, 0x3e, 0xac, 0xb2, 0x5d, + 0x46, 0x8d, 0xa3, 0xa0, 0x0b, 0x77, 0x2e, 0x1f, 0x64, 0x1c, 0x6d, 0x2b, + 0xc5, 0x54, 0xd6, 0xcf, 0x53, 0x1e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xc2, 0xe0, 0xc6, 0x78, 0x35, 0x2d, 0xee, 0x68, 0x5a, 0x28, + 0x98, 0x18, 0x34, 0x43, 0x37, 0x6a, 0xe7, 0xa1, 0xe6, 0xc3, 0xce, 0x3b, + 0x59, 0x1b, 0xf8, 0xae, 0xbb, 0x41, 0x04, 0x90, 0x64, 0xcb, 0x12, 0x10, + 0x19, 0x20, 0xc2, 0x1e, 0xea, 0x31, 0xb1, 0x41, 0x62, 0xa2, 0xff, 0x0a, + 0x08, 0x74, 0x4f, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd9, 0xcb, 0xee, 0x44, 0xd0, 0x99, 0x7c, + 0x9a, 0x5b, 0xa4, 0x00, 0x19, 0x4d, 0xd7, 0xdf, 0x58, 0x1a, 0x20, 0x5e, + 0x2f, 0x98, 0xc7, 0x90, 0x33, 0x29, 0x2b, 0x7d, 0x51, 0x97, 0x37, 0xac, + 0x76, 0x95, 0x8d, 0xf2, 0x82, 0x74, 0x19, 0xac, 0x5f, 0x25, 0xb5, 0x01, + 0x0b, 0xba, 0xde, 0x65, 0x17, 0x66, 0x47, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x22, 0x2e, 0xea, 0x73, 0xa7, 0x01, 0x07, 0x27, 0xad, + 0xa5, 0x24, 0x40, 0x4e, 0xa9, 0xd0, 0x35, 0x38, 0x30, 0x25, 0x9b, 0x5c, + 0x63, 0xf5, 0x46, 0x5b, 0xc2, 0x29, 0x4b, 0x0e, 0x92, 0xd9, 0x0d, 0x12, + 0x10, 0x67, 0x38, 0x64, 0x5f, 0xcb, 0x63, 0xba, 0xe0, 0x44, 0x9e, 0x6c, + 0x5c, 0x32, 0xd5, 0x0d, 0xf1, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xcf, 0x93, 0x33, 0x09, 0xe6, 0xa9, 0x5b, 0xae, 0xc3, 0xf0, 0x71, + 0x53, 0xc0, 0x55, 0x78, 0xb6, 0x68, 0x50, 0x30, 0xbe, 0xac, 0x4b, + 0x6e, 0x8b, 0x3e, 0x25, 0x7e, 0xea, 0xfb, 0x90, 0x00, 0x9a, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x43, 0x21, 0x87, 0x8c, 0x00, 0x00, 0x00, 0x13, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x43, 0x21, 0x87, 0x8c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0xdc, 0xe3, 0xb7, 0x9a, 0x96, 0x2d, 0xa6, 0x61, + 0xe5, 0xa4, 0x26, 0x74, 0x77, 0x4c, 0x56, 0x70, 0xb3, 0x32, 0x01, 0xbc, + 0x1f, 0x05, 0x9f, 0xbd, 0x71, 0xdd, 0xe6, 0x02, 0xb5, 0xc1, 0xb2, 0xd7, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x42, 0x38, 0x34, 0x42, 0x33, 0x43, 0x36, + 0x37, 0x37, 0x46, 0x38, 0x36, 0x35, 0x33, 0x41, 0x30, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x42, 0x38, 0x34, 0x42, 0x33, 0x43, 0x36, 0x37, 0x37, + 0x46, 0x38, 0x36, 0x35, 0x33, 0x41, 0x30, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x17, 0xbb, 0x00, 0x75, 0xf5, 0xdb, + 0x49, 0x21, 0x41, 0xd7, 0x38, 0x28, 0x40, 0x00, 0x48, 0xd0, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x22, 0x03, + 0xae, 0x71, 0xe2, 0xef, 0x7d, 0x1c, 0x74, 0x82, 0xdd, 0x32, 0x5d, 0x74, + 0x2a, 0x55, 0x1a, 0x50, 0x33, 0xf9, 0x19, 0xac, 0xd3, 0x62, 0xf5, 0xe5, + 0x98, 0x19, 0xa0, 0xe0, 0x2a, 0x3d, 0xb8, 0x2b, 0x49, 0x8e, 0x87, 0xb4, + 0x88, 0x9f, 0x08, 0x83, 0x6f, 0x97, 0xfc, 0x0f, 0x3c, 0xa0, 0x4f, 0x1c, + 0x6c, 0xc3, 0x40, 0x77, 0xcb, 0x0a, 0x5a, 0x7c, 0x9c, 0x0c, 0xbe, 0xb0, + 0x8b, 0xf2, 0x18, 0xd3, 0x19, 0x4b, 0xb2, 0xef, 0x55, 0x2f, 0x0c, 0xae, + 0x58, 0x8a, 0x80, 0x75, 0x0e, 0x3b, 0xbc, 0x64, 0x8c, 0x1b, 0x9e, 0x16, + 0xa4, 0xfb, 0x4a, 0x32, 0x09, 0xd9, 0x8c, 0x15, 0x81, 0x62, 0xa5, 0x4b, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xd6, 0xc0, 0x03, 0xd5, 0x5e, 0x10, 0xc5, 0xf3, 0x30, 0xb8, 0xa5, + 0xc2, 0xd5, 0xc7, 0xda, 0xee, 0x1a, 0x20, 0xdc, 0x87, 0x65, 0x3c, 0xe5, + 0x11, 0x59, 0x19, 0xad, 0x12, 0x5a, 0xca, 0x62, 0x6b, 0x8c, 0x7c, 0x8d, + 0x10, 0xef, 0x6f, 0x9d, 0x60, 0xd0, 0x89, 0x04, 0x8f, 0xee, 0x1e, 0xe6, + 0x8b, 0x8e, 0x8e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, + 0x3b, 0xb3, 0xc4, 0xbf, 0x8c, 0x6b, 0x2f, 0x1f, 0xfd, 0x9f, 0x6e, 0x9c, + 0xe7, 0x50, 0x45, 0x5b, 0xd3, 0x5e, 0x3c, 0x8e, 0x0c, 0x64, 0xe4, 0xe1, + 0x66, 0x86, 0x79, 0x70, 0x90, 0x0f, 0xc5, 0x12, 0x10, 0xd6, 0xa1, 0x0f, + 0x7a, 0x5a, 0x9b, 0x99, 0xf2, 0x27, 0x57, 0x6c, 0x45, 0x92, 0x2c, 0x46, + 0x2d, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x93, 0x53, 0x06, 0xa9, 0xcf, 0xe3, 0x70, 0xe5, 0xb2, 0x01, + 0x6d, 0xc5, 0xa1, 0x4c, 0xf0, 0x12, 0x1a, 0x20, 0x91, 0xc8, 0xe8, 0x44, + 0xcf, 0xb0, 0xca, 0x56, 0x02, 0x0d, 0xbe, 0x7f, 0xad, 0x89, 0x52, 0x9e, + 0xa0, 0x17, 0x50, 0xad, 0x1f, 0x52, 0xf7, 0x64, 0xeb, 0xd7, 0xa2, 0x0e, + 0x41, 0xd4, 0xb4, 0x33, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x90, 0x2a, 0x9a, 0xb3, 0x85, 0xd7, 0xc6, 0x87, 0x6d, 0x38, 0x2f, 0x57, + 0xe1, 0xef, 0xc9, 0xda, 0x59, 0x79, 0xfc, 0x97, 0x29, 0x08, 0xcf, 0x55, + 0x15, 0x6e, 0xed, 0xc1, 0x5c, 0xbd, 0x95, 0x20, 0x12, 0x10, 0xac, 0x8f, + 0x6c, 0x0f, 0xec, 0x01, 0x30, 0x36, 0x3a, 0x0e, 0x37, 0x0b, 0x00, 0x23, + 0x6a, 0x70, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x0f, 0xfb, 0xac, 0x68, 0x59, 0x29, 0x13, 0x09, 0x8d, + 0x8d, 0xb3, 0x74, 0x86, 0x12, 0xd6, 0x44, 0x1a, 0x20, 0xab, 0x99, 0x1c, + 0x07, 0x79, 0x12, 0xd1, 0xae, 0xb5, 0x2a, 0xeb, 0xaa, 0x9b, 0xce, 0xb0, + 0xd3, 0x08, 0xb7, 0x2f, 0x1f, 0x99, 0xd2, 0x9c, 0x0f, 0xa4, 0x50, 0x6c, + 0xe0, 0xf3, 0x57, 0xe5, 0xfe, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x73, 0x9e, 0x48, 0x21, 0x65, 0x7f, 0xdc, 0x46, 0x42, 0x51, 0x19, + 0x62, 0x14, 0x7f, 0x9d, 0xd4, 0xe6, 0x01, 0x32, 0x56, 0x63, 0x30, 0x0b, + 0x1a, 0x69, 0xd8, 0xb2, 0x4e, 0xe6, 0x1b, 0x18, 0x5e, 0x12, 0x10, 0xfa, + 0x2a, 0x88, 0x25, 0x4c, 0x3a, 0xb5, 0xb8, 0xf1, 0xae, 0xf5, 0x73, 0x7b, + 0x8a, 0xd8, 0xcb, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x7d, 0xb0, 0xf1, 0x4e, 0xdb, 0xe9, 0x32, 0x1b, + 0x72, 0xc6, 0x00, 0xdd, 0x7c, 0x8f, 0x11, 0x25, 0x1a, 0x20, 0x8b, 0xd5, + 0x7d, 0xb3, 0x09, 0xf3, 0x51, 0xc2, 0x33, 0x99, 0x90, 0xd2, 0xda, 0x4b, + 0xaf, 0x1c, 0x89, 0x88, 0x59, 0xdd, 0xc8, 0x89, 0xee, 0xa8, 0x82, 0xd7, + 0x62, 0xe7, 0x15, 0xeb, 0x9b, 0xc3, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x45, 0xde, 0x20, 0xf1, 0xab, 0xe0, 0xaf, 0x02, 0xbd, 0xa4, + 0xed, 0xb6, 0x57, 0x13, 0x39, 0x0d, 0x62, 0x3b, 0x4b, 0x33, 0xe2, 0x1e, + 0x51, 0xbd, 0xfc, 0x5b, 0xf2, 0x89, 0x08, 0xfa, 0x82, 0x5c, 0x12, 0x10, + 0xe7, 0xc8, 0xa7, 0x14, 0x59, 0x28, 0x3d, 0xf1, 0x4f, 0xf9, 0x60, 0x1c, + 0x54, 0x6d, 0xb5, 0xe7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x4d, 0xe9, 0xbd, 0x13, 0xbc, 0x59, 0x30, + 0xb7, 0x7c, 0x99, 0x25, 0xfe, 0x62, 0x0d, 0xe1, 0x6f, 0x1a, 0x20, 0x26, + 0x4e, 0x67, 0x1c, 0x28, 0x19, 0x2f, 0xf2, 0x9d, 0xa5, 0x98, 0x9f, 0xb5, + 0x11, 0xb2, 0x12, 0x75, 0x87, 0xea, 0xc7, 0x4a, 0x34, 0xbb, 0x55, 0x1c, + 0x58, 0x92, 0x43, 0x5e, 0x6a, 0x51, 0x80, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xbd, 0xe1, 0x7f, 0xe6, 0x79, 0xeb, 0x97, 0x75, 0x88, + 0xa8, 0x1a, 0x84, 0x77, 0xa6, 0xae, 0x71, 0xb8, 0x6d, 0x11, 0x7f, 0xdd, + 0x22, 0x76, 0xa3, 0x21, 0xcd, 0x13, 0x39, 0x20, 0xd5, 0x46, 0xf3, 0x12, + 0x10, 0x90, 0x44, 0x91, 0x0f, 0x60, 0x37, 0x47, 0x74, 0xeb, 0x27, 0xa9, + 0xba, 0x06, 0xbf, 0x7f, 0x9a, 0x62, 0x00, 0x20, 0xd0, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xdc, 0xe3, 0xb7, 0x9a, 0x96, 0x2d, 0xa6, 0x61, 0xe5, 0xa4, 0x26, + 0x74, 0x77, 0x4c, 0x56, 0x70, 0xb3, 0x32, 0x01, 0xbc, 0x1f, 0x05, + 0x9f, 0xbd, 0x71, 0xdd, 0xe6, 0x02, 0xb5, 0xc1, 0xb2, 0xd7, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf5, 0xfc, 0xaf, 0x59, 0x00, 0x00, 0x00, 0x15, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xf5, 0xfc, 0xaf, 0x59, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xfe, 0x9f, 0xdf, 0x03, 0x71, 0xe0, 0xc5, 0x34, + 0x37, 0xcf, 0x26, 0x50, 0x7a, 0xf6, 0x28, 0x68, 0x37, 0xfa, 0xf5, 0x53, + 0xa2, 0x3f, 0x8b, 0xc0, 0xd1, 0xed, 0xfc, 0x9c, 0x83, 0x52, 0x5c, 0x0f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x43, 0x33, 0x39, 0x36, 0x43, 0x45, 0x41, + 0x31, 0x37, 0x32, 0x44, 0x33, 0x34, 0x33, 0x41, 0x31, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x43, 0x33, 0x39, 0x36, 0x43, 0x45, 0x41, 0x31, 0x37, + 0x32, 0x44, 0x33, 0x34, 0x33, 0x41, 0x31, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x14, 0x40, 0x28, 0x48, 0xf6, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x0b, 0x8d, + 0x7b, 0x4c, 0xbc, 0x3b, 0xdd, 0xbd, 0xf2, 0x0e, 0x77, 0x2f, 0x0f, 0x6d, + 0x14, 0x3d, 0x1a, 0x50, 0x4f, 0x2a, 0x8c, 0x2a, 0x13, 0xca, 0x7e, 0x42, + 0x49, 0x64, 0x37, 0x2c, 0x42, 0x67, 0x18, 0xd4, 0xea, 0xde, 0xda, 0x51, + 0xc8, 0xdf, 0xe4, 0x35, 0x35, 0xd6, 0x16, 0x7d, 0xcc, 0x8f, 0x93, 0xc1, + 0xb6, 0x74, 0x37, 0x63, 0xe1, 0x0a, 0x1a, 0x00, 0x16, 0xa1, 0x18, 0x1d, + 0xda, 0x48, 0xa9, 0xfe, 0xa6, 0x05, 0x3a, 0x9b, 0x18, 0xf9, 0xab, 0x37, + 0x93, 0x62, 0x0a, 0xe6, 0x26, 0xf3, 0x88, 0x1d, 0x3c, 0x03, 0x22, 0xab, + 0xe0, 0x4b, 0x8d, 0x39, 0x15, 0xdf, 0xb1, 0xd9, 0x08, 0xfb, 0xbd, 0x14, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x4b, 0xb3, 0x86, 0xd2, 0xeb, 0xd8, 0x25, 0x4d, 0x56, 0x45, 0xc3, + 0xec, 0x4f, 0xe5, 0x27, 0x4e, 0x1a, 0x20, 0x17, 0x8f, 0x41, 0x0f, 0x58, + 0x26, 0xb5, 0xbf, 0x8b, 0x18, 0x18, 0x34, 0x04, 0x5d, 0xc7, 0xd0, 0x35, + 0x7e, 0x65, 0x7c, 0x2c, 0x9f, 0x28, 0xe9, 0x6c, 0x5a, 0xe7, 0x4b, 0xa1, + 0xed, 0x99, 0xbc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x96, + 0x57, 0x12, 0x26, 0x9b, 0xdb, 0xc2, 0x65, 0xe8, 0x09, 0x0e, 0xc5, 0x41, + 0x25, 0x70, 0x86, 0x72, 0xd3, 0xe3, 0x91, 0x57, 0xce, 0x55, 0x69, 0xc9, + 0xb1, 0x06, 0x34, 0x40, 0x31, 0xd7, 0xda, 0x12, 0x10, 0x23, 0xa7, 0x45, + 0xc1, 0x14, 0x67, 0x02, 0x00, 0x50, 0xd3, 0x5a, 0x0d, 0xa7, 0x87, 0x28, + 0x6f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x4d, 0x67, 0xf6, 0xc2, 0xf8, 0x00, 0x2f, 0x5b, 0xc7, 0x73, + 0x82, 0x86, 0x99, 0x13, 0xd4, 0xe3, 0x1a, 0x20, 0x2e, 0x6d, 0xce, 0x8c, + 0xef, 0x3a, 0xd3, 0x80, 0x27, 0x8e, 0x9a, 0xc4, 0xf5, 0x7b, 0x34, 0x15, + 0xbd, 0x24, 0xcd, 0x2b, 0xeb, 0xf8, 0x4a, 0x87, 0x44, 0x23, 0x63, 0xc3, + 0xf3, 0x6a, 0x8c, 0xa5, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xcf, 0x56, 0x43, 0xb2, 0x02, 0x89, 0x04, 0xbd, 0x58, 0x22, 0x00, 0x47, + 0xd7, 0xc7, 0x96, 0xe1, 0x9a, 0x19, 0x89, 0x7c, 0x5b, 0xe9, 0x4f, 0x31, + 0xa8, 0xf5, 0x1d, 0x73, 0xe5, 0x07, 0x4d, 0xfc, 0x12, 0x10, 0xcf, 0x5e, + 0xa4, 0x3b, 0xea, 0x50, 0x24, 0xc3, 0xcc, 0xca, 0xdc, 0xc1, 0xfe, 0x18, + 0x92, 0xb2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe6, 0x04, 0x13, 0x8d, 0xa2, 0xbd, 0x1d, 0x33, 0x6d, + 0xa6, 0x9b, 0xc8, 0xb3, 0x27, 0x16, 0x67, 0x1a, 0x20, 0x7a, 0xe1, 0xb2, + 0x14, 0xa0, 0xa8, 0xb3, 0x3b, 0x63, 0x2a, 0x51, 0xf2, 0xc2, 0x26, 0xdc, + 0xc3, 0xc6, 0x01, 0x33, 0xa2, 0xe3, 0xe4, 0x0c, 0x9f, 0xc2, 0xb1, 0x8a, + 0x9b, 0x90, 0x5d, 0xc2, 0xcf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xa8, 0x3e, 0x7f, 0x5c, 0xc7, 0xf4, 0x72, 0x43, 0x33, 0x9f, 0xef, + 0x4b, 0x2f, 0xad, 0x12, 0x0c, 0x58, 0x56, 0x97, 0x2f, 0xbe, 0x5e, 0x06, + 0xc6, 0xe9, 0x97, 0x8d, 0xe8, 0x9f, 0x03, 0x01, 0x59, 0x12, 0x10, 0xc2, + 0x61, 0x73, 0xe3, 0x9b, 0x55, 0x53, 0x2c, 0xe7, 0xd0, 0x55, 0x60, 0x76, + 0xa4, 0x27, 0x8a, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xd7, 0xd2, 0x43, 0xb7, 0x4f, 0xc3, 0xaa, 0x7a, + 0x3d, 0x2c, 0x2b, 0x19, 0xf7, 0x73, 0xc6, 0xa9, 0x1a, 0x20, 0x5c, 0x3c, + 0x52, 0x5f, 0xba, 0xdc, 0x10, 0x35, 0x16, 0x12, 0x40, 0x9e, 0xde, 0xe6, + 0xd5, 0x01, 0x8f, 0x85, 0x19, 0x2e, 0xc2, 0x8d, 0x50, 0x61, 0xdb, 0xdf, + 0x3f, 0xe1, 0x08, 0x2a, 0x7e, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x6a, 0x07, 0xa7, 0xb4, 0xdf, 0xe8, 0x53, 0xb1, 0x9b, 0xc8, + 0x50, 0x99, 0x14, 0xde, 0x27, 0xea, 0x1f, 0xab, 0x12, 0x53, 0xb7, 0xb6, + 0x79, 0xe9, 0x2d, 0x8b, 0x19, 0x9a, 0x03, 0x6d, 0x61, 0xfb, 0x12, 0x10, + 0x6b, 0xaa, 0x39, 0x62, 0x6e, 0xee, 0xb3, 0x31, 0x98, 0x29, 0x1b, 0x94, + 0xfd, 0x00, 0xaf, 0x52, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x5f, 0x92, 0x79, 0xa9, 0xe9, 0xd7, 0xba, + 0xdf, 0xbe, 0xb6, 0x08, 0xc1, 0x67, 0xbf, 0x35, 0x09, 0x1a, 0x20, 0x5b, + 0x49, 0x04, 0xac, 0x55, 0x42, 0x4a, 0x97, 0xe5, 0xb0, 0xb5, 0x50, 0x24, + 0x19, 0x81, 0xd5, 0xe9, 0xec, 0x9d, 0x6c, 0x54, 0x61, 0x35, 0x42, 0x4a, + 0xe6, 0xb5, 0x4b, 0xb5, 0x7f, 0xac, 0x9c, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x74, 0xe7, 0xb5, 0xc8, 0xd6, 0x12, 0xce, 0x98, 0x2f, + 0x4b, 0x79, 0xb5, 0xe8, 0xe6, 0xa3, 0xeb, 0x57, 0x12, 0xcc, 0x73, 0x6f, + 0xf4, 0xcf, 0x76, 0xdb, 0x21, 0xc6, 0xbc, 0xb7, 0x98, 0x01, 0x5a, 0x12, + 0x10, 0x9c, 0x2f, 0x6a, 0x83, 0xc6, 0x82, 0x27, 0x8d, 0x94, 0xca, 0x8a, + 0xd0, 0x67, 0x47, 0xc6, 0x31, 0x62, 0x00, 0x20, 0xf6, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xfe, 0x9f, 0xdf, 0x03, 0x71, 0xe0, 0xc5, 0x34, 0x37, 0xcf, 0x26, + 0x50, 0x7a, 0xf6, 0x28, 0x68, 0x37, 0xfa, 0xf5, 0x53, 0xa2, 0x3f, + 0x8b, 0xc0, 0xd1, 0xed, 0xfc, 0x9c, 0x83, 0x52, 0x5c, 0x0f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x0f, 0x34, 0xb7, 0x46, 0x00, 0x00, 0x00, 0x17, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x0f, 0x34, 0xb7, 0x46, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x45, 0x19, 0xca, 0xef, 0x49, 0x7f, 0x0e, 0x08, + 0x41, 0x55, 0x9c, 0x4a, 0x47, 0xd6, 0x69, 0x87, 0x50, 0x6c, 0xa8, 0x99, + 0x6d, 0x8b, 0x68, 0x4c, 0x61, 0x7c, 0x64, 0x43, 0x1b, 0xd3, 0x43, 0x8d, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x36, 0x38, 0x31, 0x46, 0x44, 0x41, 0x41, 0x45, + 0x46, 0x37, 0x31, 0x42, 0x35, 0x38, 0x31, 0x43, 0x31, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x38, 0x31, 0x46, 0x44, 0x41, 0x41, 0x45, 0x46, 0x37, + 0x31, 0x42, 0x35, 0x38, 0x31, 0x43, 0x31, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x49, 0x36, 0xe7, 0x8b, 0x9a, 0x99, + 0x69, 0xed, 0xfb, 0xd5, 0x38, 0x14, 0x40, 0x28, 0x48, 0x8a, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x51, 0xa7, + 0x76, 0x0b, 0x66, 0xed, 0x13, 0xcd, 0x67, 0x16, 0xbf, 0x4f, 0x45, 0x60, + 0xd1, 0x2a, 0x1a, 0x50, 0x29, 0x90, 0x01, 0x28, 0xbd, 0x20, 0x57, 0x9c, + 0x81, 0x09, 0xb0, 0xfe, 0xe6, 0x7b, 0x57, 0x68, 0xb8, 0x43, 0xd1, 0xd8, + 0xad, 0xaf, 0x12, 0x05, 0xa7, 0xbf, 0xcd, 0x36, 0xdf, 0x15, 0x48, 0x60, + 0xcc, 0x5d, 0x7a, 0x49, 0x3a, 0x42, 0x38, 0xfd, 0x24, 0x6a, 0xe9, 0x1c, + 0x43, 0xfb, 0x77, 0x3d, 0x07, 0x21, 0xd7, 0xbd, 0x4e, 0xd5, 0x3a, 0x76, + 0x43, 0xfc, 0xb7, 0xe5, 0x40, 0x4b, 0x86, 0x63, 0x1e, 0xeb, 0x9e, 0x85, + 0x8c, 0x40, 0x45, 0xb7, 0xa3, 0x66, 0x84, 0x2a, 0x8e, 0xab, 0xa3, 0x5d, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xdb, 0x12, 0x46, 0x97, 0x7c, 0x65, 0xe9, 0xe9, 0x05, 0xbf, 0x1f, + 0xad, 0x4b, 0x92, 0x8e, 0x7c, 0x1a, 0x20, 0x4c, 0x19, 0x22, 0xf5, 0x63, + 0xd7, 0xbd, 0xef, 0x13, 0x78, 0x2f, 0x29, 0xfd, 0x92, 0xcb, 0x24, 0x16, + 0x26, 0x68, 0x55, 0xe1, 0x51, 0xaf, 0x19, 0xf4, 0xea, 0xe0, 0xb1, 0x41, + 0x89, 0x37, 0x07, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x78, + 0x69, 0x8b, 0x4e, 0x68, 0x9e, 0x6f, 0xc4, 0x92, 0x08, 0x48, 0x34, 0x36, + 0x51, 0xb7, 0xbc, 0xe1, 0x59, 0x93, 0x48, 0x45, 0xee, 0x0f, 0xee, 0x3e, + 0x8f, 0x11, 0xe6, 0xa2, 0x4f, 0xde, 0xf6, 0x12, 0x10, 0xe8, 0xdd, 0x6e, + 0xc7, 0x0f, 0xb0, 0xf3, 0x46, 0xac, 0x34, 0x20, 0x24, 0x7c, 0xf2, 0xff, + 0x33, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x02, 0x03, 0xce, 0xa3, 0xb2, 0x75, 0xcb, 0xc8, 0x98, 0x91, + 0x11, 0x87, 0x50, 0x34, 0x1a, 0x9b, 0x1a, 0x20, 0x15, 0x6f, 0x8b, 0x7d, + 0xf4, 0xa1, 0x98, 0x26, 0xeb, 0x98, 0xea, 0x82, 0x01, 0x30, 0x0b, 0x67, + 0x43, 0x03, 0x1e, 0xd6, 0x75, 0x6b, 0x54, 0x68, 0xd9, 0x9e, 0x0d, 0xb1, + 0x5f, 0x79, 0xf8, 0xca, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x96, 0x77, 0x70, 0x14, 0x26, 0x08, 0x1f, 0xb2, 0x6d, 0x8f, 0xab, 0xa5, + 0x1a, 0xca, 0xcb, 0xd6, 0x36, 0xbc, 0x3e, 0x34, 0x49, 0x5e, 0xd3, 0x2c, + 0xf0, 0x4a, 0x93, 0x06, 0xb3, 0x78, 0x6d, 0xd6, 0x12, 0x10, 0x6e, 0xcb, + 0x11, 0x31, 0xe2, 0x76, 0x23, 0x64, 0x2c, 0xe4, 0xd2, 0x81, 0xb5, 0xd2, + 0xbf, 0xe1, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x78, 0x14, 0x56, 0x12, 0x5d, 0x3d, 0x7b, 0xf1, 0xcc, + 0x7b, 0x22, 0xe6, 0xa3, 0x9d, 0xb4, 0x2c, 0x1a, 0x20, 0xd6, 0x06, 0xa9, + 0x72, 0x1c, 0xab, 0xf6, 0x79, 0x9d, 0x3d, 0x5c, 0x73, 0x90, 0x95, 0x35, + 0xb0, 0x46, 0xf5, 0x64, 0xfc, 0xcc, 0x89, 0x64, 0xad, 0xd1, 0x84, 0x74, + 0x11, 0x76, 0x7a, 0x94, 0xc8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xbf, 0xbd, 0xfb, 0x83, 0xc6, 0x22, 0x68, 0x41, 0xa4, 0xa9, 0xae, + 0x11, 0x95, 0xb2, 0x55, 0x30, 0x40, 0xfb, 0x42, 0x04, 0xca, 0xd7, 0x26, + 0x4e, 0xff, 0x41, 0xcb, 0xf9, 0x62, 0xd2, 0x00, 0xaf, 0x12, 0x10, 0x78, + 0x63, 0x85, 0x9c, 0xde, 0x79, 0x8d, 0xac, 0xa6, 0xcc, 0x32, 0xa5, 0x11, + 0xf6, 0x46, 0x57, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x11, 0x0c, 0xee, 0x38, 0x82, 0x13, 0xf4, 0x0a, + 0x2f, 0x65, 0x2f, 0xc9, 0xab, 0x0c, 0x04, 0xc5, 0x1a, 0x20, 0x6b, 0xbb, + 0xb5, 0x2d, 0x9b, 0x5e, 0xe9, 0x9f, 0x9c, 0x76, 0x66, 0x30, 0x38, 0x26, + 0xe4, 0xc8, 0x69, 0x10, 0x6f, 0x79, 0x25, 0xdc, 0x4b, 0x85, 0xc1, 0x3f, + 0xfd, 0xca, 0x00, 0xde, 0x04, 0xd7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xd9, 0xd7, 0x0a, 0xf6, 0x54, 0x04, 0xc8, 0xbe, 0x46, 0x13, + 0x69, 0xd1, 0xdf, 0xff, 0x27, 0x2b, 0xed, 0x60, 0x03, 0xd2, 0x7c, 0xe5, + 0x33, 0xa1, 0x80, 0xdf, 0xa4, 0x98, 0xf8, 0x92, 0x1b, 0x6d, 0x12, 0x10, + 0xff, 0x75, 0x77, 0xfc, 0x16, 0xb3, 0xbe, 0x6a, 0xc8, 0x8e, 0xc2, 0x7c, + 0x80, 0x0d, 0xa5, 0x8c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x23, 0x68, 0xcc, 0x59, 0x17, 0x57, 0xf9, + 0x27, 0x2a, 0x3a, 0x92, 0x27, 0x4f, 0xe8, 0x8b, 0xd4, 0x1a, 0x20, 0x6f, + 0xa8, 0xee, 0x4e, 0x18, 0xf6, 0xb7, 0x60, 0x81, 0xc3, 0x1f, 0xdc, 0xcd, + 0xf7, 0x7c, 0x5f, 0x34, 0x18, 0x48, 0x12, 0xd0, 0x98, 0x6c, 0x87, 0x72, + 0xf7, 0xbd, 0x1d, 0x58, 0xe5, 0x93, 0x97, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xe3, 0x89, 0xa0, 0xd4, 0xad, 0x47, 0xc9, 0xfd, 0xa3, + 0x39, 0x0f, 0xbf, 0xd5, 0x82, 0x18, 0xe8, 0x41, 0x0c, 0x4e, 0x6e, 0x3e, + 0x48, 0x27, 0x1d, 0xf2, 0x81, 0xc3, 0x67, 0x4f, 0x35, 0x60, 0x0f, 0x12, + 0x10, 0x26, 0x68, 0x77, 0xf4, 0x97, 0x5a, 0x86, 0xc1, 0x6e, 0xd8, 0x38, + 0xdf, 0xc5, 0x45, 0xec, 0xce, 0x62, 0x00, 0x20, 0x8a, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x45, 0x19, 0xca, 0xef, 0x49, 0x7f, 0x0e, 0x08, 0x41, 0x55, 0x9c, + 0x4a, 0x47, 0xd6, 0x69, 0x87, 0x50, 0x6c, 0xa8, 0x99, 0x6d, 0x8b, + 0x68, 0x4c, 0x61, 0x7c, 0x64, 0x43, 0x1b, 0xd3, 0x43, 0x8d, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x3f, 0x5b, 0x81, 0xff, 0x00, 0x00, 0x00, 0x19, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x3f, 0x5b, 0x81, 0xff, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xa1, 0xda, 0xad, 0xd2, 0xdc, 0x38, 0xbf, 0x7a, + 0x26, 0x42, 0x2b, 0x69, 0x95, 0x7a, 0xdf, 0x61, 0x98, 0x3d, 0x23, 0x79, + 0x98, 0x02, 0xb9, 0xb8, 0x74, 0x6e, 0xe2, 0x85, 0xd0, 0xbc, 0x37, 0xd3, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x36, 0x33, 0x37, 0x34, 0x31, 0x32, 0x45, 0x30, + 0x38, 0x31, 0x39, 0x41, 0x37, 0x38, 0x46, 0x33, 0x31, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x33, 0x37, 0x34, 0x31, 0x32, 0x45, 0x30, 0x38, 0x31, + 0x39, 0x41, 0x37, 0x38, 0x46, 0x33, 0x31, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0x9e, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xa3, 0x28, + 0x15, 0x5a, 0xc8, 0xfa, 0x6d, 0x30, 0x8f, 0x9f, 0x6d, 0x85, 0x0b, 0xfd, + 0x71, 0xa9, 0x1a, 0x50, 0x7d, 0xc5, 0xa2, 0x57, 0xb8, 0xad, 0xcb, 0x9a, + 0x7c, 0x91, 0x32, 0xd3, 0x3f, 0x86, 0xdc, 0x95, 0x9e, 0x2c, 0x13, 0xdd, + 0x9b, 0x3c, 0x47, 0x7a, 0x70, 0x87, 0x6c, 0x92, 0xfc, 0xc8, 0x96, 0x30, + 0xd5, 0x84, 0x7f, 0x8b, 0x45, 0xfa, 0x9c, 0x89, 0x50, 0xf8, 0xbe, 0xd5, + 0x51, 0xe1, 0x46, 0x57, 0xcc, 0xef, 0x2b, 0x8f, 0x47, 0x9e, 0x9d, 0x6c, + 0x29, 0x21, 0x9d, 0xd2, 0x84, 0xa1, 0xb6, 0x84, 0x8d, 0x30, 0xe0, 0xd5, + 0xc6, 0x9d, 0xa8, 0xa0, 0xa9, 0x62, 0xda, 0x8a, 0x35, 0x6d, 0xcd, 0x27, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x7c, 0x84, 0xff, 0xcb, 0x17, 0x12, 0x14, 0x5d, 0x8a, 0x9c, 0x07, + 0xc6, 0x53, 0x2c, 0x69, 0x09, 0x1a, 0x20, 0x86, 0x36, 0x7d, 0x6e, 0x1d, + 0x41, 0xe6, 0x48, 0x59, 0xdf, 0xf8, 0xfd, 0x9c, 0x8b, 0xa7, 0x01, 0x34, + 0x2b, 0x53, 0x36, 0x40, 0x0d, 0xb4, 0x1e, 0x0d, 0xfb, 0x48, 0x5a, 0x64, + 0xc1, 0x25, 0x2a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x21, + 0x60, 0x16, 0x18, 0xf9, 0x64, 0x21, 0x62, 0x64, 0xd6, 0xb6, 0xd1, 0x1a, + 0x5f, 0x05, 0x38, 0x07, 0x73, 0x40, 0x4d, 0x42, 0x98, 0x5e, 0xe7, 0xd7, + 0xb4, 0xb5, 0xc1, 0x82, 0xc4, 0x37, 0x8c, 0x12, 0x10, 0x99, 0x47, 0x2f, + 0xd6, 0xc4, 0xb7, 0x4c, 0x1b, 0xb0, 0xf0, 0x1a, 0xbc, 0x27, 0x2d, 0x10, + 0x8d, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x9f, 0x66, 0x4b, 0xe9, 0x3d, 0x20, 0xf2, 0x8c, 0xe0, 0x22, + 0xba, 0x5f, 0xa6, 0xf7, 0xa9, 0x68, 0x1a, 0x20, 0x82, 0x9f, 0x80, 0x13, + 0x6e, 0x17, 0x5e, 0xaa, 0xf7, 0xca, 0x54, 0x19, 0xe9, 0x62, 0x20, 0x9a, + 0x42, 0x3b, 0x86, 0x73, 0xfa, 0x94, 0x46, 0xc4, 0x5a, 0xce, 0x45, 0xde, + 0x50, 0xc3, 0xf4, 0x78, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x74, 0x5d, 0x68, 0x04, 0xc4, 0x4a, 0x9b, 0xed, 0x32, 0x83, 0xe1, 0x38, + 0xe3, 0xa2, 0x83, 0xf3, 0xf0, 0x89, 0x1f, 0x35, 0x71, 0x94, 0x62, 0xd9, + 0xbc, 0x14, 0xcd, 0x77, 0x3c, 0x86, 0xe3, 0x3a, 0x12, 0x10, 0xf9, 0x69, + 0x59, 0x63, 0x9e, 0x89, 0xa6, 0xed, 0x92, 0x3d, 0xed, 0xde, 0xb2, 0xac, + 0x6c, 0x9f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe2, 0x0f, 0x44, 0x5b, 0x1a, 0xbe, 0x31, 0x6e, 0x37, + 0xc0, 0xc2, 0x08, 0x41, 0xcc, 0xbf, 0xe1, 0x1a, 0x20, 0x06, 0xd7, 0x61, + 0x0a, 0x00, 0x4f, 0xf7, 0xb2, 0xfe, 0xd7, 0xf6, 0x23, 0x8a, 0xf7, 0xe6, + 0xe7, 0x70, 0xc5, 0x53, 0xc8, 0xb5, 0x3b, 0x65, 0xb2, 0x10, 0x13, 0x07, + 0xbc, 0x9d, 0x8d, 0xd6, 0xea, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xd8, 0xa8, 0xcf, 0xa8, 0x93, 0x21, 0x17, 0x19, 0xc6, 0xc0, 0xb8, + 0xdf, 0x10, 0xc0, 0x43, 0xc0, 0xdc, 0x63, 0xfd, 0xf4, 0xac, 0xd8, 0x5a, + 0x50, 0x63, 0x92, 0x18, 0xb6, 0x6a, 0x70, 0x1a, 0x31, 0x12, 0x10, 0x75, + 0xaf, 0x43, 0x00, 0x4f, 0x35, 0x38, 0x03, 0x64, 0x35, 0x2a, 0x08, 0x61, + 0x56, 0x40, 0x17, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x21, 0xfc, 0x75, 0xc1, 0xa0, 0xd2, 0xad, 0x73, + 0x7a, 0xb0, 0xa2, 0x65, 0x29, 0x0f, 0x2f, 0x85, 0x1a, 0x20, 0xd9, 0x46, + 0xc5, 0x05, 0x85, 0xe2, 0xad, 0xba, 0x26, 0xe7, 0x75, 0x34, 0x36, 0xc7, + 0x5a, 0x7a, 0x23, 0xe4, 0x5a, 0x3e, 0x93, 0xfd, 0xc3, 0xed, 0xa9, 0x9e, + 0x25, 0x5e, 0x62, 0xf8, 0xd5, 0x50, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x73, 0x5b, 0x4b, 0x89, 0x74, 0x78, 0xc3, 0xf6, 0x58, 0x08, + 0x45, 0xad, 0x4d, 0x38, 0x3b, 0x65, 0x77, 0x9a, 0x41, 0x7a, 0xf6, 0x36, + 0xc1, 0x77, 0x58, 0x58, 0xe0, 0x34, 0xaa, 0x0a, 0x95, 0x2e, 0x12, 0x10, + 0x6f, 0x59, 0xf5, 0xa5, 0x36, 0x94, 0xe2, 0xeb, 0x8b, 0x38, 0x0d, 0x24, + 0xb2, 0xef, 0x66, 0x9c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x79, 0xc4, 0x1a, 0x5f, 0x7b, 0x31, 0xba, + 0x20, 0x0a, 0x5a, 0x36, 0x9b, 0x8f, 0x19, 0x9d, 0x0b, 0x1a, 0x20, 0x57, + 0x51, 0xa2, 0x07, 0x02, 0xc4, 0x6b, 0x86, 0xf6, 0x8b, 0xd7, 0xd9, 0x64, + 0xde, 0x50, 0xda, 0x46, 0x0d, 0x5e, 0x5c, 0xb2, 0x9a, 0xa0, 0xc0, 0xc5, + 0x6e, 0xd7, 0x89, 0xba, 0x70, 0xa3, 0xfb, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x8c, 0x60, 0x26, 0xa0, 0x8d, 0x7e, 0x13, 0xc8, 0xb3, + 0x2f, 0xb3, 0xbe, 0x02, 0xc4, 0x47, 0x9b, 0x33, 0x46, 0x9e, 0x03, 0xad, + 0xb8, 0x0c, 0x4a, 0x20, 0x29, 0x05, 0xf5, 0xd6, 0x94, 0xde, 0xea, 0x12, + 0x10, 0xfc, 0x40, 0xe4, 0xdc, 0xd2, 0xb6, 0xe2, 0x64, 0x33, 0x82, 0x57, + 0x05, 0xc9, 0xd2, 0x66, 0x97, 0x62, 0x00, 0x20, 0x9e, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xa1, 0xda, 0xad, 0xd2, 0xdc, 0x38, 0xbf, 0x7a, 0x26, 0x42, 0x2b, + 0x69, 0x95, 0x7a, 0xdf, 0x61, 0x98, 0x3d, 0x23, 0x79, 0x98, 0x02, + 0xb9, 0xb8, 0x74, 0x6e, 0xe2, 0x85, 0xd0, 0xbc, 0x37, 0xd3, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xee, 0x1d, 0xf8, 0x39, 0x00, 0x00, 0x00, 0x1b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xee, 0x1d, 0xf8, 0x39, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x71, 0x43, 0xb1, 0x83, 0x27, 0x37, 0xde, 0x60, + 0x3d, 0x17, 0x70, 0x20, 0x38, 0x81, 0x73, 0x4e, 0x3c, 0xb0, 0xdf, 0xdb, + 0x4f, 0xca, 0x85, 0xdc, 0xaf, 0x82, 0x81, 0x74, 0x55, 0xcb, 0x08, 0x7c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x43, 0x34, 0x44, 0x42, 0x37, 0x30, 0x30, 0x41, + 0x33, 0x46, 0x41, 0x30, 0x37, 0x46, 0x31, 0x45, 0x31, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x34, 0x44, 0x42, 0x37, 0x30, 0x30, 0x41, 0x33, 0x46, + 0x41, 0x30, 0x37, 0x46, 0x31, 0x45, 0x31, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x57, 0x66, 0x8a, 0x39, 0x11, 0xb6, + 0x77, 0x19, 0xe9, 0x17, 0x38, 0x64, 0x40, 0x32, 0x48, 0xb6, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x4a, 0xd0, + 0x7d, 0x8b, 0x08, 0x44, 0xfa, 0x02, 0x9b, 0x96, 0xfe, 0x9d, 0xef, 0x0e, + 0x4e, 0xe1, 0x1a, 0x50, 0xd4, 0xe4, 0xba, 0x5b, 0xcb, 0xbe, 0xc1, 0xbf, + 0x16, 0x47, 0x58, 0x8e, 0x99, 0x27, 0x53, 0xf9, 0x15, 0xf8, 0xd9, 0xbc, + 0xb3, 0xb8, 0x93, 0x6e, 0xef, 0x44, 0x73, 0x72, 0xd6, 0x48, 0x00, 0xba, + 0x34, 0xdd, 0x83, 0x49, 0x28, 0x7b, 0x2f, 0xad, 0x99, 0x8d, 0xf7, 0x62, + 0xe5, 0x9f, 0x8c, 0x4e, 0xe5, 0xb9, 0xb4, 0xdc, 0x66, 0x4e, 0xf3, 0xb4, + 0xd0, 0x6b, 0xd9, 0x70, 0x49, 0xa9, 0xa1, 0x8a, 0xba, 0xeb, 0xe9, 0xad, + 0x8f, 0xa6, 0x82, 0x1a, 0xd8, 0x86, 0x90, 0xeb, 0x44, 0x78, 0x81, 0x5c, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x0b, 0xc4, 0x91, 0x6d, 0x22, 0x44, 0x1c, 0x65, 0xfc, 0xd9, 0xe5, + 0x42, 0x4a, 0x4a, 0x5f, 0xc8, 0x1a, 0x20, 0xca, 0xee, 0x3a, 0x29, 0xc4, + 0xe6, 0x83, 0x55, 0x50, 0x15, 0x04, 0x76, 0xaa, 0xa5, 0xd9, 0xff, 0x1e, + 0x62, 0xbc, 0x90, 0x08, 0x5b, 0xed, 0x39, 0x90, 0x09, 0xa4, 0xfc, 0x4c, + 0xe0, 0xd0, 0x73, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x9e, + 0xbf, 0x10, 0x61, 0xc8, 0x85, 0x9f, 0x76, 0x56, 0x11, 0xef, 0x64, 0x17, + 0x66, 0x47, 0xdd, 0x6b, 0x17, 0x72, 0x39, 0x95, 0xad, 0xd4, 0x16, 0x85, + 0x58, 0x9a, 0x96, 0xd4, 0x45, 0x70, 0xbd, 0x12, 0x10, 0x66, 0xf6, 0xfc, + 0x24, 0x70, 0x0b, 0xd5, 0x02, 0x84, 0x43, 0xb1, 0x07, 0x14, 0x9c, 0xec, + 0x71, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x15, 0x0e, 0x88, 0xf7, 0xc1, 0x33, 0xfc, 0xf6, 0x41, 0xe5, + 0xca, 0x50, 0x62, 0x00, 0x66, 0x1a, 0x1a, 0x20, 0xd9, 0x67, 0x4f, 0xc6, + 0x14, 0x3c, 0xd8, 0x1c, 0x07, 0xd4, 0x97, 0xfa, 0x86, 0x7f, 0xf2, 0x4b, + 0xcf, 0xaf, 0xfe, 0xd5, 0xd4, 0x1f, 0xd0, 0x84, 0xca, 0x87, 0x82, 0x1a, + 0xa6, 0x8b, 0x18, 0x94, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xca, 0x37, 0x48, 0xf3, 0xb6, 0x3b, 0xf8, 0xee, 0xfd, 0x7a, 0x81, 0x76, + 0xcb, 0x7b, 0x72, 0xb5, 0xd6, 0x5b, 0x6d, 0x29, 0xab, 0x45, 0xab, 0xbf, + 0x13, 0xc0, 0x9c, 0xf0, 0xd1, 0x7f, 0xcd, 0x1b, 0x12, 0x10, 0xf5, 0xef, + 0x74, 0xa1, 0x2c, 0xcb, 0x61, 0x58, 0xe6, 0xd9, 0xd9, 0x82, 0x2f, 0x04, + 0x2b, 0x8f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x1d, 0x3d, 0x87, 0x74, 0x17, 0x76, 0x84, 0xf6, 0xa6, + 0xb2, 0xe4, 0x09, 0x40, 0x2f, 0xe3, 0x28, 0x1a, 0x20, 0x74, 0xf3, 0x9d, + 0x93, 0xfc, 0x7d, 0x96, 0xef, 0x38, 0x7f, 0x83, 0xcb, 0xef, 0xd4, 0xbb, + 0xd8, 0xac, 0xcf, 0x53, 0x73, 0x89, 0x79, 0x15, 0x84, 0x96, 0x1e, 0x1e, + 0x40, 0xc7, 0x97, 0xb6, 0xde, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xb0, 0x28, 0xc2, 0xcb, 0xd0, 0x3e, 0x8f, 0x9a, 0x71, 0xba, 0x3a, + 0xc4, 0xb4, 0x82, 0xe4, 0x5a, 0x0b, 0x3a, 0xea, 0xde, 0x95, 0xfe, 0x2c, + 0xa4, 0x84, 0xae, 0xd8, 0xa6, 0x37, 0xaf, 0x80, 0xe6, 0x12, 0x10, 0xc4, + 0xf5, 0x0f, 0x8b, 0xd0, 0x01, 0x55, 0xbf, 0xf4, 0xe0, 0xc8, 0xc9, 0x8a, + 0xdb, 0x08, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xfc, 0x73, 0x94, 0xdf, 0x09, 0xb0, 0x95, 0x27, + 0xdc, 0x8b, 0x8f, 0x2a, 0xca, 0xce, 0xfe, 0x0b, 0x1a, 0x20, 0xe1, 0x95, + 0xc9, 0x66, 0xbd, 0x7e, 0x0e, 0x91, 0x30, 0x4e, 0xa8, 0x87, 0xeb, 0xb0, + 0x4e, 0x3c, 0xa4, 0xe6, 0x20, 0x58, 0xb4, 0x4a, 0x5c, 0x3b, 0xc8, 0x1b, + 0x1c, 0x70, 0xc3, 0x47, 0x54, 0x9b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xe4, 0xe0, 0x3f, 0xf8, 0xf5, 0x8d, 0x04, 0xde, 0x3c, 0x9b, + 0x35, 0x29, 0x41, 0xde, 0x89, 0xff, 0xd2, 0x85, 0x3a, 0x25, 0xd6, 0x6a, + 0xfe, 0x6d, 0x6f, 0xcd, 0x8a, 0x86, 0xcf, 0x0c, 0x11, 0x6c, 0x12, 0x10, + 0xeb, 0xdf, 0x43, 0x6f, 0x70, 0xd7, 0xd4, 0xc4, 0xea, 0x4c, 0x26, 0x66, + 0xc3, 0x29, 0x85, 0x32, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xff, 0x74, 0x4b, 0x1a, 0x40, 0x30, 0x36, + 0x57, 0xd6, 0xf4, 0xfe, 0x17, 0xa7, 0xf7, 0x55, 0x5c, 0x1a, 0x20, 0x98, + 0x2a, 0x05, 0x45, 0xad, 0xbc, 0x78, 0xa0, 0xaa, 0x27, 0x58, 0xb7, 0x8b, + 0xfa, 0xb4, 0x69, 0x3a, 0xcf, 0x3f, 0xd3, 0x4d, 0x24, 0x47, 0xee, 0x62, + 0xbc, 0xd1, 0x94, 0xe1, 0x1c, 0x4a, 0x44, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x26, 0x6e, 0x71, 0xdc, 0xea, 0x2f, 0x2d, 0xab, 0xab, + 0x6a, 0x41, 0x46, 0xeb, 0x61, 0xdd, 0xf0, 0x65, 0x91, 0x23, 0x44, 0x33, + 0xd2, 0xcf, 0x7d, 0x3e, 0x48, 0xf6, 0x51, 0x03, 0xb6, 0x13, 0x2c, 0x12, + 0x10, 0x8a, 0x55, 0xc8, 0xc6, 0x0d, 0xd3, 0x5d, 0x1c, 0xbc, 0x1d, 0xa2, + 0x05, 0x2e, 0xdf, 0x0a, 0xd3, 0x62, 0x00, 0x20, 0xb6, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x71, 0x43, 0xb1, 0x83, 0x27, 0x37, 0xde, 0x60, 0x3d, 0x17, 0x70, + 0x20, 0x38, 0x81, 0x73, 0x4e, 0x3c, 0xb0, 0xdf, 0xdb, 0x4f, 0xca, + 0x85, 0xdc, 0xaf, 0x82, 0x81, 0x74, 0x55, 0xcb, 0x08, 0x7c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xfc, 0xe4, 0x61, 0x5a, 0x00, 0x00, 0x00, 0x1d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xfc, 0xe4, 0x61, 0x5a, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0x0f, 0x80, 0xfd, 0x7a, 0xcd, 0x94, 0x85, 0x49, + 0xa4, 0xf8, 0xfa, 0xc4, 0x3c, 0x16, 0x3e, 0xae, 0x45, 0x43, 0x1f, 0xde, + 0x67, 0x80, 0x60, 0x07, 0xca, 0xcf, 0x90, 0x69, 0x32, 0xd6, 0x2f, 0xaa, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x41, 0x38, 0x30, 0x44, 0x32, 0x35, 0x34, 0x30, + 0x42, 0x43, 0x42, 0x32, 0x39, 0x31, 0x44, 0x44, 0x31, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x30, 0x44, 0x32, 0x35, 0x34, 0x30, 0x42, 0x43, + 0x42, 0x32, 0x39, 0x31, 0x44, 0x44, 0x31, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xce, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xd7, 0x15, + 0x55, 0xd3, 0x0d, 0x37, 0xeb, 0x93, 0xc0, 0xb3, 0x80, 0x4b, 0x0d, 0x16, + 0x90, 0x8a, 0x1a, 0x50, 0xd5, 0xdf, 0xff, 0xad, 0x0d, 0xb3, 0x37, 0x0e, + 0x37, 0xaa, 0xfc, 0x71, 0xd0, 0xfb, 0x60, 0xf8, 0xdd, 0x14, 0x13, 0xa8, + 0x1c, 0x6f, 0x76, 0x13, 0xba, 0xe6, 0x91, 0xf3, 0x36, 0x06, 0x27, 0xf2, + 0xb0, 0x86, 0xaa, 0xb2, 0xa6, 0xd5, 0x02, 0x38, 0x31, 0x84, 0x72, 0xc0, + 0xd1, 0xe3, 0x56, 0x21, 0x84, 0xf4, 0xff, 0xe6, 0xd2, 0x27, 0xe9, 0x71, + 0x39, 0x29, 0x24, 0xf4, 0xd6, 0x43, 0x04, 0xbb, 0x9e, 0xe5, 0x7c, 0x16, + 0x6e, 0xa9, 0x01, 0x33, 0x05, 0xf0, 0x26, 0x22, 0x5f, 0x2e, 0x40, 0x4a, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xe9, 0x02, 0x22, 0x11, 0x37, 0x09, 0x6c, 0x60, 0xda, 0x14, 0x4b, + 0x40, 0xa5, 0x27, 0x17, 0x49, 0x1a, 0x20, 0xaa, 0x82, 0x59, 0xc9, 0x51, + 0x0b, 0xf2, 0x3c, 0x03, 0x0b, 0xaf, 0xe5, 0x38, 0x9c, 0x5a, 0x22, 0xd1, + 0xe6, 0x93, 0x47, 0x49, 0xe1, 0x61, 0xd1, 0x8e, 0x24, 0xc3, 0x8e, 0xba, + 0x40, 0x8e, 0xc0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xf1, + 0xdc, 0x54, 0x6a, 0x68, 0x71, 0x8e, 0x24, 0x08, 0xef, 0xf9, 0x05, 0x70, + 0x88, 0x09, 0xe1, 0xf2, 0x0b, 0x52, 0xef, 0x21, 0x0e, 0x10, 0x03, 0x75, + 0xb0, 0x34, 0x1a, 0x80, 0x0b, 0xff, 0x96, 0x12, 0x10, 0x61, 0x66, 0xdb, + 0x5d, 0x32, 0xc3, 0x13, 0x75, 0xe2, 0x33, 0xa0, 0xf1, 0xe4, 0xd1, 0x80, + 0xc2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x1d, 0x46, 0xff, 0x55, 0xf7, 0x4a, 0xc7, 0x9a, 0xa7, 0x06, + 0xc4, 0xfb, 0x4e, 0x13, 0x80, 0xac, 0x1a, 0x20, 0x43, 0x33, 0x9b, 0x99, + 0x2a, 0xe2, 0x0e, 0x15, 0x75, 0x5f, 0x16, 0xc3, 0x86, 0x80, 0xd1, 0x84, + 0xa1, 0x28, 0x10, 0xd6, 0xd7, 0x5a, 0x5d, 0x21, 0xf7, 0xba, 0x16, 0xb5, + 0x78, 0x5c, 0xd0, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x7b, 0xcb, 0x38, 0xc6, 0x79, 0xc8, 0x58, 0x28, 0xf3, 0x2c, 0x6d, 0x77, + 0xca, 0x24, 0xe0, 0x48, 0x5d, 0xaa, 0x67, 0xd1, 0x03, 0x74, 0x98, 0x3c, + 0xf9, 0xd8, 0x9a, 0x96, 0xaf, 0x43, 0xad, 0xe6, 0x12, 0x10, 0x07, 0xb9, + 0xec, 0x1d, 0x87, 0x24, 0x4f, 0x6c, 0x84, 0x9d, 0x32, 0x9c, 0xd5, 0xb4, + 0x34, 0xf1, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x74, 0x73, 0x42, 0xb3, 0x99, 0x90, 0xe0, 0xf4, 0xde, + 0xd8, 0xae, 0x6a, 0x63, 0x55, 0x0a, 0xeb, 0x1a, 0x20, 0x21, 0xe8, 0xcc, + 0xfc, 0xa1, 0x4b, 0xf6, 0xc6, 0xd6, 0xd4, 0xaf, 0xa7, 0x1f, 0x51, 0xe3, + 0x11, 0x5d, 0xdc, 0x79, 0x91, 0xa3, 0xc8, 0xc8, 0x0f, 0xbb, 0xc1, 0x80, + 0xd1, 0xc9, 0xd5, 0x4b, 0x95, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x6e, 0x4d, 0x4b, 0x4f, 0x3b, 0xd9, 0x24, 0x6a, 0x7c, 0x66, 0xd4, + 0xe8, 0x05, 0xcb, 0xff, 0x49, 0x5d, 0x20, 0xd7, 0x99, 0xa0, 0x3d, 0x70, + 0x8b, 0x77, 0xc4, 0x10, 0x41, 0xc0, 0x41, 0xa8, 0x08, 0x12, 0x10, 0xa9, + 0x91, 0x20, 0xfd, 0x85, 0x2e, 0x0f, 0xe1, 0xab, 0x44, 0x8a, 0x15, 0xcf, + 0x25, 0x97, 0xb3, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbd, 0xb0, 0x07, 0x40, 0x92, 0x6d, 0x6c, 0xda, + 0x13, 0x5d, 0x3e, 0xcb, 0xc2, 0x06, 0x57, 0xa5, 0x1a, 0x20, 0x79, 0xd7, + 0x2d, 0x0e, 0x34, 0x14, 0xbf, 0x0e, 0x06, 0xac, 0x29, 0xa0, 0xc2, 0x1e, + 0xee, 0xb0, 0xbe, 0x66, 0x77, 0x2c, 0x4f, 0x6b, 0xfa, 0x4c, 0x13, 0x06, + 0x15, 0x34, 0xc2, 0xaf, 0x9e, 0x07, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x5d, 0xf5, 0x4a, 0xc7, 0x2e, 0x21, 0x9a, 0xef, 0x60, 0xa6, + 0x20, 0xc8, 0xbc, 0xb5, 0xf5, 0x83, 0xeb, 0xe3, 0xef, 0x0f, 0xcd, 0xd7, + 0x7c, 0x76, 0xe9, 0xbc, 0x4d, 0x68, 0xe8, 0x91, 0xe5, 0x33, 0x12, 0x10, + 0xa2, 0xfd, 0x01, 0x4e, 0x14, 0xeb, 0x64, 0xc2, 0x22, 0x95, 0xcb, 0xd1, + 0x96, 0xcb, 0x55, 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xe9, 0x78, 0xdb, 0x2f, 0xf4, 0x7c, 0x7d, + 0xc3, 0x58, 0x27, 0x66, 0xa6, 0xa2, 0x8d, 0x52, 0xd4, 0x1a, 0x20, 0x9e, + 0x9d, 0x2c, 0xec, 0xd6, 0x26, 0x01, 0xd6, 0xfe, 0x61, 0x65, 0x71, 0xd1, + 0x22, 0x20, 0xff, 0x4a, 0x15, 0x1a, 0xb0, 0x45, 0x0b, 0x1d, 0x3b, 0x4c, + 0xd1, 0x14, 0x98, 0x05, 0xe7, 0xc9, 0x10, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x71, 0x0f, 0xb7, 0xde, 0x04, 0x2f, 0x8a, 0xa9, 0x93, + 0xf9, 0xd9, 0x67, 0x1e, 0xdc, 0xd2, 0x6d, 0x5e, 0xa6, 0xec, 0xe0, 0xb7, + 0x96, 0x35, 0x70, 0x10, 0x3a, 0x5d, 0x47, 0x19, 0xf6, 0x7c, 0x07, 0x12, + 0x10, 0x84, 0xea, 0x58, 0xb7, 0x69, 0x3e, 0x60, 0x3c, 0x3c, 0x5c, 0x0f, + 0x7f, 0x1e, 0x32, 0xb4, 0x8f, 0x62, 0x00, 0x20, 0xce, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x0f, 0x80, 0xfd, 0x7a, 0xcd, 0x94, 0x85, 0x49, 0xa4, 0xf8, 0xfa, + 0xc4, 0x3c, 0x16, 0x3e, 0xae, 0x45, 0x43, 0x1f, 0xde, 0x67, 0x80, + 0x60, 0x07, 0xca, 0xcf, 0x90, 0x69, 0x32, 0xd6, 0x2f, 0xaa, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x4e, 0x8a, 0xc3, 0x44, 0x00, 0x00, 0x00, 0x1f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x4e, 0x8a, 0xc3, 0x44, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x94, 0x16, 0x0c, 0x7d, 0x78, 0x8f, 0xd9, 0x6b, + 0x26, 0x18, 0xf2, 0xe5, 0x71, 0xd1, 0x9c, 0x91, 0xc0, 0x7e, 0x8c, 0x31, + 0xd9, 0xca, 0x93, 0x68, 0x2c, 0xaa, 0x96, 0xe7, 0x02, 0x55, 0x98, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x32, 0x45, 0x36, 0x31, 0x46, 0x32, 0x38, 0x44, + 0x38, 0x44, 0x36, 0x44, 0x33, 0x45, 0x41, 0x42, 0x31, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x45, 0x36, 0x31, 0x46, 0x32, 0x38, 0x44, 0x38, 0x44, + 0x36, 0x44, 0x33, 0x45, 0x41, 0x42, 0x31, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x8f, 0xc3, 0x52, 0x78, 0xd6, 0x7f, + 0x3f, 0x36, 0x4d, 0xfa, 0x38, 0x64, 0x40, 0x32, 0x48, 0xe6, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x4b, 0x3a, + 0x33, 0xf3, 0xb0, 0x1c, 0x81, 0x92, 0xb5, 0x71, 0x7c, 0xa3, 0xde, 0x3c, + 0x8b, 0x24, 0x1a, 0x50, 0x88, 0xe4, 0x84, 0x16, 0x64, 0x85, 0xc1, 0x57, + 0x59, 0xc6, 0x74, 0x91, 0xb7, 0x57, 0x18, 0x7e, 0x99, 0xb0, 0x52, 0x1b, + 0xce, 0x35, 0x02, 0xdb, 0xf5, 0xb6, 0x10, 0xad, 0x2d, 0x07, 0x39, 0xee, + 0x76, 0x6f, 0x0e, 0x33, 0xee, 0xb5, 0x1a, 0x88, 0x90, 0x58, 0x6f, 0x20, + 0xed, 0x12, 0x6b, 0x74, 0xe0, 0xbe, 0x45, 0x8e, 0x7c, 0x19, 0xde, 0xeb, + 0xea, 0x00, 0xf1, 0x2c, 0x1f, 0x97, 0x06, 0xf5, 0x94, 0x3a, 0x31, 0xa5, + 0x9e, 0xac, 0x5d, 0xe0, 0x65, 0x61, 0x22, 0x36, 0xbb, 0x4a, 0xc7, 0xac, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xc2, 0xf1, 0xb5, 0x5a, 0xa3, 0xb7, 0x71, 0xe8, 0x92, 0x27, 0x8c, + 0x2f, 0x10, 0xf5, 0x1e, 0x81, 0x1a, 0x20, 0xcb, 0x99, 0xdd, 0xc9, 0x56, + 0x2e, 0x99, 0xb1, 0x20, 0x5e, 0x4d, 0x3a, 0xdf, 0xd2, 0x3c, 0x60, 0xd7, + 0x05, 0xa4, 0x61, 0x1d, 0xf9, 0x84, 0xc4, 0x15, 0xd2, 0x23, 0x89, 0x85, + 0xb5, 0xd6, 0x63, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbd, + 0xd7, 0x09, 0xad, 0x66, 0xb5, 0x47, 0x76, 0x5f, 0xc4, 0x8a, 0x56, 0x15, + 0x91, 0x39, 0xc8, 0x46, 0x07, 0xd2, 0xe0, 0x01, 0x1d, 0xe4, 0x28, 0xf0, + 0x30, 0xc5, 0xa1, 0xae, 0x18, 0xee, 0x27, 0x12, 0x10, 0x9e, 0x1a, 0xef, + 0x44, 0x95, 0x86, 0x4a, 0x4a, 0xa6, 0x18, 0x81, 0x72, 0x4f, 0x6c, 0x60, + 0x34, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xe3, 0xfb, 0x51, 0x35, 0xb5, 0xef, 0x13, 0x15, 0x72, 0xa9, + 0xe6, 0x4a, 0xb2, 0x0b, 0xe9, 0x9e, 0x1a, 0x20, 0x17, 0xca, 0xfc, 0xa0, + 0x7c, 0xb3, 0xfd, 0x1c, 0x33, 0xde, 0x6d, 0x9a, 0x7c, 0xd5, 0xb4, 0x27, + 0xf2, 0xb8, 0x66, 0x4f, 0xa2, 0xa2, 0xc2, 0xb0, 0x5b, 0xdb, 0xc0, 0xec, + 0x16, 0x6f, 0x41, 0x49, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x28, 0xda, 0x1f, 0x75, 0x54, 0xb5, 0x19, 0x14, 0xcb, 0xc7, 0xd6, 0x55, + 0x9a, 0x42, 0x25, 0x3c, 0x11, 0xc6, 0x0d, 0x4f, 0x58, 0xc2, 0x82, 0x24, + 0xb5, 0x70, 0x3d, 0x4e, 0x9f, 0x9e, 0x65, 0xb3, 0x12, 0x10, 0xbb, 0xbe, + 0xdd, 0xf9, 0x9c, 0x87, 0x46, 0xa9, 0xc5, 0xf4, 0xf1, 0xba, 0x17, 0xb0, + 0x57, 0xc2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x52, 0x8b, 0xa5, 0x14, 0xa3, 0x6e, 0x61, 0x25, 0xfd, + 0x1f, 0x81, 0xab, 0xf9, 0xa0, 0xb4, 0x8d, 0x1a, 0x20, 0xdd, 0xf7, 0x6a, + 0xfb, 0x24, 0x52, 0x04, 0x35, 0x04, 0x0e, 0xba, 0x7e, 0xa8, 0x6a, 0x2f, + 0x47, 0xc7, 0x97, 0xa2, 0x4b, 0x11, 0xd0, 0x68, 0x16, 0x89, 0x6b, 0x7e, + 0x14, 0xc4, 0x96, 0x53, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x13, 0x3d, 0x3e, 0x8e, 0x56, 0x3e, 0xdf, 0xb6, 0x3a, 0x66, 0x01, + 0x87, 0xfe, 0x7d, 0xb1, 0x8d, 0x5d, 0xbd, 0x55, 0xca, 0x64, 0x65, 0x30, + 0xda, 0x19, 0xcb, 0x00, 0x9d, 0xa8, 0x48, 0x7c, 0x12, 0x12, 0x10, 0x3e, + 0xfc, 0x52, 0xec, 0xe3, 0x3c, 0x51, 0x7e, 0x06, 0x85, 0x0e, 0xe7, 0xcb, + 0x12, 0xb4, 0x63, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x76, 0x44, 0x2c, 0xf7, 0x31, 0x85, 0xd8, 0xc4, + 0xbe, 0xe4, 0x62, 0xbc, 0x3d, 0xc6, 0x0d, 0x9e, 0x1a, 0x20, 0x47, 0xe0, + 0xd6, 0xb2, 0xd8, 0x72, 0xa9, 0x74, 0x85, 0x5c, 0x9a, 0x01, 0x44, 0xf7, + 0x18, 0x13, 0xba, 0x12, 0xce, 0x85, 0xb8, 0xd4, 0xf3, 0xc6, 0x43, 0x35, + 0xb9, 0x4d, 0xe5, 0x29, 0x9a, 0x30, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xbe, 0x1e, 0xa8, 0x86, 0xfa, 0x05, 0xc5, 0xd5, 0x6e, 0xfb, + 0x3f, 0xb5, 0x24, 0x27, 0x02, 0x01, 0x1c, 0x3f, 0x4d, 0xa5, 0x54, 0x24, + 0x5a, 0xca, 0x0c, 0xb6, 0xd3, 0xc4, 0x6a, 0xcd, 0x08, 0x50, 0x12, 0x10, + 0xa0, 0x2b, 0xe6, 0x6c, 0xad, 0x18, 0xe8, 0xb5, 0xcf, 0x12, 0x74, 0x7a, + 0xc0, 0x88, 0x06, 0x5a, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc8, 0xdb, 0x06, 0x9c, 0x18, 0x16, 0x4d, + 0xc0, 0xbb, 0x97, 0xbe, 0x9e, 0x29, 0x92, 0xec, 0xbd, 0x1a, 0x20, 0x01, + 0x17, 0x9d, 0xfb, 0x0d, 0x6e, 0x7f, 0x87, 0x89, 0xd9, 0x12, 0x86, 0x2c, + 0xf4, 0xc8, 0xe6, 0x02, 0xba, 0xdb, 0x3e, 0x22, 0xba, 0x68, 0xbc, 0xaa, + 0xd2, 0xcb, 0xca, 0x42, 0x68, 0x68, 0x93, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x8e, 0x1e, 0x19, 0x6d, 0x80, 0xb6, 0x0a, 0x72, 0x74, + 0x40, 0x24, 0xe5, 0x96, 0x8b, 0x1f, 0x83, 0xb7, 0x5b, 0xb7, 0xa3, 0x96, + 0xf1, 0xe3, 0x54, 0x68, 0xc3, 0x6b, 0x8e, 0x4f, 0x64, 0x4d, 0x78, 0x12, + 0x10, 0x41, 0xf4, 0xee, 0x15, 0x04, 0xf5, 0x50, 0x3b, 0x56, 0xae, 0xd9, + 0x5f, 0x48, 0xe6, 0x5a, 0x01, 0x62, 0x00, 0x20, 0xe6, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x94, 0x16, 0x0c, 0x7d, 0x78, 0x8f, 0xd9, 0x6b, 0x26, 0x18, 0xf2, + 0xe5, 0x71, 0xd1, 0x9c, 0x91, 0xc0, 0x7e, 0x8c, 0x31, 0xd9, 0xca, + 0x93, 0x68, 0x2c, 0xaa, 0x96, 0xe7, 0x02, 0x55, 0x98, 0x80, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb7, 0x3c, 0x29, 0x2b, 0x00, 0x00, 0x00, 0x21, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xb7, 0x3c, 0x29, 0x2b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xbc, 0x8a, 0xed, 0x13, 0x8e, 0x2a, 0x7a, 0x2f, + 0x2f, 0x42, 0x58, 0x27, 0x80, 0x8b, 0xf1, 0xd3, 0xb6, 0xc6, 0x25, 0x1b, + 0x08, 0x4a, 0x91, 0x8f, 0xf1, 0xf6, 0x30, 0xbf, 0xd3, 0x2c, 0x54, 0x6f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x42, 0x30, 0x32, 0x46, 0x31, 0x38, 0x41, + 0x34, 0x35, 0x42, 0x36, 0x35, 0x39, 0x46, 0x45, 0x31, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x42, 0x30, 0x32, 0x46, 0x31, 0x38, 0x41, 0x34, 0x35, + 0x42, 0x36, 0x35, 0x39, 0x46, 0x45, 0x31, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xfe, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x92, 0x63, + 0x08, 0xf8, 0xf7, 0x97, 0x3b, 0xac, 0x40, 0x20, 0x16, 0x44, 0x51, 0x4e, + 0xef, 0xc0, 0x1a, 0x50, 0xe2, 0x88, 0x54, 0xed, 0x2c, 0x6f, 0xb4, 0xd5, + 0x07, 0xc5, 0x8b, 0x48, 0x21, 0x08, 0xb1, 0x37, 0x6a, 0x32, 0xa5, 0x2a, + 0x95, 0xad, 0x44, 0xa6, 0xcc, 0xa8, 0x3e, 0xe7, 0xcb, 0x47, 0x82, 0x81, + 0x9a, 0x1e, 0x8a, 0x2d, 0xaa, 0xe5, 0xd8, 0xec, 0xe5, 0x4b, 0x19, 0x51, + 0x8f, 0x3f, 0x47, 0xf8, 0xe8, 0xbc, 0xe1, 0x2e, 0xca, 0x75, 0x2b, 0xe0, + 0x33, 0xdf, 0x6a, 0xba, 0xb8, 0x47, 0x5f, 0x34, 0x55, 0x93, 0x2e, 0x71, + 0x4a, 0x10, 0x1d, 0xd0, 0x5f, 0xb3, 0x13, 0xff, 0x1f, 0xc0, 0x21, 0x63, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x6d, 0x6c, 0xd3, 0x3d, 0xe3, 0x05, 0x1a, 0xee, 0x3d, 0x84, 0x43, + 0xe0, 0xb1, 0xea, 0x03, 0x40, 0x1a, 0x20, 0xfc, 0xed, 0xeb, 0xb9, 0x18, + 0x01, 0xf4, 0x97, 0x76, 0x6b, 0x8f, 0x64, 0x18, 0x57, 0x45, 0x46, 0x81, + 0x7a, 0xd0, 0x24, 0xf7, 0xc4, 0x98, 0x5d, 0xe4, 0xa2, 0x9f, 0x0b, 0x36, + 0x79, 0xbc, 0x94, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x92, + 0x7b, 0x02, 0x5b, 0xd6, 0xad, 0x1c, 0x44, 0xea, 0xaa, 0xba, 0xc7, 0x04, + 0xf7, 0xd8, 0x59, 0xe2, 0x0c, 0xfa, 0x60, 0x61, 0xcb, 0x6c, 0xe4, 0x0c, + 0x19, 0x6b, 0x84, 0x3e, 0x94, 0x9c, 0x8c, 0x12, 0x10, 0x49, 0xc6, 0x25, + 0x52, 0x60, 0xa8, 0xb0, 0x56, 0xfc, 0xa8, 0x93, 0x3e, 0x28, 0x48, 0x86, + 0x77, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x90, 0x2f, 0x95, 0x8b, 0xb1, 0x1a, 0x5d, 0xfa, 0xa1, 0xdb, + 0x5c, 0x0b, 0x6d, 0x63, 0x7e, 0x37, 0x1a, 0x20, 0xa0, 0xbc, 0x36, 0x16, + 0x3e, 0x5b, 0x3b, 0xf9, 0x91, 0x13, 0xd7, 0x16, 0xfc, 0x6f, 0xb0, 0xce, + 0x77, 0xb4, 0xa4, 0x94, 0x5a, 0xc3, 0xe9, 0x06, 0x07, 0xa6, 0xca, 0x65, + 0x71, 0xc0, 0x99, 0xee, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x7d, 0xe7, 0x3e, 0x33, 0xb1, 0x83, 0x69, 0x8c, 0xb2, 0xc5, 0x24, 0x00, + 0xbb, 0x03, 0xf8, 0x14, 0x9d, 0x3c, 0x2b, 0x06, 0x97, 0x93, 0xc4, 0x1a, + 0x14, 0x9e, 0xa7, 0x07, 0xb3, 0x49, 0x1e, 0xc3, 0x12, 0x10, 0xc0, 0xf7, + 0x85, 0x08, 0x8e, 0xdc, 0xe7, 0xaa, 0x9f, 0x58, 0x0f, 0xbb, 0x17, 0x5f, + 0x41, 0x12, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x69, 0xb3, 0x06, 0x50, 0x61, 0xf8, 0xac, 0x8c, 0x92, + 0xcb, 0x00, 0xa2, 0x5c, 0xbb, 0x93, 0x22, 0x1a, 0x20, 0xf1, 0xcf, 0x47, + 0x27, 0x71, 0xbe, 0xb4, 0xc9, 0x22, 0xea, 0x72, 0xf4, 0x7d, 0x43, 0x3a, + 0xf5, 0xc1, 0x57, 0xcc, 0x83, 0xce, 0xfa, 0xc5, 0x89, 0x6c, 0x32, 0xbd, + 0xf7, 0xf0, 0xfc, 0xcf, 0x52, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xbb, 0xc4, 0x7e, 0x6d, 0xd8, 0x97, 0x49, 0x8f, 0xc1, 0xea, 0x10, + 0xd4, 0x69, 0x23, 0x84, 0xff, 0xcb, 0x24, 0xdd, 0x8d, 0x18, 0xc0, 0xf3, + 0xc7, 0xe1, 0x07, 0x3f, 0x09, 0x7c, 0x43, 0x2a, 0xe6, 0x12, 0x10, 0x09, + 0x0d, 0x66, 0xb9, 0xe3, 0xf6, 0x09, 0x92, 0x4b, 0xe8, 0x61, 0xdc, 0x89, + 0xcf, 0x51, 0x87, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xfa, 0x6e, 0x0e, 0x12, 0x3c, 0x83, 0x86, 0x5b, + 0x75, 0x73, 0xce, 0xcf, 0xf5, 0x3a, 0x4a, 0xd8, 0x1a, 0x20, 0xd6, 0x5b, + 0xbf, 0xb7, 0x30, 0x93, 0xeb, 0x69, 0x7e, 0xab, 0x6d, 0x6c, 0xb7, 0x54, + 0xb2, 0x96, 0x4c, 0xcf, 0x5d, 0x5e, 0xe5, 0x65, 0x8e, 0x40, 0x19, 0xd1, + 0x58, 0x02, 0x6c, 0x0f, 0x64, 0x68, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x05, 0x97, 0xc6, 0xf4, 0x16, 0xe4, 0x0b, 0x87, 0x4a, 0xc4, + 0xdb, 0x66, 0x56, 0x47, 0x01, 0x18, 0xee, 0x5b, 0x56, 0x2e, 0xde, 0x8a, + 0x9f, 0x2c, 0x1a, 0x81, 0x49, 0xba, 0x63, 0xdc, 0x75, 0xfb, 0x12, 0x10, + 0x6a, 0x26, 0x99, 0x34, 0x94, 0x25, 0x65, 0xf2, 0x26, 0xf3, 0xba, 0x20, + 0x2c, 0x02, 0x76, 0x08, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x0a, 0x21, 0x35, 0xd9, 0x86, 0xd6, 0x18, + 0x2d, 0x23, 0xa3, 0xad, 0x7f, 0xe9, 0xdd, 0xa5, 0xb4, 0x1a, 0x20, 0xe0, + 0xd5, 0xa0, 0xfc, 0x7e, 0xfd, 0xf2, 0xaa, 0xd1, 0x6a, 0xe8, 0x7d, 0xa3, + 0x44, 0x36, 0xd0, 0xed, 0xe4, 0x23, 0xca, 0x01, 0x9a, 0x72, 0xf5, 0x7c, + 0x10, 0x67, 0x2c, 0xec, 0x3c, 0x14, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xc8, 0xd9, 0xa2, 0x1a, 0xa1, 0x4f, 0x0a, 0x5a, 0x7f, + 0x07, 0x1d, 0x3d, 0xd3, 0x3a, 0x49, 0xc3, 0x88, 0x43, 0x6f, 0xb6, 0x27, + 0x96, 0xd3, 0xfb, 0xd6, 0x69, 0xfa, 0x36, 0x4b, 0xb6, 0xf9, 0x29, 0x12, + 0x10, 0xbe, 0xac, 0x8b, 0x87, 0x64, 0x70, 0xe4, 0x6a, 0x16, 0x33, 0x33, + 0xac, 0x49, 0x58, 0xb0, 0x80, 0x62, 0x00, 0x20, 0xfe, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xbc, 0x8a, 0xed, 0x13, 0x8e, 0x2a, 0x7a, 0x2f, 0x2f, 0x42, 0x58, + 0x27, 0x80, 0x8b, 0xf1, 0xd3, 0xb6, 0xc6, 0x25, 0x1b, 0x08, 0x4a, + 0x91, 0x8f, 0xf1, 0xf6, 0x30, 0xbf, 0xd3, 0x2c, 0x54, 0x6f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb0, 0x3b, 0xbe, 0xbe, 0x00, 0x00, 0x00, 0x23, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xb0, 0x3b, 0xbe, 0xbe, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x7b, 0x3f, 0x25, 0xae, 0x8c, 0x6b, 0x9a, 0x5f, + 0x77, 0xb9, 0xc2, 0x9e, 0xed, 0xcf, 0xb1, 0x44, 0xe3, 0x1f, 0x65, 0xf7, + 0x0f, 0x3e, 0x6f, 0x6a, 0xe9, 0x25, 0xa6, 0x84, 0xfa, 0x68, 0x54, 0x88, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x42, 0x34, 0x30, 0x43, 0x33, 0x39, 0x35, + 0x33, 0x43, 0x44, 0x35, 0x30, 0x32, 0x42, 0x34, 0x31, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x42, 0x34, 0x30, 0x43, 0x33, 0x39, 0x35, 0x33, 0x43, + 0x44, 0x35, 0x30, 0x32, 0x42, 0x34, 0x31, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x22, 0x24, 0x62, 0xda, 0x63, 0x87, + 0x90, 0x27, 0xf9, 0x5e, 0x38, 0x64, 0x40, 0x32, 0x48, 0x96, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x32, 0xf1, + 0xaa, 0x8f, 0xae, 0x98, 0x56, 0x5c, 0xf0, 0x6a, 0x1e, 0xc3, 0x70, 0x8f, + 0x2a, 0x1c, 0x1a, 0x50, 0x8a, 0xd6, 0x1a, 0xd2, 0xb8, 0x71, 0x4e, 0xe1, + 0xb3, 0xcf, 0xe4, 0x4d, 0xfd, 0xe4, 0xf2, 0xe9, 0xa9, 0x54, 0x6c, 0x22, + 0x0a, 0xb6, 0x96, 0x53, 0x3c, 0x67, 0x3a, 0x42, 0x33, 0x9e, 0x04, 0xfd, + 0x2a, 0x36, 0x5b, 0x32, 0xd0, 0x3f, 0x53, 0x47, 0x2c, 0xfe, 0x88, 0x66, + 0x39, 0x39, 0xdb, 0x55, 0x24, 0x47, 0x46, 0xf2, 0x4b, 0xec, 0xa0, 0x38, + 0x00, 0x3f, 0xbc, 0x1e, 0x90, 0x8f, 0x5d, 0x13, 0x66, 0xae, 0xd4, 0x45, + 0x2f, 0xf0, 0x59, 0xb2, 0x26, 0x77, 0xff, 0xbf, 0x05, 0xc1, 0xef, 0x2e, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x97, 0x3c, 0x0c, 0xe7, 0x36, 0x26, 0xec, 0x31, 0x69, 0x61, 0xc7, + 0x07, 0x13, 0x28, 0xf3, 0x7b, 0x1a, 0x20, 0xa1, 0xa7, 0xc7, 0x11, 0x58, + 0xd2, 0x9a, 0x01, 0xaa, 0xca, 0x13, 0x71, 0x62, 0x3b, 0xcb, 0x07, 0xde, + 0x51, 0x0f, 0x4a, 0x16, 0xed, 0xef, 0x15, 0xb0, 0x04, 0x12, 0x5b, 0xd6, + 0x45, 0xeb, 0x0b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x79, + 0x30, 0x57, 0xcd, 0x15, 0x65, 0x0e, 0x51, 0xc3, 0x77, 0x53, 0xf0, 0x3d, + 0xb2, 0x6b, 0x3a, 0x82, 0xb3, 0x21, 0xe1, 0xc8, 0x30, 0x71, 0x04, 0xa3, + 0x1e, 0x17, 0x4b, 0x98, 0x94, 0x49, 0x79, 0x12, 0x10, 0x5d, 0x87, 0xa9, + 0xa3, 0x19, 0xf9, 0x04, 0x76, 0x67, 0x06, 0xc7, 0x3b, 0xf0, 0x25, 0x8e, + 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x37, 0x76, 0x5d, 0xbd, 0xec, 0xf6, 0xe8, 0x27, 0x98, 0xa9, + 0x25, 0x99, 0xaa, 0x06, 0xa7, 0xfd, 0x1a, 0x20, 0xbb, 0x8d, 0x11, 0x51, + 0x93, 0x12, 0x68, 0xcd, 0x06, 0x43, 0x58, 0xd1, 0x3c, 0x35, 0xb7, 0xcb, + 0x1f, 0xc7, 0x99, 0x09, 0x72, 0xc4, 0x71, 0xe9, 0x2c, 0x50, 0x63, 0x59, + 0x79, 0x3b, 0x4c, 0xe0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x2c, 0x51, 0xc9, 0xae, 0x8d, 0x26, 0xfc, 0xd4, 0xc7, 0x8e, 0xb3, 0xf7, + 0x17, 0x10, 0x39, 0x7f, 0xf7, 0xbd, 0x99, 0x83, 0x5f, 0x7e, 0xf3, 0x48, + 0x62, 0xaa, 0x9c, 0x78, 0xd5, 0xfb, 0x3c, 0x5e, 0x12, 0x10, 0x89, 0xdd, + 0xf2, 0x8c, 0xe2, 0xa0, 0x25, 0xc0, 0x10, 0x99, 0x88, 0x0a, 0x5a, 0xd3, + 0xcc, 0x00, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe4, 0x53, 0x34, 0xb3, 0x64, 0x16, 0xe8, 0x2b, 0x2c, + 0x34, 0x58, 0x8e, 0x6a, 0x78, 0x18, 0xe7, 0x1a, 0x20, 0xea, 0x84, 0xde, + 0xe4, 0x54, 0x55, 0xb8, 0x48, 0x0c, 0xe1, 0xb2, 0x90, 0x4f, 0x69, 0xe0, + 0x13, 0xc9, 0xd0, 0x76, 0xfa, 0xd5, 0x99, 0x52, 0x9d, 0x30, 0xdb, 0x64, + 0x46, 0x5e, 0x6c, 0x29, 0x6d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x88, 0x6c, 0x53, 0x39, 0x49, 0x22, 0x4b, 0x58, 0x67, 0x73, 0x23, + 0x82, 0xa7, 0x19, 0xd0, 0x36, 0x4c, 0xfd, 0x4e, 0x9a, 0x74, 0x4d, 0xd5, + 0xb2, 0x22, 0xe0, 0x8e, 0x08, 0x55, 0xe6, 0x67, 0x0d, 0x12, 0x10, 0xf9, + 0xd2, 0xba, 0x30, 0xad, 0xc7, 0xfd, 0x52, 0x20, 0x63, 0x42, 0x29, 0x22, + 0x9d, 0x92, 0x39, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x29, 0x0c, 0x6e, 0x61, 0x58, 0xef, 0xcb, 0x9a, + 0xbd, 0x33, 0x0a, 0x01, 0x3a, 0xf8, 0xc0, 0x02, 0x1a, 0x20, 0x8f, 0xb7, + 0x32, 0xaf, 0x35, 0xc7, 0xc5, 0x99, 0xef, 0xb6, 0x0f, 0xf5, 0xba, 0x19, + 0x98, 0xcc, 0x88, 0x7f, 0x76, 0x87, 0xa9, 0x3a, 0x01, 0x58, 0x90, 0x05, + 0x73, 0x63, 0x9f, 0x02, 0x93, 0x37, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x17, 0x3f, 0xa1, 0x36, 0x19, 0xf8, 0xed, 0x13, 0x3a, 0x59, + 0xc7, 0x31, 0x5a, 0x00, 0x0b, 0xdb, 0xda, 0xfd, 0x61, 0xf9, 0x00, 0x62, + 0xa9, 0x3c, 0x46, 0x3c, 0x64, 0x4c, 0x85, 0x04, 0x61, 0xa6, 0x12, 0x10, + 0x6a, 0x22, 0x3d, 0x1c, 0xe8, 0xbb, 0x7a, 0x0d, 0x4b, 0x0f, 0xb1, 0x94, + 0xb0, 0xb1, 0x53, 0xbe, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xcb, 0xbf, 0x7e, 0x6f, 0xfa, 0x46, 0xc3, + 0xcd, 0xb1, 0x8e, 0x52, 0xfd, 0x4b, 0xa8, 0xe9, 0x36, 0x1a, 0x20, 0x89, + 0x72, 0x49, 0xde, 0xb5, 0xfe, 0x41, 0x23, 0x8f, 0x86, 0x71, 0x5a, 0x98, + 0xeb, 0xda, 0xde, 0x7a, 0x40, 0xc5, 0xbd, 0xea, 0xce, 0x0d, 0x0d, 0xda, + 0xd6, 0xb1, 0x2f, 0x20, 0xbf, 0x8c, 0xce, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x5b, 0xd5, 0x1a, 0x74, 0xfa, 0x7b, 0x4a, 0x78, 0x04, + 0xe7, 0x74, 0x84, 0x9e, 0x8c, 0x33, 0xb0, 0xdc, 0x9d, 0xef, 0x5b, 0x5f, + 0xa4, 0x11, 0xd2, 0xe6, 0x90, 0xae, 0x51, 0x44, 0x94, 0x92, 0x5f, 0x12, + 0x10, 0x48, 0x71, 0x2c, 0xdd, 0x7a, 0x07, 0x75, 0xf1, 0x00, 0x4c, 0x5d, + 0x0d, 0x80, 0x13, 0xf3, 0x60, 0x62, 0x00, 0x20, 0x96, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x7b, 0x3f, 0x25, 0xae, 0x8c, 0x6b, 0x9a, 0x5f, 0x77, 0xb9, 0xc2, + 0x9e, 0xed, 0xcf, 0xb1, 0x44, 0xe3, 0x1f, 0x65, 0xf7, 0x0f, 0x3e, + 0x6f, 0x6a, 0xe9, 0x25, 0xa6, 0x84, 0xfa, 0x68, 0x54, 0x88, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf7, 0x25, 0xba, 0x99, 0x00, 0x00, 0x00, 0x25, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xf7, 0x25, 0xba, 0x99, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xeb, 0x4a, 0xf9, 0x73, 0xeb, 0x36, 0x7c, 0xac, + 0xa2, 0xbd, 0x5a, 0x82, 0x82, 0x8d, 0xa0, 0xf8, 0x7d, 0x33, 0x03, 0x44, + 0xd0, 0x1f, 0xc5, 0x13, 0x9c, 0x78, 0x1f, 0x38, 0xf1, 0x66, 0xf2, 0x33, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x31, 0x46, 0x46, 0x44, 0x43, 0x36, 0x42, + 0x32, 0x44, 0x42, 0x37, 0x45, 0x37, 0x39, 0x43, 0x32, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x31, 0x46, 0x46, 0x44, 0x43, 0x36, 0x42, 0x32, 0x44, + 0x42, 0x37, 0x45, 0x37, 0x39, 0x43, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xae, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x3f, 0x5a, + 0xa5, 0xb9, 0x05, 0x88, 0xa7, 0x2e, 0x2b, 0xb1, 0x4a, 0xea, 0xbb, 0xaf, + 0x8e, 0x4b, 0x1a, 0x50, 0xcc, 0xad, 0xcb, 0x6b, 0xf6, 0xf6, 0x18, 0xb7, + 0xae, 0xee, 0xd9, 0xfe, 0x2d, 0x11, 0x48, 0x23, 0x12, 0x0f, 0xa4, 0x14, + 0x0c, 0xf3, 0xf1, 0x83, 0xa1, 0x47, 0x51, 0xf0, 0xa5, 0xfb, 0xa6, 0x71, + 0xaa, 0x3b, 0xa5, 0x9a, 0x7e, 0xdb, 0x93, 0x84, 0xdd, 0x0e, 0xf5, 0x18, + 0xc8, 0xf8, 0xd4, 0x15, 0x65, 0x15, 0x05, 0xeb, 0xd7, 0xae, 0x76, 0x05, + 0xd0, 0xb3, 0xf0, 0xd3, 0x0b, 0x87, 0xea, 0x0c, 0x35, 0x43, 0xa6, 0x59, + 0xe2, 0x3a, 0xa8, 0x91, 0xb8, 0xa1, 0xdb, 0xff, 0xcd, 0x2b, 0xc4, 0xc0, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xbc, 0x3e, 0xb7, 0xc9, 0xf4, 0xd3, 0xa5, 0xa1, 0x1e, 0x89, 0x49, + 0xdd, 0x0b, 0x26, 0x34, 0xaf, 0x1a, 0x20, 0x8a, 0x26, 0x61, 0x81, 0x62, + 0xd0, 0x41, 0x4e, 0xb7, 0xbe, 0x6c, 0x90, 0xad, 0xdf, 0x03, 0xa5, 0x91, + 0x6c, 0xa0, 0xfb, 0x7f, 0xfc, 0x29, 0x4a, 0x4c, 0x61, 0x18, 0xf6, 0x06, + 0x43, 0x17, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xdf, + 0x85, 0xd9, 0x1c, 0x64, 0x12, 0x08, 0xf8, 0x43, 0x09, 0xb6, 0xe7, 0xc4, + 0xac, 0x83, 0x44, 0xdd, 0x8a, 0xe8, 0x92, 0x64, 0xdc, 0x8a, 0x81, 0xde, + 0xdc, 0xc3, 0x11, 0xa2, 0xba, 0x32, 0x16, 0x12, 0x10, 0x17, 0xb6, 0xd3, + 0xe7, 0x49, 0x02, 0xfb, 0xab, 0x28, 0xc9, 0xa4, 0x1f, 0xea, 0x6d, 0x1c, + 0x49, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x67, 0x69, 0x04, 0xc6, 0xee, 0x95, 0x20, 0xa2, 0x3f, 0x16, + 0x59, 0x8b, 0x8c, 0x27, 0xd1, 0x1a, 0x1a, 0x20, 0xb2, 0x7c, 0xd8, 0xa2, + 0x87, 0xa5, 0x5e, 0x73, 0x89, 0x9d, 0xc0, 0xcd, 0x8f, 0x9c, 0xf9, 0xb7, + 0x2f, 0x65, 0x91, 0xfb, 0xb6, 0xa4, 0x3a, 0x37, 0x59, 0x7c, 0xd5, 0x54, + 0x85, 0xe3, 0xa8, 0x55, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x33, 0x18, 0x3e, 0x5e, 0x7a, 0xcf, 0x99, 0xe3, 0xe2, 0x84, 0xc3, 0x78, + 0x44, 0x80, 0xcd, 0x8b, 0x6e, 0xcf, 0x51, 0x44, 0xc3, 0xcf, 0xdb, 0x96, + 0x08, 0x92, 0xe3, 0x73, 0xa1, 0x51, 0x95, 0xfc, 0x12, 0x10, 0x67, 0x88, + 0x61, 0x24, 0xfc, 0xe8, 0x2d, 0x9e, 0x2b, 0x07, 0x1f, 0x61, 0x42, 0xe6, + 0x2b, 0xba, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xa1, 0x11, 0x78, 0xc0, 0x02, 0x56, 0xea, 0x9c, 0xfb, + 0xc5, 0xaa, 0xc7, 0xd2, 0x86, 0x68, 0x98, 0x1a, 0x20, 0x9a, 0x69, 0x2d, + 0x33, 0x1a, 0x66, 0x9f, 0xa0, 0x21, 0xfc, 0xc0, 0x1a, 0x78, 0x61, 0x9c, + 0xb7, 0x5a, 0x07, 0x6b, 0x17, 0x47, 0xf0, 0xac, 0x85, 0x6a, 0x9f, 0x32, + 0xf0, 0x8f, 0xe6, 0x24, 0x56, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xe8, 0xbc, 0xaa, 0xea, 0x07, 0xc4, 0x7a, 0xd5, 0x69, 0xfd, 0x76, + 0xd7, 0x6a, 0x35, 0xd6, 0xa7, 0x32, 0xc4, 0x7e, 0x74, 0xf5, 0x6d, 0xaf, + 0x55, 0xa6, 0x01, 0xfa, 0x03, 0x7b, 0x45, 0xe1, 0x24, 0x12, 0x10, 0xe5, + 0xf4, 0x9c, 0x6e, 0x11, 0xdd, 0x32, 0x26, 0x31, 0x2f, 0xa1, 0x30, 0x4b, + 0x47, 0x44, 0x4c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xba, 0x6b, 0x06, 0x89, 0xbc, 0xf8, 0x78, 0x49, + 0x8a, 0xea, 0x8f, 0x40, 0x7b, 0x87, 0xe3, 0x82, 0x1a, 0x20, 0x58, 0x05, + 0xc9, 0x79, 0xdd, 0x0b, 0xda, 0xb8, 0xf2, 0x20, 0xd1, 0x99, 0x5a, 0x6d, + 0xa8, 0x76, 0x63, 0x4f, 0xd7, 0xf2, 0x00, 0xfb, 0x19, 0xbb, 0xb8, 0x92, + 0xe0, 0x12, 0x96, 0x17, 0xf9, 0xfa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xd7, 0xdf, 0x2c, 0x08, 0xf6, 0x32, 0xb0, 0xbf, 0xbf, 0xdb, + 0xb3, 0x06, 0xad, 0x20, 0xcf, 0x4a, 0xa8, 0x6b, 0x11, 0xae, 0x09, 0xfb, + 0x4d, 0xf4, 0x02, 0x39, 0xfb, 0x3c, 0xc9, 0x30, 0x35, 0xfd, 0x12, 0x10, + 0x32, 0xbc, 0x05, 0x0b, 0x83, 0x2b, 0x84, 0x40, 0x87, 0x20, 0xc5, 0xbb, + 0x73, 0x59, 0x94, 0x31, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x87, 0x36, 0xfd, 0x3b, 0xe0, 0xaf, 0xe8, + 0x3a, 0xa0, 0xc5, 0x99, 0x69, 0x5b, 0x81, 0x94, 0x7d, 0x1a, 0x20, 0xe2, + 0xc0, 0x87, 0x29, 0x7d, 0x03, 0xc5, 0xe9, 0x3f, 0xd9, 0x2e, 0x80, 0x22, + 0x4c, 0xb7, 0x4b, 0xda, 0x6a, 0x6b, 0xda, 0x7a, 0xe1, 0x5c, 0xe3, 0x16, + 0x59, 0x52, 0x9c, 0xb0, 0x2f, 0x44, 0x7f, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x36, 0x74, 0xd0, 0xed, 0xb5, 0x87, 0x13, 0xf5, 0x00, + 0x7f, 0x42, 0x39, 0x39, 0x87, 0xf0, 0xb3, 0xe5, 0xe1, 0x3f, 0x0a, 0xec, + 0x68, 0xb3, 0x4c, 0x1d, 0xf2, 0x0d, 0x13, 0x4d, 0x8e, 0x33, 0x62, 0x12, + 0x10, 0x8f, 0x32, 0x1c, 0x99, 0x18, 0x53, 0xda, 0x49, 0x99, 0x0d, 0xa7, + 0xe5, 0x98, 0x08, 0xa3, 0x82, 0x62, 0x00, 0x20, 0xae, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xeb, 0x4a, 0xf9, 0x73, 0xeb, 0x36, 0x7c, 0xac, 0xa2, 0xbd, 0x5a, + 0x82, 0x82, 0x8d, 0xa0, 0xf8, 0x7d, 0x33, 0x03, 0x44, 0xd0, 0x1f, + 0xc5, 0x13, 0x9c, 0x78, 0x1f, 0x38, 0xf1, 0x66, 0xf2, 0x33, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xa0, 0xdd, 0x28, 0x57, 0x00, 0x00, 0x00, 0x27, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xa0, 0xdd, 0x28, 0x57, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x4b, 0x5f, 0x8c, 0xf1, 0x52, 0xfa, 0xb8, 0x6e, + 0x92, 0xd6, 0xed, 0x38, 0x82, 0x16, 0x40, 0x46, 0x7c, 0x2b, 0x0f, 0x8d, + 0x70, 0x05, 0xd0, 0x4f, 0x83, 0x35, 0x6e, 0x8f, 0x2b, 0x97, 0x5a, 0xfa, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x44, 0x36, 0x46, 0x42, 0x34, 0x30, 0x32, 0x39, + 0x32, 0x44, 0x35, 0x37, 0x31, 0x34, 0x42, 0x43, 0x32, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x36, 0x46, 0x42, 0x34, 0x30, 0x32, 0x39, 0x32, 0x44, + 0x35, 0x37, 0x31, 0x34, 0x42, 0x43, 0x32, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x28, 0x73, 0xf4, 0x4c, 0x7f, 0xc3, + 0xd0, 0x82, 0x54, 0x9b, 0x38, 0x64, 0x40, 0x32, 0x48, 0xc6, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x5a, 0xc9, + 0x32, 0x59, 0xf2, 0x88, 0x50, 0x16, 0xd2, 0xe0, 0xa0, 0xef, 0x8a, 0x48, + 0xbe, 0xf9, 0x1a, 0x50, 0x8b, 0xf2, 0x01, 0x32, 0x71, 0x07, 0x24, 0x49, + 0x63, 0xca, 0xe7, 0xf3, 0x81, 0x95, 0x13, 0xb1, 0xba, 0x28, 0x8c, 0x8f, + 0xe3, 0xd3, 0xc1, 0x29, 0x33, 0x08, 0x40, 0x8b, 0xfe, 0x59, 0x61, 0x48, + 0xc4, 0x79, 0x5e, 0x31, 0x5f, 0x7b, 0x66, 0x67, 0x15, 0x04, 0x8d, 0xe2, + 0x99, 0x3f, 0xfe, 0x65, 0x1a, 0xa4, 0x08, 0x5d, 0x12, 0x3f, 0xf1, 0x07, + 0xdf, 0x85, 0x6f, 0x62, 0x8b, 0xd9, 0xa6, 0x80, 0xe0, 0x8a, 0xc5, 0xfb, + 0x45, 0x39, 0xd4, 0x1f, 0x82, 0xf0, 0xd4, 0x79, 0xe4, 0xcb, 0xdb, 0x00, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x76, 0x77, 0xfa, 0xdc, 0xa7, 0x9a, 0x6f, 0x85, 0xd1, 0xb2, 0x13, + 0x10, 0x02, 0x75, 0x0e, 0x77, 0x1a, 0x20, 0x4f, 0x0f, 0x8f, 0xa3, 0x1d, + 0x14, 0x0c, 0x60, 0x45, 0x86, 0xce, 0xef, 0xba, 0x30, 0x2d, 0x4c, 0x18, + 0x18, 0x53, 0xa4, 0x04, 0x82, 0x9e, 0xd9, 0x68, 0xf7, 0x04, 0x90, 0x4b, + 0x11, 0x22, 0xaf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x0f, + 0x05, 0x2a, 0x19, 0xaa, 0x4f, 0x56, 0x6a, 0xe4, 0x5a, 0x32, 0x67, 0x78, + 0x52, 0x53, 0xfb, 0x11, 0x59, 0xed, 0xf7, 0x3c, 0xc3, 0xf6, 0x27, 0x74, + 0x72, 0x32, 0xc2, 0x34, 0x96, 0x63, 0xc4, 0x12, 0x10, 0x98, 0x92, 0xde, + 0x17, 0xcf, 0x62, 0x0d, 0x40, 0x45, 0x4a, 0x04, 0x3e, 0x7d, 0xab, 0xf5, + 0xe9, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x08, 0xcf, 0xdf, 0x7a, 0xb7, 0x43, 0xa5, 0xd3, 0xd1, 0x82, + 0xb4, 0x52, 0xb0, 0xa1, 0x47, 0x49, 0x1a, 0x20, 0xbe, 0xa8, 0x90, 0xbe, + 0x67, 0x2b, 0x5d, 0x93, 0xe3, 0xe9, 0xbd, 0x7f, 0xe3, 0xf3, 0x68, 0xb2, + 0x8f, 0x62, 0x0a, 0x76, 0xd7, 0xaf, 0xaa, 0x4f, 0x64, 0xad, 0xe3, 0x7c, + 0x1e, 0x23, 0xcf, 0x61, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x03, 0x19, 0x9e, 0x38, 0x65, 0x70, 0x7b, 0x19, 0x2e, 0xa0, 0x0f, 0x6c, + 0x82, 0xeb, 0xf2, 0x76, 0x45, 0xb8, 0x6e, 0x92, 0xfd, 0x09, 0x85, 0x2b, + 0xb8, 0xf3, 0xd8, 0x26, 0x58, 0xfd, 0xf3, 0x6f, 0x12, 0x10, 0xcf, 0xd3, + 0x7a, 0xa8, 0x8d, 0xe4, 0x9e, 0x0f, 0xcc, 0x56, 0xb4, 0xe2, 0xd7, 0xc6, + 0x72, 0xa6, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x61, 0x91, 0xe3, 0xfe, 0xe8, 0x72, 0xdb, 0xbb, 0xa6, + 0xc0, 0x8b, 0x5c, 0x50, 0xb2, 0xb1, 0x43, 0x1a, 0x20, 0x9e, 0x4c, 0x46, + 0xcf, 0x02, 0xb1, 0xce, 0x9c, 0xf1, 0xcf, 0x61, 0x9e, 0x40, 0x69, 0x5c, + 0xee, 0x26, 0xe5, 0xc6, 0x68, 0x36, 0x71, 0x6d, 0x76, 0x1e, 0x2c, 0x07, + 0x57, 0xec, 0x5c, 0xe8, 0xff, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xc1, 0x91, 0x6b, 0xb2, 0x50, 0xb3, 0xa2, 0x8a, 0x32, 0xa6, 0xab, + 0x89, 0xf8, 0xef, 0x3d, 0x40, 0xcf, 0xa3, 0xbe, 0x02, 0xa7, 0xd6, 0xfc, + 0xe2, 0x89, 0xd9, 0x29, 0x2e, 0x81, 0x8a, 0xb8, 0x38, 0x12, 0x10, 0x77, + 0x97, 0x95, 0x17, 0x57, 0x6e, 0x6d, 0xd7, 0x4c, 0x01, 0xe5, 0x49, 0x28, + 0x13, 0xb3, 0x98, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x97, 0x2b, 0xec, 0x3c, 0x26, 0x83, 0x01, 0xbe, + 0xa2, 0xa7, 0x47, 0x50, 0x3b, 0xb7, 0x5b, 0x23, 0x1a, 0x20, 0x06, 0x1a, + 0xee, 0x9b, 0x3a, 0xa3, 0xf3, 0x31, 0x54, 0x6f, 0x73, 0x01, 0x5e, 0xd3, + 0xb4, 0x37, 0x1d, 0x12, 0x28, 0xde, 0x67, 0xc7, 0x1c, 0xbf, 0x7c, 0xfd, + 0x01, 0xdb, 0xb4, 0xf2, 0xdf, 0x17, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xf9, 0xd6, 0xc3, 0xdd, 0xe1, 0xb0, 0x64, 0xc2, 0xc9, 0xe9, + 0x8a, 0x71, 0xea, 0x0a, 0xf6, 0x1d, 0x65, 0x42, 0x5c, 0x35, 0xea, 0xd2, + 0xdc, 0x00, 0x4f, 0xb3, 0x8f, 0xc9, 0x37, 0xa0, 0x52, 0x05, 0x12, 0x10, + 0xa9, 0x03, 0xb3, 0xf9, 0xc2, 0x31, 0xbe, 0x7b, 0xb1, 0x7f, 0x24, 0x3e, + 0x28, 0x0a, 0xdb, 0x3b, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xf9, 0xda, 0x79, 0x05, 0xfe, 0xf9, 0x04, + 0x87, 0x18, 0x93, 0x51, 0xc1, 0x5a, 0x02, 0x28, 0xef, 0x1a, 0x20, 0x11, + 0x57, 0x19, 0xdb, 0xe6, 0x9a, 0xed, 0x99, 0x6f, 0x93, 0xac, 0x56, 0x04, + 0x5f, 0x01, 0x6e, 0x8d, 0x57, 0xa5, 0x96, 0xaa, 0x85, 0xee, 0x22, 0x22, + 0xe1, 0xcf, 0x5d, 0x4e, 0x9e, 0x9c, 0x51, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xd1, 0xa0, 0x80, 0x83, 0x9c, 0x30, 0xf1, 0xc1, 0x6e, + 0x39, 0xaf, 0x20, 0x05, 0x9c, 0x22, 0x5b, 0x5b, 0xa4, 0x80, 0xa8, 0x1a, + 0x5c, 0x39, 0x8f, 0x16, 0x0d, 0x63, 0xb8, 0x14, 0x4e, 0x14, 0x15, 0x12, + 0x10, 0xb2, 0xc4, 0x4d, 0xd8, 0x55, 0x03, 0x6f, 0x54, 0x39, 0xdb, 0x52, + 0xe7, 0x17, 0x73, 0xdd, 0xc3, 0x62, 0x00, 0x20, 0xc6, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x4b, 0x5f, 0x8c, 0xf1, 0x52, 0xfa, 0xb8, 0x6e, 0x92, 0xd6, 0xed, + 0x38, 0x82, 0x16, 0x40, 0x46, 0x7c, 0x2b, 0x0f, 0x8d, 0x70, 0x05, + 0xd0, 0x4f, 0x83, 0x35, 0x6e, 0x8f, 0x2b, 0x97, 0x5a, 0xfa, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xc4, 0x49, 0x50, 0x65, 0x00, 0x00, 0x00, 0x29, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xc4, 0x49, 0x50, 0x65, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0xf7, 0x77, 0xaa, 0x58, 0x2c, 0x65, 0x49, 0x60, + 0x08, 0x37, 0xee, 0xc6, 0x3a, 0xbd, 0x4f, 0x4b, 0xd5, 0x97, 0x33, 0x13, + 0x8a, 0xb6, 0x49, 0x0d, 0x8d, 0x1d, 0x14, 0x5b, 0xeb, 0x2e, 0xe9, 0x35, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x34, 0x30, 0x35, 0x45, 0x45, 0x31, 0x33, 0x32, + 0x45, 0x31, 0x42, 0x46, 0x41, 0x44, 0x38, 0x32, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x30, 0x35, 0x45, 0x45, 0x31, 0x33, 0x32, 0x45, 0x31, + 0x42, 0x46, 0x41, 0x44, 0x38, 0x32, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xde, 0x94, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x45, 0x6a, 0xf4, 0xab, 0x55, 0xad, 0x03, 0xe6, + 0x03, 0x80, 0xd8, 0x1a, 0xed, 0x57, 0xf8, 0x5e, 0x1a, 0x50, 0x61, 0x07, + 0x45, 0x2d, 0xe5, 0x18, 0x30, 0x68, 0x5c, 0x28, 0x54, 0x98, 0x47, 0x89, + 0xb7, 0x0e, 0x18, 0x82, 0x0f, 0xd4, 0xd2, 0xac, 0xf9, 0x62, 0x71, 0x40, + 0xf8, 0xd3, 0x38, 0xd5, 0x7f, 0x66, 0x3a, 0x54, 0x45, 0x2a, 0xcf, 0xe5, + 0x9d, 0x69, 0xa1, 0x39, 0xed, 0x5b, 0xf0, 0x37, 0x5a, 0x3b, 0x96, 0x02, + 0x10, 0xe5, 0x77, 0xc8, 0x00, 0x74, 0xc8, 0x00, 0x39, 0xb5, 0x0f, 0xc0, + 0x2a, 0xe5, 0x5b, 0xc5, 0x89, 0xb8, 0x23, 0xce, 0xef, 0xed, 0x3c, 0x0b, + 0x36, 0x8e, 0x04, 0xaa, 0x0f, 0xd8, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x72, 0x6e, 0x6b, 0xdb, 0xb2, + 0xa5, 0xe1, 0x7c, 0x1c, 0x08, 0x18, 0x36, 0x70, 0x43, 0x1f, 0x8d, 0x1a, + 0x20, 0x62, 0xbd, 0xab, 0xeb, 0x3f, 0x12, 0xc4, 0xa5, 0x8a, 0x64, 0xcf, + 0xf8, 0x34, 0x56, 0xd4, 0x8e, 0x77, 0xce, 0xcb, 0xdd, 0xef, 0x97, 0x9d, + 0x09, 0x85, 0xd2, 0x4d, 0x03, 0x73, 0xc5, 0x83, 0xa8, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, 0x9e, 0xd4, 0x2c, 0x57, 0xae, 0x75, + 0x71, 0xec, 0xee, 0x04, 0xe2, 0x28, 0xe2, 0x04, 0xae, 0x9a, 0x0b, 0x78, + 0xa8, 0x69, 0x05, 0x37, 0x42, 0x26, 0x78, 0x3d, 0x76, 0x67, 0x7a, 0x80, + 0x39, 0x12, 0x10, 0x6c, 0x37, 0xa4, 0xfd, 0xed, 0xf5, 0x35, 0xd5, 0x2f, + 0xa4, 0x15, 0xda, 0x3c, 0xab, 0xe7, 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x50, 0xb1, 0x7b, 0x32, + 0xdd, 0x61, 0x40, 0xbe, 0xfe, 0xa9, 0x94, 0xa6, 0x3f, 0x84, 0x93, 0x2b, + 0x1a, 0x20, 0x7a, 0x4e, 0x4f, 0xa3, 0xd1, 0xe3, 0x98, 0xf6, 0xf1, 0x16, + 0x5b, 0x60, 0x77, 0x79, 0xdb, 0x6a, 0x4c, 0x3a, 0x6d, 0x1d, 0x2f, 0xb7, + 0x40, 0xc9, 0x58, 0x7a, 0xc0, 0xb2, 0x28, 0x2f, 0xcc, 0x4f, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xea, 0x4f, 0xd0, 0xfe, 0x01, 0xf4, + 0xd7, 0x99, 0xa4, 0x55, 0x65, 0x95, 0xae, 0x91, 0xee, 0xeb, 0xd6, 0xdb, + 0xc8, 0x1f, 0x0d, 0x86, 0xbd, 0x3c, 0x0d, 0xf1, 0xb7, 0xb6, 0xb6, 0x4c, + 0x82, 0x9f, 0x12, 0x10, 0x0e, 0x06, 0x05, 0x24, 0xcd, 0x4f, 0x69, 0xc3, + 0x62, 0xb3, 0x16, 0x8b, 0xff, 0x02, 0x44, 0x2e, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xd1, 0x77, 0xd8, + 0x2a, 0x56, 0x50, 0xc3, 0x94, 0xbd, 0x8b, 0x49, 0x2c, 0x99, 0x12, 0x4b, + 0x57, 0x1a, 0x20, 0x4a, 0x3b, 0x3e, 0x72, 0x34, 0xd1, 0x03, 0x77, 0xb7, + 0x93, 0x36, 0x82, 0xaf, 0x3b, 0x4c, 0xa2, 0xe9, 0x1d, 0xe2, 0xd7, 0xa8, + 0x27, 0x24, 0xbb, 0x67, 0x92, 0xf5, 0x08, 0x8d, 0x08, 0x4d, 0xe1, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x1d, 0xd6, 0x37, 0xea, 0x97, + 0xa2, 0x41, 0x77, 0x69, 0xaf, 0x42, 0x54, 0x93, 0x57, 0x1e, 0x56, 0x47, + 0xe9, 0x42, 0x4d, 0x99, 0xa9, 0xf9, 0x80, 0x39, 0x0c, 0xac, 0xe2, 0xa6, + 0xdc, 0x8e, 0x4f, 0x12, 0x10, 0x0f, 0x6a, 0x62, 0xfa, 0x00, 0xd0, 0x25, + 0x1d, 0x91, 0xcb, 0x7f, 0x69, 0x38, 0x4c, 0x8b, 0xb8, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x46, 0x13, + 0xc4, 0x95, 0x3a, 0x58, 0x37, 0x53, 0x25, 0x74, 0xf7, 0xa0, 0x76, 0x35, + 0x79, 0x42, 0x1a, 0x20, 0xde, 0xd9, 0xa8, 0x64, 0x70, 0x98, 0x51, 0x74, + 0xac, 0x27, 0xe9, 0x20, 0x7a, 0x24, 0x3d, 0x08, 0x03, 0x1e, 0x85, 0x8c, + 0xcb, 0x5a, 0xf3, 0x66, 0x37, 0x8c, 0x2a, 0x58, 0x6b, 0x9a, 0x61, 0x3c, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x54, 0x4c, 0x4e, 0x7e, + 0xcc, 0xe4, 0x9b, 0x58, 0xbb, 0x36, 0x5b, 0x26, 0x44, 0xc9, 0x0d, 0x7e, + 0xaa, 0x1b, 0x47, 0x79, 0x14, 0x73, 0x2e, 0x1e, 0xee, 0xf6, 0x79, 0x9d, + 0x23, 0x51, 0x52, 0xc3, 0x12, 0x10, 0x95, 0xde, 0x65, 0xd1, 0x42, 0x0a, + 0x1c, 0xfc, 0x25, 0xd9, 0x40, 0x86, 0xd2, 0xb1, 0xd1, 0x57, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x22, + 0x4a, 0xcb, 0x8c, 0x15, 0x25, 0x14, 0x98, 0x2f, 0x49, 0xf1, 0x8f, 0xda, + 0x31, 0xe1, 0x63, 0x1a, 0x20, 0x93, 0x72, 0x91, 0x02, 0xf6, 0xc8, 0x6e, + 0x74, 0x89, 0x1d, 0x19, 0xfc, 0x39, 0x88, 0x2e, 0x5d, 0x54, 0x45, 0x03, + 0xf9, 0x95, 0x35, 0x19, 0xea, 0x8c, 0x0e, 0x2c, 0xc6, 0xd1, 0xd9, 0x19, + 0x60, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x4a, 0x8d, 0x5f, + 0xc0, 0x90, 0x82, 0xba, 0x0a, 0x00, 0x10, 0x8c, 0x94, 0xe6, 0xa5, 0xfb, + 0x46, 0x54, 0x10, 0xa1, 0xe8, 0xd1, 0xdd, 0x24, 0xb2, 0xec, 0x82, 0x4d, + 0x47, 0xe6, 0x24, 0x1f, 0x82, 0x12, 0x10, 0x81, 0xa8, 0xd7, 0x6a, 0xe6, + 0x48, 0x7a, 0xca, 0xb2, 0xa0, 0x15, 0x86, 0x34, 0x05, 0xeb, 0x66, 0x62, + 0x00, 0x20, 0xde, 0x94, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xf7, 0x77, 0xaa, 0x58, 0x2c, 0x65, 0x49, 0x60, 0x08, 0x37, 0xee, + 0xc6, 0x3a, 0xbd, 0x4f, 0x4b, 0xd5, 0x97, 0x33, 0x13, 0x8a, 0xb6, + 0x49, 0x0d, 0x8d, 0x1d, 0x14, 0x5b, 0xeb, 0x2e, 0xe9, 0x35, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x11, 0x59, 0x42, 0x00, 0x00, 0x00, 0x00, 0x2b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x11, 0x59, 0x42, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0x33, 0xfd, 0x9a, 0x6e, 0x04, 0xb0, 0xb7, 0x1a, + 0xbe, 0x04, 0xdb, 0x46, 0xb1, 0xe6, 0xd1, 0x3b, 0xd6, 0xc5, 0xe8, 0xaa, + 0x6d, 0xec, 0x27, 0x0e, 0x2e, 0x37, 0x73, 0xc4, 0x5c, 0xec, 0xae, 0x0a, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x38, 0x34, 0x42, 0x32, 0x32, 0x33, 0x35, 0x39, + 0x39, 0x32, 0x35, 0x33, 0x34, 0x31, 0x46, 0x30, 0x32, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x38, 0x34, 0x42, 0x32, 0x32, 0x33, 0x35, 0x39, 0x39, 0x32, + 0x35, 0x33, 0x34, 0x31, 0x46, 0x30, 0x32, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xb5, 0x57, 0xaf, 0x5c, 0x87, 0xd0, + 0x3a, 0x2a, 0xe2, 0xd1, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xd1, 0x95, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xc9, 0x37, 0xac, 0x66, 0xa0, 0x2f, 0xe6, 0xe5, + 0x66, 0xed, 0xf9, 0xfa, 0xaf, 0x75, 0xb8, 0xb5, 0x1a, 0x50, 0x4f, 0x4a, + 0xec, 0xe1, 0x8b, 0x6c, 0x69, 0x9b, 0x03, 0x2b, 0xdf, 0x5f, 0x68, 0x71, + 0x0c, 0xbd, 0x43, 0x3e, 0x59, 0x51, 0xa2, 0x10, 0xb2, 0xbe, 0x17, 0xe2, + 0xcf, 0x98, 0x03, 0x5f, 0xe6, 0xb8, 0x11, 0x24, 0xc2, 0x7e, 0xb0, 0xc8, + 0xc7, 0x1e, 0xf2, 0xf9, 0xc4, 0x07, 0xd7, 0xe0, 0x88, 0xc5, 0xd6, 0xfc, + 0x6c, 0x95, 0xb8, 0xbd, 0xe5, 0x3f, 0x49, 0x3d, 0x32, 0x1f, 0x7e, 0xdf, + 0xfb, 0xb2, 0x12, 0x56, 0xa7, 0x37, 0xd8, 0xe5, 0xc9, 0x41, 0xe7, 0xb1, + 0x45, 0xfa, 0xac, 0xdf, 0x3d, 0x92, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd9, 0xd3, 0xa5, 0x78, 0x70, + 0x42, 0x80, 0x5f, 0x8d, 0x05, 0x93, 0x04, 0xdf, 0x4e, 0x21, 0x80, 0x1a, + 0x20, 0x59, 0x96, 0x77, 0x74, 0xb0, 0xbe, 0x5f, 0x9a, 0xa5, 0xad, 0xce, + 0xb3, 0x98, 0xc7, 0xe5, 0x21, 0x75, 0xff, 0x76, 0x72, 0x09, 0x83, 0x48, + 0x14, 0xcf, 0xe3, 0x71, 0x22, 0x65, 0x20, 0xa2, 0x3e, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xf8, 0xe8, 0x10, 0x14, 0x38, 0xbe, 0x92, + 0xfd, 0x96, 0xea, 0x22, 0xe8, 0xed, 0x08, 0x02, 0x48, 0x8d, 0xbf, 0xee, + 0xbe, 0x71, 0x11, 0xb0, 0x07, 0xe0, 0x34, 0xa1, 0x9e, 0x98, 0x46, 0x5a, + 0x30, 0x12, 0x10, 0xdd, 0xcb, 0x53, 0x36, 0x5f, 0xdf, 0xa1, 0xb4, 0xd5, + 0x1c, 0x69, 0x53, 0x95, 0x88, 0xf0, 0xbe, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x2c, 0x03, 0xc0, 0xf4, + 0x04, 0xf2, 0xe5, 0xad, 0xd6, 0x31, 0xf9, 0x75, 0xb7, 0x43, 0xce, 0x48, + 0x1a, 0x20, 0x4c, 0x8d, 0x9b, 0x8e, 0x23, 0x74, 0xa7, 0x52, 0xdc, 0x37, + 0xdc, 0xa8, 0x50, 0x0d, 0xeb, 0xcd, 0x05, 0xef, 0x41, 0x71, 0xe5, 0xb2, + 0xfb, 0x9c, 0x94, 0xeb, 0x41, 0x90, 0x79, 0xca, 0xe2, 0xf3, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xb9, 0x77, 0xed, 0x3c, 0xd6, 0x2b, + 0x94, 0x35, 0x85, 0xec, 0x95, 0xf0, 0x6e, 0xfa, 0xd2, 0x0c, 0x07, 0x4f, + 0x59, 0xef, 0x8d, 0xf4, 0x26, 0x3f, 0xba, 0xa5, 0x58, 0x41, 0x54, 0x8e, + 0x91, 0xc4, 0x12, 0x10, 0xf6, 0xc5, 0x89, 0xef, 0x31, 0x14, 0x21, 0xdc, + 0x20, 0x51, 0x20, 0x95, 0x7c, 0x76, 0xe7, 0xd7, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xc0, 0x0a, 0x94, + 0x98, 0xc1, 0x7a, 0xfc, 0xd5, 0x99, 0x46, 0xf4, 0x2b, 0x39, 0x87, 0x68, + 0x96, 0x1a, 0x20, 0x86, 0xa6, 0x92, 0xae, 0xf9, 0xfd, 0x79, 0xd8, 0xdd, + 0xc5, 0x8c, 0x8f, 0xa4, 0x7a, 0xec, 0x3b, 0xdb, 0x67, 0xdb, 0xdd, 0x07, + 0x4c, 0xe9, 0x24, 0xdb, 0x1b, 0x35, 0xb5, 0x1a, 0xfa, 0x7b, 0x20, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xe7, 0x85, 0x47, 0x65, 0xbe, + 0x31, 0xdc, 0x17, 0x30, 0x0e, 0x40, 0xbb, 0x24, 0x70, 0xbc, 0x74, 0x7b, + 0x3e, 0xbb, 0xf8, 0xa0, 0x73, 0x0e, 0xe4, 0xa1, 0x9e, 0xc7, 0xb1, 0xf0, + 0x78, 0x47, 0x8a, 0x12, 0x10, 0x7a, 0xf1, 0x8f, 0xfd, 0xec, 0xcf, 0x57, + 0xaf, 0xbb, 0x06, 0x9e, 0x17, 0x15, 0xf3, 0x5c, 0x11, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xc1, 0x28, + 0x6f, 0xa0, 0x12, 0x52, 0x5b, 0x6a, 0x5a, 0x11, 0x8c, 0x75, 0x5c, 0xa6, + 0x6b, 0xdb, 0x1a, 0x20, 0xfa, 0x0f, 0xb0, 0x94, 0xbd, 0x8d, 0x96, 0x55, + 0xe5, 0x46, 0xf9, 0xbe, 0x68, 0x89, 0xd3, 0x5e, 0xef, 0xf1, 0x5c, 0x19, + 0x7f, 0x16, 0x5e, 0xb6, 0xba, 0xc5, 0x79, 0x53, 0xf4, 0xe5, 0xf5, 0x94, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xcc, 0xbf, 0xd1, 0xeb, + 0xb9, 0xf3, 0xf3, 0x17, 0xee, 0xa6, 0x21, 0x26, 0xba, 0x7a, 0x7f, 0x0b, + 0xac, 0xe7, 0xa2, 0x3c, 0xcd, 0x5e, 0x7a, 0xaf, 0x0e, 0x4a, 0xf8, 0x0b, + 0xfb, 0x07, 0x06, 0x8d, 0x12, 0x10, 0x7c, 0x69, 0x13, 0xd3, 0x06, 0x31, + 0xec, 0x82, 0x97, 0x83, 0x2c, 0x5e, 0x18, 0xa8, 0x67, 0x8d, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd9, + 0x75, 0xfb, 0x80, 0xb5, 0xa7, 0xec, 0x37, 0x69, 0x28, 0x33, 0x9e, 0x88, + 0x94, 0x16, 0x54, 0x1a, 0x20, 0x04, 0x06, 0xf7, 0x58, 0xe8, 0x18, 0xd3, + 0xe2, 0x71, 0xb1, 0x8e, 0x0f, 0x94, 0xf3, 0xc8, 0xdb, 0x53, 0x42, 0xfb, + 0x6c, 0xbc, 0x4f, 0x8d, 0x24, 0x15, 0x0f, 0x69, 0x49, 0x1f, 0x94, 0x11, + 0xd9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbc, 0x2a, 0x6e, + 0xe9, 0xdb, 0x63, 0x9e, 0x61, 0xb2, 0x6e, 0x20, 0x8f, 0x35, 0xc6, 0xc9, + 0x66, 0x6a, 0xcf, 0xf2, 0x46, 0xae, 0x3d, 0x45, 0x81, 0x4a, 0xa6, 0xbd, + 0x3c, 0x33, 0xb0, 0x7c, 0x00, 0x12, 0x10, 0xde, 0x3f, 0xcf, 0xad, 0x81, + 0xa8, 0x09, 0x17, 0x73, 0x1f, 0xa0, 0x65, 0x3a, 0xaf, 0xa7, 0x33, 0x62, + 0x00, 0x20, 0xd1, 0x95, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x33, 0xfd, 0x9a, 0x6e, 0x04, 0xb0, 0xb7, 0x1a, 0xbe, 0x04, 0xdb, + 0x46, 0xb1, 0xe6, 0xd1, 0x3b, 0xd6, 0xc5, 0xe8, 0xaa, 0x6d, 0xec, + 0x27, 0x0e, 0x2e, 0x37, 0x73, 0xc4, 0x5c, 0xec, 0xae, 0x0a, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x8a, 0xf6, 0xf2, 0xa5, 0x00, 0x00, 0x00, 0x2d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x8a, 0xf6, 0xf2, 0xa5, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0x65, 0xef, 0xf6, 0x41, 0x52, 0x83, 0x4f, 0x95, + 0xd8, 0xf0, 0xf1, 0x88, 0xb4, 0xa7, 0x2b, 0xc5, 0xf0, 0x1d, 0xa0, 0x6f, + 0x0c, 0x2f, 0x1c, 0xe9, 0x43, 0x31, 0xe2, 0x9a, 0x31, 0xcf, 0xab, 0x87, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x46, 0x43, 0x32, 0x34, 0x32, 0x30, 0x30, 0x31, + 0x42, 0x36, 0x31, 0x39, 0x42, 0x36, 0x31, 0x32, 0x32, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x43, 0x32, 0x34, 0x32, 0x30, 0x30, 0x31, 0x42, 0x36, + 0x31, 0x39, 0x42, 0x36, 0x31, 0x32, 0x32, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xc4, 0x96, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xe1, 0x3b, 0x6e, 0x3c, 0xe3, 0xe7, 0xad, 0x30, + 0xbd, 0x12, 0xb7, 0x53, 0x95, 0xcb, 0x54, 0x81, 0x1a, 0x50, 0xf4, 0x7e, + 0x07, 0x67, 0xeb, 0xd6, 0x1b, 0xe8, 0xb5, 0x97, 0x5a, 0x57, 0x11, 0xd9, + 0x94, 0x5b, 0x34, 0x08, 0x1f, 0x62, 0xd3, 0xc3, 0x63, 0xce, 0x54, 0x1c, + 0xd6, 0x92, 0x6a, 0x45, 0x47, 0xbe, 0x9d, 0x15, 0x47, 0x30, 0x9b, 0x79, + 0x4a, 0x5c, 0x24, 0xa6, 0x8c, 0xa8, 0xb7, 0x4a, 0x01, 0xa7, 0x8c, 0x8d, + 0x7b, 0xbf, 0xa7, 0x3a, 0x56, 0x88, 0x12, 0x5e, 0x14, 0x5d, 0x1d, 0x27, + 0x17, 0x24, 0xfe, 0xe9, 0x32, 0x9f, 0xaf, 0xa6, 0x86, 0x26, 0x39, 0xdc, + 0xaa, 0x9f, 0xa9, 0x9b, 0x66, 0xaf, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x7f, 0x5d, 0xae, 0xe5, 0xf4, + 0xa4, 0x78, 0xd4, 0x8f, 0x76, 0x28, 0x9e, 0x12, 0xb3, 0xed, 0x60, 0x1a, + 0x20, 0xd9, 0x14, 0x27, 0x71, 0x02, 0xb1, 0x84, 0x98, 0xb5, 0x84, 0x05, + 0x2d, 0x9c, 0xeb, 0x43, 0x7d, 0x1b, 0x08, 0xc7, 0x1d, 0x5e, 0xc6, 0xc8, + 0x6d, 0x54, 0x32, 0xef, 0xf9, 0x55, 0xbb, 0x3d, 0x23, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xee, 0x32, 0x40, 0xd6, 0xed, 0xd8, 0x42, + 0x4c, 0xbe, 0x79, 0x25, 0xc0, 0xd9, 0x31, 0xe9, 0x07, 0x96, 0xcc, 0xad, + 0x58, 0x48, 0x87, 0xe3, 0xa8, 0x33, 0x51, 0xd2, 0x92, 0x1b, 0x8c, 0xbb, + 0xe3, 0x12, 0x10, 0xe6, 0x27, 0x86, 0xb5, 0x5a, 0x5e, 0x42, 0xcd, 0xc8, + 0x78, 0x07, 0x47, 0x09, 0xf1, 0xee, 0x00, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xed, 0x4e, 0x7c, 0x9e, + 0x80, 0x42, 0xb8, 0x7e, 0x10, 0xff, 0xd8, 0xb2, 0x64, 0x43, 0xeb, 0xa2, + 0x1a, 0x20, 0x06, 0xd4, 0x49, 0x59, 0x7b, 0x25, 0x14, 0x30, 0x98, 0xee, + 0xaf, 0xb4, 0xbe, 0x5a, 0xf0, 0xf5, 0xad, 0x2f, 0xf6, 0x72, 0x1e, 0x6f, + 0xac, 0xcf, 0x1f, 0x44, 0x48, 0x92, 0x30, 0x84, 0xb0, 0x33, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x6f, 0xd0, 0x6b, 0x80, 0x41, 0xb1, + 0x50, 0xbc, 0x0f, 0xf0, 0x1f, 0x40, 0x00, 0xa4, 0x8a, 0x0e, 0xe6, 0x47, + 0xe2, 0xb1, 0xf3, 0xca, 0x8a, 0x27, 0xe3, 0xae, 0x32, 0x47, 0x70, 0x66, + 0x95, 0x66, 0x12, 0x10, 0x8f, 0xe9, 0xd7, 0x6a, 0x32, 0x09, 0xb8, 0xa5, + 0x3c, 0x68, 0x9c, 0x90, 0x01, 0xd7, 0x8b, 0x91, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x0e, 0xc0, 0x2a, + 0x24, 0x26, 0xe7, 0x6b, 0x84, 0x6a, 0x14, 0x55, 0x0a, 0x10, 0xbd, 0x0a, + 0xd8, 0x1a, 0x20, 0xc2, 0x96, 0xc5, 0x0f, 0x08, 0xf8, 0x1e, 0xe5, 0xcd, + 0x4e, 0x29, 0xf4, 0xde, 0x94, 0x45, 0xaf, 0x50, 0xbe, 0xb0, 0x8d, 0x8b, + 0xe1, 0x76, 0x2b, 0xbd, 0xe4, 0xdf, 0x49, 0x1c, 0x42, 0x96, 0x95, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x31, 0x54, 0xd0, 0xc9, 0xbf, + 0x63, 0x0d, 0x85, 0x51, 0x51, 0x4e, 0xe7, 0x3e, 0x2f, 0xc8, 0x10, 0x5e, + 0x60, 0xd7, 0x1c, 0x5c, 0xfa, 0x73, 0xc1, 0x0e, 0x7c, 0x49, 0xdb, 0xa4, + 0xaf, 0xbf, 0x23, 0x12, 0x10, 0xcb, 0x50, 0xee, 0x0b, 0x8e, 0x99, 0x6e, + 0x2d, 0x29, 0x81, 0xcf, 0x1d, 0x95, 0x11, 0xf0, 0xd2, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x21, 0xff, + 0x6a, 0x61, 0x96, 0xe2, 0x94, 0xff, 0x0c, 0x1f, 0x05, 0xf9, 0x27, 0xda, + 0x26, 0xb4, 0x1a, 0x20, 0x19, 0x7a, 0x7f, 0xff, 0xf1, 0x51, 0xf5, 0xbf, + 0x71, 0x55, 0xd6, 0x33, 0x9d, 0x69, 0xf9, 0x76, 0x1f, 0x86, 0xb0, 0xb5, + 0x9f, 0xb6, 0x5a, 0xca, 0xfe, 0x07, 0xa8, 0x7c, 0x57, 0xf7, 0xed, 0x57, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x70, 0xcb, 0x43, 0x2f, + 0xd0, 0xaa, 0xc8, 0xf8, 0xf3, 0x12, 0x10, 0xde, 0x2f, 0xc5, 0x3b, 0x8b, + 0x5c, 0xc2, 0x32, 0x23, 0x3f, 0x5d, 0x71, 0xee, 0x83, 0x92, 0xa7, 0x3e, + 0x2a, 0xe0, 0x96, 0x67, 0x12, 0x10, 0x31, 0xb2, 0x53, 0xaa, 0x17, 0x29, + 0x61, 0x76, 0xa2, 0xc6, 0x55, 0x54, 0xd5, 0x24, 0x3d, 0x44, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xa4, + 0x52, 0x6d, 0x50, 0x3b, 0xf5, 0x41, 0x91, 0x13, 0x00, 0x86, 0x3c, 0xe2, + 0x58, 0xc7, 0xb5, 0x1a, 0x20, 0xb2, 0xed, 0x5c, 0x30, 0x87, 0xa0, 0x81, + 0xb6, 0x76, 0xad, 0xd9, 0x9d, 0xfb, 0xea, 0xaa, 0x5e, 0x25, 0x2e, 0xb6, + 0x1f, 0xb4, 0xc9, 0xfe, 0xc7, 0xe6, 0xf9, 0x93, 0xdb, 0xfc, 0xcb, 0x84, + 0x5d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x67, 0xce, 0xaf, + 0x93, 0x9a, 0x5f, 0x29, 0x7b, 0x32, 0x40, 0x9b, 0x5b, 0x4a, 0x25, 0xcf, + 0x7e, 0x97, 0x79, 0xc5, 0x25, 0x5b, 0x19, 0xe2, 0x41, 0x3c, 0xc5, 0x6d, + 0x0d, 0xd7, 0xcf, 0xd6, 0x07, 0x12, 0x10, 0x68, 0x61, 0x64, 0x5f, 0x29, + 0xf1, 0xf4, 0x97, 0x6b, 0xb8, 0xe7, 0x80, 0x48, 0x95, 0x14, 0xcd, 0x62, + 0x00, 0x20, 0xc4, 0x96, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x65, 0xef, 0xf6, 0x41, 0x52, 0x83, 0x4f, 0x95, 0xd8, 0xf0, 0xf1, + 0x88, 0xb4, 0xa7, 0x2b, 0xc5, 0xf0, 0x1d, 0xa0, 0x6f, 0x0c, 0x2f, + 0x1c, 0xe9, 0x43, 0x31, 0xe2, 0x9a, 0x31, 0xcf, 0xab, 0x87, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xd0, 0x2d, 0x48, 0x46, 0x00, 0x00, 0x00, 0x2f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xd0, 0x2d, 0x48, 0x46, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0x99, 0xf3, 0x24, 0xda, 0x42, 0x21, 0x14, 0xf6, + 0x21, 0xba, 0x64, 0xec, 0x87, 0x1e, 0x86, 0x52, 0x2f, 0x81, 0x78, 0x23, + 0x0b, 0xea, 0xfb, 0xbe, 0x5e, 0xa7, 0x1a, 0xd2, 0x57, 0x23, 0xc6, 0xbe, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x41, 0x38, 0x35, 0x45, 0x42, 0x34, 0x31, 0x37, + 0x44, 0x39, 0x37, 0x38, 0x32, 0x46, 0x39, 0x32, 0x32, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x35, 0x45, 0x42, 0x34, 0x31, 0x37, 0x44, 0x39, + 0x37, 0x38, 0x32, 0x46, 0x39, 0x32, 0x32, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xf3, 0x8c, 0xf8, 0xb7, 0x38, 0xc2, + 0x2a, 0x89, 0x72, 0xad, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xb7, 0x97, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x0a, 0x16, 0xbb, 0xb7, 0x16, 0x34, 0xf4, 0x9a, + 0x63, 0x64, 0xce, 0x02, 0xe3, 0x75, 0xb4, 0xf8, 0x1a, 0x50, 0x5e, 0x3c, + 0xeb, 0x1d, 0x7c, 0x99, 0x7e, 0x6d, 0x4a, 0x40, 0x79, 0x30, 0xd1, 0x5f, + 0x5e, 0xe9, 0xbe, 0xae, 0x5c, 0xff, 0x4e, 0x69, 0x2b, 0x0f, 0x16, 0xc1, + 0x50, 0xf1, 0x6a, 0x33, 0x89, 0x2a, 0x49, 0x7c, 0xa6, 0x9c, 0x1a, 0x54, + 0xe0, 0xb7, 0x37, 0x88, 0x06, 0x29, 0x0e, 0x42, 0xc8, 0x9d, 0xc1, 0xc1, + 0xea, 0x80, 0xfd, 0x27, 0x2b, 0x16, 0xc8, 0xed, 0x79, 0x2d, 0x1d, 0x1d, + 0xe6, 0x97, 0xb8, 0xa5, 0x19, 0xe8, 0x2a, 0x13, 0xc5, 0x55, 0xa1, 0x64, + 0x80, 0xb2, 0x5c, 0xd1, 0x23, 0xbd, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd1, 0xc0, 0x0d, 0xf4, 0x96, + 0xcb, 0x6f, 0x2b, 0x90, 0x3e, 0xa8, 0x65, 0x86, 0x74, 0x28, 0x95, 0x1a, + 0x20, 0x7b, 0xf5, 0xcc, 0x8d, 0x96, 0xca, 0xe2, 0xf6, 0x8a, 0xce, 0x1b, + 0x0d, 0x1c, 0x1b, 0x9c, 0x5f, 0x35, 0xe0, 0xfa, 0x3a, 0xcc, 0xa1, 0x9e, + 0xcb, 0x5d, 0x1c, 0x0f, 0x68, 0x67, 0x10, 0x49, 0xa8, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xc4, 0x48, 0x4d, 0xa3, 0x2b, 0x86, 0x76, + 0xf7, 0xfa, 0xc5, 0x1c, 0xfc, 0xc9, 0x18, 0x7c, 0xcb, 0xde, 0x21, 0x5c, + 0x56, 0xc1, 0x91, 0x5d, 0x27, 0xc6, 0x1f, 0x12, 0xe1, 0x26, 0xd8, 0x1e, + 0x5f, 0x12, 0x10, 0xc8, 0x92, 0x8e, 0x9f, 0x17, 0x05, 0x8e, 0xf6, 0x10, + 0xa6, 0xaf, 0x1c, 0x6e, 0xe0, 0x99, 0x68, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xea, 0xcd, 0x01, 0xd8, + 0x0c, 0xc4, 0x56, 0xeb, 0x77, 0x5e, 0x90, 0x3c, 0xad, 0xfa, 0xdb, 0x1f, + 0x1a, 0x20, 0x13, 0xad, 0x5e, 0x1b, 0x17, 0x3d, 0x2f, 0x79, 0x46, 0xbf, + 0x51, 0x26, 0xe6, 0x21, 0xf9, 0x50, 0x30, 0x89, 0x49, 0x8d, 0xc7, 0xf6, + 0x48, 0x52, 0x04, 0x12, 0xd0, 0xca, 0xce, 0x73, 0x4e, 0x11, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x62, 0x1f, 0x0a, 0x9c, 0x91, 0x30, + 0x5d, 0x33, 0x23, 0x26, 0xca, 0xb1, 0xf7, 0x7f, 0x18, 0xfd, 0xb4, 0xa9, + 0xbc, 0x47, 0x45, 0xb2, 0x79, 0xca, 0x47, 0xb8, 0x09, 0x83, 0xad, 0xe2, + 0xdb, 0xdf, 0x12, 0x10, 0x3c, 0xa2, 0x1d, 0x13, 0xf1, 0xc4, 0x68, 0xc7, + 0xb0, 0x60, 0xbb, 0x10, 0x3f, 0x91, 0x25, 0xfd, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x44, 0xd1, 0xfb, + 0x8d, 0xb8, 0xee, 0xb3, 0x1d, 0x4d, 0x8c, 0x1e, 0x1c, 0xb7, 0xa4, 0x2f, + 0x8c, 0x1a, 0x20, 0x3b, 0xa9, 0xd6, 0xa4, 0x37, 0x22, 0x23, 0x5b, 0x4d, + 0xb6, 0x1f, 0xb3, 0x37, 0xea, 0x0f, 0x5d, 0x0d, 0xd2, 0xa8, 0xcc, 0x6b, + 0x52, 0x82, 0x10, 0x2c, 0x1a, 0xfb, 0xfc, 0xbc, 0xaa, 0x90, 0x69, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xa1, 0x85, 0x45, 0x27, 0x5d, + 0xfe, 0x68, 0x09, 0x58, 0x6e, 0xcb, 0x3c, 0xc4, 0xe8, 0xf3, 0xc2, 0xbe, + 0x02, 0x91, 0x7b, 0xe8, 0x8a, 0xdf, 0x75, 0xc2, 0xe8, 0xa3, 0x3f, 0xb4, + 0x55, 0x9f, 0x70, 0x12, 0x10, 0xf8, 0x4a, 0xef, 0xc3, 0x6b, 0xf4, 0x2c, + 0xd9, 0x0e, 0x5e, 0x23, 0xa4, 0x1c, 0xd5, 0xaf, 0x31, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x10, 0xd9, + 0x2f, 0x79, 0x3b, 0xcd, 0x46, 0x18, 0xdf, 0x24, 0xc0, 0x06, 0xfd, 0x48, + 0xb0, 0xc5, 0x1a, 0x20, 0xba, 0x0a, 0x03, 0xc7, 0xdc, 0x4e, 0xa2, 0xf9, + 0xde, 0x4e, 0x5e, 0xab, 0x88, 0xbe, 0x23, 0x5c, 0xe6, 0xe8, 0x36, 0xed, + 0x76, 0x5a, 0x28, 0xa0, 0x55, 0x4c, 0xac, 0x3e, 0xb8, 0x92, 0xf2, 0x9d, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xab, 0x04, 0xa7, 0x47, + 0x6d, 0xc3, 0xcd, 0xdf, 0xd3, 0xf6, 0xaa, 0x84, 0x56, 0x4c, 0x8b, 0x11, + 0xbc, 0x32, 0xc1, 0xff, 0xa3, 0x29, 0x43, 0xef, 0x27, 0x1d, 0x84, 0x12, + 0x32, 0x6f, 0x6a, 0xd5, 0x12, 0x10, 0x43, 0x24, 0x3b, 0x28, 0x55, 0xfb, + 0x08, 0x87, 0xef, 0x7c, 0x65, 0x44, 0x0c, 0x0d, 0x49, 0x5f, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xe4, + 0x3f, 0x6c, 0x0e, 0x3d, 0x86, 0x77, 0xca, 0xe6, 0x51, 0xd0, 0x03, 0x9a, + 0x6d, 0x26, 0x21, 0x1a, 0x20, 0xb8, 0xd8, 0x8a, 0xfb, 0x3c, 0x6b, 0x39, + 0xad, 0xf2, 0x87, 0x1c, 0xca, 0xa8, 0x0d, 0xf9, 0x4e, 0xcf, 0x4b, 0xba, + 0xe0, 0x54, 0x96, 0x1f, 0x67, 0xc9, 0xd2, 0xaf, 0xb0, 0xa9, 0x50, 0xc6, + 0xd4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xdb, 0xc2, 0x08, + 0x01, 0xc7, 0xaf, 0x03, 0x35, 0xc0, 0x66, 0x7f, 0xfa, 0xb0, 0xda, 0x0e, + 0xe0, 0xb8, 0x85, 0x25, 0x76, 0x21, 0xae, 0xc2, 0x41, 0xe7, 0x17, 0x36, + 0x50, 0xd0, 0x76, 0xb7, 0x72, 0x12, 0x10, 0xae, 0xd8, 0x7e, 0x09, 0xf8, + 0x9e, 0x95, 0x2e, 0x1f, 0x07, 0x86, 0xe2, 0x38, 0xd4, 0xac, 0x19, 0x62, + 0x00, 0x20, 0xb7, 0x97, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x99, 0xf3, 0x24, 0xda, 0x42, 0x21, 0x14, 0xf6, 0x21, 0xba, 0x64, + 0xec, 0x87, 0x1e, 0x86, 0x52, 0x2f, 0x81, 0x78, 0x23, 0x0b, 0xea, + 0xfb, 0xbe, 0x5e, 0xa7, 0x1a, 0xd2, 0x57, 0x23, 0xc6, 0xbe, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x04, 0x86, 0x99, 0x78, 0x00, 0x00, 0x00, 0x31, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x04, 0x86, 0x99, 0x78, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0x62, 0xac, 0x80, 0x29, 0xf6, 0xff, 0x57, 0x2e, + 0x15, 0x2f, 0x44, 0x00, 0xe3, 0x27, 0x04, 0x53, 0x7f, 0xa5, 0xfc, 0x64, + 0x49, 0xdf, 0x21, 0x76, 0xa2, 0x39, 0x17, 0xdd, 0x9b, 0x2b, 0x2a, 0x1e, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x31, 0x36, 0x44, 0x34, 0x33, 0x44, 0x39, 0x43, + 0x34, 0x43, 0x32, 0x42, 0x30, 0x34, 0x43, 0x44, 0x32, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x36, 0x44, 0x34, 0x33, 0x44, 0x39, 0x43, 0x34, 0x43, + 0x32, 0x42, 0x30, 0x34, 0x43, 0x44, 0x32, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xaa, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x72, 0xed, 0xd2, 0x04, 0x7c, 0xcf, 0x83, 0x76, + 0xfd, 0x15, 0x18, 0xba, 0xfe, 0xfe, 0x75, 0xd2, 0x1a, 0x50, 0x3f, 0x81, + 0x1e, 0x08, 0xd7, 0x1f, 0x03, 0xbb, 0x14, 0x8d, 0xd3, 0x3d, 0x7c, 0xc0, + 0x76, 0xc8, 0x37, 0x59, 0x33, 0xbe, 0xae, 0xce, 0xf0, 0x40, 0x59, 0x05, + 0x90, 0xeb, 0x58, 0x23, 0x5d, 0x78, 0xf0, 0x89, 0xef, 0x79, 0x1d, 0x89, + 0xfc, 0x25, 0xe8, 0xb4, 0x5f, 0xc1, 0xf9, 0x7e, 0x45, 0x7e, 0x27, 0x79, + 0x09, 0x0e, 0xbc, 0x00, 0x8e, 0xcf, 0x7a, 0xed, 0xcc, 0xd7, 0x3f, 0x21, + 0xa6, 0x47, 0xfc, 0xde, 0xd8, 0x3a, 0x5d, 0x86, 0x9a, 0xfe, 0x5e, 0xab, + 0x22, 0x7c, 0x51, 0xe3, 0xc9, 0x07, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x37, 0x47, 0xc4, 0x60, 0x7f, + 0x32, 0x70, 0x23, 0x08, 0x96, 0xe2, 0xec, 0xbd, 0x55, 0xea, 0x2f, 0x1a, + 0x20, 0x0f, 0x68, 0xdb, 0x84, 0xb7, 0x6e, 0x51, 0xc8, 0x85, 0xea, 0x9e, + 0x67, 0xb8, 0x58, 0xbe, 0xa4, 0x84, 0x25, 0xfd, 0xc9, 0xed, 0x71, 0x6c, + 0x2e, 0x20, 0xdc, 0x23, 0xad, 0x07, 0x6b, 0x91, 0xe0, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xfa, 0xfd, 0x7d, 0x5b, 0x7c, 0xcf, 0xc8, + 0x21, 0xa7, 0x4e, 0x69, 0x28, 0x01, 0x17, 0x6a, 0xa9, 0x3a, 0x62, 0x2d, + 0xe6, 0x04, 0xc9, 0x67, 0xa1, 0x74, 0x60, 0xe2, 0x73, 0xec, 0x6d, 0xf6, + 0xa2, 0x12, 0x10, 0xb1, 0x5f, 0x21, 0x34, 0x58, 0x98, 0xbb, 0x88, 0x2f, + 0x8d, 0x18, 0x7c, 0x10, 0x01, 0xdb, 0x75, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x65, 0x66, 0x55, 0xf7, + 0x0a, 0xef, 0x27, 0x33, 0x74, 0xbf, 0x04, 0x98, 0x9b, 0x77, 0x5d, 0x0b, + 0x1a, 0x20, 0x24, 0x30, 0x55, 0x74, 0xe6, 0x86, 0x62, 0x6c, 0x2b, 0x99, + 0x63, 0x84, 0xab, 0xed, 0x0f, 0x8f, 0xc5, 0x49, 0x2e, 0xa0, 0x76, 0xd2, + 0xe4, 0xc2, 0x27, 0x1d, 0x18, 0x6b, 0xb3, 0x6e, 0xf3, 0xf2, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xcc, 0x0b, 0x57, 0x83, 0x11, 0xf3, + 0xf2, 0x50, 0x4b, 0x0e, 0x4c, 0x45, 0x91, 0xa0, 0x2f, 0x26, 0x45, 0x31, + 0xb4, 0xde, 0x3e, 0x60, 0xb4, 0x3c, 0x11, 0x92, 0xd9, 0xc2, 0x42, 0xb0, + 0x7e, 0x19, 0x12, 0x10, 0x27, 0xcd, 0xf1, 0x85, 0x21, 0x4f, 0x77, 0x95, + 0x0b, 0x76, 0x0f, 0x79, 0x2a, 0x06, 0x3f, 0xf8, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x50, 0xda, 0x14, + 0xd6, 0xc2, 0x9c, 0x37, 0x2c, 0xdd, 0x6e, 0x03, 0x9b, 0xed, 0x4c, 0xd3, + 0x97, 0x1a, 0x20, 0x44, 0x78, 0x41, 0xff, 0x48, 0x54, 0x83, 0x05, 0x7c, + 0x57, 0xf1, 0xcb, 0x88, 0xf8, 0x29, 0x56, 0xd4, 0x5e, 0x68, 0xc2, 0x60, + 0x56, 0xe5, 0x56, 0x0d, 0x09, 0xbc, 0xc6, 0xe4, 0x94, 0xd8, 0x3e, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x03, 0xbd, 0x8d, 0xf3, 0x80, + 0x38, 0x58, 0x72, 0xa6, 0x8a, 0xd4, 0x7a, 0xb4, 0x4d, 0xa4, 0xea, 0x89, + 0x1c, 0xee, 0x46, 0xc6, 0x30, 0xca, 0xe9, 0xf1, 0x36, 0x15, 0x60, 0xf5, + 0x6c, 0x98, 0x15, 0x12, 0x10, 0x09, 0xc7, 0x7c, 0x1b, 0x72, 0x20, 0xc2, + 0x27, 0xf0, 0xf4, 0x7b, 0xa4, 0x3d, 0xae, 0x25, 0x68, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x15, 0x1d, + 0x3d, 0x04, 0xda, 0xc4, 0xfb, 0x03, 0xc4, 0xd4, 0x6b, 0xb0, 0xdb, 0x4c, + 0xda, 0xc6, 0x1a, 0x20, 0xfa, 0x10, 0x6a, 0x10, 0xd3, 0x5c, 0x82, 0x24, + 0xc4, 0xe3, 0xbe, 0x34, 0xe8, 0x8c, 0x37, 0xae, 0x91, 0xc5, 0xce, 0x65, + 0xc4, 0x87, 0xcb, 0xaf, 0xb2, 0x90, 0x64, 0xbc, 0x20, 0xd9, 0x3e, 0x6a, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x10, 0x6b, 0x99, 0x00, + 0x0f, 0x90, 0xae, 0x2e, 0x2d, 0x41, 0x17, 0xea, 0xd0, 0xeb, 0xf9, 0xda, + 0x8a, 0x7c, 0x5a, 0x18, 0x20, 0x1d, 0xc2, 0xd0, 0x39, 0x64, 0x01, 0x6f, + 0x7c, 0x00, 0x72, 0xf4, 0x12, 0x10, 0xe4, 0x0b, 0x34, 0xf5, 0xa3, 0xda, + 0xb7, 0xd1, 0x3f, 0x9f, 0xbe, 0x3f, 0x50, 0xfa, 0xb9, 0xea, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc5, + 0x42, 0x49, 0xbf, 0x67, 0xf4, 0xe8, 0xdc, 0xb4, 0x45, 0x46, 0x85, 0xd2, + 0x4f, 0xed, 0x2f, 0x1a, 0x20, 0xe7, 0x32, 0xff, 0x94, 0xac, 0x0f, 0x8b, + 0xff, 0x68, 0x35, 0x68, 0x73, 0x32, 0x93, 0x66, 0x3b, 0x19, 0xf1, 0x53, + 0x1c, 0x38, 0x92, 0xa8, 0xe0, 0xc7, 0x26, 0x22, 0x4d, 0xe9, 0x09, 0x25, + 0x03, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xfa, 0x40, 0xae, + 0x3d, 0x7f, 0x00, 0x72, 0xbc, 0x9b, 0x33, 0x7d, 0xf7, 0x77, 0x6c, 0xe7, + 0x64, 0xeb, 0xb2, 0xd3, 0x5c, 0xd9, 0x3f, 0x01, 0x74, 0x6f, 0xef, 0x9c, + 0x6b, 0xd7, 0x50, 0x6a, 0x58, 0x12, 0x10, 0x19, 0x3e, 0x48, 0xb5, 0x7f, + 0x9c, 0xeb, 0xd3, 0x44, 0x07, 0xa8, 0xa3, 0x1b, 0x74, 0xd5, 0x09, 0x62, + 0x00, 0x20, 0xaa, 0x98, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x62, 0xac, 0x80, 0x29, 0xf6, 0xff, 0x57, 0x2e, 0x15, 0x2f, 0x44, + 0x00, 0xe3, 0x27, 0x04, 0x53, 0x7f, 0xa5, 0xfc, 0x64, 0x49, 0xdf, + 0x21, 0x76, 0xa2, 0x39, 0x17, 0xdd, 0x9b, 0x2b, 0x2a, 0x1e, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xaa, 0xc5, 0x58, 0x53, 0x00, 0x00, 0x00, 0x33, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xaa, 0xc5, 0x58, 0x53, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0xd8, 0x37, 0x8c, 0x35, 0x70, 0x81, 0x15, 0x47, + 0x58, 0x7e, 0xf1, 0xb4, 0x31, 0x33, 0xdc, 0x63, 0x53, 0x6b, 0x03, 0x1e, + 0x16, 0x57, 0xfd, 0xaf, 0x95, 0x19, 0x51, 0x65, 0x92, 0x26, 0x53, 0x5c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x36, 0x39, 0x46, 0x32, 0x42, 0x31, 0x46, + 0x38, 0x42, 0x36, 0x43, 0x44, 0x37, 0x42, 0x32, 0x32, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x36, 0x39, 0x46, 0x32, 0x42, 0x31, 0x46, 0x38, 0x42, + 0x36, 0x43, 0x44, 0x37, 0x42, 0x32, 0x32, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x41, 0x2a, 0xcc, 0xe9, 0x8c, 0xa7, + 0xb7, 0x3c, 0xfd, 0xc7, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xcb, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0xff, 0x7e, 0x0e, 0x6a, 0x37, 0xbb, 0x97, 0xb7, + 0x11, 0x97, 0x86, 0x1f, 0xe8, 0x4e, 0x3a, 0xb3, 0x1a, 0x50, 0xc9, 0x95, + 0xd1, 0xf3, 0x76, 0x9b, 0x87, 0x88, 0x0e, 0x56, 0x7d, 0xbb, 0xb7, 0x65, + 0x04, 0x42, 0xb9, 0x0f, 0x63, 0x50, 0xc6, 0x61, 0x0f, 0xf5, 0xa1, 0xf6, + 0x46, 0x77, 0xe8, 0x66, 0xfe, 0xdb, 0x6d, 0xc1, 0xb1, 0x96, 0x3c, 0xaa, + 0xad, 0x90, 0xf3, 0xa6, 0x50, 0xcf, 0x6a, 0x0a, 0x76, 0xe7, 0x6c, 0x06, + 0x24, 0xcc, 0xa3, 0xb6, 0x79, 0x62, 0xc3, 0xc9, 0x40, 0x86, 0x2f, 0x33, + 0x62, 0x97, 0x28, 0xbe, 0xf6, 0x94, 0xd8, 0x8f, 0xd5, 0xef, 0x18, 0x11, + 0x60, 0x01, 0x9d, 0x62, 0x05, 0xb3, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xe6, 0xd4, 0xdc, 0xa0, 0x11, + 0x80, 0x09, 0x5a, 0x53, 0xab, 0x01, 0x41, 0x73, 0x63, 0x63, 0x02, 0x1a, + 0x20, 0xd9, 0x9b, 0xc7, 0x49, 0x88, 0x6f, 0xe9, 0x36, 0x5d, 0xd4, 0xe6, + 0x52, 0x9a, 0x4e, 0x98, 0x4a, 0x9c, 0xeb, 0x84, 0x69, 0x3a, 0xc2, 0xdd, + 0xeb, 0xfe, 0x67, 0xbb, 0x31, 0xdb, 0x8a, 0x6b, 0xfb, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0x0e, 0x77, 0x59, 0xd4, 0x0f, 0x4d, 0xcf, + 0x5b, 0x75, 0x24, 0xfe, 0x38, 0xf7, 0xf0, 0x50, 0x80, 0x9a, 0x13, 0x5d, + 0x41, 0x31, 0x17, 0xf8, 0x45, 0xa4, 0xb3, 0x69, 0x49, 0x83, 0x73, 0xcd, + 0xc4, 0x12, 0x10, 0xe7, 0x36, 0xa1, 0xc6, 0xe5, 0xbd, 0x94, 0x74, 0xde, + 0x56, 0xa8, 0xf8, 0xa4, 0xeb, 0xae, 0x3e, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x65, 0x54, 0x5c, 0x35, + 0x07, 0x2d, 0x85, 0x78, 0x9e, 0xcf, 0x84, 0x46, 0x83, 0xa1, 0x65, 0xca, + 0x1a, 0x20, 0x32, 0x50, 0x1a, 0x44, 0x67, 0x63, 0x2e, 0xd3, 0x36, 0x0f, + 0x3b, 0xab, 0x3c, 0xa0, 0x61, 0xcd, 0x55, 0xa9, 0xce, 0xdb, 0x7d, 0x3b, + 0x9c, 0x6d, 0xbc, 0xc1, 0x93, 0x3d, 0xb0, 0x16, 0x0e, 0xae, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x14, 0x1a, 0x34, 0xd0, 0x8c, 0x1f, + 0x7a, 0x6d, 0x87, 0x13, 0x96, 0x6e, 0x00, 0xfb, 0xcd, 0xd6, 0x84, 0x88, + 0xe4, 0xb3, 0xea, 0x2d, 0x3a, 0xc0, 0xb5, 0xe5, 0x12, 0xa9, 0x01, 0x29, + 0x33, 0x0f, 0x12, 0x10, 0x77, 0x98, 0x5a, 0x32, 0x60, 0xbd, 0x66, 0xd4, + 0xa8, 0x60, 0x4e, 0x79, 0xda, 0xb0, 0xff, 0x0f, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xaf, 0xba, 0x47, + 0xdf, 0x34, 0xc0, 0x84, 0x5e, 0x6d, 0xc1, 0x6e, 0xb8, 0xbd, 0xd0, 0xf3, + 0xf9, 0x1a, 0x20, 0x34, 0xd6, 0xbf, 0x4b, 0x11, 0x6c, 0xe9, 0x4d, 0x66, + 0x26, 0xda, 0x14, 0x36, 0x6a, 0x88, 0x4b, 0x64, 0x1a, 0xe2, 0xab, 0x9c, + 0xd2, 0x68, 0x22, 0x06, 0x97, 0x68, 0xf2, 0x54, 0xb7, 0xa4, 0xc4, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xa5, 0x1a, 0xea, 0x7f, 0x91, + 0x90, 0xdf, 0xf9, 0x86, 0x40, 0xc6, 0x54, 0x8a, 0xd8, 0xba, 0x87, 0xb2, + 0xa2, 0xe2, 0xee, 0xec, 0x3d, 0x96, 0x65, 0x38, 0xd4, 0xc8, 0x54, 0x02, + 0x0c, 0xe4, 0xe0, 0x12, 0x10, 0x12, 0xe7, 0x56, 0xf6, 0x1d, 0x51, 0x32, + 0x47, 0x80, 0xe3, 0xd3, 0xce, 0xa7, 0xf5, 0xa9, 0x83, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x04, 0xf6, + 0x85, 0x1d, 0xf7, 0xbc, 0xd6, 0x35, 0xaa, 0x2c, 0xc8, 0x6b, 0x66, 0x01, + 0xe5, 0x9f, 0x1a, 0x20, 0xbc, 0xef, 0xf7, 0x33, 0xbb, 0x97, 0x2e, 0x40, + 0x2d, 0x9f, 0x2a, 0x09, 0x06, 0xdf, 0x56, 0x4b, 0x30, 0x40, 0x91, 0x9d, + 0x49, 0xa6, 0xdb, 0xc7, 0x9b, 0x12, 0x0d, 0xaa, 0x8c, 0x7d, 0x9a, 0x25, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xeb, 0x54, 0x85, 0x93, + 0xc4, 0x83, 0x91, 0xda, 0xce, 0x00, 0xbd, 0xdf, 0x13, 0x6f, 0x14, 0x22, + 0xfe, 0x99, 0xd9, 0xdb, 0x31, 0x97, 0x1f, 0xb5, 0x39, 0x93, 0xdd, 0x95, + 0xc0, 0x54, 0xde, 0x7b, 0x12, 0x10, 0x2f, 0xe5, 0xd1, 0x2f, 0xd1, 0xa3, + 0x4f, 0xf0, 0x66, 0x73, 0x2f, 0xc9, 0x98, 0x4c, 0xa1, 0xf2, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x7d, + 0xc0, 0xde, 0x49, 0xb3, 0xd8, 0x2f, 0xc2, 0xb1, 0x9a, 0x96, 0x4f, 0x80, + 0x03, 0x84, 0x26, 0x1a, 0x20, 0x45, 0x09, 0x1d, 0x31, 0x32, 0xfb, 0xb0, + 0xa8, 0x29, 0xc0, 0xb1, 0xec, 0xb5, 0x7d, 0x0e, 0x47, 0x8b, 0x1a, 0xf1, + 0xf1, 0x44, 0x53, 0x04, 0x29, 0xcc, 0xb1, 0x70, 0x81, 0xa6, 0x2c, 0x46, + 0xa2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x02, 0x02, 0xde, + 0xe4, 0xdd, 0x18, 0x44, 0xce, 0x63, 0x11, 0x1e, 0x4c, 0x19, 0xdb, 0xf3, + 0x9f, 0x87, 0xe1, 0x10, 0x77, 0xb5, 0xe8, 0x5e, 0x09, 0xf2, 0xe3, 0xa6, + 0x0c, 0xee, 0x79, 0xef, 0x5f, 0x12, 0x10, 0xbb, 0x21, 0x1e, 0x1a, 0xb0, + 0xeb, 0x84, 0x59, 0x23, 0xe8, 0x82, 0xa2, 0x7e, 0xc6, 0xe0, 0x29, 0x62, + 0x00, 0x20, 0xcb, 0x98, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xd8, 0x37, 0x8c, 0x35, 0x70, 0x81, 0x15, 0x47, 0x58, 0x7e, 0xf1, + 0xb4, 0x31, 0x33, 0xdc, 0x63, 0x53, 0x6b, 0x03, 0x1e, 0x16, 0x57, + 0xfd, 0xaf, 0x95, 0x19, 0x51, 0x65, 0x92, 0x26, 0x53, 0x5c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xdb, 0x33, 0x2f, 0x31, 0x00, 0x00, 0x00, 0x35, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xdb, 0x33, 0x2f, 0x31, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x60, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf7, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x31, + 0x00, 0x00, 0x00, 0x20, 0xef, 0xec, 0x8e, 0x09, 0x39, 0x6d, 0x7f, 0x66, + 0xbc, 0xc8, 0xbe, 0xbd, 0xfe, 0xc1, 0xd9, 0xc8, 0x87, 0xf9, 0x10, 0x07, + 0x8b, 0xaa, 0x0a, 0x26, 0x60, 0x5b, 0xb0, 0xc0, 0x3e, 0xdd, 0x3f, 0xfb, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x43, 0x35, 0x42, 0x39, 0x43, 0x46, 0x45, 0x41, + 0x34, 0x34, 0x45, 0x31, 0x42, 0x33, 0x30, 0x33, 0x33, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x35, 0x42, 0x39, 0x43, 0x46, 0x45, 0x41, 0x34, 0x34, + 0x45, 0x31, 0x42, 0x33, 0x30, 0x33, 0x33, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xec, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xfa, 0x05, 0x44, 0x23, + 0xe9, 0x8b, 0x03, 0x93, 0x56, 0xfb, 0xfb, 0x7c, 0xd7, 0xf0, 0xf1, 0xf7, + 0x1a, 0x50, 0xab, 0xbe, 0xdb, 0x58, 0x1a, 0x2e, 0xd4, 0xa4, 0xff, 0x2b, + 0x45, 0x47, 0xf3, 0xc4, 0x3f, 0x69, 0xf7, 0xef, 0xa4, 0x12, 0xce, 0xa5, + 0x70, 0x67, 0x8c, 0x6a, 0xde, 0x94, 0x49, 0x9c, 0xde, 0x01, 0x23, 0xb4, + 0x3c, 0x1b, 0x52, 0xab, 0x3e, 0x99, 0x53, 0xf2, 0xa6, 0x72, 0xbe, 0x46, + 0x9a, 0x49, 0x89, 0x06, 0xd6, 0x86, 0x94, 0xd7, 0xb2, 0xc1, 0x99, 0xc9, + 0x4b, 0x06, 0x71, 0xdf, 0x9e, 0xc7, 0x32, 0xf4, 0xff, 0x9f, 0x85, 0x0f, + 0x7a, 0xf4, 0x15, 0x02, 0x0b, 0x07, 0x57, 0x5c, 0x0c, 0xe0, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x18, + 0x78, 0x16, 0xb8, 0x23, 0xdb, 0x07, 0x96, 0xf9, 0x97, 0xf1, 0xac, 0xfb, + 0x5b, 0xf3, 0x4c, 0x1a, 0x20, 0x95, 0xe3, 0xb4, 0x09, 0xd1, 0x39, 0xc5, + 0xa2, 0x8d, 0x15, 0x07, 0x65, 0x3a, 0x9c, 0x45, 0xdf, 0x2c, 0x8a, 0x1a, + 0x1b, 0xfc, 0x31, 0x23, 0x5f, 0x81, 0xb5, 0x84, 0x34, 0xbc, 0x89, 0x2d, + 0xb2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xd4, 0x04, 0xc5, + 0xaa, 0xb0, 0xdf, 0xa9, 0xde, 0xb3, 0x27, 0xed, 0x7e, 0xff, 0xd7, 0xe0, + 0x26, 0xaf, 0xc2, 0xb1, 0xde, 0xa0, 0x44, 0xbf, 0xe0, 0x35, 0xff, 0xd6, + 0x00, 0x1f, 0x1d, 0xe4, 0x11, 0x12, 0x10, 0x18, 0x5e, 0xc5, 0xe7, 0xd2, + 0xa4, 0xbd, 0x58, 0xbe, 0x81, 0x8b, 0x91, 0x1b, 0x32, 0x8a, 0xb3, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xfd, 0x4c, 0x21, 0xa7, 0xf8, 0x5f, 0x6c, 0xb9, 0x3d, 0x87, 0x7f, 0x06, + 0xbb, 0x26, 0x8a, 0x66, 0x1a, 0x20, 0x86, 0xf2, 0x1c, 0x41, 0x81, 0xbf, + 0xbf, 0x3b, 0x77, 0x59, 0x4f, 0x9e, 0xd8, 0x8d, 0x87, 0xfd, 0xfc, 0xfb, + 0xfd, 0xd9, 0xa6, 0xbb, 0x13, 0xbd, 0x61, 0x00, 0x1f, 0x50, 0x82, 0xfb, + 0xfa, 0x79, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5b, 0xba, + 0x69, 0x32, 0x2b, 0x88, 0xba, 0x04, 0xee, 0xf8, 0x6e, 0x52, 0x44, 0x29, + 0x86, 0x2c, 0xa8, 0xb5, 0x09, 0x3a, 0x8e, 0xe2, 0x9a, 0x34, 0xc7, 0x3e, + 0x59, 0x66, 0x5e, 0xfa, 0xd4, 0xe4, 0x12, 0x10, 0xad, 0xdb, 0x87, 0xb6, + 0xe9, 0xe4, 0x99, 0xf8, 0x7d, 0x77, 0xc6, 0xa8, 0x02, 0x7b, 0x0f, 0xb0, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x64, 0x7d, 0xea, 0x75, 0xa7, 0x16, 0x01, 0xe9, 0x3b, 0x38, 0x4e, + 0x53, 0x19, 0x56, 0xb6, 0x95, 0x1a, 0x20, 0x6b, 0xba, 0x84, 0x3b, 0xc3, + 0x46, 0x13, 0xf5, 0xad, 0xae, 0x76, 0x10, 0x5e, 0xc8, 0x87, 0x8a, 0x3f, + 0xcb, 0x58, 0x41, 0x76, 0x52, 0x1c, 0x9d, 0x71, 0x7c, 0x21, 0x8b, 0x34, + 0x4a, 0x99, 0x3b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5f, + 0x04, 0x06, 0xf6, 0x84, 0x05, 0x71, 0xba, 0x7c, 0x48, 0x47, 0xee, 0xe1, + 0xa4, 0x07, 0x57, 0x16, 0xca, 0x70, 0xee, 0x2e, 0x90, 0x36, 0xc0, 0xa9, + 0x99, 0x5e, 0x06, 0x83, 0x10, 0x9d, 0xc7, 0x12, 0x10, 0x82, 0xb5, 0x82, + 0x19, 0xb9, 0x3d, 0x96, 0x05, 0x67, 0xe3, 0x64, 0x10, 0x9c, 0xff, 0x4d, + 0x8e, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0x74, 0x61, 0x8f, 0x5f, 0x87, 0x28, 0x54, 0xe8, 0x76, 0x58, + 0x98, 0x91, 0x4a, 0x4c, 0xa6, 0x42, 0x1a, 0x20, 0x23, 0x20, 0xd0, 0x38, + 0x36, 0x57, 0x9e, 0x28, 0x18, 0x4d, 0x28, 0x42, 0xac, 0xbb, 0x4b, 0x95, + 0x62, 0x31, 0x01, 0xb1, 0x88, 0x69, 0xbf, 0xbf, 0x8b, 0xc7, 0x7d, 0xdd, + 0x2c, 0x1c, 0xfe, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x6e, 0xc8, 0x43, 0x53, 0x43, 0xbf, 0x82, 0x7b, 0x10, 0xe9, 0x44, 0x36, + 0xa3, 0xe0, 0x08, 0xe3, 0x05, 0x82, 0x80, 0x98, 0xd0, 0x2c, 0x2f, 0x9d, + 0x4a, 0xc5, 0x19, 0x30, 0xb5, 0x85, 0xfb, 0x60, 0x12, 0x10, 0x57, 0x3c, + 0x1b, 0x21, 0x38, 0xf7, 0xbf, 0x35, 0xbd, 0xf4, 0x5c, 0xf4, 0x8d, 0x7a, + 0x73, 0xb7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0x54, 0x51, 0x65, 0xa0, 0xeb, 0x04, 0x90, 0xc8, 0x0c, + 0x4e, 0x6a, 0x43, 0xe8, 0x98, 0xe4, 0x33, 0x1a, 0x20, 0x72, 0x9c, 0x35, + 0x1b, 0xbb, 0xdd, 0x02, 0xa3, 0x25, 0x35, 0x88, 0x04, 0x18, 0x6e, 0x8c, + 0x99, 0xb1, 0x40, 0x9f, 0xac, 0x8e, 0x8b, 0xc4, 0x4c, 0xad, 0x89, 0xa6, + 0x5f, 0x27, 0x2d, 0x91, 0x5d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x5c, 0x1d, 0x6d, 0xd4, 0x89, 0xcf, 0x18, 0x5e, 0xda, 0x1d, 0xd3, + 0x74, 0x7e, 0x88, 0xc8, 0x02, 0x47, 0xf2, 0xb5, 0xb5, 0x2c, 0xaa, 0x04, + 0x23, 0xca, 0xe0, 0xa7, 0xbc, 0xfb, 0x4d, 0xd5, 0x1e, 0x12, 0x10, 0xc0, + 0x4a, 0x24, 0xbc, 0x19, 0xbd, 0x44, 0xd3, 0x4f, 0xcb, 0xc5, 0x70, 0x59, + 0x65, 0x06, 0x4a, 0x62, 0x00, 0x20, 0xec, 0x98, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xef, 0xec, 0x8e, 0x09, 0x39, 0x6d, 0x7f, 0x66, 0xbc, 0xc8, 0xbe, + 0xbd, 0xfe, 0xc1, 0xd9, 0xc8, 0x87, 0xf9, 0x10, 0x07, 0x8b, 0xaa, + 0x0a, 0x26, 0x60, 0x5b, 0xb0, 0xc0, 0x3e, 0xdd, 0x3f, 0xfb, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x23, 0xbd, 0x73, 0xc7, 0x00, 0x00, 0x00, 0x37, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x23, 0xbd, 0x73, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdd, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x55, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xda, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x15, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3d, + 0x00, 0x00, 0x00, 0x20, 0x33, 0x0e, 0x0b, 0xbf, 0xf8, 0x28, 0x6b, 0x04, + 0x60, 0x12, 0x51, 0x0b, 0xa2, 0xca, 0x80, 0xf6, 0x06, 0x33, 0x55, 0xcf, + 0x8c, 0xe9, 0x7c, 0x6f, 0x13, 0xad, 0xa6, 0xef, 0xae, 0x7c, 0xef, 0x27, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x45, 0x37, 0x32, 0x35, 0x31, 0x38, 0x37, + 0x43, 0x45, 0x34, 0x41, 0x45, 0x38, 0x34, 0x35, 0x33, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x45, 0x37, 0x32, 0x35, 0x31, 0x38, 0x37, 0x43, 0x45, + 0x34, 0x41, 0x45, 0x38, 0x34, 0x35, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x94, 0xae, 0x63, 0x92, 0x9c, 0xbe, + 0x4d, 0xe8, 0x38, 0xd7, 0x38, 0x00, 0x40, 0x00, 0x48, 0xc6, 0x99, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xfb, 0xc7, 0x9a, 0x59, + 0xb9, 0xff, 0x13, 0x4a, 0x7f, 0x80, 0x5c, 0x8f, 0xd5, 0x51, 0x36, 0xa3, + 0x1a, 0x50, 0xd1, 0xc4, 0x9b, 0x4d, 0xe4, 0xb0, 0xd1, 0xa9, 0xf4, 0xe1, + 0x06, 0x28, 0xbb, 0x22, 0xe2, 0x2e, 0xff, 0x1c, 0x73, 0x88, 0x91, 0x0c, + 0xbb, 0x54, 0x21, 0x6e, 0x76, 0x28, 0x04, 0xa9, 0x68, 0xcf, 0x7e, 0x1f, + 0x1d, 0x3e, 0x4d, 0xfc, 0x67, 0x3a, 0xb7, 0x41, 0x8b, 0xcc, 0xf4, 0xb4, + 0x14, 0xf2, 0x61, 0x64, 0xf2, 0x44, 0x09, 0xef, 0x94, 0xca, 0xf1, 0xa2, + 0x16, 0xf5, 0x99, 0x99, 0xf6, 0xae, 0xe5, 0xa7, 0x4c, 0xdf, 0x6d, 0xf6, + 0x71, 0x82, 0xbc, 0x1b, 0x69, 0x66, 0x1b, 0x20, 0x30, 0x71, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x5c, + 0x59, 0xfe, 0x29, 0x0f, 0x22, 0x4b, 0xbb, 0x7b, 0xbe, 0x51, 0xb1, 0x15, + 0xaf, 0x28, 0xd6, 0x1a, 0x20, 0xc5, 0x0e, 0x81, 0x80, 0x75, 0xaa, 0x6a, + 0x20, 0x01, 0x4e, 0xfa, 0x12, 0x26, 0xe3, 0x36, 0xa3, 0x04, 0x67, 0x52, + 0x3b, 0x20, 0x74, 0xe8, 0x64, 0x55, 0x98, 0xb0, 0x72, 0x8e, 0x48, 0xf9, + 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, 0x7e, 0xcb, + 0x64, 0xab, 0xe3, 0x4d, 0xf4, 0x6f, 0x7f, 0x59, 0x7f, 0xc5, 0x24, 0xa2, + 0x8c, 0x9f, 0xc4, 0xbe, 0xb0, 0x1f, 0x5f, 0x23, 0xef, 0x62, 0x3b, 0xeb, + 0x60, 0xb7, 0x1f, 0x27, 0xe6, 0x12, 0x10, 0x84, 0x4f, 0x2f, 0x51, 0xd4, + 0x75, 0x03, 0x03, 0xd9, 0xa1, 0x36, 0x93, 0x37, 0x71, 0xaf, 0x33, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x46, 0x05, 0xf1, 0x99, 0x3c, 0x7a, 0x7b, 0x1e, 0xe2, 0xe0, 0x30, 0x9c, + 0x14, 0xcf, 0xdc, 0xab, 0x1a, 0x20, 0x04, 0xcb, 0x9d, 0xae, 0xb9, 0x62, + 0x8c, 0x28, 0x06, 0x57, 0xa5, 0x71, 0x90, 0xa5, 0x3b, 0xb5, 0x82, 0xa6, + 0x2c, 0x6d, 0xb1, 0x76, 0xc2, 0xfa, 0x76, 0x5f, 0xe5, 0xdd, 0xe7, 0xf6, + 0xdf, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x69, 0x64, + 0x69, 0x42, 0xe9, 0xad, 0x43, 0x8a, 0xac, 0x3b, 0x5b, 0x56, 0x32, 0xb6, + 0xfd, 0xdd, 0x52, 0xd3, 0x94, 0x3e, 0x5c, 0x57, 0xe9, 0xf3, 0x16, 0xfd, + 0xfa, 0x50, 0x61, 0x1e, 0x7f, 0xef, 0x12, 0x10, 0xab, 0x54, 0x2e, 0xf1, + 0xd5, 0x19, 0x65, 0x4f, 0xbc, 0x74, 0x37, 0x80, 0x5e, 0xad, 0xcf, 0x7f, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0xf7, 0xab, 0x7f, 0xab, 0xa2, 0xeb, 0x92, 0x0e, 0x32, 0x5e, 0x0a, + 0x55, 0xe5, 0xfe, 0x87, 0x0e, 0x1a, 0x20, 0xec, 0x67, 0xd1, 0xe6, 0x29, + 0x1e, 0xdb, 0xaa, 0x84, 0xd2, 0xb3, 0x84, 0xe8, 0x5f, 0x47, 0x33, 0xc4, + 0xe2, 0xf9, 0x5d, 0x7d, 0xa8, 0x09, 0x4a, 0x73, 0x8f, 0x89, 0x62, 0x2d, + 0x04, 0xef, 0x01, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x57, + 0x9c, 0x13, 0x6f, 0xfc, 0x0e, 0x22, 0xcc, 0x88, 0xdd, 0xd2, 0xfb, 0xed, + 0x83, 0xdb, 0xad, 0x2f, 0xe5, 0x56, 0x3d, 0xd7, 0x75, 0xdf, 0x3f, 0x0b, + 0xa6, 0x79, 0x75, 0x85, 0xb4, 0x3c, 0xd0, 0x12, 0x10, 0x31, 0xa8, 0x83, + 0xa9, 0x43, 0xb3, 0xd9, 0xf7, 0x65, 0x93, 0xfb, 0x52, 0x70, 0x86, 0xf3, + 0xf0, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0xb9, 0xc4, 0x7a, 0x1c, 0x7d, 0xde, 0x1f, 0xc7, 0x7d, 0xa4, + 0xc8, 0xa5, 0x4e, 0xda, 0x98, 0xc0, 0x1a, 0x20, 0x72, 0x4e, 0x94, 0x0a, + 0x7c, 0x4e, 0x31, 0x3a, 0x52, 0xcc, 0xc2, 0x6e, 0x8e, 0x10, 0x0c, 0x9a, + 0x69, 0xd4, 0xa8, 0x43, 0x9d, 0x39, 0x41, 0xc0, 0xcf, 0x9d, 0x13, 0x1b, + 0xce, 0x3a, 0x2d, 0x45, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x12, 0x4e, 0x97, 0x26, 0xad, 0x18, 0xb7, 0x0b, 0x28, 0x5c, 0xc7, 0x0b, + 0xef, 0x76, 0x68, 0x07, 0x4b, 0x24, 0xff, 0xbb, 0x2a, 0xa5, 0x3b, 0x6c, + 0x75, 0xf1, 0xe4, 0x50, 0xf5, 0x37, 0xe4, 0xd6, 0x12, 0x10, 0xa1, 0xeb, + 0x14, 0xbf, 0xa7, 0xa5, 0x74, 0x30, 0x06, 0xc8, 0xf3, 0x4e, 0x3d, 0x16, + 0x99, 0x4c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0xe7, 0x0a, 0x9c, 0x74, 0x5c, 0x9a, 0x5a, 0x48, 0xed, + 0x40, 0x58, 0xb7, 0x59, 0x8c, 0xba, 0x07, 0x1a, 0x20, 0x49, 0x70, 0x2c, + 0xf4, 0x66, 0x36, 0x69, 0xa1, 0x57, 0x41, 0xb2, 0xee, 0xe9, 0xe7, 0x25, + 0xdd, 0xb7, 0xeb, 0x30, 0x7b, 0x69, 0xf9, 0xc4, 0x41, 0xfd, 0x5e, 0x4f, + 0x61, 0x5a, 0xda, 0x1e, 0x1e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xce, 0xd3, 0x90, 0x50, 0x85, 0xbc, 0x3a, 0x00, 0x0b, 0x1b, 0xac, + 0x43, 0xbc, 0x7a, 0x9a, 0x3e, 0x9c, 0x42, 0x77, 0x9c, 0x3e, 0x41, 0xba, + 0x95, 0x0f, 0x22, 0x21, 0x98, 0xc9, 0xfa, 0x92, 0x7d, 0x12, 0x10, 0x41, + 0x3e, 0x88, 0x37, 0xd2, 0x23, 0xaa, 0xd4, 0xf8, 0x70, 0xf8, 0x76, 0x4a, + 0xdc, 0x93, 0x97, 0x62, 0x00, 0x20, 0xc6, 0x99, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x33, 0x0e, 0x0b, 0xbf, 0xf8, 0x28, 0x6b, 0x04, 0x60, 0x12, 0x51, + 0x0b, 0xa2, 0xca, 0x80, 0xf6, 0x06, 0x33, 0x55, 0xcf, 0x8c, 0xe9, + 0x7c, 0x6f, 0x13, 0xad, 0xa6, 0xef, 0xae, 0x7c, 0xef, 0x27, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x9d, 0x8d, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x39, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x9d, 0x8d, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xeb, 0x49, 0xa4, 0x69, 0x96, 0xb2, 0x03, + 0x71, 0x7a, 0x8b, 0xe5, 0xf2, 0x61, 0xb0, 0xe8, 0x2d, 0x40, 0x0f, 0x3f, + 0x4e, 0xfc, 0x5f, 0xe8, 0x4b, 0x70, 0x5b, 0x21, 0x35, 0x03, 0xc4, 0x12, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x41, 0x38, 0x45, 0x44, 0x38, 0x37, 0x38, 0x39, + 0x32, 0x31, 0x38, 0x39, 0x37, 0x36, 0x32, 0x36, 0x33, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x45, 0x44, 0x38, 0x37, 0x38, 0x39, 0x32, 0x31, + 0x38, 0x39, 0x37, 0x36, 0x32, 0x36, 0x33, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xa0, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xa1, 0xc0, + 0x05, 0x4d, 0xc5, 0x3b, 0x39, 0x65, 0x78, 0x9a, 0x82, 0x1c, 0x95, 0x70, + 0xef, 0x76, 0x1a, 0x50, 0x01, 0x42, 0x0e, 0xc3, 0x37, 0xc9, 0x70, 0x86, + 0xed, 0x14, 0xeb, 0xc6, 0x01, 0x26, 0x5e, 0x97, 0x7d, 0x7d, 0xed, 0xa6, + 0xb2, 0x3f, 0xae, 0x74, 0x42, 0x67, 0xa5, 0xa4, 0xe6, 0xcd, 0x9a, 0x44, + 0xb1, 0xfd, 0xfb, 0x12, 0x93, 0xf0, 0xb7, 0x5e, 0x3e, 0x1f, 0xfd, 0x2f, + 0xcb, 0xb1, 0xd6, 0xea, 0x4a, 0xc3, 0xea, 0x63, 0x68, 0xe6, 0xe0, 0xbe, + 0xd0, 0xb5, 0x4e, 0x58, 0x8c, 0xc5, 0x12, 0x92, 0xb4, 0x49, 0x10, 0x3b, + 0x0e, 0xe4, 0x15, 0x75, 0xfa, 0x17, 0x0e, 0x27, 0x38, 0x27, 0x34, 0x5e, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xdc, 0x38, 0x0c, 0x66, 0x86, 0xdd, 0x0d, 0xda, 0xb2, 0xd9, 0x71, + 0xd5, 0x57, 0x98, 0xb6, 0x8b, 0x1a, 0x20, 0x06, 0xed, 0xcc, 0x99, 0x80, + 0xa5, 0x9b, 0x0f, 0xbe, 0x62, 0x95, 0x9c, 0xa9, 0x29, 0xe0, 0xdc, 0x29, + 0x82, 0x2f, 0x4e, 0x1a, 0x3b, 0x16, 0xd9, 0x14, 0x0a, 0x39, 0x4a, 0xf0, + 0x6d, 0x9f, 0x05, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5f, + 0x8c, 0x99, 0xb9, 0xbd, 0x86, 0x19, 0x96, 0x2d, 0xa6, 0x9f, 0xc7, 0x46, + 0x75, 0x2f, 0xa6, 0xdb, 0x89, 0xe2, 0x1b, 0x11, 0x30, 0xe6, 0x59, 0x89, + 0x15, 0x87, 0x3f, 0x8f, 0x05, 0xf4, 0x57, 0x12, 0x10, 0x46, 0x5f, 0xf7, + 0xc2, 0x5f, 0xe9, 0x39, 0x96, 0x44, 0x9e, 0x57, 0x72, 0xd2, 0xed, 0x72, + 0x3b, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xf0, 0x3d, 0x75, 0xd0, 0x23, 0x4c, 0x23, 0xac, 0x9f, 0x88, + 0xd5, 0xec, 0x4e, 0x95, 0x0c, 0x8a, 0x1a, 0x20, 0xa3, 0xae, 0xf5, 0xd8, + 0xc7, 0x33, 0x29, 0x62, 0x8a, 0x93, 0x64, 0xe6, 0x3e, 0x7d, 0x92, 0x26, + 0x68, 0x6c, 0xab, 0x48, 0xcc, 0xdf, 0x4b, 0xae, 0x05, 0xcd, 0x2b, 0x44, + 0x3e, 0x16, 0x71, 0x13, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x45, 0x6a, 0x5b, 0xa4, 0xdb, 0xb9, 0x22, 0x96, 0xf2, 0x0f, 0xf1, 0xcf, + 0xf3, 0x22, 0x93, 0x01, 0x2b, 0xba, 0x43, 0xc1, 0xbe, 0xab, 0x40, 0xc9, + 0x16, 0xd4, 0x55, 0xb4, 0x22, 0x45, 0x71, 0x4a, 0x12, 0x10, 0xa6, 0x6a, + 0x85, 0x24, 0xa8, 0xc6, 0x62, 0xb8, 0xb0, 0x64, 0xaf, 0xcc, 0x94, 0xc1, + 0x2a, 0x78, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xb3, 0x8f, 0xa5, 0x5a, 0x0d, 0x58, 0x9e, 0x64, 0x07, + 0x95, 0x13, 0xc8, 0xd4, 0xa1, 0x88, 0x0f, 0x1a, 0x20, 0xdc, 0xf1, 0x89, + 0x16, 0xe9, 0xf8, 0xcd, 0x97, 0x53, 0x52, 0x4a, 0x84, 0x9a, 0xc8, 0x32, + 0x03, 0xba, 0xfb, 0x96, 0xb3, 0x59, 0x0d, 0xaf, 0x66, 0x39, 0x98, 0x05, + 0x27, 0x79, 0x73, 0xf3, 0xb6, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x27, 0x71, 0x48, 0xbc, 0x80, 0xeb, 0x94, 0xe8, 0xba, 0xa7, 0x7c, + 0x4d, 0x0b, 0x8e, 0x24, 0x4a, 0xc9, 0xa7, 0x5a, 0x71, 0x5d, 0x76, 0xf4, + 0xc4, 0x97, 0xe7, 0x18, 0x99, 0x4f, 0xb4, 0x15, 0x57, 0x12, 0x10, 0xd8, + 0xb5, 0x60, 0x37, 0xad, 0xcd, 0x02, 0x61, 0xb1, 0x33, 0x6f, 0xb3, 0x95, + 0xf5, 0x63, 0xc8, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x85, 0x7b, 0x3d, 0x69, 0x6e, 0x09, 0x83, 0x73, + 0x0c, 0xea, 0xa2, 0x59, 0xdc, 0xdc, 0x74, 0x3e, 0x1a, 0x20, 0x56, 0xc9, + 0xb0, 0xa2, 0xe1, 0xef, 0x1c, 0xdf, 0x1b, 0x5e, 0xb4, 0x24, 0xc0, 0x2e, + 0xc2, 0x68, 0x93, 0x85, 0x04, 0x4f, 0xe5, 0xca, 0xd7, 0x3a, 0x99, 0x6c, + 0x23, 0x50, 0x24, 0xc5, 0xf3, 0x33, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xa4, 0x8e, 0x11, 0x30, 0xe8, 0x0e, 0x69, 0x0c, 0x8a, 0x77, + 0xef, 0x5f, 0x99, 0x35, 0xe6, 0xa7, 0xcb, 0xc2, 0x61, 0x18, 0x4d, 0xef, + 0x52, 0x97, 0x91, 0xb3, 0x54, 0x00, 0xf0, 0x2a, 0x8c, 0xe6, 0x12, 0x10, + 0xb9, 0x02, 0xe8, 0xd0, 0xc6, 0x3c, 0x4f, 0x2d, 0x73, 0xa3, 0x93, 0xe5, + 0x51, 0x54, 0x69, 0x76, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xf1, 0x3e, 0x72, 0xc6, 0x13, 0x2a, 0x19, + 0xe3, 0xc3, 0xff, 0x91, 0xf3, 0x22, 0x56, 0x13, 0x07, 0x1a, 0x20, 0x4e, + 0xcf, 0xcc, 0x08, 0x9b, 0xd6, 0xe6, 0x0c, 0x1a, 0x5f, 0x0d, 0x3f, 0xad, + 0x8f, 0xca, 0x44, 0x06, 0xb9, 0xc3, 0x27, 0xf8, 0x65, 0x85, 0xce, 0x4a, + 0x95, 0x47, 0xab, 0x08, 0xca, 0x55, 0xa3, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x93, 0x60, 0xdb, 0x0c, 0xb1, 0x29, 0xf3, 0xf3, 0x5c, + 0x16, 0x6e, 0x9e, 0x8d, 0x96, 0xc1, 0xdb, 0xfa, 0x9c, 0xac, 0x07, 0x7b, + 0x55, 0xe5, 0x0a, 0xc7, 0x9d, 0x0e, 0xec, 0x65, 0x28, 0x00, 0x26, 0x12, + 0x10, 0x6f, 0xcb, 0x6d, 0xbd, 0x34, 0xc9, 0xba, 0x1e, 0x51, 0x6d, 0x9b, + 0x81, 0x9b, 0xc5, 0xba, 0xc1, 0x62, 0x00, 0x20, 0xa0, 0x9a, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x3a, 0xeb, 0x49, 0xa4, 0x69, 0x96, 0xb2, 0x03, 0x71, 0x7a, 0x8b, + 0xe5, 0xf2, 0x61, 0xb0, 0xe8, 0x2d, 0x40, 0x0f, 0x3f, 0x4e, 0xfc, + 0x5f, 0xe8, 0x4b, 0x70, 0x5b, 0x21, 0x35, 0x03, 0xc4, 0x12, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x75, 0x58, 0x8a, 0x10, 0x00, 0x00, 0x00, 0x3b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x75, 0x58, 0x8a, 0x10, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0xec, 0x48, 0xfb, 0xcd, 0x93, 0x54, 0xd7, 0x72, + 0xb1, 0x81, 0x34, 0xee, 0x3e, 0x9e, 0x8f, 0x11, 0xb9, 0x6e, 0xd9, 0x9a, + 0x5c, 0xdb, 0xe7, 0xdc, 0xd2, 0x98, 0xb8, 0x2c, 0x2c, 0x44, 0x86, 0x39, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x34, 0x46, 0x31, 0x32, 0x42, 0x39, 0x34, + 0x42, 0x44, 0x36, 0x43, 0x44, 0x41, 0x38, 0x33, 0x33, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x34, 0x46, 0x31, 0x32, 0x42, 0x39, 0x34, 0x42, 0x44, + 0x36, 0x43, 0x44, 0x41, 0x38, 0x33, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x80, 0xc8, 0xac, 0x49, 0x2e, 0x92, + 0x30, 0x8b, 0x48, 0x36, 0x38, 0x00, 0x40, 0x00, 0x48, 0xae, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x3d, 0xad, + 0x2e, 0x61, 0x18, 0x84, 0xd0, 0x2b, 0xc9, 0x0f, 0x50, 0xef, 0x39, 0xb3, + 0x3a, 0xa8, 0x1a, 0x50, 0x6d, 0x07, 0x2b, 0x8e, 0xa8, 0x56, 0x22, 0x7e, + 0xf1, 0xc4, 0x88, 0x69, 0xf3, 0x94, 0xcd, 0xcd, 0x39, 0x06, 0xef, 0xc3, + 0x1c, 0xfe, 0x65, 0x6a, 0x93, 0x13, 0x62, 0xb7, 0x33, 0x33, 0x7e, 0x74, + 0x33, 0xb2, 0x82, 0xd5, 0xf6, 0x4d, 0x21, 0x19, 0x69, 0x99, 0x23, 0xce, + 0xf3, 0xfb, 0xa9, 0xa0, 0xa1, 0xc8, 0xde, 0x60, 0xef, 0x1a, 0xb2, 0x52, + 0xfe, 0x2e, 0x30, 0xc9, 0xc6, 0xf6, 0xb4, 0x24, 0x28, 0x54, 0x9f, 0xa6, + 0xe1, 0x8c, 0xca, 0x0a, 0x10, 0x56, 0x65, 0xe2, 0xb5, 0xf8, 0xb7, 0x15, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xde, 0x34, 0xc9, 0x3a, 0x13, 0x3e, 0x10, 0xbb, 0x95, 0x0a, 0x72, + 0xd4, 0x33, 0xcb, 0x96, 0x43, 0x1a, 0x20, 0xe6, 0x63, 0xc2, 0x1f, 0x8a, + 0x08, 0x63, 0x9c, 0xba, 0xc7, 0xba, 0xf1, 0x12, 0xe3, 0xec, 0x1f, 0x06, + 0x82, 0x3f, 0x16, 0x4d, 0x4b, 0xce, 0xa3, 0x83, 0x81, 0x89, 0xe0, 0x38, + 0xe9, 0x6f, 0x0d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xb6, + 0x8c, 0x1f, 0x70, 0x70, 0x74, 0xcb, 0x0a, 0x6a, 0x68, 0xf1, 0x1d, 0x15, + 0x32, 0xb1, 0xea, 0xdb, 0xfe, 0x87, 0x0e, 0x4f, 0xa3, 0xb2, 0xe0, 0x42, + 0xd8, 0x3a, 0xd4, 0x88, 0x86, 0x08, 0x59, 0x12, 0x10, 0xb8, 0x09, 0x46, + 0xc0, 0x3c, 0x7c, 0x4e, 0xac, 0x1c, 0x3e, 0x8a, 0x4f, 0x11, 0xac, 0x1a, + 0x8f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xc0, 0x6c, 0x1f, 0x6d, 0x93, 0x17, 0x01, 0x88, 0xb6, 0x0b, + 0x49, 0x06, 0x57, 0x39, 0x74, 0xfd, 0x1a, 0x20, 0x3a, 0xe6, 0x98, 0xd2, + 0x74, 0x61, 0x6a, 0x73, 0x84, 0x8b, 0x0d, 0x09, 0x41, 0x37, 0xfa, 0x92, + 0x78, 0xc9, 0x84, 0x26, 0xb2, 0x44, 0xf8, 0x92, 0x91, 0xe6, 0xb0, 0xdb, + 0x25, 0xdf, 0xb8, 0xa4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xd4, 0x56, 0x76, 0x3f, 0xfe, 0x20, 0x7e, 0x03, 0xae, 0xe9, 0xdd, 0x82, + 0x9e, 0x47, 0x9a, 0xed, 0xa8, 0x11, 0xdd, 0x6f, 0xee, 0xae, 0xae, 0x6b, + 0x75, 0x70, 0x37, 0xba, 0x84, 0x3e, 0x18, 0xc0, 0x12, 0x10, 0xb5, 0x7b, + 0x91, 0xaf, 0x31, 0xfc, 0x0e, 0x66, 0xed, 0x28, 0x06, 0x8d, 0x9a, 0xe8, + 0xb4, 0x53, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x1a, 0xe6, 0x9a, 0x49, 0xa0, 0xd2, 0x53, 0x47, 0x43, + 0x83, 0xc3, 0x02, 0x08, 0xba, 0x4c, 0x77, 0x1a, 0x20, 0xe8, 0x67, 0x03, + 0x8f, 0x44, 0xbb, 0x9e, 0xf3, 0x1c, 0x67, 0xff, 0x7b, 0x40, 0x73, 0xb2, + 0x33, 0xa3, 0xfb, 0x48, 0x7e, 0x71, 0x48, 0x66, 0x7c, 0xe5, 0x6c, 0xed, + 0x3d, 0x9a, 0x80, 0xf4, 0x49, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xd5, 0x95, 0x20, 0x6e, 0xd9, 0x6a, 0x09, 0xaa, 0x36, 0xb7, 0x06, + 0xd9, 0x03, 0xf4, 0xe4, 0xb1, 0x97, 0xa5, 0xfe, 0xaf, 0x42, 0xbf, 0xc6, + 0xbe, 0x9b, 0x42, 0x05, 0x19, 0x36, 0xf8, 0x23, 0x0b, 0x12, 0x10, 0xd1, + 0xdb, 0x84, 0x79, 0x99, 0x6f, 0xb4, 0x05, 0xad, 0x03, 0xb8, 0xf7, 0xa7, + 0xc2, 0xa1, 0x05, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbe, 0x4b, 0xfa, 0xcb, 0xe3, 0x08, 0xb2, 0x92, + 0x61, 0xc6, 0x68, 0x4f, 0x2d, 0x91, 0x09, 0x8e, 0x1a, 0x20, 0x68, 0x7f, + 0x5f, 0x5f, 0x85, 0x47, 0xc4, 0xe1, 0x25, 0xff, 0x9a, 0x3c, 0x97, 0x6e, + 0x33, 0xdf, 0x00, 0x7f, 0x8b, 0x19, 0x7c, 0xc4, 0xc6, 0x4b, 0x62, 0xcc, + 0xcb, 0x4b, 0x19, 0xd3, 0xb0, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x3a, 0xb2, 0xa0, 0x8e, 0x31, 0x98, 0x44, 0xfa, 0x3f, 0x4b, + 0x2a, 0x8c, 0x3f, 0x9f, 0x9b, 0x37, 0x96, 0x6d, 0x87, 0xd1, 0x3b, 0x75, + 0x3f, 0x2f, 0x7e, 0xa6, 0x0c, 0xd7, 0xec, 0xad, 0x7e, 0x46, 0x12, 0x10, + 0xca, 0xd5, 0x82, 0xb3, 0x91, 0x9f, 0x83, 0x18, 0xa3, 0xee, 0x23, 0x3a, + 0x34, 0x59, 0x8a, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x05, 0x4b, 0x7f, 0x07, 0x01, 0xe0, 0xe6, + 0xaa, 0x23, 0x18, 0xf5, 0x55, 0xb7, 0xc8, 0xde, 0x83, 0x1a, 0x20, 0x87, + 0x99, 0x4b, 0xf0, 0xa2, 0xd9, 0x42, 0x8e, 0x37, 0x78, 0x11, 0xad, 0x58, + 0xfd, 0x08, 0x6a, 0x10, 0x25, 0x1c, 0x91, 0x59, 0x9f, 0x07, 0x31, 0xdf, + 0x5e, 0x92, 0xa8, 0x74, 0x49, 0x73, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x25, 0x0e, 0x63, 0x7e, 0x38, 0x8f, 0x49, 0x4c, 0x32, + 0x35, 0xce, 0xce, 0xb8, 0xd5, 0xd0, 0x44, 0xdc, 0x7c, 0x98, 0xaa, 0x73, + 0x00, 0xa3, 0x93, 0x48, 0x0a, 0x5e, 0x35, 0x6c, 0x6e, 0xfc, 0x6b, 0x12, + 0x10, 0x37, 0xe1, 0xd5, 0xdd, 0x2f, 0x3a, 0xd6, 0x25, 0x6f, 0x7b, 0x3f, + 0x1f, 0x98, 0x0f, 0x68, 0x3e, 0x62, 0x00, 0x20, 0xae, 0x9a, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xec, 0x48, 0xfb, 0xcd, 0x93, 0x54, 0xd7, 0x72, 0xb1, 0x81, 0x34, + 0xee, 0x3e, 0x9e, 0x8f, 0x11, 0xb9, 0x6e, 0xd9, 0x9a, 0x5c, 0xdb, + 0xe7, 0xdc, 0xd2, 0x98, 0xb8, 0x2c, 0x2c, 0x44, 0x86, 0x39, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x23, 0x35, 0xf3, 0x96, 0x00, 0x00, 0x00, 0x3d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x23, 0x35, 0xf3, 0x96, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x60, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf7, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x31, + 0x00, 0x00, 0x00, 0x20, 0x18, 0x0d, 0xc2, 0x89, 0x7d, 0xbe, 0xa2, 0xf7, + 0x6a, 0xb2, 0xa0, 0x08, 0x4f, 0xfd, 0x64, 0x07, 0xe8, 0x5e, 0x5c, 0xbf, + 0xb9, 0x5a, 0x75, 0x93, 0x6c, 0x46, 0x9b, 0x55, 0x07, 0x00, 0x4b, 0x7c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x43, 0x34, 0x33, 0x32, 0x37, 0x32, 0x45, + 0x37, 0x35, 0x43, 0x30, 0x37, 0x38, 0x36, 0x38, 0x33, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x43, 0x34, 0x33, 0x32, 0x37, 0x32, 0x45, 0x37, 0x35, + 0x43, 0x30, 0x37, 0x38, 0x36, 0x38, 0x33, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xbc, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0xde, 0x02, 0x0a, 0x30, + 0xb7, 0x9b, 0x6d, 0x84, 0xae, 0xf7, 0xfc, 0xda, 0xce, 0x77, 0x07, 0xd4, + 0x1a, 0x50, 0x43, 0xaa, 0xd4, 0x85, 0x4a, 0xb4, 0xbe, 0x98, 0x0d, 0x49, + 0x65, 0xe2, 0x72, 0x00, 0xb8, 0xa9, 0x08, 0x38, 0x95, 0x3d, 0xf0, 0x26, + 0xc2, 0xc1, 0xa9, 0x68, 0xd6, 0xb1, 0xc2, 0x71, 0x56, 0xc6, 0x77, 0x8c, + 0xc7, 0x31, 0x61, 0x60, 0xda, 0x09, 0x82, 0x93, 0x42, 0xdf, 0x5a, 0x4f, + 0x1d, 0x28, 0xce, 0x78, 0x6f, 0x0c, 0xad, 0xa0, 0x17, 0xd9, 0xbb, 0xcc, + 0xcd, 0x88, 0xd1, 0x2c, 0x74, 0x87, 0xc4, 0x20, 0x6e, 0xdf, 0x59, 0x47, + 0xb0, 0xd1, 0x0e, 0xf3, 0xe7, 0x05, 0xa5, 0x06, 0xf5, 0x92, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x34, + 0xf0, 0x13, 0x6b, 0x38, 0x1f, 0x09, 0x75, 0x91, 0xda, 0xa7, 0x2a, 0x8d, + 0xb5, 0xb9, 0x82, 0x1a, 0x20, 0x6a, 0x62, 0xff, 0x95, 0x70, 0xd5, 0x25, + 0xa5, 0x5c, 0x9b, 0x34, 0xb8, 0x67, 0x0d, 0x46, 0x90, 0xf2, 0x3f, 0x36, + 0xb7, 0x8c, 0x37, 0xbb, 0x0f, 0x39, 0x01, 0xf3, 0xda, 0x3c, 0xaa, 0x9e, + 0x68, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xc4, 0x40, 0xb0, + 0x6e, 0x45, 0x63, 0x6e, 0xc9, 0xe5, 0xb7, 0xe8, 0x94, 0x27, 0x25, 0x8a, + 0xbf, 0xfd, 0xdd, 0x67, 0x8e, 0x25, 0xf0, 0x22, 0x4d, 0xd0, 0x16, 0xb5, + 0x1a, 0x01, 0x2d, 0x87, 0x95, 0x12, 0x10, 0xf3, 0x05, 0x0d, 0xcb, 0xd4, + 0xa2, 0xb3, 0x57, 0x76, 0x64, 0x12, 0x39, 0xb1, 0x09, 0x22, 0x64, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x57, 0x7d, 0xf6, 0xbb, 0xb2, 0xa3, 0xdf, 0x40, 0x86, 0x36, 0xe9, 0xc5, + 0x8f, 0x56, 0xa9, 0xf7, 0x1a, 0x20, 0xf9, 0x1d, 0xc6, 0x15, 0xaf, 0xa8, + 0xf7, 0xcd, 0xbb, 0x33, 0x5e, 0x35, 0x83, 0x36, 0xe1, 0xfc, 0x5e, 0xe6, + 0x10, 0x8f, 0x97, 0x9b, 0xbc, 0xe3, 0x2e, 0x30, 0x64, 0x5d, 0x0c, 0x0d, + 0x63, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x6b, 0x62, + 0xf0, 0xed, 0x8e, 0x61, 0x7e, 0x5b, 0x20, 0xed, 0x90, 0x15, 0x45, 0x4e, + 0xac, 0xfc, 0x9d, 0x2e, 0x10, 0x59, 0x36, 0xf6, 0x44, 0x40, 0xb2, 0xdd, + 0x90, 0x2f, 0xf2, 0xfd, 0x51, 0x8a, 0x12, 0x10, 0xc2, 0x90, 0x44, 0xf8, + 0xb9, 0xb5, 0x91, 0x19, 0x49, 0x45, 0xda, 0xa6, 0x69, 0xce, 0xaf, 0x6b, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x2e, 0xb2, 0x78, 0x89, 0xd3, 0xd9, 0xf1, 0xb9, 0x78, 0x2b, 0x1f, + 0x04, 0xdd, 0x4d, 0x64, 0x80, 0x1a, 0x20, 0x07, 0x03, 0x99, 0xfe, 0xb1, + 0x40, 0x6c, 0xf4, 0xd6, 0x58, 0x52, 0x6b, 0x5a, 0x40, 0x83, 0xa8, 0x91, + 0x95, 0x5b, 0x1e, 0xe2, 0xdd, 0xf5, 0xdf, 0x30, 0xe4, 0xf3, 0x60, 0xb6, + 0xf7, 0xc4, 0x7a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbe, + 0x8e, 0xdf, 0x9e, 0xf3, 0x2c, 0x08, 0x8f, 0x0d, 0x2a, 0xca, 0x5b, 0xd0, + 0x6c, 0xfe, 0x84, 0x03, 0x53, 0x7f, 0x13, 0xfd, 0xe6, 0x09, 0x7e, 0x7c, + 0x2a, 0x8a, 0x3e, 0x80, 0x3e, 0x6e, 0xa2, 0x12, 0x10, 0x2c, 0xd6, 0xb5, + 0xb7, 0xbe, 0xaa, 0xd5, 0x43, 0x33, 0xe4, 0x2e, 0xbb, 0xa7, 0x90, 0x5e, + 0xd0, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0xd0, 0x6f, 0x80, 0xf8, 0xf9, 0x8e, 0x19, 0x15, 0x9f, 0xe6, + 0x3e, 0x0c, 0x50, 0x5a, 0xd1, 0x51, 0x1a, 0x20, 0xb8, 0xae, 0xfb, 0x60, + 0x64, 0x70, 0x4c, 0xe2, 0x22, 0x6a, 0x64, 0x4c, 0xad, 0x9a, 0xde, 0x1e, + 0x0c, 0x06, 0x88, 0x64, 0x2a, 0x5b, 0xc2, 0x55, 0x62, 0xb7, 0x04, 0x6a, + 0xc9, 0xc5, 0x5a, 0x4d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xd8, 0x63, 0x89, 0x6f, 0xce, 0x3b, 0x38, 0xb7, 0xe2, 0x4a, 0x38, 0x54, + 0x31, 0x9c, 0x7f, 0x8e, 0x56, 0x47, 0x85, 0xec, 0xf0, 0x6a, 0x7f, 0x2b, + 0x9c, 0x2d, 0x90, 0x8b, 0x00, 0xa2, 0x89, 0xb7, 0x12, 0x10, 0xac, 0xa0, + 0x9e, 0x33, 0x1a, 0xfb, 0x6c, 0xc5, 0x84, 0x77, 0x51, 0xea, 0xac, 0x23, + 0xcd, 0x22, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0xd4, 0x95, 0xea, 0x4a, 0x28, 0x80, 0x88, 0xce, 0xa4, + 0x74, 0x8b, 0xb4, 0x31, 0x10, 0x41, 0x58, 0x1a, 0x20, 0xba, 0x15, 0x0c, + 0xa1, 0x14, 0xb6, 0x58, 0xcc, 0x5b, 0xb2, 0x7a, 0x82, 0x28, 0xcd, 0xe7, + 0x5b, 0x77, 0x5b, 0xab, 0xae, 0xfb, 0x11, 0xd4, 0x68, 0xcc, 0x67, 0xdc, + 0x35, 0x57, 0x10, 0x49, 0xc2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x52, 0x14, 0xb7, 0x57, 0x9e, 0xb4, 0x9a, 0x90, 0x62, 0x85, 0xba, + 0xa7, 0x06, 0x12, 0x50, 0xe6, 0xef, 0x8f, 0x10, 0x64, 0xff, 0x85, 0x03, + 0x32, 0x9a, 0x8b, 0xed, 0x08, 0x77, 0xa1, 0xbe, 0xf0, 0x12, 0x10, 0x47, + 0x1c, 0xb1, 0xbf, 0xcc, 0x3b, 0xdc, 0xca, 0x50, 0xf9, 0x00, 0xe9, 0xeb, + 0x32, 0x08, 0x00, 0x62, 0x00, 0x20, 0xbc, 0x9a, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x18, 0x0d, 0xc2, 0x89, 0x7d, 0xbe, 0xa2, 0xf7, 0x6a, 0xb2, 0xa0, + 0x08, 0x4f, 0xfd, 0x64, 0x07, 0xe8, 0x5e, 0x5c, 0xbf, 0xb9, 0x5a, + 0x75, 0x93, 0x6c, 0x46, 0x9b, 0x55, 0x07, 0x00, 0x4b, 0x7c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x98, 0xdb, 0x82, 0xe7, 0x00, 0x00, 0x00, 0x3f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x98, 0xdb, 0x82, 0xe7, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdd, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x55, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xda, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x15, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3d, + 0x00, 0x00, 0x00, 0x20, 0xef, 0x2a, 0xcb, 0x19, 0x15, 0xe5, 0x33, 0x75, + 0xf0, 0xad, 0x55, 0x4e, 0xc3, 0x0b, 0xe4, 0xc5, 0xdc, 0xce, 0x93, 0xaa, + 0x1f, 0xc0, 0x84, 0x67, 0xb5, 0x89, 0x84, 0x61, 0x82, 0x0c, 0x9d, 0xaf, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x39, 0x35, 0x46, 0x36, 0x34, 0x39, 0x39, + 0x37, 0x42, 0x38, 0x43, 0x36, 0x42, 0x44, 0x39, 0x33, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x39, 0x35, 0x46, 0x36, 0x34, 0x39, 0x39, 0x37, 0x42, + 0x38, 0x43, 0x36, 0x42, 0x44, 0x39, 0x33, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x9f, 0x49, 0xc0, 0xf7, 0x77, 0x4e, + 0xb6, 0x10, 0x9f, 0x73, 0x38, 0x00, 0x40, 0x00, 0x48, 0xe2, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x0d, 0x56, 0xf8, 0x9d, + 0xce, 0xfb, 0x63, 0x9f, 0xb0, 0x31, 0x77, 0x41, 0x1a, 0x44, 0x02, 0x93, + 0x1a, 0x50, 0x18, 0xb2, 0x65, 0xa8, 0xb5, 0x9e, 0x87, 0x5d, 0x37, 0x1a, + 0x33, 0x27, 0xa1, 0xac, 0x4d, 0xc9, 0xd0, 0x14, 0x09, 0x36, 0xd7, 0x31, + 0x0e, 0x95, 0xba, 0x8b, 0x44, 0x8b, 0xd1, 0xa4, 0xaa, 0x05, 0x75, 0x3c, + 0x01, 0x1a, 0xf1, 0xac, 0xbf, 0xf8, 0xdd, 0x50, 0x98, 0x20, 0xfd, 0xa5, + 0x9c, 0x5a, 0x78, 0x04, 0x20, 0x19, 0x0b, 0xff, 0x73, 0x3b, 0x41, 0x9f, + 0x15, 0xb7, 0x3c, 0x78, 0xdf, 0x0c, 0x45, 0x00, 0x55, 0x0e, 0xa7, 0x65, + 0x2a, 0xaa, 0xeb, 0xbb, 0x9a, 0xb1, 0x66, 0x5c, 0xc4, 0x03, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x93, + 0xbd, 0xb7, 0xba, 0x11, 0x5a, 0x00, 0xf6, 0x8f, 0x1e, 0xbb, 0x83, 0x6d, + 0x91, 0x2f, 0x63, 0x1a, 0x20, 0x20, 0x09, 0x17, 0xf1, 0xb4, 0x1c, 0x7a, + 0x10, 0x9a, 0x72, 0x9d, 0x33, 0x32, 0x68, 0x75, 0x71, 0x15, 0x03, 0x7b, + 0xf7, 0x72, 0x38, 0xe9, 0x39, 0xed, 0x4f, 0x43, 0xb1, 0x5b, 0xd8, 0x68, + 0x04, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x2e, 0x27, 0xea, + 0xd0, 0xf7, 0xcc, 0x22, 0x3f, 0xf9, 0x0f, 0xb4, 0xd7, 0x89, 0x58, 0x41, + 0x0c, 0x6d, 0xc1, 0xcc, 0xd2, 0x74, 0xb5, 0xb4, 0x46, 0x56, 0x2a, 0x8b, + 0xb9, 0x31, 0xbe, 0x73, 0xf1, 0x12, 0x10, 0x52, 0xa8, 0x40, 0x24, 0xbd, + 0xdb, 0x12, 0xa3, 0x7c, 0x0e, 0xe7, 0x6d, 0xd8, 0xa3, 0x83, 0x6c, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x85, 0x41, 0x84, 0x79, 0x25, 0xbc, 0x7d, 0xe7, 0x20, 0x1f, 0x3c, 0x95, + 0xbf, 0xa4, 0xfc, 0x43, 0x1a, 0x20, 0x30, 0x26, 0xd2, 0xb4, 0xe8, 0x06, + 0x27, 0x0c, 0xbf, 0x46, 0x30, 0x77, 0xfd, 0x30, 0xac, 0x50, 0x81, 0x1a, + 0x16, 0x3f, 0x86, 0x60, 0x17, 0xed, 0x00, 0xc3, 0x4c, 0xd8, 0x1f, 0x9b, + 0xa1, 0xdf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x9f, 0x51, + 0xb9, 0x72, 0x90, 0x71, 0x4c, 0x16, 0x62, 0x8b, 0xf2, 0x8e, 0x22, 0xce, + 0xbf, 0xd8, 0x13, 0x6d, 0x11, 0x85, 0xbf, 0x3c, 0x10, 0xf5, 0x16, 0xfb, + 0x8b, 0xd9, 0x4f, 0x27, 0xf6, 0xc2, 0x12, 0x10, 0x6d, 0x5e, 0xbc, 0x50, + 0x6d, 0x13, 0xea, 0xe5, 0xa2, 0xfd, 0x52, 0x50, 0x3b, 0x9e, 0xe6, 0x52, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x18, 0xac, 0x83, 0x66, 0xf1, 0x01, 0x27, 0xd2, 0x56, 0x44, 0xe2, + 0x95, 0x87, 0x29, 0x7e, 0x47, 0x1a, 0x20, 0x9a, 0x4e, 0x02, 0xb3, 0x09, + 0x45, 0xd9, 0x55, 0x6b, 0x45, 0x4a, 0x8d, 0xac, 0x95, 0x41, 0x76, 0xdd, + 0x62, 0x80, 0xb1, 0x50, 0xe6, 0x63, 0x42, 0x19, 0x1c, 0xa9, 0x0f, 0x19, + 0x32, 0xcc, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x66, + 0x48, 0xfa, 0x38, 0x2c, 0xb5, 0xa9, 0x80, 0x4c, 0x46, 0x86, 0x40, 0x3a, + 0x68, 0x0a, 0x03, 0xcc, 0x54, 0xda, 0x35, 0x8d, 0xc0, 0x78, 0x5f, 0xe9, + 0xd4, 0xfd, 0x59, 0xd8, 0x32, 0xd8, 0x39, 0x12, 0x10, 0xb5, 0xae, 0xdb, + 0x51, 0x8b, 0x92, 0xea, 0xd1, 0x79, 0xa2, 0x01, 0x84, 0x7e, 0x01, 0xa3, + 0x72, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0x3b, 0x13, 0x76, 0x8a, 0x19, 0x03, 0x38, 0x0c, 0x4c, 0x80, + 0xcb, 0x64, 0xc7, 0x0c, 0x23, 0x50, 0x1a, 0x20, 0xf7, 0x70, 0xad, 0x3e, + 0x4e, 0x1f, 0x1c, 0x24, 0xbb, 0xe3, 0x3e, 0xd1, 0x1f, 0x3f, 0x5a, 0x0b, + 0x1c, 0x20, 0xbc, 0xd7, 0x2f, 0x36, 0x31, 0x0e, 0x73, 0xa6, 0x1d, 0xdb, + 0xe9, 0x25, 0x38, 0x38, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x2b, 0x9b, 0x7a, 0xce, 0xb0, 0x02, 0xa5, 0x84, 0xe7, 0xc9, 0xb4, 0x64, + 0x0c, 0x98, 0xbd, 0x3b, 0x90, 0x40, 0x1e, 0x69, 0x52, 0x83, 0x1a, 0x82, + 0x38, 0xe8, 0x7f, 0xdb, 0xd4, 0x9b, 0x62, 0x0e, 0x12, 0x10, 0xb4, 0x63, + 0xf0, 0x69, 0x4d, 0x8a, 0x9d, 0xc5, 0x32, 0x70, 0x78, 0x72, 0xe0, 0x56, + 0x7b, 0x10, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0x52, 0x75, 0x51, 0xba, 0x51, 0x01, 0x5f, 0xbc, 0xc8, + 0x8f, 0xb9, 0x62, 0xff, 0x98, 0x2e, 0x3c, 0x1a, 0x20, 0x08, 0x12, 0xd4, + 0x6d, 0xe7, 0x7a, 0x2a, 0x10, 0x89, 0x8d, 0xba, 0xaa, 0x03, 0x72, 0x4a, + 0x06, 0x48, 0xb4, 0xd3, 0xab, 0xe7, 0xe3, 0xb4, 0xc5, 0xd3, 0xe6, 0xe5, + 0x16, 0xeb, 0xc6, 0x98, 0xbf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x18, 0xea, 0xca, 0xd4, 0xc6, 0xa3, 0x05, 0xca, 0x94, 0xa1, 0x1c, + 0xf4, 0x2c, 0x2d, 0xae, 0x79, 0xfc, 0xc5, 0xa3, 0x98, 0x6b, 0xa4, 0xdd, + 0xdc, 0x88, 0xe0, 0x31, 0xa1, 0x6d, 0x02, 0xf9, 0x49, 0x12, 0x10, 0xdf, + 0x37, 0xc3, 0x90, 0x1b, 0xfc, 0x97, 0x25, 0xc3, 0xeb, 0x62, 0xf9, 0x11, + 0xbc, 0x0e, 0xc0, 0x62, 0x00, 0x20, 0xe2, 0x9a, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xef, 0x2a, 0xcb, 0x19, 0x15, 0xe5, 0x33, 0x75, 0xf0, 0xad, 0x55, + 0x4e, 0xc3, 0x0b, 0xe4, 0xc5, 0xdc, 0xce, 0x93, 0xaa, 0x1f, 0xc0, + 0x84, 0x67, 0xb5, 0x89, 0x84, 0x61, 0x82, 0x0c, 0x9d, 0xaf, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// Renewal Tests. +// A few renewal examples from filter *PIG*:*CdmUseCase*. +// Note: running these cases generates many renewals. It should be +// ok to only test one or two. +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, + 0x44, 0x37, 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, 0x44, 0x37, + 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x90, 0x99, + 0x86, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xa7, 0x99, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, + 0x44, 0x37, 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, 0x44, 0x37, + 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x04, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x90, 0x99, + 0x86, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xec, 0x99, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0xb5, 0x6b, 0x94, 0x55, 0x00, 0x00, 0x00, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0xb5, 0x6b, 0x94, 0x55, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x44, 0x41, 0x30, 0x35, 0x34, 0x37, 0x43, 0x33, + 0x35, 0x33, 0x39, 0x43, 0x36, 0x45, 0x39, 0x41, 0x32, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x41, 0x30, 0x35, 0x34, 0x37, 0x43, 0x33, 0x35, 0x33, + 0x39, 0x43, 0x36, 0x45, 0x39, 0x41, 0x32, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0x25, 0xda, 0x91, 0x67, 0x0e, 0x88, + 0x2e, 0x8b, 0xca, 0x5b, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xfd, 0x9c, 0x86, + 0xa2, 0x06, 0x12, 0x0d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x38, 0x80, + 0xe7, 0x84, 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x6b, 0x94, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x20, 0x8e, 0x9d, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} +} // namespace + +} // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_golden_v17.cpp b/oemcrypto/odk/test/odk_golden_v17.cpp new file mode 100644 index 0000000..786c678 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v17.cpp @@ -0,0 +1,3846 @@ +// Copyright 2023 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" + +namespace wvodk_test { + +namespace { + +using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::ODK_RenewalRequest; + +using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize::CreateCoreLicenseResponseFromProto; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; +using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; + +class ODKGoldenProvisionV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_ProvisioningRequest core_provisioning_request; + EXPECT_TRUE(CoreProvisioningRequestFromMessage(core_request_, + &core_provisioning_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, provisioning_response_, core_provisioning_request, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_LicenseRequest core_license_request; + EXPECT_TRUE( + CoreLicenseRequestFromMessage(core_request_, &core_license_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreLicenseResponseFromProto( + features, serialized_license_, core_license_request, + core_request_sha256_, nonce_required_, uses_padding_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + bool nonce_required_ = true; + bool uses_padding_ = true; + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_RenewalRequest core_renewal_request; + EXPECT_TRUE( + CoreRenewalRequestFromMessage(core_request_, &core_renewal_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreRenewalResponse(features, core_renewal_request, + renewal_duration_seconds_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + uint64_t renewal_duration_seconds_; + std::string core_request_; + std::string core_response_; + std::string renewal_; +}; + +// README (for ODK maintainers): Set the environment variable +// DUMP_GOLDEN_DATA="yes" +// Then set the environment variable GTEST_FILTER to the test you want to run. +// Run the script for the platform we want. E.g. run_fake_l1_tests, +// run_prov30_tests or run_prov40_tests. Look for the autogenerated code in +// $CDM_DIR/out/testbed/debug/*_data.cpp. If you are updating the ODK library, +// and you have to change the code above, then you're fine. If you have to +// change the code below then there is probably a backwards compatibility +// problem. + +////////////////////////////////////////////////////////////////////// +// Provisioning tests. +// One provisioning example from each of fake-l1 (with keybox), +// and prov30. For v17, Prov 4.0 does not use a core message. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV17, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x02, 0x00, + 0x11, 0x52, 0x08, 0x36, 0xa1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x02, 0x00, 0x11, + 0x52, 0x08, 0x36, 0xa1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xf3, 0x43, 0x08, 0xd7, 0xad, 0x72, 0x69, 0x16, 0x23, + 0xbe, 0xa3, 0xfe, 0x15, 0xf4, 0xe4, 0x04, 0xc1, 0x91, 0x3d, 0x2a, 0x30, + 0x74, 0xcb, 0x85, 0x5e, 0x72, 0x00, 0xf0, 0xce, 0xe6, 0x05, 0x02, 0x39, + 0x57, 0x6d, 0x76, 0xa2, 0x92, 0xdf, 0x4f, 0x49, 0x55, 0xfb, 0x6d, 0x5b, + 0xed, 0xdd, 0x5a, 0xd6, 0xb7, 0x3b, 0xe3, 0xe4, 0x58, 0x41, 0x6e, 0x35, + 0xec, 0x49, 0xd6, 0xd0, 0xf2, 0xa9, 0xbf, 0xc7, 0xad, 0xeb, 0x22, 0xc4, + 0x0e, 0xdf, 0xfb, 0xe6, 0xf3, 0x36, 0xca, 0xf4, 0x3a, 0x3e, 0x05, 0xcc, + 0x5a, 0xba, 0xca, 0xa4, 0xf2, 0x7e, 0xc0, 0x90, 0x81, 0x11, 0x2a, 0x74, + 0x7e, 0x7d, 0xad, 0x31, 0x28, 0xa3, 0xa5, 0xb7, 0xed, 0xad, 0x0b, 0x3c, + 0xb1, 0xba, 0x01, 0x18, 0x76, 0x50, 0xca, 0xdf, 0xcb, 0x2b, 0x7a, 0x9e, + 0xb3, 0x52, 0x83, 0x38, 0x33, 0x2d, 0x4b, 0xa5, 0x0b, 0x15, 0xd8, 0x6d, + 0x54, 0x87, 0x18, 0x70, 0x51, 0x1d, 0xc2, 0x21, 0xae, 0xfe, 0x08, 0x17, + 0x17, 0x8e, 0x7b, 0xd0, 0x28, 0x5a, 0xdc, 0x73, 0x8e, 0x75, 0x38, 0x24, + 0x56, 0x80, 0x6c, 0x2f, 0x43, 0xf7, 0x21, 0xff, 0xa4, 0xaa, 0x96, 0x27, + 0x9e, 0x24, 0x7d, 0xc6, 0xe8, 0x06, 0x82, 0xfc, 0x24, 0xd3, 0x94, 0x5e, + 0x4d, 0xe6, 0x4e, 0x4a, 0xc0, 0x18, 0x16, 0xd2, 0x76, 0x7c, 0x1e, 0x80, + 0xdf, 0xc7, 0x98, 0xac, 0x14, 0x9c, 0x04, 0x8a, 0x29, 0xb0, 0xa0, 0x2c, + 0xf8, 0xb4, 0x9e, 0x13, 0xb7, 0x16, 0x8c, 0xf3, 0x50, 0x50, 0x4b, 0x80, + 0x6e, 0x5f, 0xb8, 0xe0, 0x08, 0x87, 0x36, 0x48, 0x8e, 0xf0, 0x23, 0x8c, + 0x9c, 0x85, 0x37, 0x73, 0x26, 0xd8, 0xc9, 0xb8, 0x7b, 0xf0, 0xc1, 0x71, + 0x7c, 0x04, 0xd4, 0xbe, 0x24, 0xaf, 0x46, 0x80, 0x42, 0x37, 0x7b, 0x6f, + 0x31, 0x89, 0xb1, 0x47, 0x80, 0x52, 0xdb, 0xfe, 0x75, 0x0a, 0xc6, 0x76, + 0x9e, 0x38, 0x8c, 0xc5, 0x8a, 0xa0, 0xc4, 0x19, 0xd5, 0x19, 0x86, 0x68, + 0xc2, 0xda, 0x57, 0xf9, 0xb4, 0x18, 0x1f, 0xf8, 0x0a, 0x20, 0x7a, 0x1e, + 0x6e, 0x0f, 0xac, 0x62, 0xff, 0xd3, 0xf4, 0xbe, 0x65, 0x57, 0xca, 0xb6, + 0x67, 0x5a, 0xa2, 0x48, 0x56, 0x8f, 0xcd, 0xeb, 0xde, 0x3b, 0x23, 0xd5, + 0x8c, 0xb7, 0x98, 0x9e, 0xe6, 0x3f, 0x47, 0x56, 0x6f, 0xc5, 0x62, 0x25, + 0xba, 0xfd, 0xcc, 0xa0, 0x8d, 0x20, 0x3c, 0xe4, 0xef, 0x72, 0xc0, 0x31, + 0xa1, 0x05, 0x78, 0x47, 0xba, 0x41, 0x39, 0x5c, 0x6f, 0x58, 0x2c, 0x3c, + 0xb5, 0xac, 0x39, 0x16, 0xc5, 0xae, 0xd9, 0x97, 0x09, 0x69, 0x02, 0x49, + 0x86, 0x5c, 0x1a, 0xc5, 0x91, 0x71, 0x7e, 0x6f, 0x75, 0xdd, 0x8d, 0x60, + 0xbc, 0x6d, 0xb3, 0x9f, 0x82, 0x9e, 0x0b, 0x20, 0xe7, 0x97, 0x99, 0x33, + 0x14, 0xb9, 0xcb, 0x90, 0x4c, 0x55, 0x09, 0x1e, 0x04, 0xcf, 0x0c, 0xf0, + 0x8d, 0x9f, 0xea, 0x51, 0xcb, 0x85, 0x36, 0x3e, 0x0f, 0x5f, 0x7b, 0x24, + 0x26, 0x21, 0x8d, 0xd7, 0xcb, 0x22, 0xfb, 0xd7, 0xdc, 0x4f, 0x36, 0x18, + 0x4d, 0xae, 0x1e, 0xaa, 0x41, 0x66, 0x7a, 0x2d, 0xd0, 0x78, 0xba, 0x2d, + 0x9a, 0xc6, 0x9b, 0x39, 0x14, 0xe4, 0x3f, 0x74, 0x4a, 0xbb, 0x30, 0xb4, + 0x5f, 0x88, 0x71, 0xde, 0x0e, 0x29, 0xe9, 0xbb, 0x94, 0x61, 0x91, 0x40, + 0xd5, 0x5b, 0x62, 0x9c, 0x8f, 0x4f, 0xcc, 0xa6, 0xe9, 0x57, 0x10, 0x99, + 0x17, 0x17, 0x9f, 0x5b, 0xd5, 0x11, 0x53, 0x74, 0x05, 0xed, 0x99, 0xd6, + 0x49, 0xbb, 0x16, 0xd1, 0xf0, 0x21, 0xa0, 0xc4, 0xd9, 0x8c, 0xa9, 0x6d, + 0xb6, 0x4a, 0x3f, 0x64, 0xae, 0x33, 0x38, 0xd8, 0xb5, 0x0c, 0x51, 0x7e, + 0x97, 0xba, 0xe5, 0x76, 0x67, 0x2b, 0x7c, 0xb1, 0xc8, 0x5a, 0xe3, 0x71, + 0xaa, 0x42, 0xc6, 0x03, 0xa8, 0x14, 0xe4, 0x82, 0xa8, 0x7a, 0xdb, 0x8a, + 0x36, 0x16, 0xa9, 0xe3, 0xc9, 0xf5, 0xb3, 0x21, 0x79, 0x2c, 0xaf, 0x14, + 0xac, 0x03, 0xfa, 0xc7, 0x98, 0xcf, 0x1c, 0x8e, 0x1e, 0x34, 0xd3, 0x1d, + 0x11, 0x6d, 0x42, 0x5f, 0x69, 0xb0, 0x59, 0x69, 0xe2, 0x25, 0xcd, 0x5c, + 0x1f, 0xdc, 0x79, 0xfa, 0x08, 0xf7, 0x24, 0xa0, 0xf8, 0xed, 0x93, 0x9d, + 0x65, 0x4a, 0xd8, 0x8d, 0x07, 0x9c, 0xf4, 0x14, 0x1c, 0xce, 0x74, 0x60, + 0x13, 0x1a, 0xf6, 0x8f, 0x11, 0x15, 0x23, 0x4f, 0x26, 0xd4, 0x7c, 0xfd, + 0x83, 0x2b, 0xd6, 0x33, 0xea, 0x5d, 0x12, 0x6a, 0x7e, 0x2f, 0x68, 0x53, + 0x08, 0x28, 0x65, 0xbb, 0x37, 0xba, 0xff, 0xb9, 0xc8, 0x85, 0xaf, 0x8a, + 0x2f, 0x1c, 0xaa, 0x64, 0xdd, 0xed, 0x3f, 0xf2, 0xd3, 0x55, 0xdd, 0x3b, + 0x79, 0x51, 0xee, 0xde, 0x34, 0x48, 0xe9, 0xb9, 0x0a, 0xf6, 0xe0, 0x7e, + 0xa4, 0x54, 0xbe, 0x63, 0xe0, 0x54, 0x43, 0x3f, 0x9a, 0xc0, 0x27, 0xab, + 0x0a, 0x3f, 0x7a, 0x16, 0x44, 0xd2, 0x0f, 0xf1, 0xab, 0x5e, 0x31, 0x56, + 0xc8, 0x88, 0x26, 0x65, 0x33, 0x6a, 0x21, 0x64, 0xb5, 0xfd, 0x10, 0xf4, + 0x15, 0x98, 0xbe, 0xd3, 0x05, 0x02, 0x65, 0x59, 0x21, 0x2b, 0xb6, 0x9a, + 0x09, 0x3c, 0xd8, 0x83, 0x1d, 0x03, 0xab, 0x4e, 0xb2, 0xf1, 0xf7, 0xc1, + 0xde, 0x07, 0x69, 0xf3, 0xfe, 0xc8, 0x71, 0x57, 0xcf, 0x65, 0xa2, 0x26, + 0x44, 0xc2, 0x01, 0x0d, 0x60, 0x3a, 0x7b, 0x1b, 0xfc, 0x7c, 0xfe, 0xcc, + 0x6f, 0xe0, 0xbf, 0xa3, 0x88, 0xec, 0x6b, 0xc3, 0x0f, 0x0b, 0x43, 0xb2, + 0x58, 0x25, 0x56, 0xc3, 0xd7, 0x37, 0xbd, 0xa8, 0x25, 0x5d, 0xff, 0x0d, + 0xb6, 0x58, 0xf8, 0x3c, 0x3c, 0xd4, 0x32, 0xd0, 0x1e, 0xe0, 0x5f, 0xf6, + 0x93, 0x0a, 0xb2, 0x87, 0xee, 0x88, 0x98, 0x77, 0x09, 0x71, 0x96, 0x6d, + 0xba, 0x88, 0xf2, 0x93, 0x95, 0x5b, 0x01, 0xd2, 0xc0, 0xfe, 0xcf, 0xbd, + 0x4d, 0x04, 0xe4, 0x1a, 0xcb, 0xa9, 0x9c, 0x3c, 0xdb, 0x0f, 0x39, 0xd7, + 0x0b, 0xa5, 0x95, 0x7f, 0x0e, 0x4d, 0x63, 0x63, 0xb8, 0x96, 0x9e, 0x5a, + 0x3d, 0xad, 0x78, 0x86, 0x42, 0xa2, 0xe5, 0x15, 0x26, 0x97, 0xdb, 0x9d, + 0x52, 0x47, 0x77, 0x62, 0xa3, 0x7b, 0xe0, 0x28, 0x2f, 0xe9, 0x3f, 0x01, + 0x20, 0xc1, 0x01, 0x87, 0xdc, 0x37, 0x47, 0x98, 0x00, 0x70, 0x55, 0xea, + 0x49, 0x38, 0x9e, 0x1b, 0x08, 0x82, 0x3c, 0xcb, 0xff, 0x6f, 0xe7, 0xda, + 0xcd, 0x1d, 0x81, 0x7f, 0xba, 0x2b, 0xe9, 0x0b, 0x3a, 0xa8, 0xbd, 0xf5, + 0xd3, 0x3c, 0x19, 0x7b, 0xe7, 0xc7, 0x34, 0x17, 0xd2, 0xfe, 0x4a, 0x93, + 0x19, 0x32, 0x20, 0x9e, 0x39, 0xc7, 0x9a, 0x84, 0xc9, 0xd4, 0xb4, 0x44, + 0x66, 0x02, 0xf3, 0xf1, 0xad, 0x15, 0xaa, 0xfd, 0xa6, 0x5e, 0xe5, 0xfb, + 0x05, 0xa0, 0x8e, 0xc6, 0x96, 0xa4, 0x45, 0xf1, 0xed, 0xd3, 0x4b, 0xfd, + 0xa7, 0xf1, 0xd2, 0x54, 0x92, 0x78, 0x4b, 0x4f, 0xd7, 0xb4, 0xd0, 0xf2, + 0x9e, 0x39, 0x15, 0x48, 0x41, 0x22, 0xe9, 0x80, 0xf2, 0x87, 0x91, 0x2d, + 0x41, 0x8b, 0xee, 0x07, 0x52, 0x23, 0xaf, 0x47, 0x15, 0x3e, 0x8b, 0x22, + 0x9a, 0xe0, 0xe3, 0x11, 0xdf, 0xa3, 0x77, 0xdf, 0xdc, 0x42, 0xcd, 0x9f, + 0x06, 0x46, 0x3a, 0x1b, 0x00, 0xc2, 0x9b, 0x2e, 0x13, 0x58, 0x95, 0x14, + 0xc1, 0x8d, 0x1c, 0xcc, 0x49, 0xd1, 0xe8, 0x06, 0xc6, 0x31, 0x52, 0x31, + 0x85, 0x3d, 0xab, 0xe6, 0x97, 0xca, 0xf8, 0x66, 0xc2, 0xff, 0x2b, 0xc6, + 0x4c, 0xf9, 0x72, 0x6e, 0x01, 0xda, 0x23, 0x87, 0xe1, 0x4c, 0x71, 0x73, + 0x7d, 0xe8, 0xf3, 0x6b, 0x60, 0x7c, 0x23, 0x08, 0x6b, 0xf2, 0x9c, 0x52, + 0xd1, 0xa9, 0x27, 0x17, 0x11, 0x33, 0x7c, 0x4d, 0xca, 0x3b, 0xb9, 0xf3, + 0x26, 0x68, 0x0f, 0xf2, 0xc3, 0x4e, 0xde, 0xfe, 0x77, 0xe9, 0xed, 0x30, + 0x4f, 0x85, 0x79, 0xa0, 0x74, 0xab, 0xc3, 0xc1, 0x6b, 0x97, 0xc6, 0xce, + 0xee, 0x29, 0x68, 0xf7, 0x9d, 0x5e, 0x2d, 0x7a, 0x8d, 0x3e, 0x4f, 0xed, + 0x20, 0xe3, 0xab, 0xdf, 0xe5, 0x79, 0x04, 0x3b, 0x82, 0x36, 0x20, 0x6e, + 0x61, 0x64, 0x45, 0xd5, 0x11, 0xca, 0x4a, 0x26, 0xf1, 0x24, 0x7b, 0x65, + 0xf6, 0x61, 0xa5, 0xb5, 0x65, 0x6a, 0x04, 0xfb, 0xc5, 0x96, 0x04, 0xe9, + 0xdd, 0xf7, 0xe4, 0x10, 0xcd, 0xfa, 0x21, 0x1e, 0x84, 0x78, 0xcb, 0xf4, + 0xa6, 0xc4, 0x86, 0xd9, 0x3f, 0x79, 0xab, 0x90, 0xb3, 0x03, 0xb2, 0xa2, + 0xb9, 0xd8, 0xbd, 0x1b, 0x21, 0x64, 0x7d, 0x40, 0x13, 0x8c, 0x16, 0x19, + 0x4d, 0x39, 0x91, 0x45, 0x50, 0x99, 0x47, 0xae, 0x7d, 0xe4, 0xac, 0xd0, + 0x2e, 0x0a, 0x4d, 0xf8, 0x3e, 0x78, 0xfd, 0x69, 0x6c, 0x34, 0x07, 0x3a, + 0xc1, 0x5b, 0xd3, 0xd1, 0x10, 0xcc, 0xc0, 0xa9, 0x2c, 0x19, 0x2b, 0x6a, + 0x9c, 0x0d, 0x7d, 0xce, 0x32, 0x50, 0xce, 0xc4, 0xd2, 0x59, 0x5a, 0x06, + 0xbc, 0xba, 0x40, 0x74, 0xcf, 0x03, 0x94, 0x02, 0x3e, 0xee, 0x43, 0x93, + 0x62, 0xf8, 0xc9, 0xa1, 0x04, 0xd7, 0x61, 0xea, 0x16, 0xa4, 0xfb, 0xef, + 0xc2, 0x2e, 0x32, 0x2e, 0xd2, 0x32, 0xfc, 0x85, 0x8e, 0x8e, 0x6e, 0x12, + 0x10, 0xc1, 0xd7, 0xc5, 0xd4, 0x81, 0xc6, 0x17, 0x53, 0x4f, 0x6d, 0x99, + 0x7e, 0x42, 0x8b, 0x2c, 0xb2, 0x1a, 0xa8, 0x0b, 0x0a, 0xeb, 0x03, 0x08, + 0x02, 0x12, 0x10, 0x7c, 0xb4, 0x9f, 0x98, 0x7a, 0x63, 0x5e, 0x1e, 0x0a, + 0x52, 0x18, 0x46, 0x94, 0x58, 0x2d, 0x6e, 0x18, 0xe7, 0xc7, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xe2, 0x58, 0x32, 0xa8, 0x8f, 0x42, 0xf5, 0x8b, 0x68, 0x66, 0x1d, + 0x2b, 0x6c, 0xf5, 0x60, 0xc5, 0x27, 0xb4, 0x2f, 0x2d, 0xa1, 0x9f, 0xce, + 0xe1, 0x9c, 0xb1, 0xb6, 0xa9, 0x09, 0x40, 0x03, 0xd8, 0x41, 0x3b, 0xbc, + 0x9d, 0xa8, 0x6d, 0x47, 0xc7, 0xad, 0x0f, 0x47, 0x7f, 0xa5, 0xab, 0x81, + 0x82, 0x5b, 0x09, 0x2a, 0x35, 0x26, 0x72, 0x6f, 0xf0, 0x82, 0xd8, 0x0c, + 0x2d, 0xf8, 0x55, 0xf5, 0x26, 0x07, 0x58, 0x97, 0xf2, 0x9f, 0x23, 0x63, + 0x9a, 0x7b, 0xef, 0xcd, 0x75, 0x04, 0xac, 0x8b, 0x20, 0x24, 0x75, 0xdd, + 0xb2, 0xb1, 0xc6, 0x81, 0xc8, 0xe3, 0xd2, 0xdd, 0xed, 0x8e, 0x70, 0x75, + 0xb7, 0x60, 0xb4, 0x16, 0x59, 0xc7, 0x98, 0x41, 0x9d, 0xff, 0x86, 0x5f, + 0x85, 0x64, 0x1d, 0xe4, 0x60, 0x85, 0xe1, 0xbb, 0xe0, 0x66, 0x1e, 0xd4, + 0xc1, 0x09, 0x4d, 0x5b, 0xa8, 0xf9, 0x90, 0xfd, 0xb4, 0x5d, 0x7c, 0x90, + 0x77, 0xfb, 0xd1, 0xd3, 0x12, 0x69, 0xe9, 0xd7, 0x8d, 0xac, 0xc6, 0x99, + 0x51, 0x95, 0xf3, 0x37, 0xe6, 0xf9, 0xff, 0xab, 0x23, 0xd3, 0x40, 0x43, + 0x80, 0x1a, 0x7d, 0x19, 0x7b, 0x97, 0xb5, 0xfa, 0x8f, 0x64, 0x85, 0xa4, + 0xe3, 0xae, 0x37, 0x18, 0x58, 0x38, 0xd1, 0xc6, 0x85, 0x4b, 0x16, 0x03, + 0xae, 0x3f, 0xfd, 0x8e, 0xb3, 0xf4, 0x2a, 0x5f, 0xce, 0x11, 0x9b, 0xa1, + 0x5e, 0x3d, 0x6a, 0xb6, 0x30, 0x99, 0xb3, 0xb8, 0xf3, 0x6e, 0xed, 0x6e, + 0xee, 0xb9, 0x4b, 0x1a, 0x36, 0x67, 0x91, 0x70, 0x02, 0xec, 0x0c, 0xa5, + 0x55, 0xa1, 0x64, 0x29, 0x42, 0x7f, 0x39, 0x9a, 0x15, 0xa1, 0x20, 0x40, + 0x3f, 0x69, 0x4e, 0x97, 0xe3, 0xc3, 0x5c, 0x94, 0x3b, 0x59, 0x58, 0xb1, + 0x0d, 0x6b, 0xfd, 0x26, 0x84, 0x71, 0x60, 0xcf, 0x3a, 0xa3, 0x2c, 0x04, + 0x76, 0xbe, 0xe3, 0x0e, 0xeb, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x52, 0xaa, 0x01, 0x08, 0x01, 0x10, 0x00, + 0x1a, 0x81, 0x01, 0x04, 0xc2, 0x7a, 0x4c, 0xca, 0x5d, 0xda, 0xf5, 0xd2, + 0xd6, 0x6c, 0x67, 0x6e, 0x8f, 0x75, 0x26, 0x41, 0x36, 0xb3, 0xb3, 0xa6, + 0x1f, 0x2e, 0x98, 0xb7, 0x76, 0x7a, 0x63, 0x3d, 0x27, 0xf7, 0xef, 0x3c, + 0x46, 0x36, 0x44, 0x80, 0x93, 0x76, 0x1f, 0x2b, 0xda, 0xc5, 0x78, 0x76, + 0x24, 0x82, 0xba, 0x9d, 0xac, 0xb8, 0x6d, 0xe3, 0x38, 0x2e, 0x5c, 0x2a, + 0x25, 0x39, 0xff, 0x7b, 0x51, 0x5a, 0x9b, 0x53, 0xb4, 0xfb, 0x1b, 0x1d, + 0x8c, 0xe7, 0x16, 0xc9, 0x39, 0x40, 0xe3, 0xbe, 0x30, 0x85, 0x26, 0xdb, + 0x49, 0x78, 0x62, 0x50, 0x0e, 0x4d, 0xf4, 0x88, 0xc4, 0xcb, 0xb1, 0x75, + 0x50, 0xbe, 0x38, 0xa1, 0x57, 0x3b, 0x8c, 0xd0, 0xe9, 0xb2, 0x18, 0x8d, + 0x87, 0xdd, 0x31, 0x44, 0x89, 0xa7, 0x9d, 0x51, 0x74, 0x9c, 0xdc, 0xfe, + 0x39, 0x22, 0x37, 0xc7, 0xef, 0xd4, 0x41, 0x42, 0xac, 0xce, 0x3e, 0xa1, + 0x22, 0x20, 0xf8, 0x60, 0x88, 0xd5, 0xc2, 0x33, 0x6d, 0xb4, 0x92, 0x11, + 0x73, 0xbc, 0x51, 0xf9, 0x33, 0xd9, 0x65, 0x49, 0xba, 0xd8, 0x4a, 0x2e, + 0x96, 0x85, 0x1e, 0x3a, 0xdf, 0xdb, 0x6a, 0xce, 0x17, 0x41, 0x12, 0x80, + 0x02, 0x22, 0x5c, 0x2d, 0x62, 0xca, 0xea, 0x54, 0x08, 0xaf, 0x58, 0xc4, + 0x5e, 0xeb, 0xd9, 0x1a, 0xee, 0xf9, 0x30, 0x31, 0xff, 0x95, 0x18, 0x74, + 0xae, 0xe7, 0x67, 0x3f, 0x33, 0x19, 0xff, 0xf4, 0x0e, 0x69, 0x0c, 0xfc, + 0xd8, 0x81, 0x79, 0xa6, 0x02, 0x06, 0xc4, 0x14, 0x57, 0xf6, 0x8a, 0xd4, + 0xc9, 0x77, 0x50, 0x83, 0x05, 0x9b, 0xf7, 0xa6, 0x58, 0x7c, 0x68, 0x53, + 0x83, 0x7b, 0x47, 0x49, 0xbc, 0xbd, 0x4c, 0xb3, 0xff, 0x67, 0x4f, 0x48, + 0x10, 0xd7, 0x9a, 0x6b, 0x55, 0xe1, 0x17, 0x3d, 0x05, 0xdb, 0x62, 0x8e, + 0x5c, 0x11, 0xa7, 0xce, 0x71, 0xab, 0x78, 0xfe, 0x8e, 0x60, 0x9b, 0x53, + 0x6b, 0x02, 0xb9, 0xf8, 0x9b, 0x58, 0x47, 0x29, 0x8e, 0x0d, 0x8e, 0x57, + 0x27, 0xa5, 0x7f, 0xeb, 0x36, 0xc6, 0x61, 0x58, 0xd2, 0x20, 0x0e, 0x38, + 0xd5, 0x98, 0xdb, 0x5d, 0x71, 0xf5, 0x76, 0x80, 0x32, 0x44, 0xd6, 0x4c, + 0x02, 0x1f, 0xa6, 0xbb, 0xef, 0xc9, 0xe2, 0x1b, 0xfc, 0x35, 0x7b, 0xe4, + 0xc4, 0xfd, 0xf3, 0x26, 0x7b, 0xd3, 0xe2, 0xdf, 0x3d, 0x27, 0x8a, 0x7b, + 0x97, 0x0b, 0x5e, 0x72, 0x05, 0x2a, 0x27, 0x45, 0x7a, 0x2c, 0x59, 0x82, + 0x75, 0xd5, 0x65, 0x9d, 0x37, 0x3e, 0x34, 0xc3, 0x2d, 0x84, 0xfb, 0xe7, + 0xa7, 0xae, 0x4b, 0x1b, 0x54, 0x2d, 0xec, 0xfe, 0x82, 0x68, 0x94, 0xf7, + 0x58, 0x47, 0xfc, 0x89, 0xb3, 0xf3, 0x75, 0x8d, 0x46, 0xd6, 0x05, 0x3a, + 0xb9, 0xe6, 0xae, 0x72, 0x1a, 0xf9, 0x0e, 0x69, 0xd0, 0x56, 0x29, 0x14, + 0xa2, 0x0f, 0x20, 0xaa, 0x20, 0x99, 0xc1, 0x02, 0x7b, 0xa5, 0xb1, 0xcb, + 0x2e, 0xa7, 0x46, 0x63, 0x3f, 0x9f, 0x95, 0x63, 0xee, 0x69, 0x92, 0x7a, + 0xe2, 0xa3, 0x0d, 0xae, 0xc7, 0x09, 0xee, 0xab, 0xb4, 0x69, 0x7d, 0x1e, + 0x54, 0x1b, 0xfc, 0x09, 0xc0, 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, + 0x01, 0x12, 0x10, 0x65, 0x80, 0x2c, 0x9b, 0x62, 0x5e, 0x5a, 0x31, 0x9c, + 0x33, 0xdc, 0x1c, 0xb7, 0xc3, 0xc6, 0xd4, 0x18, 0xe3, 0xa5, 0xbd, 0xd0, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xb8, 0x05, 0x02, 0x04, 0x3c, 0x2a, 0x8a, 0x0f, 0xd8, 0xd2, 0x5c, + 0x61, 0x3e, 0x1e, 0x3e, 0x3b, 0x5e, 0x34, 0x9f, 0x33, 0x2f, 0x04, 0x51, + 0x6a, 0x75, 0x10, 0xd3, 0x80, 0x21, 0xa5, 0x62, 0x9b, 0x9a, 0xa0, 0x27, + 0xae, 0xad, 0x3c, 0x75, 0x9b, 0x7a, 0xfe, 0x70, 0xbe, 0xd6, 0x5f, 0x3d, + 0xf6, 0x86, 0x0f, 0xf5, 0xeb, 0x60, 0xb9, 0x83, 0xa3, 0xff, 0xa3, 0x3f, + 0xde, 0x06, 0xf3, 0xb7, 0x30, 0x14, 0xdf, 0xc8, 0x45, 0xab, 0x37, 0x1c, + 0x66, 0x00, 0x56, 0x2e, 0x9d, 0x90, 0x4f, 0x84, 0x2b, 0x8b, 0xa4, 0xa5, + 0xd9, 0x20, 0x0f, 0xfa, 0x3e, 0xd4, 0x5d, 0x70, 0x55, 0x20, 0xa5, 0xc3, + 0x72, 0xa8, 0x89, 0xf9, 0xe3, 0x14, 0x38, 0x62, 0x34, 0xc6, 0x89, 0x7a, + 0xe6, 0x55, 0x85, 0x1f, 0xcd, 0x9a, 0xdb, 0x4e, 0xf9, 0x12, 0x6c, 0x78, + 0x38, 0x6e, 0xa9, 0x3b, 0xcb, 0x25, 0xba, 0x3e, 0xc4, 0x75, 0xc5, 0x5c, + 0x60, 0x8e, 0x77, 0x1c, 0x76, 0x3a, 0xb0, 0x25, 0x06, 0xf9, 0xb0, 0x72, + 0x52, 0xd6, 0xab, 0xf7, 0xea, 0x64, 0xb1, 0xeb, 0xde, 0x7b, 0x95, 0xc6, + 0x40, 0x76, 0x90, 0x53, 0x3b, 0xd6, 0x89, 0x0b, 0x92, 0x74, 0xc1, 0x60, + 0x66, 0xf7, 0x4f, 0xc4, 0x01, 0xea, 0x35, 0x5f, 0x0a, 0x02, 0x10, 0x68, + 0x14, 0xd4, 0x9b, 0xf0, 0xc8, 0x9e, 0x6e, 0x1f, 0x8d, 0xb2, 0xa4, 0x78, + 0x41, 0xcd, 0x0d, 0xad, 0x79, 0x32, 0x96, 0xa1, 0x07, 0xc3, 0x62, 0x23, + 0x40, 0x4f, 0x2b, 0xf1, 0xfc, 0xa1, 0x6f, 0xd0, 0xa4, 0xb9, 0x82, 0x63, + 0x4d, 0xb6, 0x24, 0x07, 0xf8, 0xf1, 0x4a, 0xca, 0xe3, 0xb0, 0x5a, 0x03, + 0x8b, 0xd3, 0xe4, 0xbb, 0xba, 0xe4, 0x39, 0x1b, 0xbf, 0xa7, 0xa4, 0x7f, + 0xb9, 0xd0, 0x1d, 0xe8, 0x57, 0xea, 0x88, 0xe5, 0xe3, 0x6e, 0xe3, 0x6e, + 0x24, 0x58, 0x59, 0xfc, 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x12, 0x80, 0x03, 0x7e, 0x06, 0x58, 0x1a, 0x01, 0x91, 0x84, 0xab, + 0x57, 0x2a, 0xfd, 0xca, 0xdd, 0xd0, 0x3f, 0x16, 0x1c, 0xe6, 0x82, 0x00, + 0xf8, 0xe6, 0xf8, 0xad, 0x16, 0x19, 0x47, 0x36, 0x0b, 0xc8, 0xd4, 0x9c, + 0x0d, 0x68, 0x00, 0x9b, 0x1c, 0x46, 0x44, 0xf9, 0xb3, 0xf3, 0xfb, 0x6d, + 0xdf, 0xd9, 0x2e, 0xf9, 0x2d, 0xe6, 0x2d, 0x41, 0xd4, 0x59, 0xd2, 0x9d, + 0x81, 0xbf, 0xae, 0xf3, 0x97, 0x0a, 0x3a, 0x39, 0xd2, 0x5b, 0x26, 0x62, + 0xec, 0xb0, 0x3b, 0x2d, 0xa7, 0xb6, 0x83, 0x02, 0xfa, 0xa6, 0xdd, 0x98, + 0xd9, 0x5a, 0x14, 0x3c, 0xc8, 0xc1, 0xcb, 0x6a, 0xdd, 0xa7, 0x6d, 0x2e, + 0xe9, 0xc3, 0x72, 0x3f, 0xaf, 0x95, 0xa2, 0x9c, 0xdc, 0x3e, 0x96, 0x8b, + 0x68, 0x21, 0xa9, 0x1c, 0x05, 0x1c, 0xa2, 0x80, 0xa8, 0x66, 0x69, 0x71, + 0x0a, 0x1a, 0xd7, 0xa4, 0x4b, 0xf9, 0x21, 0x80, 0x27, 0x46, 0x0d, 0xf6, + 0x94, 0xe2, 0xe9, 0x27, 0x03, 0x96, 0xdf, 0x22, 0x19, 0x63, 0xf2, 0x1e, + 0xe6, 0xaa, 0x22, 0x0a, 0x5e, 0xe4, 0xa4, 0xd0, 0xfe, 0xb3, 0xd5, 0x3e, + 0xb5, 0x73, 0x2f, 0x8f, 0x91, 0xe9, 0xa9, 0x6b, 0x3b, 0x8b, 0xe2, 0x84, + 0xc5, 0x13, 0x39, 0xea, 0x28, 0x4d, 0x4d, 0x0e, 0xdd, 0x55, 0xb6, 0xad, + 0x56, 0xf7, 0x41, 0x64, 0x20, 0xe0, 0x5e, 0x05, 0x9f, 0x97, 0x34, 0xa9, + 0x6b, 0xe2, 0x5a, 0xa4, 0x45, 0x60, 0xdb, 0xa8, 0xc3, 0x87, 0x55, 0xa4, + 0x2a, 0x82, 0xbd, 0x7f, 0x88, 0xed, 0xd1, 0x9d, 0xf3, 0x46, 0xa6, 0x67, + 0xb3, 0x3b, 0x81, 0x14, 0xc7, 0x6a, 0x88, 0x38, 0xc4, 0x23, 0xd8, 0x24, + 0xa5, 0x0b, 0x23, 0x25, 0x1a, 0x08, 0x81, 0x36, 0xd6, 0xe8, 0xf4, 0x75, + 0x29, 0x9d, 0x2a, 0xfd, 0x46, 0xce, 0xa5, 0x1b, 0x5c, 0xbd, 0xf7, 0x89, + 0xa5, 0x72, 0x12, 0x5c, 0xd2, 0x4f, 0xbb, 0x81, 0x3b, 0x38, 0x7a, 0x10, + 0xcd, 0x2a, 0x30, 0xe3, 0x44, 0x76, 0x34, 0xab, 0x34, 0x08, 0xf9, 0x6b, + 0x9c, 0xf3, 0xd9, 0x88, 0x96, 0xd4, 0x05, 0xf3, 0xf5, 0x40, 0xd9, 0xc5, + 0x79, 0x62, 0x76, 0x0f, 0xcd, 0x17, 0x7c, 0xdd, 0x10, 0x1e, 0xb8, 0xa4, + 0x14, 0x8b, 0x9c, 0x29, 0xce, 0xd5, 0xea, 0xd6, 0x45, 0xa9, 0x5b, 0x69, + 0x8f, 0x1c, 0xdc, 0x6e, 0x1d, 0xb6, 0x67, 0x8b, 0x85, 0x07, 0x41, 0x86, + 0x08, 0x0d, 0x68, 0xd1, 0x3c, 0xd3, 0x7e, 0x07, 0xb1, 0x6d, 0xe3, 0x70, + 0xcd, 0x9a, 0xfb, 0x9b, 0x25, 0x56, 0x4a, 0x73, 0xa3, 0x0e, 0x2a, 0xf8, + 0x08, 0x5e, 0xa3, 0x7d, 0x31, 0x0c, 0x47, 0x4f, 0x0e, 0x67, 0xac, 0x00, + 0xca, 0x99, 0x2a, 0x52, 0x96, 0xfa, 0xed, 0xad, 0x7a, 0xa0, 0x6e, 0xcd, + 0x79, 0x0f, 0x1e, 0x3d, 0x42, 0x65, 0x58, 0xfa, 0x98, 0x38, 0x3e, 0x3c, + 0xd2, 0xed, 0x48, 0x30, 0x22, 0x04, 0xa1, 0x36, 0x08, 0x52, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +TEST_F(ODKGoldenProvisionV17, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x02, 0x00, + 0x11, 0x97, 0x5f, 0xe4, 0xee, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x02, 0x00, 0x11, + 0x97, 0x5f, 0xe4, 0xee, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x09, 0xec, 0x00, 0x00, 0x01, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xe6, 0x71, 0x29, 0x43, 0xec, 0xc7, 0x9d, 0xad, 0x9a, + 0x40, 0xf1, 0x14, 0x6d, 0x99, 0xe9, 0xae, 0x6f, 0xbf, 0x12, 0xaa, 0x6d, + 0x7b, 0x6d, 0x3e, 0xf4, 0x14, 0x3f, 0xd1, 0xbe, 0x0f, 0x33, 0x14, 0x3f, + 0x5b, 0x4c, 0x2c, 0xb7, 0xb8, 0xc8, 0xd0, 0x09, 0x7b, 0xe9, 0x07, 0xd3, + 0xb7, 0x59, 0x40, 0x2b, 0xd0, 0x88, 0x93, 0x02, 0x5b, 0xa9, 0x9b, 0xdc, + 0xa2, 0x7a, 0xd0, 0x89, 0xa7, 0x21, 0x30, 0x05, 0xa9, 0xac, 0xe4, 0xa1, + 0x39, 0xf3, 0xe1, 0xf9, 0x37, 0x17, 0xbc, 0xfa, 0xd0, 0x12, 0x7d, 0xa8, + 0x1d, 0x26, 0x14, 0xd5, 0xc4, 0x4d, 0x99, 0x07, 0x92, 0xac, 0x3f, 0x53, + 0x82, 0x96, 0xec, 0x47, 0x94, 0x54, 0x33, 0x3e, 0x9c, 0xab, 0x5b, 0xa0, + 0xff, 0x3c, 0x7d, 0x64, 0xa5, 0x0f, 0x52, 0x35, 0xb8, 0x66, 0x5a, 0x63, + 0xdc, 0xd7, 0xe2, 0x3e, 0x48, 0xf6, 0x30, 0x6a, 0x60, 0x7d, 0xa8, 0x4e, + 0x38, 0x45, 0x0f, 0x6a, 0xd5, 0xbb, 0xc8, 0x23, 0x5e, 0x3c, 0xfd, 0xdf, + 0x76, 0x40, 0x6a, 0x1d, 0x6f, 0xae, 0x45, 0x9d, 0x7f, 0x1b, 0x4b, 0xb2, + 0xd3, 0x89, 0x63, 0xeb, 0xb4, 0x44, 0x22, 0x2c, 0x1a, 0x3f, 0x19, 0x07, + 0x95, 0x2c, 0xf8, 0xa0, 0xc2, 0xa0, 0xd4, 0x02, 0xf0, 0x26, 0x89, 0x21, + 0x27, 0x24, 0x4d, 0x50, 0x24, 0x3c, 0x28, 0xfe, 0x96, 0x00, 0x3e, 0xfc, + 0x40, 0xf2, 0x15, 0x83, 0x37, 0x35, 0x2e, 0xfa, 0x2d, 0xff, 0x7b, 0x53, + 0xff, 0xad, 0x06, 0xf3, 0x18, 0xc0, 0xdd, 0xc3, 0xeb, 0x0c, 0x0d, 0x74, + 0x60, 0x37, 0xaa, 0xd0, 0x2a, 0x1d, 0xeb, 0x97, 0xe2, 0x82, 0xd2, 0x7c, + 0x96, 0xa2, 0x6e, 0x53, 0x89, 0xb4, 0x74, 0xbe, 0x7d, 0xc7, 0x9c, 0x81, + 0x16, 0xe0, 0x44, 0xd1, 0xe4, 0xfe, 0xba, 0x58, 0xc7, 0x26, 0xd3, 0x0f, + 0x25, 0x2f, 0x8c, 0xc1, 0x59, 0x9f, 0xd6, 0xe8, 0xe3, 0xa4, 0x7d, 0x0a, + 0x73, 0xa5, 0xc5, 0xb5, 0x32, 0x21, 0xde, 0x47, 0xba, 0xec, 0x5b, 0x6f, + 0x82, 0x22, 0x7b, 0x74, 0xf1, 0x86, 0x22, 0x20, 0xed, 0xf6, 0xec, 0xc2, + 0x30, 0xd5, 0x77, 0xdf, 0x55, 0xd6, 0x8a, 0xee, 0x34, 0x0d, 0xbc, 0xc7, + 0xb0, 0x11, 0x03, 0xf8, 0xd9, 0x57, 0x0a, 0x96, 0x2c, 0xe0, 0x13, 0xc4, + 0x59, 0x47, 0x80, 0x89, 0x47, 0x38, 0x5d, 0x22, 0x51, 0x13, 0xa6, 0x08, + 0x36, 0x0d, 0x2b, 0x02, 0xa3, 0xab, 0xca, 0xe2, 0x80, 0xfc, 0x3a, 0x05, + 0xa6, 0x7e, 0xb5, 0x56, 0xd9, 0x42, 0x9d, 0x0f, 0xfd, 0xfc, 0x98, 0xf8, + 0xfa, 0x9c, 0x28, 0xc3, 0xfa, 0x3f, 0x2f, 0x08, 0x68, 0x6a, 0xb9, 0xdb, + 0x7a, 0x8b, 0x6b, 0x78, 0x5a, 0x69, 0xaf, 0x93, 0x2b, 0xbd, 0xdd, 0x0b, + 0x07, 0x1e, 0xf3, 0x4e, 0x28, 0xa0, 0x32, 0xcb, 0xcf, 0xaa, 0xd1, 0xa8, + 0x12, 0xfb, 0xc6, 0x10, 0xdc, 0x1c, 0x37, 0x0a, 0x7e, 0xcc, 0x98, 0x0f, + 0x84, 0xe7, 0x07, 0xe1, 0x36, 0x5d, 0x83, 0x12, 0x76, 0xf4, 0x3f, 0xa4, + 0xb9, 0x39, 0x60, 0xf8, 0x79, 0x10, 0x9f, 0x2f, 0x91, 0xb0, 0xfc, 0xac, + 0x25, 0xa0, 0x70, 0x80, 0x3b, 0x03, 0xca, 0x4c, 0x4f, 0xb8, 0xa2, 0x1a, + 0xe5, 0xe6, 0xd8, 0x81, 0x12, 0x34, 0xc0, 0x18, 0x8b, 0xfa, 0x5f, 0xa5, + 0x0a, 0xe4, 0x4f, 0x09, 0x67, 0xf2, 0x8f, 0x5c, 0x81, 0xe9, 0xd2, 0x42, + 0x89, 0xc0, 0x5d, 0xba, 0x17, 0xa5, 0x58, 0xa5, 0x8f, 0xa4, 0x5c, 0x99, + 0x08, 0x5c, 0xee, 0x1c, 0xe0, 0xb6, 0xbc, 0xb5, 0x63, 0x15, 0xf3, 0x03, + 0x06, 0x1a, 0x05, 0x16, 0x93, 0x63, 0x57, 0xf0, 0xde, 0x14, 0x82, 0xf0, + 0xa8, 0xf5, 0xcc, 0x79, 0x3b, 0x42, 0x31, 0x08, 0x34, 0xc8, 0x36, 0x51, + 0x72, 0x45, 0xcb, 0x5b, 0xd1, 0xd9, 0x63, 0xd0, 0xe4, 0x9d, 0x27, 0xdd, + 0x98, 0x40, 0x01, 0xff, 0x62, 0xc2, 0xec, 0x7b, 0x2a, 0x2e, 0x12, 0x4f, + 0xb5, 0x61, 0x70, 0xee, 0x7c, 0xcd, 0xd9, 0xf6, 0xc1, 0x53, 0x83, 0x9a, + 0x45, 0x3c, 0xda, 0xfe, 0x98, 0x2c, 0x30, 0x85, 0x9e, 0xb3, 0xc7, 0x74, + 0x36, 0x98, 0x82, 0x78, 0xc2, 0x11, 0x3e, 0xd7, 0x10, 0xab, 0x31, 0x2e, + 0x6b, 0xc4, 0x33, 0x4d, 0x7f, 0x70, 0x38, 0xb2, 0x4b, 0x20, 0xbc, 0x65, + 0xcf, 0x6a, 0xa1, 0x12, 0xb0, 0x50, 0xf7, 0x98, 0x3e, 0xc9, 0x7b, 0x97, + 0xf6, 0x5c, 0x5c, 0xbe, 0x9e, 0xe5, 0x8b, 0xb0, 0xc7, 0x27, 0x78, 0xc3, + 0x87, 0x8b, 0xe5, 0x33, 0xee, 0x8e, 0x00, 0x04, 0xf6, 0xda, 0x90, 0x21, + 0x7d, 0xa0, 0x85, 0x9d, 0x55, 0xdc, 0x10, 0x11, 0x28, 0x91, 0x2c, 0x7b, + 0xf8, 0x09, 0x51, 0xed, 0x13, 0x51, 0xb1, 0x1d, 0x88, 0x94, 0x85, 0x6c, + 0x55, 0xaf, 0x2b, 0x64, 0xec, 0xe0, 0x6a, 0xa0, 0x4f, 0xe9, 0x97, 0x74, + 0x68, 0x84, 0xaf, 0x59, 0xf7, 0xf3, 0x60, 0xd6, 0x63, 0xde, 0x9f, 0xce, + 0xc9, 0x55, 0xb4, 0xe6, 0x60, 0xc6, 0x85, 0xe7, 0x8f, 0x67, 0xc5, 0xd0, + 0xf5, 0xf9, 0xb1, 0x90, 0x8b, 0x63, 0x44, 0xaf, 0x03, 0x05, 0x5e, 0xa9, + 0x70, 0x20, 0xae, 0x5e, 0xa9, 0xc6, 0x5f, 0x41, 0x5a, 0x86, 0x75, 0x28, + 0x1b, 0x00, 0x46, 0x58, 0x67, 0xe5, 0xb0, 0x3b, 0xc1, 0xf5, 0x44, 0xf8, + 0x19, 0x40, 0x8e, 0xe9, 0x9b, 0x58, 0xa3, 0xd0, 0xac, 0x4b, 0x8b, 0xb9, + 0x9f, 0xec, 0x23, 0x92, 0xcb, 0xa2, 0xfd, 0x88, 0x34, 0x46, 0x48, 0xcc, + 0x05, 0xb3, 0xb6, 0x83, 0x2a, 0xbe, 0xbe, 0x7c, 0xd6, 0x4e, 0x5d, 0x67, + 0x53, 0x8b, 0xc9, 0xa4, 0xd0, 0xde, 0xd8, 0xea, 0xdd, 0x7c, 0x8f, 0x94, + 0xe6, 0x16, 0xa1, 0x4b, 0xe7, 0xb7, 0xe4, 0x71, 0x76, 0x4c, 0x40, 0x8a, + 0xd3, 0xb9, 0x70, 0x18, 0x9e, 0x57, 0xa6, 0x5e, 0x19, 0xbe, 0xdd, 0x5d, + 0x51, 0x29, 0x02, 0x83, 0xfd, 0x59, 0x1d, 0xc9, 0x31, 0x6d, 0x86, 0x5c, + 0x24, 0xb7, 0x03, 0xf1, 0x33, 0xa4, 0x55, 0xec, 0x3b, 0x24, 0x3a, 0xe6, + 0x3e, 0x13, 0x87, 0xde, 0x36, 0x3e, 0x51, 0x82, 0x77, 0x01, 0x0a, 0x30, + 0x1a, 0x66, 0x43, 0x5e, 0x39, 0x11, 0xf4, 0x1d, 0xd3, 0x5e, 0x47, 0x3c, + 0xd7, 0x47, 0x9e, 0x9c, 0xb7, 0xee, 0x84, 0xe9, 0xcc, 0x0b, 0x40, 0x2d, + 0xa0, 0x72, 0x5b, 0x77, 0xd2, 0xca, 0x0f, 0xd8, 0x8b, 0x24, 0xae, 0x4e, + 0x01, 0xcd, 0xed, 0xdc, 0x1d, 0x68, 0xa1, 0xd2, 0xbf, 0x92, 0xa1, 0x3a, + 0x8f, 0xc9, 0x42, 0xfa, 0xc2, 0x66, 0x20, 0xbd, 0xc0, 0x4d, 0x58, 0x2b, + 0x52, 0x2e, 0x0d, 0xc4, 0xec, 0xec, 0xdf, 0x3c, 0xc6, 0x05, 0x6c, 0x5b, + 0xc6, 0x09, 0x95, 0xa5, 0x77, 0x4b, 0x5d, 0x63, 0xdb, 0xec, 0x06, 0xf1, + 0x39, 0x2e, 0x2c, 0x5b, 0x5d, 0xe1, 0x96, 0x02, 0x06, 0x20, 0x17, 0xf5, + 0x84, 0x01, 0x95, 0xea, 0xf0, 0x9f, 0x0e, 0x71, 0x10, 0x7c, 0x8a, 0x29, + 0x15, 0xed, 0xee, 0x66, 0x80, 0x84, 0x4c, 0xdc, 0xa4, 0xd2, 0x1a, 0x3c, + 0x05, 0x85, 0x5c, 0xb2, 0x43, 0x14, 0x2b, 0x11, 0xd4, 0x12, 0xf3, 0xbd, + 0xf4, 0x37, 0x90, 0x37, 0x7f, 0x4e, 0x8a, 0x84, 0x2c, 0x73, 0xd2, 0x60, + 0x63, 0xb6, 0xd4, 0x1b, 0xc2, 0xaf, 0x28, 0x48, 0x94, 0x4f, 0x2d, 0xd7, + 0x59, 0x89, 0xc6, 0x34, 0xe8, 0x27, 0xb2, 0xa5, 0x57, 0x89, 0x4e, 0x53, + 0xf1, 0xe5, 0x62, 0xb0, 0x37, 0xc7, 0x91, 0x75, 0x2f, 0xa5, 0x5e, 0x7b, + 0xce, 0xdb, 0xdc, 0xd0, 0x29, 0x63, 0x8f, 0x86, 0x6f, 0x1a, 0xf0, 0x67, + 0x39, 0x3c, 0x2b, 0x2c, 0xdf, 0x73, 0xd7, 0xaa, 0x07, 0x9b, 0x17, 0x48, + 0x11, 0xf2, 0x77, 0xbd, 0x01, 0x32, 0x94, 0x38, 0x2d, 0x08, 0x1b, 0x44, + 0xcb, 0xa3, 0x9c, 0x60, 0x11, 0xd6, 0x71, 0x1f, 0x3c, 0x38, 0x6d, 0x46, + 0xd0, 0xe6, 0x23, 0x75, 0x4e, 0xe4, 0x28, 0xa7, 0x9e, 0x6c, 0xe9, 0xc7, + 0x1d, 0x47, 0x65, 0x13, 0xd5, 0xd4, 0x71, 0xf1, 0xc8, 0x20, 0xf9, 0x4f, + 0xbf, 0x1c, 0x83, 0xf0, 0x50, 0xd5, 0xe9, 0x31, 0x99, 0xa4, 0x0a, 0x00, + 0xe9, 0xf0, 0xd1, 0x7c, 0xa6, 0x42, 0x68, 0x60, 0x37, 0xd7, 0xad, 0x34, + 0xf9, 0x97, 0xfd, 0xf1, 0x83, 0x35, 0xc4, 0x6b, 0x96, 0x6a, 0xce, 0xac, + 0x17, 0x29, 0x67, 0x8f, 0x4c, 0x89, 0xaa, 0x9c, 0x8c, 0x53, 0x06, 0x52, + 0xac, 0x3c, 0x4d, 0x05, 0x11, 0x73, 0x15, 0x09, 0xb9, 0x3d, 0x19, 0xbb, + 0x8e, 0xae, 0xae, 0x79, 0xab, 0x4d, 0x6e, 0xd2, 0xfb, 0x85, 0x01, 0x1d, + 0x0e, 0x1e, 0x17, 0xb4, 0x8e, 0x1b, 0x04, 0x76, 0x6d, 0x22, 0x5d, 0x51, + 0xdb, 0xa7, 0xc5, 0x74, 0x05, 0xe3, 0xc6, 0xa9, 0xab, 0xa8, 0x6a, 0x21, + 0xc4, 0x43, 0x23, 0xbc, 0xf7, 0xca, 0xf2, 0x12, 0x88, 0x76, 0xbb, 0x18, + 0xba, 0x5b, 0xaa, 0x84, 0x9b, 0x54, 0xcb, 0x15, 0x9f, 0x75, 0xa6, 0x07, + 0xc1, 0x2f, 0x4a, 0xdc, 0x0f, 0x94, 0xfb, 0x23, 0xbd, 0x4f, 0x60, 0x2d, + 0x13, 0xea, 0x78, 0x39, 0x0d, 0x77, 0xd0, 0xb5, 0x48, 0xa2, 0x3b, 0x27, + 0x4d, 0xb3, 0x50, 0xb6, 0xaf, 0xdf, 0xa9, 0x4a, 0xfb, 0x0c, 0x86, 0x7b, + 0x3a, 0x79, 0xd7, 0xb4, 0xa0, 0xa7, 0x3d, 0xf9, 0xd3, 0x20, 0xdd, 0x12, + 0x10, 0xc5, 0x6a, 0x79, 0xb2, 0xad, 0x9f, 0x05, 0x8d, 0x16, 0x18, 0xea, + 0xd0, 0x8c, 0x2a, 0x3f, 0xdc, 0x1a, 0xfb, 0x09, 0x0a, 0xbe, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x35, 0x7f, 0x7a, 0xfa, 0x7d, 0x33, 0x42, 0x33, 0x1c, + 0x8c, 0xd1, 0x07, 0xdd, 0xc7, 0x5a, 0x96, 0x18, 0xfb, 0xc8, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xe0, 0x6f, 0x39, 0x4c, 0xe6, 0x8a, 0x6d, 0x01, 0x07, 0x30, 0xa5, + 0x99, 0xc6, 0x54, 0x56, 0x3d, 0x7e, 0xff, 0xf5, 0xb7, 0x36, 0xbc, 0x59, + 0x87, 0x89, 0xbc, 0x8a, 0x88, 0x57, 0xfc, 0xaa, 0x6c, 0x48, 0xbc, 0xb4, + 0x63, 0xf1, 0xe4, 0xd7, 0x65, 0x0c, 0xda, 0x79, 0xe0, 0xd0, 0x24, 0xed, + 0x14, 0x58, 0x93, 0xc2, 0x9a, 0xd4, 0xde, 0x77, 0x81, 0x7d, 0x89, 0x42, + 0x32, 0xca, 0x9c, 0x29, 0x2a, 0xec, 0x9b, 0x0a, 0xc7, 0xe3, 0x47, 0xba, + 0x09, 0x92, 0xbb, 0xd0, 0xca, 0x99, 0xb8, 0x7d, 0xac, 0xf0, 0x79, 0x6d, + 0xf0, 0x31, 0x64, 0x76, 0x92, 0x6c, 0x1e, 0xd4, 0x9b, 0xff, 0x33, 0x49, + 0x5b, 0xd4, 0x2a, 0x77, 0xea, 0x84, 0x5b, 0x15, 0xe6, 0xff, 0x4b, 0x3b, + 0x56, 0xae, 0x55, 0x93, 0xbf, 0x0e, 0x4f, 0x66, 0x2d, 0x7a, 0xcb, 0x6a, + 0x70, 0x1d, 0x30, 0x94, 0x74, 0x8c, 0x55, 0xe4, 0x76, 0xdc, 0xa9, 0x8c, + 0x08, 0x30, 0x91, 0x26, 0xbd, 0xe2, 0x4e, 0x2a, 0xfa, 0xbf, 0x1a, 0x38, + 0x64, 0xf9, 0xcd, 0x36, 0x32, 0x59, 0xe8, 0x69, 0x2d, 0xbf, 0xba, 0xc0, + 0xed, 0x4a, 0xb8, 0x1f, 0x4e, 0x77, 0x4a, 0x25, 0xea, 0x53, 0xcc, 0x04, + 0xb1, 0xd9, 0x63, 0x62, 0xb1, 0x53, 0x72, 0x8a, 0x1f, 0x70, 0x87, 0x63, + 0x03, 0x72, 0x59, 0x4d, 0x49, 0xd5, 0x99, 0x46, 0xb7, 0xbc, 0x1b, 0xe7, + 0x1f, 0x58, 0x19, 0x83, 0x8e, 0x7b, 0x39, 0x27, 0x29, 0xe7, 0x6f, 0x40, + 0x89, 0xd1, 0xa3, 0x26, 0xc6, 0xf6, 0xb6, 0x5e, 0xe2, 0x5a, 0xc7, 0x2f, + 0x6d, 0xa4, 0xc9, 0x31, 0xd5, 0xcf, 0xe2, 0x3d, 0x0f, 0x05, 0x60, 0xd1, + 0x77, 0xed, 0xd1, 0x4c, 0xeb, 0x08, 0x7c, 0x64, 0xfb, 0x95, 0x78, 0x88, + 0xe6, 0x86, 0x00, 0x83, 0x22, 0xff, 0xdf, 0xc4, 0x1b, 0xaa, 0xe6, 0xe0, + 0x7e, 0xdc, 0x97, 0x62, 0xef, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x12, 0x80, 0x02, 0x6a, 0xb0, 0x72, 0xec, + 0xba, 0xb9, 0xbd, 0x9e, 0x85, 0x38, 0x76, 0xad, 0xc1, 0x58, 0xd4, 0x71, + 0xd6, 0x99, 0xc8, 0x7b, 0x75, 0x69, 0x09, 0xb3, 0x1e, 0x8b, 0x3d, 0xb0, + 0x06, 0x16, 0xcb, 0x84, 0x79, 0xc7, 0x7f, 0xc4, 0x68, 0x38, 0xbc, 0xa7, + 0xd4, 0xee, 0x7b, 0x04, 0xf7, 0x94, 0x72, 0xae, 0xe2, 0x5c, 0x0d, 0x37, + 0x2d, 0x78, 0xfd, 0xa7, 0xd7, 0xac, 0xa2, 0x08, 0x50, 0x90, 0xc0, 0x50, + 0x06, 0x9d, 0x2a, 0xba, 0xb1, 0xc1, 0x71, 0x49, 0xcd, 0x2e, 0x3c, 0x68, + 0x53, 0x0b, 0x23, 0xdf, 0x85, 0xc0, 0x4e, 0x4f, 0x8f, 0x42, 0x6b, 0x18, + 0x55, 0xbc, 0x88, 0x23, 0xff, 0xe0, 0x51, 0xac, 0xa8, 0xc7, 0xf2, 0xa7, + 0x28, 0xaf, 0x89, 0x2c, 0x02, 0x9e, 0xf1, 0xec, 0xf4, 0x04, 0x05, 0x7b, + 0x43, 0x3e, 0x28, 0x01, 0x17, 0xa1, 0x11, 0x9c, 0x98, 0xd5, 0x93, 0xf7, + 0x9a, 0xd3, 0x68, 0xcf, 0x75, 0x05, 0x52, 0x57, 0xea, 0x3f, 0xc0, 0x9b, + 0x63, 0x04, 0x9b, 0x8a, 0x66, 0x04, 0xe8, 0x7e, 0xb7, 0xda, 0x1b, 0xae, + 0x5c, 0x12, 0x5a, 0x1e, 0xa1, 0x00, 0x3d, 0xc0, 0x69, 0x26, 0x55, 0x39, + 0x0f, 0x50, 0x9c, 0x11, 0x76, 0xcc, 0x31, 0x4e, 0x51, 0x91, 0xae, 0xfc, + 0x94, 0x05, 0x5e, 0xa6, 0xe5, 0x85, 0xcc, 0x36, 0x22, 0x2e, 0xda, 0x7c, + 0x16, 0x40, 0xdf, 0xdd, 0x24, 0xec, 0x9d, 0x10, 0x9f, 0x3d, 0x65, 0xdc, + 0x00, 0x94, 0xf9, 0x0e, 0x36, 0x93, 0xb8, 0xa3, 0x8c, 0x30, 0xf5, 0xfb, + 0x94, 0x8e, 0xce, 0x34, 0xb6, 0xc8, 0xef, 0xe3, 0x10, 0x64, 0xc4, 0x29, + 0x51, 0xf9, 0x4f, 0x46, 0x46, 0x5b, 0x2f, 0x83, 0x42, 0xe4, 0x24, 0x63, + 0xff, 0xac, 0xec, 0x8e, 0x13, 0xad, 0x99, 0x24, 0xad, 0x58, 0xab, 0x61, + 0xfb, 0xd0, 0xda, 0xca, 0x48, 0xd4, 0xb1, 0xbf, 0x30, 0x04, 0xb0, 0x27, + 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, 0x01, 0x12, 0x10, 0x6b, 0x99, + 0x4c, 0x4a, 0x94, 0x73, 0x2e, 0x0c, 0x81, 0xca, 0xcc, 0x34, 0x71, 0xcf, + 0x8a, 0x63, 0x18, 0xe1, 0xa7, 0xbd, 0xd0, 0x05, 0x22, 0x8e, 0x02, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbc, 0xfa, 0x43, 0x1b, + 0xaa, 0xbb, 0xd9, 0xb7, 0x5b, 0xb8, 0xec, 0xf6, 0xf0, 0xb6, 0xb1, 0xa6, + 0xc3, 0xd1, 0x45, 0xb8, 0x6e, 0x40, 0x85, 0xa0, 0xcf, 0x24, 0x68, 0x91, + 0xc2, 0x45, 0x8d, 0x4e, 0xf2, 0x42, 0x9e, 0xaa, 0x72, 0xed, 0x86, 0xdc, + 0xfb, 0x85, 0x29, 0x3f, 0x90, 0xb0, 0xc5, 0x12, 0x4e, 0x42, 0x0b, 0xce, + 0xfa, 0x0f, 0x83, 0x1a, 0x4c, 0xe9, 0xc9, 0xc1, 0x0b, 0x12, 0xeb, 0xc7, + 0xc5, 0x1a, 0xd5, 0xa1, 0x8d, 0x26, 0x6d, 0x78, 0x87, 0x2d, 0xc2, 0x63, + 0x84, 0x6c, 0x5e, 0x78, 0xd8, 0x0a, 0x78, 0x68, 0xc2, 0x82, 0x40, 0x0a, + 0xf7, 0x02, 0x63, 0x97, 0xec, 0x1c, 0x08, 0x91, 0x2b, 0xc2, 0xa7, 0xe9, + 0x17, 0xb8, 0x7b, 0x84, 0xed, 0xdc, 0x5c, 0x6c, 0x11, 0x38, 0xb4, 0x18, + 0xff, 0x11, 0x32, 0xd4, 0x34, 0x48, 0xc0, 0xa0, 0x47, 0x2d, 0x81, 0xe2, + 0xb6, 0x41, 0xe9, 0xd4, 0x5a, 0xf1, 0x75, 0x3d, 0x94, 0xf7, 0xb7, 0xf6, + 0x3b, 0x35, 0x78, 0x9c, 0x72, 0x7b, 0x12, 0xe0, 0x73, 0xd9, 0x92, 0x3d, + 0x23, 0xe6, 0xa2, 0x50, 0x95, 0xcc, 0xbc, 0x8b, 0xef, 0xa3, 0x09, 0x85, + 0x85, 0xb8, 0x74, 0xa8, 0x10, 0xab, 0x0a, 0x18, 0x35, 0x7d, 0x27, 0x5c, + 0x6a, 0x52, 0x0e, 0x5b, 0xb9, 0xa9, 0x2c, 0xee, 0xdf, 0x6e, 0xa3, 0x49, + 0xbf, 0x32, 0x3a, 0x6a, 0xe2, 0x72, 0xe4, 0xdd, 0x6f, 0xfb, 0x89, 0xf3, + 0xdf, 0xa6, 0x4a, 0x52, 0x8a, 0x9d, 0xd5, 0x49, 0x04, 0x33, 0xd2, 0xa2, + 0xca, 0x74, 0x3b, 0x2c, 0x34, 0xf1, 0x12, 0x2f, 0x85, 0xc3, 0x3c, 0x4f, + 0x73, 0x1f, 0x2c, 0x8a, 0xd2, 0x6f, 0xa4, 0xb7, 0x91, 0xf9, 0x5f, 0x79, + 0x04, 0x9c, 0x69, 0xe6, 0x62, 0xab, 0x15, 0x91, 0x23, 0x0e, 0x62, 0xbc, + 0x80, 0x1f, 0x97, 0x5f, 0x33, 0xe7, 0x33, 0x9e, 0x91, 0xf6, 0xdc, 0xfb, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, 0x3d, 0x12, 0x80, 0x03, 0x0e, + 0x78, 0x2b, 0x14, 0x53, 0x5c, 0x82, 0x9a, 0x00, 0x8d, 0x49, 0x18, 0x5e, + 0x21, 0xb6, 0xfb, 0xeb, 0xa7, 0xee, 0x10, 0x26, 0x75, 0x6f, 0xcd, 0x45, + 0xe8, 0x64, 0x72, 0x56, 0x9e, 0x39, 0x3d, 0x7e, 0x6a, 0x70, 0x5d, 0xf1, + 0x4a, 0xc0, 0x23, 0x66, 0x07, 0x04, 0x4c, 0x8d, 0x18, 0xf7, 0xa7, 0xc5, + 0xc3, 0x18, 0x3f, 0x72, 0xf4, 0xfd, 0xad, 0xb5, 0xc6, 0x8b, 0x77, 0x2e, + 0x20, 0xfb, 0xe4, 0x7b, 0xef, 0x79, 0xef, 0xcd, 0x7f, 0x21, 0x9c, 0x32, + 0xcf, 0xf4, 0xc8, 0xee, 0xfa, 0x81, 0x38, 0x7e, 0x36, 0xec, 0xdd, 0x29, + 0x94, 0xc3, 0xb7, 0x25, 0x6e, 0x77, 0x90, 0x81, 0xbe, 0x6c, 0x16, 0x75, + 0x83, 0x33, 0x41, 0x78, 0x74, 0xb3, 0x54, 0xa4, 0xe6, 0x1c, 0x95, 0xa2, + 0x1c, 0x2b, 0x93, 0x6c, 0xb7, 0xd3, 0x37, 0x31, 0x57, 0xa8, 0x95, 0xce, + 0x0e, 0x16, 0xc0, 0xbb, 0x4e, 0x23, 0xca, 0x23, 0x2a, 0x66, 0x4c, 0xe5, + 0xac, 0xc3, 0x0a, 0xe3, 0x31, 0x32, 0x53, 0xad, 0x2c, 0x70, 0x1d, 0x5a, + 0x20, 0x27, 0xf2, 0x6f, 0x0c, 0x53, 0x7b, 0x71, 0x77, 0x94, 0x5c, 0x28, + 0xc3, 0xf3, 0x3e, 0x48, 0x5f, 0x1a, 0xa2, 0x18, 0xf3, 0x53, 0xb4, 0xa5, + 0x3c, 0xb1, 0x9c, 0x67, 0x39, 0x68, 0x8d, 0xfa, 0x96, 0x8f, 0x6f, 0xdd, + 0x29, 0x35, 0xbc, 0x2c, 0x0d, 0xe5, 0xd7, 0xff, 0x25, 0x2d, 0xcd, 0x3f, + 0xdc, 0xb9, 0xa0, 0xaf, 0x5a, 0x41, 0x3c, 0xce, 0xa9, 0xab, 0x75, 0xee, + 0xf2, 0xbe, 0xee, 0xa8, 0x3b, 0x29, 0xaf, 0x07, 0xbf, 0x84, 0xbd, 0xdd, + 0xe3, 0x83, 0x42, 0xd5, 0x40, 0x8d, 0x39, 0xcf, 0x4d, 0xa9, 0xa3, 0x0c, + 0xd8, 0xbc, 0xfc, 0x32, 0xa5, 0x03, 0x63, 0x22, 0x82, 0xde, 0x3d, 0x1d, + 0xd9, 0x54, 0xd8, 0xcc, 0x57, 0x10, 0x8b, 0xbe, 0xc3, 0xae, 0x52, 0xbc, + 0xaf, 0x17, 0x62, 0xe7, 0x9f, 0x42, 0x75, 0xb8, 0x92, 0x7f, 0x61, 0xd8, + 0x08, 0x57, 0x40, 0x10, 0x2c, 0x85, 0x96, 0x97, 0x48, 0x14, 0xde, 0xb0, + 0x5f, 0xf9, 0xc6, 0xde, 0xfc, 0x25, 0x9c, 0x4d, 0x6e, 0x52, 0x54, 0xf0, + 0xa2, 0xa5, 0xfc, 0x32, 0x45, 0x75, 0x94, 0xbe, 0xe9, 0x57, 0x2a, 0xb8, + 0x6e, 0xab, 0x0f, 0xf5, 0x0c, 0x9a, 0xf9, 0x29, 0x06, 0x65, 0x54, 0xd8, + 0x93, 0x98, 0x3a, 0x5c, 0x71, 0x52, 0x0d, 0xf3, 0x4b, 0xc4, 0xc5, 0xbd, + 0x34, 0xb3, 0x58, 0xcf, 0x83, 0x94, 0xf0, 0x60, 0xb7, 0x91, 0x56, 0xff, + 0x21, 0x7d, 0x03, 0xeb, 0xc9, 0x09, 0x0c, 0x45, 0x6d, 0xa0, 0xaa, 0xd3, + 0x58, 0xc6, 0xea, 0x9d, 0x2c, 0xfc, 0xd3, 0x0a, 0x43, 0x62, 0x66, 0x4d, + 0xdc, 0x25, 0xe2, 0x7f, 0x7e, 0x39, 0x33, 0x82, 0x97, 0x30, 0xfe, 0xdd, + 0x4d, 0x64, 0x56, 0xff, 0xf1, 0x76, 0xc2, 0x78, 0x0b, 0xce, 0xb3, 0x22, + 0x04, 0xee, 0xe4, 0x5f, 0x97, 0x2a, 0x80, 0x02, 0xa4, 0xd4, 0xca, 0x05, + 0x61, 0xfc, 0x6d, 0xbb, 0x73, 0x76, 0xb0, 0x4e, 0xec, 0x7c, 0x7e, 0xdb, + 0xcc, 0x93, 0xa8, 0x8b, 0x0a, 0xb9, 0x80, 0x1b, 0xdb, 0x96, 0xa4, 0x02, + 0xac, 0xe9, 0x46, 0x7e, 0x88, 0x71, 0xb7, 0xe2, 0x37, 0x8b, 0x26, 0x64, + 0x27, 0xba, 0xb0, 0x29, 0x07, 0xdb, 0x80, 0x74, 0x3f, 0x36, 0xac, 0x95, + 0x13, 0xd7, 0xe1, 0x28, 0xe3, 0x07, 0x87, 0x90, 0xa7, 0xef, 0xe4, 0x24, + 0x54, 0x60, 0x01, 0x56, 0xdb, 0xab, 0xad, 0x43, 0x8b, 0xe5, 0x25, 0xa9, + 0x1f, 0xd7, 0x9d, 0x43, 0xe7, 0xf3, 0x27, 0x3c, 0xdf, 0xa3, 0xe8, 0xbc, + 0xb6, 0xe3, 0xa8, 0x9e, 0xaf, 0x17, 0xb1, 0x96, 0x45, 0x5d, 0x8a, 0x8b, + 0x48, 0xed, 0xa5, 0x4d, 0xfa, 0x51, 0xfa, 0x2f, 0x32, 0x60, 0x34, 0x1b, + 0xd8, 0xcf, 0xa5, 0xf9, 0x8f, 0x9e, 0xec, 0x0d, 0xd7, 0x00, 0xd8, 0x23, + 0xa4, 0x4f, 0x01, 0xa3, 0x3f, 0x17, 0x4e, 0x6e, 0x0f, 0x05, 0xd7, 0xc5, + 0xf2, 0xaa, 0x5a, 0x5c, 0x7a, 0x92, 0x04, 0xb1, 0xfb, 0x30, 0x45, 0x0a, + 0xed, 0x41, 0x37, 0x73, 0x92, 0x81, 0x62, 0x3f, 0x64, 0x29, 0x46, 0x56, + 0xc8, 0x9c, 0x86, 0xea, 0xf2, 0xd2, 0x17, 0x63, 0xac, 0xd8, 0x05, 0x78, + 0xa0, 0xfb, 0xbc, 0x2b, 0x8d, 0xde, 0xad, 0x8b, 0xcc, 0xc1, 0x52, 0x06, + 0x91, 0xb3, 0xae, 0x0c, 0x43, 0x6f, 0x86, 0xea, 0x03, 0xbd, 0x87, 0x0d, + 0x1f, 0xa9, 0xbf, 0x87, 0xce, 0xb4, 0x5b, 0x5e, 0x73, 0x55, 0x0e, 0x32, + 0xd9, 0x0d, 0x74, 0xf1, 0xcb, 0x67, 0x57, 0xe4, 0x8f, 0x29, 0x01, 0xb5, + 0x52, 0xe2, 0xc2, 0x4b, 0x4d, 0xc3, 0x5d, 0x62, 0x44, 0x17, 0x10, 0x2a, + 0x56, 0x64, 0x90, 0xf2, 0xd4, 0x98, 0x73, 0xaf, 0x1f, 0x4e, 0x77, 0xa8, + 0xa0, 0x61, 0xa5, 0x15, 0x63, 0x1e, 0x3a, 0x64, 0x1d, 0xcc, 0xa3, 0x4c, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x85, 0xaf, 0xcc, 0x86, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x95, 0x00, 0x02, 0x00, 0x11, + 0x85, 0xaf, 0xcc, 0x86, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x20, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x33, 0x46, 0x30, 0x44, 0x36, 0x41, 0x45, + 0x33, 0x36, 0x43, 0x41, 0x38, 0x37, 0x38, 0x36, 0x30, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x33, 0x46, 0x30, 0x44, 0x36, 0x41, 0x45, 0x33, 0x36, + 0x43, 0x41, 0x38, 0x37, 0x38, 0x36, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x5b, 0x7d, 0x63, 0x39, 0x95, 0x57, 0x37, 0x17, 0x5d, 0x8f, 0x47, 0x82, + 0x4d, 0x5a, 0xd7, 0xfd, 0x1a, 0x50, 0xda, 0x2c, 0x6d, 0xf5, 0xe8, 0x3b, + 0x27, 0x68, 0x51, 0xc1, 0xb3, 0x7e, 0x3f, 0xa3, 0x4e, 0xb3, 0xbf, 0x3a, + 0xd4, 0x66, 0xbf, 0xe1, 0x4e, 0x32, 0x1b, 0xf5, 0xf1, 0xaf, 0xab, 0xde, + 0x90, 0x4b, 0xfe, 0x35, 0x54, 0x35, 0x07, 0x17, 0xf1, 0x91, 0x83, 0x8e, + 0x40, 0xbc, 0xbf, 0xeb, 0x57, 0xd2, 0xd7, 0x75, 0x83, 0xf7, 0xce, 0x69, + 0xd8, 0x61, 0xe5, 0x19, 0x8a, 0x14, 0x5e, 0xb8, 0x1b, 0xc1, 0xbd, 0x27, + 0xf6, 0x71, 0xc0, 0x37, 0x13, 0x62, 0x9c, 0xa3, 0x66, 0xe0, 0x8b, 0xa8, + 0x98, 0x3c, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0x9a, 0x30, 0xb3, 0xb3, 0x48, 0xbb, 0x91, 0x31, 0x17, 0x06, + 0x3a, 0x4b, 0xd8, 0x5f, 0x67, 0x9a, 0x1a, 0x20, 0x1e, 0xe1, 0xb0, 0xa3, + 0xe4, 0x52, 0xf1, 0x00, 0xbd, 0x2b, 0x4c, 0xbd, 0xa9, 0x90, 0xd5, 0xf8, + 0x48, 0xdd, 0x42, 0x23, 0x19, 0x29, 0x08, 0xa8, 0x22, 0x2d, 0xad, 0x7a, + 0xed, 0x7b, 0x87, 0x16, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x85, 0xaf, 0xcc, 0x86, + 0x80, 0x00, 0x00, 0x00, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = false; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xbe, 0x81, 0x80, 0x1d, 0x00, 0x00, 0x00, 0x0a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x95, 0x00, 0x02, 0x00, 0x11, + 0xbe, 0x81, 0x80, 0x1d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x42, 0x30, 0x43, 0x46, 0x30, 0x31, 0x38, 0x34, + 0x34, 0x38, 0x39, 0x46, 0x34, 0x42, 0x33, 0x32, 0x30, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x30, 0x43, 0x46, 0x30, 0x31, 0x38, 0x34, 0x34, 0x38, + 0x39, 0x46, 0x34, 0x42, 0x33, 0x32, 0x30, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x4a, 0x71, 0xc4, 0xb2, 0xac, 0x76, + 0x5c, 0x21, 0xec, 0x3d, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0xaa, 0x99, 0x95, 0xa7, 0x4a, 0x28, 0x0f, 0x65, 0x1d, 0xfa, 0x03, 0x1d, + 0x6a, 0x4c, 0xb4, 0xcb, 0x1a, 0x50, 0x5b, 0xc5, 0x86, 0xe5, 0xfe, 0x26, + 0x71, 0x85, 0x08, 0x11, 0xf8, 0xcd, 0xeb, 0xaa, 0x9e, 0x99, 0x1c, 0xc2, + 0xbe, 0x20, 0x6b, 0x81, 0xf0, 0x5e, 0x36, 0xb6, 0x0b, 0x87, 0x6c, 0x69, + 0x27, 0x4e, 0x0b, 0x00, 0x56, 0x98, 0x48, 0x26, 0x32, 0x6c, 0xdc, 0x26, + 0x4a, 0x8a, 0xae, 0x81, 0x4f, 0x57, 0x6f, 0xf2, 0x88, 0xa6, 0xe4, 0xc7, + 0x20, 0x1b, 0x20, 0x5f, 0x00, 0x8c, 0xdb, 0xe2, 0xe7, 0x9a, 0x34, 0x4b, + 0xfa, 0xc6, 0x0d, 0xa2, 0xf9, 0x54, 0xb3, 0x08, 0x9d, 0x95, 0x78, 0xae, + 0xd2, 0x72, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0x83, 0x2f, 0x47, 0xdb, 0xea, 0xb7, 0xf0, 0xbe, 0xfb, 0x55, + 0x48, 0xd5, 0xa2, 0x68, 0x7d, 0x04, 0x1a, 0x20, 0xea, 0xec, 0x5f, 0x39, + 0xcc, 0x91, 0xe0, 0x34, 0x75, 0xa4, 0x4e, 0xe9, 0xef, 0xfa, 0x73, 0xb6, + 0x1e, 0xa9, 0x7b, 0xe3, 0x02, 0xc2, 0x1c, 0x89, 0x31, 0x1b, 0x5b, 0xf7, + 0xbe, 0x26, 0xe6, 0xc1, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x81, 0x80, 0x1d, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x78, 0x9a, 0x2d, 0xcd, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x02, 0x00, 0x11, + 0x78, 0x9a, 0x2d, 0xcd, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x42, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x54, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x66, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x44, 0x44, 0x39, 0x32, 0x30, 0x45, 0x43, 0x45, + 0x42, 0x37, 0x45, 0x33, 0x36, 0x36, 0x42, 0x45, 0x30, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x44, 0x39, 0x32, 0x30, 0x45, 0x43, 0x45, 0x42, 0x37, + 0x45, 0x33, 0x36, 0x36, 0x42, 0x45, 0x30, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc3, 0x52, 0xcf, 0xa8, 0x45, 0x4b, + 0xd8, 0x6e, 0x39, 0xc5, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x53, 0xa7, 0x22, 0x66, 0xaa, 0x89, 0x20, 0x19, 0xbd, 0x71, 0x5b, 0xae, + 0xbd, 0x0f, 0x63, 0x8b, 0x1a, 0x50, 0x23, 0xce, 0xb5, 0x0a, 0x10, 0x2f, + 0x61, 0x0e, 0x70, 0xa5, 0x5d, 0x0a, 0x26, 0xb3, 0xae, 0x59, 0x5a, 0x82, + 0xb8, 0xbf, 0x7c, 0x89, 0x3d, 0x13, 0xee, 0xb4, 0x00, 0x5f, 0x4e, 0x5b, + 0x67, 0xc4, 0x6b, 0x19, 0x79, 0x26, 0xbd, 0xbd, 0xcf, 0x19, 0xee, 0x77, + 0xa0, 0xab, 0x7c, 0xe3, 0x4c, 0xc1, 0x1a, 0x7b, 0xa0, 0x41, 0x89, 0x83, + 0x36, 0x61, 0xf0, 0x62, 0x28, 0x91, 0xb8, 0x68, 0x26, 0xe5, 0x80, 0xd1, + 0x13, 0x80, 0x8e, 0xe6, 0xfe, 0x09, 0x6f, 0x85, 0xdc, 0x48, 0x18, 0xfa, + 0x29, 0xd4, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0xfc, 0xf0, 0x03, 0xef, 0x56, 0xf1, 0x0b, 0x2f, 0x02, 0xcd, + 0xd6, 0xe2, 0x51, 0x24, 0xfb, 0x1b, 0x1a, 0x20, 0x29, 0xde, 0x86, 0x18, + 0x2a, 0x69, 0xc6, 0x7d, 0xcc, 0xde, 0xe9, 0x01, 0xf2, 0x7d, 0xec, 0xba, + 0x01, 0xf0, 0x34, 0x90, 0xf9, 0x86, 0x36, 0x60, 0xef, 0x56, 0xce, 0xfd, + 0x84, 0x1c, 0x97, 0xcc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x78, 0x9a, 0x2d, 0xcd, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x12, 0x10, 0x91, 0xa3, 0xd5, 0x6c, 0xf8, 0x2a, 0x49, 0xd4, + 0x36, 0x66, 0x34, 0x4d, 0x0b, 0xb9, 0xc4, 0x2b, 0x1a, 0x20, 0x41, 0xc9, + 0x72, 0xe3, 0x04, 0x4b, 0x5a, 0xac, 0x7f, 0x82, 0x4c, 0x63, 0xca, 0xb6, + 0xc9, 0xa0, 0x71, 0x89, 0x23, 0xd5, 0xdc, 0x9c, 0x00, 0x73, 0x45, 0xb6, + 0x6e, 0xe8, 0xd8, 0xfa, 0x33, 0x48, 0x20, 0x02, 0x28, 0x05, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x78, 0x9a, + 0x2d, 0xcd, 0x8c, 0x00, 0x40, 0x10, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, + 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xdc, 0x6b, 0x48, 0x20, 0x00, 0x00, 0x00, 0x10, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xdc, 0x6b, 0x48, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x39, 0x44, 0x46, 0x32, 0x35, 0x37, 0x46, 0x31, + 0x30, 0x45, 0x33, 0x44, 0x46, 0x35, 0x34, 0x31, 0x30, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x39, 0x44, 0x46, 0x32, 0x35, 0x37, 0x46, 0x31, 0x30, 0x45, + 0x33, 0x44, 0x46, 0x35, 0x34, 0x31, 0x30, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x28, 0x40, 0x00, 0x48, 0xf2, 0xcb, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x1a, 0x6f, + 0x35, 0xa2, 0xf4, 0x59, 0x0b, 0xec, 0x20, 0x47, 0x0d, 0x0b, 0x21, 0xda, + 0x89, 0x6b, 0x1a, 0x50, 0x06, 0x30, 0xb6, 0x4a, 0xf3, 0xc7, 0x96, 0x19, + 0x38, 0xab, 0x14, 0x6c, 0xba, 0xe4, 0xed, 0x27, 0x70, 0x4d, 0xef, 0x0f, + 0x8c, 0xf8, 0xcc, 0x2a, 0xd2, 0x38, 0x67, 0x81, 0xb6, 0xd2, 0x74, 0x76, + 0x6f, 0x86, 0x29, 0xfc, 0x91, 0x37, 0x04, 0x75, 0xfc, 0xd9, 0xaa, 0xd4, + 0xe6, 0x99, 0x6c, 0x62, 0xc4, 0xcb, 0x50, 0x7a, 0xb9, 0x4d, 0x1f, 0x8d, + 0x75, 0x1f, 0x85, 0x46, 0xcc, 0x94, 0xb0, 0x37, 0x3a, 0x71, 0x17, 0x52, + 0xa7, 0x77, 0x21, 0xda, 0xb5, 0xf0, 0x03, 0xad, 0x07, 0xab, 0xd8, 0xea, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x12, 0xf7, 0x07, 0x1c, 0x91, 0x6c, 0x7f, 0xb0, 0x37, 0xc4, 0xf5, 0x6b, + 0x76, 0xdd, 0xf0, 0x16, 0x1a, 0x20, 0x9e, 0x6b, 0xac, 0xc8, 0xa6, 0x7e, + 0x84, 0x01, 0x05, 0x90, 0x59, 0xc2, 0x6b, 0xa0, 0x26, 0xd7, 0x24, 0x4f, + 0xf3, 0xee, 0x47, 0x01, 0x88, 0x73, 0x0f, 0x7c, 0x7c, 0x6e, 0x24, 0x95, + 0x7c, 0xd2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x61, 0xa6, 0x60, 0xf4, 0x6e, 0xfe, 0xbf, 0xaf, 0x91, 0xba, + 0x2f, 0xc0, 0x99, 0x84, 0x31, 0x8b, 0x1a, 0x20, 0xa6, 0x0d, 0xf5, 0x64, + 0x17, 0xe3, 0x22, 0x28, 0x3b, 0xdd, 0x33, 0xb2, 0x38, 0x80, 0xcc, 0x10, + 0x00, 0xb9, 0x3e, 0xf5, 0x05, 0x2e, 0xb4, 0xcb, 0x20, 0xa5, 0x22, 0xd6, + 0xc9, 0xa9, 0xbc, 0x46, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xc2, 0x95, 0x87, 0xdc, 0x18, 0xd4, 0xc2, 0xf4, + 0x8f, 0xac, 0xb0, 0x03, 0xb8, 0xe9, 0xfa, 0xe7, 0x1a, 0x20, 0x9c, 0x45, + 0xee, 0x4a, 0xf0, 0xf8, 0x86, 0x69, 0x79, 0x42, 0x5e, 0xef, 0x22, 0x76, + 0xe6, 0x77, 0x4d, 0x76, 0x1f, 0x51, 0x17, 0xc8, 0xed, 0x88, 0x9c, 0x4f, + 0xee, 0xee, 0x5e, 0x4b, 0xbe, 0xc2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, + 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xc0, 0xb5, 0x5e, 0x8f, 0xae, 0x65, + 0x2e, 0x96, 0xbb, 0x23, 0x6d, 0x51, 0x18, 0xc2, 0x66, 0xaf, 0x1a, 0x20, + 0x3f, 0x36, 0xd5, 0xce, 0xc6, 0xb4, 0xff, 0x7c, 0xe6, 0xb1, 0xa6, 0x22, + 0xb7, 0x45, 0xed, 0x00, 0xd3, 0x6a, 0xe8, 0x50, 0x14, 0xe5, 0x90, 0xaa, + 0xec, 0xe2, 0xa0, 0x1b, 0x1b, 0xa1, 0x99, 0x54, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x0a, 0x8d, 0x91, 0xe5, + 0x9d, 0xf2, 0x81, 0x63, 0x6d, 0xc4, 0xaf, 0x98, 0xa3, 0xbe, 0xcf, 0xb6, + 0x1a, 0x20, 0x83, 0x47, 0x68, 0x45, 0x87, 0x87, 0x47, 0x66, 0x81, 0x1f, + 0x6f, 0xe6, 0x3e, 0xbe, 0x51, 0xf3, 0x60, 0xb5, 0x7e, 0xfa, 0x27, 0xd4, + 0x42, 0x59, 0x1a, 0x8c, 0xc4, 0xcf, 0xd4, 0x2e, 0x0a, 0x91, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x48, 0x7b, 0xdb, 0x50, 0x00, 0x00, 0x00, 0x12, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x48, 0x7b, 0xdb, 0x50, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x32, 0x43, 0x32, 0x36, 0x39, 0x46, 0x34, 0x33, + 0x34, 0x31, 0x37, 0x38, 0x30, 0x36, 0x38, 0x33, 0x30, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x43, 0x32, 0x36, 0x39, 0x46, 0x34, 0x33, 0x34, 0x31, + 0x37, 0x38, 0x30, 0x36, 0x38, 0x33, 0x30, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xad, 0xc4, 0xee, 0xcd, 0x8a, 0x4e, + 0x7b, 0x1d, 0x48, 0x5a, 0x38, 0x28, 0x40, 0x00, 0x48, 0x98, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xfc, 0x99, + 0xbf, 0xe9, 0x0c, 0xa1, 0xa2, 0xb6, 0xf8, 0xbd, 0x6e, 0x22, 0x2f, 0xba, + 0x72, 0xf5, 0x1a, 0x50, 0xfc, 0xfe, 0xc7, 0x7e, 0x79, 0xa3, 0x13, 0x94, + 0x8d, 0x88, 0xc3, 0x58, 0x12, 0x99, 0x37, 0xba, 0xa7, 0x53, 0x6d, 0xad, + 0x18, 0xd8, 0x5e, 0x24, 0x25, 0x76, 0x49, 0x1f, 0x3c, 0x2d, 0x0e, 0x35, + 0x6d, 0xfa, 0x63, 0x26, 0xee, 0xc5, 0x45, 0xd2, 0x6a, 0x28, 0x9a, 0x4b, + 0x4d, 0x97, 0xcd, 0xc8, 0xb3, 0x77, 0x13, 0x40, 0xec, 0x3d, 0x2b, 0x4e, + 0xc5, 0xcc, 0x1b, 0x10, 0x49, 0xfc, 0xe1, 0x90, 0x50, 0xf2, 0x09, 0x44, + 0x79, 0x48, 0xbf, 0xff, 0x06, 0x34, 0x93, 0x4b, 0x7c, 0xe1, 0xf0, 0xc8, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x24, 0xd9, 0x64, 0xe7, 0x1f, 0xc5, 0x7a, 0x33, 0xce, 0xde, 0xa7, 0x87, + 0xc8, 0x43, 0x28, 0x3e, 0x1a, 0x20, 0x21, 0xac, 0xb5, 0x19, 0xb7, 0x6d, + 0x57, 0x3b, 0x4d, 0x26, 0x25, 0x77, 0xa4, 0x80, 0x4d, 0xf2, 0x97, 0x51, + 0xe0, 0x8f, 0xc4, 0x49, 0x37, 0xa0, 0x66, 0x80, 0xa0, 0x57, 0x21, 0x87, + 0x52, 0xdc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xed, 0x84, 0x17, 0xb3, 0xb9, 0xc4, 0x4f, 0x4d, 0x28, 0xaa, + 0x73, 0x18, 0xf8, 0x64, 0xef, 0xdd, 0x1a, 0x20, 0x89, 0xe4, 0xc4, 0x2d, + 0xd3, 0x33, 0xdb, 0xcd, 0xf0, 0xcb, 0x21, 0xf2, 0x14, 0x69, 0xdf, 0x56, + 0x0e, 0xd8, 0x1c, 0x26, 0x8b, 0x11, 0x07, 0xbf, 0x8a, 0xb3, 0xb4, 0xcc, + 0x4a, 0xfe, 0xc5, 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xf9, 0x98, 0x18, 0x90, 0x27, 0xb5, 0x70, 0x10, + 0x91, 0xe6, 0x31, 0x42, 0xd6, 0xbe, 0xb9, 0x1c, 0x1a, 0x20, 0x02, 0xf2, + 0xdb, 0xdd, 0x0d, 0x42, 0x5f, 0x28, 0x1b, 0x6c, 0x70, 0x50, 0x10, 0x3b, + 0xb2, 0x9a, 0x79, 0x06, 0xd6, 0x84, 0x4b, 0xa9, 0x99, 0x6e, 0xf2, 0x48, + 0x97, 0x59, 0x69, 0x4b, 0x42, 0x06, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, + 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x37, 0x62, 0x66, 0xa2, 0x1f, 0x65, + 0x25, 0xe2, 0xd7, 0x44, 0x6f, 0x6f, 0x90, 0xd8, 0x5f, 0xac, 0x1a, 0x20, + 0xed, 0xef, 0x90, 0x25, 0x55, 0x94, 0x5e, 0x39, 0x53, 0x3e, 0x32, 0xf2, + 0xd0, 0xc9, 0xc8, 0xa9, 0xaa, 0xf0, 0x51, 0x58, 0xaf, 0xd0, 0x8b, 0x44, + 0x96, 0xbf, 0x17, 0xf9, 0x2c, 0x91, 0x6a, 0x2e, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x7e, 0x5c, 0xa6, 0xbc, + 0x35, 0x17, 0x3e, 0xa4, 0x12, 0xca, 0x28, 0xf7, 0x32, 0x05, 0xb5, 0x3e, + 0x1a, 0x20, 0x38, 0x61, 0xf6, 0x0a, 0x8b, 0xa0, 0x4a, 0x9b, 0x9d, 0x04, + 0x15, 0xdd, 0xb7, 0xdf, 0x8e, 0xb1, 0x3a, 0x44, 0x3b, 0x52, 0xaf, 0x27, + 0xd8, 0x47, 0x5f, 0x4d, 0xbe, 0xd9, 0x5f, 0x8e, 0xd0, 0xcd, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0x98, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x0d, 0xd9, 0x8d, 0x30, 0x00, 0x00, 0x00, 0x14, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x0d, 0xd9, 0x8d, 0x30, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x35, 0x36, 0x43, 0x44, 0x38, 0x38, 0x34, + 0x32, 0x39, 0x44, 0x43, 0x46, 0x45, 0x33, 0x43, 0x31, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x35, 0x36, 0x43, 0x44, 0x38, 0x38, 0x34, 0x32, 0x39, + 0x44, 0x43, 0x46, 0x45, 0x33, 0x43, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x14, 0x40, 0x28, 0x48, 0xbe, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x5d, 0x34, + 0x93, 0xab, 0x64, 0x12, 0x52, 0x4c, 0xa7, 0xc9, 0x2f, 0x63, 0x7b, 0x13, + 0x13, 0x0d, 0x1a, 0x50, 0x9c, 0x0d, 0x53, 0xa6, 0xb2, 0xb6, 0x12, 0x33, + 0xfd, 0x10, 0xac, 0x6b, 0x9a, 0x18, 0xc8, 0x32, 0x9e, 0xfa, 0x4d, 0xf2, + 0x61, 0xcf, 0x7e, 0x6e, 0xb6, 0x6b, 0x15, 0x35, 0xdc, 0x76, 0x6a, 0x4f, + 0x12, 0x91, 0x73, 0xc9, 0x71, 0x00, 0x7e, 0x3e, 0xd1, 0x72, 0xa3, 0xb6, + 0x7d, 0x88, 0xba, 0x34, 0x3b, 0xb1, 0xcd, 0xb0, 0xd3, 0x2d, 0x9b, 0x02, + 0xe6, 0xb9, 0xe6, 0x9c, 0x1e, 0x49, 0xcf, 0x6e, 0x6c, 0x81, 0x5d, 0x2b, + 0xe7, 0x10, 0x06, 0x57, 0x72, 0x73, 0x25, 0x1f, 0x75, 0xd5, 0x8f, 0x76, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x42, 0xeb, 0x1f, 0xda, 0x27, 0x25, 0xfe, 0x17, 0x4c, 0xb4, 0x2e, 0x40, + 0xc1, 0x89, 0x8c, 0xc1, 0x1a, 0x20, 0xc7, 0xcb, 0x77, 0x46, 0x8e, 0x07, + 0xfd, 0x09, 0x33, 0x80, 0xbe, 0xe7, 0x1f, 0x2a, 0x28, 0x45, 0x57, 0xd6, + 0xde, 0x53, 0xa4, 0xb6, 0x5b, 0x34, 0x8c, 0x32, 0x0d, 0x59, 0x39, 0x5e, + 0xca, 0x9a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x81, 0x33, 0xb1, 0xf5, 0x2b, 0x76, 0x88, 0x33, 0x21, 0x38, + 0x38, 0x7f, 0xa9, 0xe5, 0xa7, 0x26, 0x1a, 0x20, 0xe1, 0xf3, 0x77, 0xcd, + 0xb9, 0x96, 0x59, 0xf3, 0xce, 0x12, 0x1c, 0xec, 0xb2, 0xac, 0x53, 0xfa, + 0xe5, 0x1a, 0x17, 0xe0, 0x34, 0x9b, 0x8c, 0x17, 0xa8, 0xad, 0x6f, 0xe3, + 0xe1, 0x59, 0x55, 0x30, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xce, 0xe5, 0xc8, 0x2e, 0x55, 0x3a, 0xe5, 0x00, + 0xf4, 0x5a, 0x04, 0xbe, 0xb3, 0x71, 0xa2, 0x8e, 0x1a, 0x20, 0x4f, 0xa7, + 0x07, 0x80, 0x3a, 0xcd, 0x99, 0x6e, 0x63, 0x68, 0x7e, 0xba, 0x15, 0x6d, + 0xb5, 0xca, 0xcc, 0x4a, 0x71, 0xc2, 0xde, 0x21, 0x34, 0x56, 0x93, 0x5f, + 0x5d, 0xed, 0xac, 0x17, 0xe1, 0x5b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, + 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x5e, 0xa3, 0x21, 0x87, 0x20, 0x18, + 0x9a, 0x51, 0xef, 0x72, 0x4a, 0x96, 0x54, 0x43, 0x5f, 0xe8, 0x1a, 0x20, + 0x58, 0xf0, 0x02, 0x41, 0xad, 0x41, 0x35, 0xcb, 0xf3, 0x68, 0x9b, 0x39, + 0x26, 0xe4, 0x8a, 0xd5, 0x16, 0xb0, 0x2d, 0x6a, 0xc2, 0xbf, 0xcc, 0x57, + 0x18, 0xcc, 0x2c, 0x78, 0xb9, 0x24, 0xc7, 0xa7, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x69, 0xe5, 0x3c, 0xc8, + 0xcd, 0x1d, 0x38, 0xec, 0xea, 0x7d, 0x2b, 0x5b, 0x68, 0xa0, 0x73, 0xf2, + 0x1a, 0x20, 0x4a, 0xed, 0x21, 0xea, 0xdc, 0x18, 0xe1, 0x8c, 0xca, 0xa4, + 0xbd, 0xef, 0xa9, 0xe0, 0xd5, 0x01, 0xd8, 0xa7, 0x60, 0x48, 0x46, 0x25, + 0x96, 0xca, 0xf7, 0xcf, 0x51, 0x3f, 0xca, 0x54, 0xbe, 0xac, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xbe, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xa8, 0xfd, 0x09, 0xa2, 0x00, 0x00, 0x00, 0x16, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xa8, 0xfd, 0x09, 0xa2, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x42, 0x45, 0x45, 0x42, 0x38, 0x39, 0x41, 0x37, + 0x30, 0x46, 0x45, 0x30, 0x45, 0x45, 0x36, 0x45, 0x31, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x45, 0x45, 0x42, 0x38, 0x39, 0x41, 0x37, 0x30, 0x46, + 0x45, 0x30, 0x45, 0x45, 0x36, 0x45, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x9e, 0xd3, 0x15, 0xd7, 0x3a, 0x81, + 0x9e, 0x80, 0x3e, 0x89, 0x38, 0x14, 0x40, 0x28, 0x48, 0xd2, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xe1, 0xb8, + 0xe4, 0x8c, 0x3f, 0xac, 0xb2, 0xce, 0x18, 0x70, 0x02, 0x63, 0xa5, 0x32, + 0xce, 0xf9, 0x1a, 0x50, 0x39, 0xa1, 0x03, 0x1c, 0x51, 0x44, 0xca, 0x46, + 0x38, 0x7c, 0x9c, 0x8f, 0xaa, 0x11, 0xd1, 0x46, 0x33, 0xc9, 0xf6, 0xb5, + 0x96, 0x84, 0x33, 0x3a, 0x0e, 0xd4, 0xf0, 0x05, 0x3b, 0x37, 0x20, 0x1c, + 0x02, 0x4a, 0x84, 0xd1, 0x1f, 0x0d, 0x62, 0x80, 0x4a, 0x72, 0xdb, 0xd0, + 0x89, 0x81, 0x23, 0xb2, 0x03, 0xe9, 0x7f, 0xb1, 0x37, 0xa5, 0xc4, 0xfa, + 0x73, 0x25, 0x9c, 0x72, 0xa5, 0xd0, 0x2f, 0x76, 0x8a, 0x9f, 0x4d, 0xa9, + 0x31, 0xac, 0xcf, 0xb8, 0xdc, 0xcc, 0x49, 0xd9, 0xfc, 0x9c, 0x47, 0x06, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xac, 0x8a, 0xdc, 0xd8, 0x01, 0x81, 0xc8, 0x8d, 0xb6, 0x5d, 0xcf, 0x44, + 0x99, 0x7e, 0xd6, 0x89, 0x1a, 0x20, 0x22, 0x4f, 0x2a, 0xf2, 0xbe, 0x3b, + 0x06, 0x03, 0xc1, 0x14, 0x31, 0x00, 0xd4, 0xff, 0x98, 0xe5, 0xe2, 0x9a, + 0x57, 0x7a, 0x3d, 0x1b, 0xbd, 0x19, 0x0b, 0x22, 0x1e, 0x10, 0x1c, 0xb5, + 0xf8, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x42, 0xa1, 0xe7, 0x7e, 0x5f, 0xd1, 0x60, 0xac, 0xb7, 0xad, + 0xc6, 0xcb, 0x08, 0x7c, 0x55, 0x71, 0x1a, 0x20, 0xe2, 0x81, 0x20, 0x2b, + 0x70, 0x15, 0x65, 0xcc, 0x4a, 0x3b, 0x39, 0xee, 0xda, 0x36, 0xd2, 0x8b, + 0x2f, 0x49, 0xbb, 0xf3, 0xb2, 0xe1, 0x20, 0xa4, 0x02, 0x99, 0x0a, 0x0e, + 0xbb, 0x04, 0x5e, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x6d, 0x33, 0x1d, 0xbc, 0x75, 0x53, 0xe4, 0x00, + 0xae, 0x6e, 0x2e, 0x8c, 0x28, 0x0c, 0x4c, 0xda, 0x1a, 0x20, 0x45, 0x77, + 0x36, 0xc4, 0x9f, 0x19, 0x66, 0x01, 0xfd, 0x95, 0x1e, 0x7f, 0xe5, 0xed, + 0xc1, 0x45, 0x5a, 0xdd, 0x90, 0x28, 0x45, 0x78, 0xae, 0x19, 0x7d, 0x4e, + 0x98, 0x0b, 0xad, 0x0b, 0x82, 0x4b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, + 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xff, 0x90, 0xda, 0xff, 0xbb, 0xba, + 0x68, 0x07, 0x9a, 0x25, 0xfe, 0x7d, 0x79, 0x76, 0xc4, 0x49, 0x1a, 0x20, + 0xb2, 0xb0, 0x82, 0x6d, 0x5d, 0x7c, 0xc6, 0x6a, 0xc5, 0xe8, 0x99, 0x7a, + 0xc4, 0xaf, 0xdb, 0x5d, 0xd4, 0xc3, 0x13, 0xf0, 0xe4, 0x8d, 0xd3, 0xda, + 0xa4, 0xdb, 0xfe, 0x9b, 0x9b, 0x79, 0xf7, 0x94, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x9d, 0x5d, 0x8d, 0x07, + 0x79, 0xfd, 0x4b, 0x14, 0x17, 0xc2, 0x0a, 0xfb, 0x05, 0xaf, 0xc3, 0x8b, + 0x1a, 0x20, 0xb0, 0xc9, 0x3c, 0xdf, 0xe8, 0x97, 0x17, 0x11, 0xc3, 0xff, + 0x61, 0xc2, 0x8b, 0x97, 0xed, 0x0d, 0x05, 0xa4, 0x8b, 0xf1, 0x49, 0x6b, + 0x57, 0x9d, 0x83, 0xf7, 0x8e, 0x71, 0x48, 0x17, 0x95, 0xad, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xd2, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x30, 0x6a, 0xdd, 0xc0, 0x00, 0x00, 0x00, 0x18, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x30, 0x6a, 0xdd, 0xc0, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x43, 0x31, 0x43, 0x46, 0x34, 0x35, 0x30, 0x35, + 0x36, 0x37, 0x33, 0x34, 0x42, 0x38, 0x44, 0x35, 0x31, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x31, 0x43, 0x46, 0x34, 0x35, 0x30, 0x35, 0x36, 0x37, + 0x33, 0x34, 0x42, 0x38, 0x44, 0x35, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xe6, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x7e, 0x34, + 0x2b, 0x5f, 0x07, 0x4b, 0x7c, 0x94, 0xb1, 0x1c, 0x59, 0x4c, 0x23, 0x97, + 0xe4, 0x76, 0x1a, 0x50, 0xc3, 0xdd, 0xfe, 0x4e, 0x36, 0x64, 0x4b, 0x34, + 0x23, 0xa5, 0x87, 0xd3, 0x4a, 0x11, 0xed, 0x36, 0x88, 0x6e, 0x81, 0x25, + 0xab, 0x58, 0xb8, 0x0c, 0x51, 0x00, 0x2a, 0xc2, 0x62, 0xb4, 0xc0, 0x97, + 0x71, 0x9d, 0x98, 0xad, 0x84, 0xaf, 0x83, 0x1c, 0xd6, 0x0b, 0xd0, 0xab, + 0xf7, 0x8b, 0x53, 0xcb, 0xba, 0x1f, 0xf1, 0x99, 0x93, 0x5c, 0xca, 0xcb, + 0x81, 0xf9, 0x23, 0x9c, 0x38, 0xa9, 0xfb, 0x46, 0x40, 0x18, 0x63, 0xc1, + 0xe2, 0xc0, 0x24, 0x18, 0x68, 0xc0, 0xae, 0x78, 0x0a, 0x4f, 0x6d, 0x33, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xf6, 0xad, 0xc7, 0xcf, 0xd2, 0xa1, 0x05, 0xb9, 0xa9, 0x5e, 0x56, 0x09, + 0x7f, 0x30, 0x28, 0x5d, 0x1a, 0x20, 0xbf, 0x5a, 0x87, 0x0b, 0x3d, 0x70, + 0x31, 0x8d, 0xa7, 0x4e, 0x2e, 0x5f, 0xfc, 0xcb, 0x18, 0x1d, 0x04, 0xe4, + 0xd7, 0x58, 0xb2, 0x5b, 0x52, 0xe4, 0x63, 0x4c, 0x43, 0x97, 0xd3, 0xc9, + 0xa8, 0x35, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x1d, 0xd1, 0x0d, 0xdc, 0xc9, 0x45, 0xac, 0x3e, 0x53, 0xff, + 0xf3, 0x5e, 0x65, 0x97, 0xe7, 0x0a, 0x1a, 0x20, 0x2c, 0xd6, 0x71, 0xd3, + 0xc6, 0x55, 0x00, 0x77, 0xa0, 0x58, 0x3c, 0xd3, 0xc6, 0x7b, 0xbf, 0x59, + 0xbc, 0xe2, 0x2f, 0xb8, 0x55, 0x48, 0x00, 0x10, 0x36, 0x3f, 0xb6, 0xc6, + 0x6c, 0x81, 0x3a, 0x59, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x99, 0x72, 0x9c, 0x6f, 0x0a, 0xfd, 0x77, 0xde, + 0xb5, 0xf4, 0x23, 0x2f, 0xdf, 0x78, 0xa9, 0xd2, 0x1a, 0x20, 0xfd, 0xf6, + 0x8c, 0x0e, 0x34, 0xda, 0x20, 0xd4, 0xb9, 0x65, 0x45, 0x4a, 0x44, 0x8b, + 0x2a, 0x61, 0xf9, 0x23, 0x83, 0x21, 0x92, 0x5e, 0x6d, 0x03, 0x10, 0x9c, + 0x8f, 0xed, 0x67, 0x54, 0x6f, 0x8e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, + 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x13, 0x6f, 0x48, 0x7e, 0xae, 0x0d, + 0xb1, 0x9e, 0xa8, 0x8d, 0xeb, 0x85, 0xbc, 0xda, 0x9a, 0x87, 0x1a, 0x20, + 0x65, 0x3e, 0xbe, 0xcb, 0xd2, 0xd3, 0xa1, 0x11, 0xbf, 0x2b, 0x50, 0x2e, + 0x8c, 0x40, 0xf8, 0xe6, 0x40, 0xec, 0x69, 0x93, 0xec, 0xd6, 0x2d, 0x20, + 0x28, 0x3d, 0x7c, 0x55, 0x55, 0x92, 0x69, 0x39, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd2, 0x55, 0x69, 0x6c, + 0x86, 0x63, 0x6e, 0x18, 0xa8, 0xc1, 0x28, 0xce, 0xfe, 0x8c, 0xdb, 0xd1, + 0x1a, 0x20, 0x3b, 0xe8, 0x2f, 0x8e, 0xb8, 0x80, 0x97, 0xf1, 0x09, 0x9b, + 0xdb, 0x61, 0xc8, 0xb9, 0xc1, 0x7b, 0x13, 0x9c, 0xc6, 0x1a, 0xd7, 0x7d, + 0x0e, 0x06, 0x23, 0x0e, 0x2d, 0xc5, 0x51, 0xf7, 0xf4, 0x83, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xe6, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xd5, 0x2f, 0x4a, 0x02, 0x00, 0x00, 0x00, 0x1a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xd5, 0x2f, 0x4a, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x46, 0x39, 0x46, 0x46, 0x44, 0x32, 0x46, 0x33, + 0x39, 0x44, 0x46, 0x37, 0x42, 0x36, 0x35, 0x32, 0x31, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x39, 0x46, 0x46, 0x44, 0x32, 0x46, 0x33, 0x39, 0x44, + 0x46, 0x37, 0x42, 0x36, 0x35, 0x32, 0x31, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x29, 0xbd, 0x4b, 0xc5, 0x78, 0x12, + 0xfd, 0xf2, 0xef, 0x93, 0x38, 0x64, 0x40, 0x32, 0x48, 0xfe, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x13, 0xb0, + 0xce, 0xd8, 0xea, 0x21, 0x01, 0x1a, 0xe4, 0x03, 0x20, 0xbd, 0x13, 0xc0, + 0xd4, 0xec, 0x1a, 0x50, 0x3b, 0xd0, 0x8b, 0x01, 0x34, 0xbc, 0xae, 0xe6, + 0x57, 0x34, 0xac, 0x15, 0x59, 0x39, 0xe8, 0xa8, 0x29, 0xc1, 0xca, 0x59, + 0x75, 0xc5, 0xd0, 0x61, 0x0f, 0x55, 0xa7, 0x96, 0x5b, 0x8b, 0xfa, 0xee, + 0x62, 0x3f, 0x59, 0xbc, 0xb9, 0x75, 0x18, 0x9d, 0xfc, 0x2e, 0x6a, 0xe7, + 0x65, 0x12, 0x74, 0x94, 0xf2, 0x36, 0x29, 0xbc, 0x6b, 0xff, 0xea, 0xa9, + 0x78, 0x86, 0xd8, 0x8f, 0x87, 0x74, 0x5e, 0x23, 0x5f, 0xcf, 0x88, 0xb3, + 0x43, 0x85, 0xcc, 0x12, 0xa1, 0xc2, 0x60, 0x9e, 0x53, 0xdb, 0xa1, 0x48, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x67, 0xca, 0x1c, 0xa8, 0x9d, 0xfb, 0x4d, 0x5c, 0x85, 0x89, 0x62, 0xae, + 0x69, 0xe3, 0x9f, 0x5d, 0x1a, 0x20, 0xb7, 0x3e, 0xd2, 0x1d, 0xc5, 0x1b, + 0xa5, 0xf1, 0x5d, 0xaa, 0x3d, 0x87, 0xe7, 0x9e, 0x21, 0xfd, 0xda, 0xdc, + 0xf0, 0x44, 0xde, 0x02, 0x88, 0xde, 0x60, 0x72, 0xb5, 0x03, 0x11, 0x73, + 0x5a, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x4c, 0x19, 0xeb, 0x0b, 0xab, 0xfd, 0x12, 0x2e, 0x26, 0x25, + 0x43, 0x10, 0x3a, 0xb7, 0x15, 0xc3, 0x1a, 0x20, 0x9b, 0x9a, 0xdd, 0xe3, + 0xdc, 0x45, 0x2e, 0xd7, 0xea, 0x4c, 0xe3, 0x42, 0xb2, 0x5a, 0xe3, 0x33, + 0x83, 0x55, 0x61, 0x5c, 0x94, 0x95, 0xa4, 0x27, 0x47, 0x2d, 0xd6, 0x0b, + 0x83, 0x3e, 0xfe, 0xc7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x2f, 0x90, 0x4c, 0xa1, 0xb9, 0x87, 0x71, 0x9f, + 0x7b, 0x13, 0x37, 0x06, 0xe8, 0x5d, 0xc7, 0x44, 0x1a, 0x20, 0x04, 0x7a, + 0xf4, 0xa4, 0xe2, 0x62, 0x69, 0x2e, 0x94, 0xf7, 0x9a, 0xb9, 0x10, 0x52, + 0xa5, 0x74, 0xfc, 0xf1, 0xc7, 0x34, 0x8d, 0xdd, 0x09, 0xa7, 0xc4, 0xf8, + 0xb5, 0x41, 0x52, 0x5e, 0x02, 0xda, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, + 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xf3, 0x79, 0xe2, 0x1b, 0xb1, 0xd9, + 0x16, 0x05, 0x5e, 0x42, 0xe3, 0x5c, 0x6a, 0xb4, 0x81, 0x02, 0x1a, 0x20, + 0xe7, 0xbb, 0xd0, 0xc9, 0xa0, 0xd0, 0xf2, 0xff, 0xca, 0x78, 0x41, 0x37, + 0x7a, 0xe1, 0xcf, 0x87, 0x8b, 0x3f, 0x27, 0x59, 0xe5, 0xbf, 0x1c, 0xcd, + 0xb6, 0x27, 0xf5, 0x16, 0x77, 0x3c, 0xd2, 0xd3, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc0, 0xca, 0x8f, 0xa9, + 0x4c, 0xd6, 0x78, 0xec, 0x2d, 0x72, 0x5e, 0xc5, 0x5f, 0x7b, 0x89, 0x62, + 0x1a, 0x20, 0xfe, 0x73, 0x9a, 0xd6, 0x07, 0x1e, 0x97, 0x14, 0xd7, 0x6b, + 0x8a, 0xea, 0x80, 0x97, 0x1e, 0x94, 0x6f, 0xa4, 0x27, 0xa3, 0xd8, 0xe4, + 0xe7, 0x08, 0xe1, 0x21, 0xfe, 0xef, 0xed, 0x7c, 0x56, 0x23, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xfe, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x8a, 0x59, 0xd8, 0xfa, 0x00, 0x00, 0x00, 0x1c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x8a, 0x59, 0xd8, 0xfa, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x34, 0x43, 0x37, 0x36, 0x39, 0x45, 0x41, 0x32, + 0x42, 0x38, 0x46, 0x37, 0x45, 0x42, 0x35, 0x31, 0x31, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x43, 0x37, 0x36, 0x39, 0x45, 0x41, 0x32, 0x42, 0x38, + 0x46, 0x37, 0x45, 0x42, 0x35, 0x31, 0x31, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0x96, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xde, 0xee, + 0x35, 0xf5, 0xd6, 0xbc, 0x45, 0xc2, 0x2c, 0x48, 0x36, 0x68, 0xc6, 0x6c, + 0x7a, 0x8c, 0x1a, 0x50, 0x27, 0xed, 0xa9, 0xd3, 0xba, 0x48, 0x6b, 0xa4, + 0x1d, 0x7a, 0x79, 0x2c, 0xd6, 0x4c, 0x21, 0x0e, 0x51, 0x8d, 0xdb, 0x50, + 0x89, 0xa1, 0x8f, 0xe0, 0x17, 0x9a, 0x18, 0xa1, 0xbc, 0x57, 0xcc, 0xbe, + 0xcf, 0x6b, 0x4e, 0x4b, 0x7c, 0x47, 0xb6, 0x2e, 0x8c, 0x46, 0x71, 0xd5, + 0x17, 0x2d, 0x83, 0xbc, 0x77, 0xfd, 0xcb, 0x25, 0x35, 0x9c, 0x60, 0xb3, + 0x68, 0x30, 0xd6, 0xbc, 0xdf, 0x0b, 0xe7, 0xa1, 0x8c, 0x41, 0x5e, 0x30, + 0x1a, 0xe6, 0x1e, 0x34, 0xa0, 0x2a, 0xc3, 0x37, 0xce, 0xd6, 0xad, 0x75, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x76, 0xb8, 0x60, 0x00, 0x9a, 0xfd, 0x7b, 0xe2, 0xf3, 0x57, 0x32, 0x66, + 0x12, 0x7b, 0x9e, 0xe0, 0x1a, 0x20, 0x79, 0xd5, 0x4a, 0xf8, 0x89, 0x3b, + 0x49, 0xc3, 0xf5, 0xb3, 0xb6, 0x01, 0xcd, 0xe4, 0x51, 0x70, 0xe6, 0x58, + 0xa3, 0x8c, 0x0c, 0x25, 0x82, 0x40, 0xe1, 0xb7, 0x36, 0x17, 0x12, 0x91, + 0x5a, 0x17, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xe0, 0xd1, 0x0c, 0x75, 0x0f, 0x0a, 0x6e, 0x97, 0x43, 0x81, + 0x3e, 0x13, 0x4a, 0x5f, 0xb7, 0x5c, 0x1a, 0x20, 0x3a, 0xa4, 0x10, 0xd9, + 0x40, 0x45, 0x3f, 0xaa, 0x35, 0x97, 0xd1, 0xce, 0xec, 0xcf, 0x01, 0xd5, + 0xef, 0xc6, 0x01, 0x2b, 0x2f, 0xdf, 0xc1, 0x00, 0x4f, 0xed, 0x97, 0x9a, + 0x77, 0x3a, 0x8b, 0x12, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x36, 0x67, 0xef, 0x31, 0x64, 0xee, 0x80, 0xcb, + 0x77, 0x29, 0x8c, 0xd9, 0x26, 0x34, 0x0e, 0x43, 0x1a, 0x20, 0x91, 0x79, + 0xde, 0xa1, 0x11, 0x24, 0x28, 0x8b, 0x0f, 0x2b, 0x3f, 0xf6, 0x12, 0xa8, + 0x37, 0xf4, 0x63, 0xb4, 0x96, 0xce, 0xcf, 0x8c, 0xfc, 0x4b, 0xb0, 0x90, + 0xdc, 0x2c, 0x34, 0xbe, 0x55, 0xdb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, + 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x7e, 0x7b, 0xed, 0xc1, 0x81, 0x4c, + 0xca, 0x07, 0x2e, 0x59, 0xa5, 0x8e, 0x8e, 0x1b, 0x60, 0x10, 0x1a, 0x20, + 0x24, 0x1d, 0x94, 0x69, 0x6d, 0x87, 0x0f, 0xae, 0x18, 0x2f, 0x79, 0x19, + 0xea, 0x46, 0x74, 0xc8, 0x65, 0x49, 0x39, 0xd3, 0x20, 0x47, 0x64, 0xbf, + 0x65, 0x4b, 0x37, 0xf0, 0xce, 0xb9, 0x14, 0x79, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xde, 0x9f, 0x96, 0x51, + 0x52, 0x02, 0x08, 0xab, 0x10, 0x8c, 0xcc, 0x44, 0xd7, 0x7b, 0x4c, 0x0b, + 0x1a, 0x20, 0x3f, 0xc2, 0x0f, 0xac, 0xb7, 0x89, 0xa1, 0x9f, 0x16, 0x9b, + 0xb5, 0x15, 0xa9, 0x19, 0x30, 0x6f, 0x67, 0x1c, 0xad, 0x9d, 0xda, 0x78, + 0x9e, 0xe0, 0x3e, 0x8b, 0xb8, 0xd0, 0x27, 0x3f, 0xf0, 0xdb, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0x96, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x9d, 0x6a, 0x09, 0x4d, 0x00, 0x00, 0x00, 0x1e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x9d, 0x6a, 0x09, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x33, 0x34, 0x46, 0x30, 0x45, 0x31, 0x38, 0x30, + 0x35, 0x42, 0x41, 0x37, 0x46, 0x43, 0x35, 0x38, 0x31, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x34, 0x46, 0x30, 0x45, 0x31, 0x38, 0x30, 0x35, 0x42, + 0x41, 0x37, 0x46, 0x43, 0x35, 0x38, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xd8, 0x35, 0xc4, 0xf6, 0xfe, 0x5e, + 0x8b, 0x9e, 0xa9, 0x6a, 0x38, 0x64, 0x40, 0x32, 0x48, 0xae, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x32, 0x4b, + 0xaa, 0xff, 0xe4, 0x70, 0x86, 0xba, 0x11, 0x0f, 0xa5, 0x9f, 0x07, 0x17, + 0x85, 0xf6, 0x1a, 0x50, 0x2e, 0xc7, 0x37, 0x36, 0x3c, 0xfb, 0x94, 0x53, + 0xeb, 0x75, 0x85, 0x5e, 0x26, 0x3f, 0xf5, 0xac, 0x2c, 0x46, 0xb8, 0x17, + 0x02, 0x00, 0x13, 0x11, 0x07, 0x37, 0x97, 0xf1, 0x86, 0xf6, 0xdc, 0xc0, + 0x6e, 0x39, 0x18, 0xa0, 0xc6, 0xf4, 0x23, 0x67, 0x8d, 0xb6, 0xda, 0xda, + 0x8d, 0xc4, 0x5d, 0x04, 0x71, 0x40, 0xa3, 0x52, 0xe5, 0xfd, 0x9f, 0x2d, + 0xf7, 0xf3, 0x55, 0xc5, 0x03, 0x66, 0x1c, 0x53, 0x72, 0x1e, 0x13, 0x98, + 0x15, 0xc2, 0xf3, 0xe6, 0xab, 0x8e, 0xe0, 0xed, 0xc5, 0xc6, 0x9f, 0x57, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x2a, 0x0b, 0x6e, 0x97, 0xbb, 0xf6, 0x14, 0x2e, 0xa8, 0xb3, 0x03, 0xe2, + 0x18, 0x7c, 0xc6, 0xde, 0x1a, 0x20, 0xd5, 0x8f, 0xb4, 0x8d, 0x35, 0x9e, + 0xd0, 0x25, 0x55, 0x37, 0x5b, 0x73, 0xcb, 0x3e, 0x0c, 0xd8, 0x05, 0x4e, + 0xa9, 0x85, 0xe7, 0x43, 0x57, 0x43, 0x9d, 0x0e, 0x33, 0xa2, 0xae, 0xaf, + 0xd9, 0xb8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x7a, 0xe7, 0xfd, 0x45, 0x81, 0xb0, 0xbb, 0x06, 0x1e, 0xe2, + 0x30, 0x97, 0xa1, 0xda, 0xe8, 0x98, 0x1a, 0x20, 0x80, 0x95, 0x3d, 0x88, + 0xf8, 0x16, 0x67, 0xba, 0x61, 0xac, 0x6e, 0xc7, 0x66, 0x7d, 0xd9, 0x65, + 0x50, 0xe4, 0xc7, 0x20, 0x54, 0x16, 0xef, 0xde, 0xb5, 0x11, 0x0a, 0x65, + 0x28, 0xec, 0x97, 0xd8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xd0, 0x26, 0xcf, 0xc9, 0x73, 0xfd, 0xef, 0xee, + 0x85, 0x37, 0x52, 0x70, 0x05, 0xeb, 0xbb, 0x67, 0x1a, 0x20, 0x76, 0xba, + 0xcc, 0x4a, 0xb1, 0xbf, 0x39, 0x69, 0x96, 0xe8, 0x06, 0xd0, 0x29, 0x28, + 0xc4, 0x59, 0x0f, 0x21, 0x38, 0x18, 0x89, 0x01, 0xd8, 0xe5, 0xdd, 0xc1, + 0x0b, 0x63, 0x50, 0x75, 0x42, 0xca, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, + 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x1a, 0xfd, 0x2e, 0x78, 0x87, 0x4b, + 0xdd, 0xf6, 0x9d, 0xc5, 0x76, 0x0b, 0xf9, 0xec, 0x2a, 0x48, 0x1a, 0x20, + 0x55, 0x9c, 0x76, 0x9a, 0x7d, 0x94, 0x29, 0xdf, 0x10, 0x20, 0x1e, 0xfa, + 0xfd, 0xfd, 0x97, 0xac, 0xed, 0xe7, 0x5f, 0x14, 0x5d, 0x9e, 0x25, 0x0b, + 0x6b, 0x1d, 0xe5, 0xc8, 0x83, 0x68, 0xa5, 0xbb, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x82, 0xdb, 0xe0, 0xa3, + 0xdc, 0x01, 0x8c, 0x4e, 0x5d, 0x61, 0x16, 0x7e, 0xed, 0x77, 0x08, 0xa3, + 0x1a, 0x20, 0xbb, 0xe3, 0x3f, 0x32, 0xee, 0x8a, 0x8c, 0x09, 0xe6, 0xf1, + 0x56, 0x27, 0x70, 0xc2, 0x0b, 0x3d, 0x50, 0xea, 0xd5, 0x9d, 0x6b, 0xb1, + 0x60, 0xf5, 0x02, 0x3e, 0x4b, 0xcd, 0xd7, 0x3d, 0x89, 0xef, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xae, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x62, 0x41, 0x90, 0x1a, 0x00, 0x00, 0x00, 0x20, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x62, 0x41, 0x90, 0x1a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x41, 0x30, 0x31, 0x45, 0x36, 0x43, 0x30, + 0x45, 0x30, 0x39, 0x37, 0x39, 0x37, 0x30, 0x42, 0x31, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x41, 0x30, 0x31, 0x45, 0x36, 0x43, 0x30, 0x45, 0x30, + 0x39, 0x37, 0x39, 0x37, 0x30, 0x42, 0x31, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xc6, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xd4, 0x05, + 0xbb, 0xf4, 0x17, 0xfb, 0xd1, 0x6e, 0x0a, 0xc9, 0xa8, 0xdf, 0x9e, 0x33, + 0x0a, 0x07, 0x1a, 0x50, 0xa8, 0x44, 0x98, 0x69, 0xb3, 0x2e, 0xe2, 0xb4, + 0x8d, 0x95, 0x9e, 0x60, 0xc2, 0x3b, 0x31, 0xa5, 0xd1, 0x50, 0xd6, 0x91, + 0x7d, 0xc4, 0x3d, 0x95, 0x97, 0x30, 0x54, 0x1d, 0x8c, 0x37, 0x4e, 0x89, + 0xcb, 0xec, 0x29, 0x32, 0xa7, 0x57, 0x09, 0x36, 0x7f, 0xb6, 0x7f, 0xbf, + 0xa3, 0x75, 0x68, 0xf4, 0xc5, 0xfe, 0xb0, 0xa6, 0x60, 0xac, 0xc6, 0xea, + 0xeb, 0x37, 0xad, 0x01, 0x90, 0x7b, 0xc5, 0x47, 0xc9, 0xa7, 0x9a, 0x2c, + 0xcb, 0x45, 0x81, 0x4b, 0xa3, 0x92, 0x8e, 0xdb, 0x37, 0xbe, 0x56, 0x2c, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x8d, 0x12, 0x01, 0x58, 0x99, 0xe1, 0xc6, 0x6a, 0x91, 0x01, 0x55, 0xd7, + 0xaa, 0x31, 0xf5, 0xcf, 0x1a, 0x20, 0xe5, 0x6b, 0xde, 0x6e, 0x27, 0x04, + 0x51, 0x9d, 0x96, 0x93, 0x73, 0x9e, 0x76, 0x7a, 0x7f, 0x3e, 0xf8, 0x2f, + 0xa1, 0xaa, 0x63, 0x06, 0xca, 0xce, 0x55, 0x0b, 0xba, 0xc5, 0xfd, 0xa1, + 0x78, 0x67, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x9e, 0x3b, 0xc5, 0x78, 0x56, 0x0d, 0x87, 0xfa, 0x07, 0x5d, + 0xff, 0x5f, 0x8e, 0xb0, 0x39, 0x4b, 0x1a, 0x20, 0xf8, 0x96, 0xf3, 0x67, + 0x5b, 0x8c, 0xa2, 0xcb, 0x70, 0xc4, 0x31, 0xa7, 0x5d, 0xc7, 0x6f, 0x42, + 0x09, 0x24, 0x21, 0xb0, 0x87, 0x03, 0xea, 0x34, 0x15, 0x41, 0x74, 0x67, + 0x0f, 0xed, 0x86, 0xbd, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xf1, 0xa0, 0x61, 0xa4, 0xa3, 0x26, 0xd1, 0xfc, + 0x78, 0x8a, 0x15, 0xf7, 0x58, 0x59, 0x01, 0xeb, 0x1a, 0x20, 0x78, 0x04, + 0x42, 0x9d, 0xef, 0xfc, 0x81, 0xb1, 0x1b, 0x2f, 0xef, 0xfa, 0x62, 0xba, + 0x98, 0x62, 0xa2, 0xe0, 0xdc, 0x39, 0x1d, 0x63, 0x59, 0x74, 0x3d, 0x06, + 0xb6, 0x18, 0x56, 0x41, 0x34, 0xa6, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, + 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x8f, 0x60, 0x25, 0x41, 0xcd, 0x3c, + 0x2b, 0x45, 0xb1, 0x6e, 0x44, 0xa8, 0xc3, 0xa1, 0xb0, 0x4f, 0x1a, 0x20, + 0xbd, 0xaa, 0x5c, 0xb0, 0x4f, 0xe0, 0x2e, 0x8e, 0x29, 0x19, 0x43, 0x19, + 0x29, 0xff, 0xac, 0x23, 0xcd, 0x11, 0xc0, 0xd8, 0x81, 0x0a, 0x97, 0x3d, + 0x4c, 0xba, 0xc1, 0xd1, 0x5a, 0x46, 0xa7, 0x4f, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x2b, 0xa4, 0xd4, 0x8a, + 0x36, 0x4f, 0xa9, 0xcb, 0x8b, 0xc2, 0x7b, 0x89, 0x11, 0x5f, 0xf9, 0xa3, + 0x1a, 0x20, 0xc2, 0xdd, 0xd0, 0x3d, 0xd9, 0x61, 0xfc, 0x19, 0x7a, 0x06, + 0x6a, 0xda, 0xcd, 0xa8, 0x98, 0x66, 0xea, 0x2f, 0x7a, 0x36, 0x99, 0xbd, + 0x52, 0xd8, 0x10, 0x75, 0xb1, 0xa1, 0x83, 0x55, 0xb5, 0xa5, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xc6, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0x86, 0x63, 0x3a, 0x00, 0x00, 0x00, 0x22, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0x86, 0x63, 0x3a, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x37, 0x30, 0x44, 0x32, 0x42, 0x41, 0x41, 0x31, + 0x45, 0x46, 0x33, 0x32, 0x31, 0x46, 0x37, 0x45, 0x31, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x30, 0x44, 0x32, 0x42, 0x41, 0x41, 0x31, 0x45, 0x46, + 0x33, 0x32, 0x31, 0x46, 0x37, 0x45, 0x31, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xf1, 0x19, 0x08, 0xcf, 0x56, 0xc3, + 0x86, 0xf7, 0x45, 0x60, 0x38, 0x64, 0x40, 0x32, 0x48, 0xde, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x67, 0xe9, + 0x5c, 0xdf, 0xe1, 0xf7, 0xbf, 0xfb, 0x2d, 0x48, 0x7a, 0xac, 0xf3, 0xbe, + 0xec, 0x74, 0x1a, 0x50, 0x82, 0xa3, 0x4f, 0xef, 0x8c, 0xb8, 0x20, 0xd0, + 0x2e, 0xaf, 0x0a, 0xed, 0x01, 0x01, 0x14, 0xc7, 0x7c, 0xa0, 0x85, 0x8f, + 0x07, 0xbe, 0x25, 0x06, 0x98, 0x5c, 0x6f, 0x34, 0x30, 0x6e, 0xab, 0x87, + 0x89, 0xdc, 0x64, 0xac, 0x79, 0xb3, 0x33, 0x2b, 0x63, 0x1f, 0x17, 0xae, + 0x18, 0x5b, 0x0c, 0xdf, 0x56, 0x06, 0x33, 0x3f, 0xf9, 0x42, 0xc9, 0x1d, + 0x80, 0x22, 0xd8, 0x04, 0xad, 0xf3, 0xca, 0x39, 0xb0, 0xfa, 0x7f, 0xe2, + 0x44, 0x40, 0xef, 0xed, 0x3a, 0xe8, 0x51, 0x8a, 0x2e, 0x22, 0xa1, 0x67, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xd7, 0x30, 0x81, 0x6e, 0xbb, 0x74, 0x55, 0x61, 0xe0, 0x51, 0xd1, 0xbb, + 0x39, 0x85, 0x35, 0x4f, 0x1a, 0x20, 0x05, 0xc7, 0xc6, 0x1b, 0xf1, 0xde, + 0xa8, 0xe8, 0x85, 0xa7, 0x04, 0xb4, 0xd9, 0x6f, 0x35, 0x0a, 0x2b, 0xae, + 0xf0, 0xe1, 0x2b, 0x40, 0x9a, 0xd6, 0xcb, 0x87, 0x87, 0x9c, 0x8b, 0x81, + 0xba, 0xff, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x47, 0x74, 0xd4, 0xf0, 0x2e, 0xd4, 0x15, 0x62, 0x54, 0xda, + 0x24, 0xc9, 0x55, 0x15, 0xee, 0xdf, 0x1a, 0x20, 0xaa, 0xdb, 0xba, 0x0d, + 0x66, 0x6d, 0xad, 0xea, 0xfc, 0xa1, 0x1f, 0x33, 0xd4, 0x83, 0xcd, 0x1f, + 0x8d, 0x10, 0xa3, 0xd1, 0x3c, 0x0a, 0xa8, 0x26, 0x3a, 0x57, 0x5e, 0xba, + 0x0f, 0x93, 0xca, 0xc7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xc9, 0x8c, 0xed, 0x9b, 0x1a, 0xd8, 0x9d, 0xac, + 0xe0, 0x7f, 0x66, 0x65, 0x7c, 0x7f, 0x22, 0xfd, 0x1a, 0x20, 0x7e, 0xaa, + 0x05, 0x56, 0x23, 0xd0, 0xf3, 0xd3, 0xea, 0x20, 0x03, 0x88, 0xca, 0xfa, + 0xef, 0xca, 0xd5, 0x83, 0x40, 0x19, 0x38, 0x8d, 0x2e, 0x75, 0xb9, 0x22, + 0x80, 0x12, 0x6e, 0x48, 0x0b, 0x2a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, + 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x57, 0xe7, 0x86, 0xdf, 0x5f, 0x76, + 0x33, 0x49, 0x21, 0xba, 0x30, 0xf7, 0xb4, 0x44, 0xef, 0xcf, 0x1a, 0x20, + 0x58, 0xa0, 0xf6, 0xa2, 0xfc, 0xd2, 0x1b, 0xb8, 0x3c, 0x46, 0xc0, 0x73, + 0xa1, 0xf9, 0x6a, 0xb4, 0x64, 0x17, 0x80, 0x95, 0x57, 0x35, 0x24, 0xfd, + 0x20, 0xd7, 0x40, 0x27, 0x7a, 0xbf, 0x26, 0x7a, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x2e, 0x0f, 0x30, 0x33, + 0x07, 0xf9, 0x9b, 0x9c, 0x1b, 0x94, 0xd3, 0x66, 0xd2, 0x6f, 0xae, 0x62, + 0x1a, 0x20, 0x19, 0xd6, 0x65, 0x46, 0x6d, 0xab, 0xa1, 0x9a, 0xba, 0x11, + 0xb0, 0x8d, 0xcb, 0x47, 0x86, 0x04, 0x7f, 0x9d, 0x02, 0xda, 0x20, 0xe4, + 0xc2, 0xee, 0x6a, 0x3c, 0xd6, 0x27, 0x2c, 0x7e, 0x61, 0x04, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xde, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x47, 0x80, 0xa5, 0xb1, 0x00, 0x00, 0x00, 0x24, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x47, 0x80, 0xa5, 0xb1, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x42, 0x43, 0x33, 0x43, 0x34, 0x33, 0x32, + 0x44, 0x43, 0x36, 0x43, 0x46, 0x36, 0x39, 0x36, 0x32, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x42, 0x43, 0x33, 0x43, 0x34, 0x33, 0x32, 0x44, 0x43, + 0x36, 0x43, 0x46, 0x36, 0x39, 0x36, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xf6, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x47, 0x56, + 0x49, 0xa8, 0x71, 0x66, 0xe0, 0x78, 0xbe, 0xa9, 0x7f, 0xd1, 0xb6, 0xea, + 0x7c, 0xe8, 0x1a, 0x50, 0xdf, 0x1d, 0x12, 0xfa, 0x2b, 0x4b, 0x4a, 0x50, + 0xe7, 0x1c, 0xd5, 0x46, 0x57, 0x62, 0x79, 0x90, 0xa6, 0x71, 0x3e, 0x06, + 0xaa, 0x7e, 0x31, 0xcc, 0x06, 0x1e, 0x44, 0xee, 0xb4, 0xd5, 0x57, 0xc7, + 0xc9, 0x56, 0xe0, 0x7e, 0x16, 0x33, 0x6c, 0x85, 0xb3, 0xb7, 0x16, 0x99, + 0xbd, 0x31, 0x7e, 0xb0, 0xe2, 0x26, 0xc8, 0x71, 0x42, 0x1f, 0x5f, 0xd6, + 0xd5, 0x30, 0x6d, 0x60, 0x7b, 0x99, 0x8b, 0x67, 0x68, 0x9f, 0xd7, 0x5e, + 0xe0, 0x25, 0xc8, 0x86, 0x9f, 0x01, 0xec, 0x12, 0x54, 0xcf, 0xa8, 0xa2, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xd2, 0x6d, 0xc4, 0x9c, 0x32, 0xc6, 0x61, 0x36, 0xc4, 0x13, 0x58, 0xf7, + 0x02, 0xdd, 0x8b, 0x56, 0x1a, 0x20, 0xd6, 0x36, 0x3f, 0x64, 0x76, 0xb3, + 0x59, 0xa1, 0xfb, 0x56, 0xf7, 0xa2, 0x0f, 0x06, 0x6c, 0xef, 0x76, 0x25, + 0xed, 0x36, 0x32, 0xc1, 0x7b, 0x66, 0x7f, 0x66, 0x6a, 0xbb, 0xb2, 0xf2, + 0xd6, 0x0e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xdc, 0xb8, 0x06, 0x9c, 0x04, 0x4e, 0x2f, 0xda, 0x25, 0x07, + 0x59, 0xcf, 0x31, 0x98, 0x09, 0x3f, 0x1a, 0x20, 0x52, 0xd0, 0xfd, 0x86, + 0x2d, 0x14, 0xe6, 0x99, 0xc3, 0x94, 0x29, 0x08, 0x11, 0x20, 0x05, 0x3f, + 0x60, 0x68, 0x96, 0xc0, 0x9a, 0xbb, 0x85, 0x01, 0xe5, 0xb4, 0xb7, 0x4a, + 0x2d, 0x9e, 0x7d, 0x9c, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xb6, 0xbd, 0x8f, 0x81, 0x0f, 0x33, 0x10, 0xda, + 0x90, 0x08, 0xe2, 0x6b, 0xa5, 0x50, 0x96, 0x24, 0x1a, 0x20, 0x42, 0xb6, + 0x3e, 0x22, 0x7f, 0x77, 0x95, 0x16, 0x87, 0x72, 0xba, 0x54, 0x2a, 0x42, + 0x50, 0xac, 0xfe, 0x9c, 0x78, 0x67, 0x50, 0x66, 0xe8, 0xa3, 0xf9, 0xe0, + 0x7a, 0x2a, 0x79, 0xd5, 0xc7, 0x1b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, + 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x7b, 0xc8, 0x64, 0x16, 0x55, 0x67, + 0xbb, 0x19, 0x09, 0x3e, 0x96, 0x81, 0xdf, 0xbb, 0x02, 0xd4, 0x1a, 0x20, + 0x07, 0x4c, 0x12, 0x78, 0x59, 0xd1, 0x58, 0x3a, 0x5c, 0x5a, 0x56, 0x3d, + 0xf3, 0x19, 0xc3, 0x83, 0x47, 0xd4, 0xe0, 0x94, 0x64, 0x43, 0x1c, 0xf1, + 0x63, 0xf1, 0x9b, 0x67, 0x9b, 0xfc, 0xa5, 0xc4, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x47, 0x2e, 0x6c, 0xdd, + 0xfd, 0x16, 0xeb, 0x27, 0x36, 0xac, 0x34, 0x45, 0x77, 0x51, 0x27, 0x44, + 0x1a, 0x20, 0x85, 0xe9, 0xe3, 0x8c, 0x87, 0xa2, 0xff, 0xcf, 0x75, 0x40, + 0x9a, 0x2c, 0xa4, 0x36, 0x3e, 0x8f, 0xd2, 0x7a, 0xdd, 0xfe, 0x08, 0x65, + 0x7a, 0x4f, 0x3c, 0xe5, 0x10, 0x1e, 0x20, 0xab, 0xcf, 0x0f, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xf6, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xc6, 0x1a, 0x2b, 0x29, 0x00, 0x00, 0x00, 0x26, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xc6, 0x1a, 0x2b, 0x29, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x39, 0x35, 0x37, 0x32, 0x32, 0x36, 0x43, + 0x31, 0x43, 0x39, 0x46, 0x41, 0x41, 0x42, 0x44, 0x32, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x39, 0x35, 0x37, 0x32, 0x32, 0x36, 0x43, 0x31, 0x43, + 0x39, 0x46, 0x41, 0x41, 0x42, 0x44, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xaf, 0xc3, 0xd3, 0xcc, 0x8e, 0x97, + 0xc2, 0x65, 0x4f, 0x1c, 0x38, 0x64, 0x40, 0x32, 0x48, 0x8e, 0xce, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x66, 0xdd, + 0x68, 0x6f, 0x64, 0x88, 0x31, 0x70, 0xa3, 0xb4, 0x4c, 0x9d, 0xbf, 0x89, + 0x34, 0xab, 0x1a, 0x50, 0xc2, 0xa5, 0x42, 0x08, 0xe5, 0x58, 0x5c, 0x05, + 0x10, 0xed, 0x1f, 0x3b, 0x15, 0xd2, 0x94, 0xa0, 0x28, 0x41, 0x5b, 0x9d, + 0x1e, 0x4b, 0x4f, 0x84, 0x31, 0x02, 0x31, 0xe0, 0x14, 0x4d, 0xbd, 0x92, + 0xd6, 0x53, 0xc3, 0xd0, 0x7d, 0x8d, 0x13, 0xa0, 0x9f, 0xca, 0xad, 0xe8, + 0x60, 0x42, 0x40, 0x1e, 0xb9, 0xda, 0x7a, 0x57, 0xd0, 0xa8, 0xa8, 0xee, + 0x7c, 0xd9, 0xfb, 0xc3, 0x77, 0xb0, 0x7e, 0xf6, 0xda, 0x27, 0x86, 0x06, + 0xd8, 0xf2, 0x4b, 0x06, 0xd3, 0x0b, 0x32, 0x3b, 0x65, 0xb6, 0x28, 0x3a, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x68, 0x08, 0x6d, 0xab, 0x92, 0xf5, 0x83, 0x63, 0x5a, 0x0c, 0x03, 0x38, + 0xa8, 0x3e, 0x64, 0x33, 0x1a, 0x20, 0x5b, 0x51, 0xbd, 0x2c, 0xaa, 0x9c, + 0xe7, 0xfa, 0xa0, 0xa8, 0x53, 0x1f, 0x4d, 0x67, 0x71, 0xce, 0x8f, 0x27, + 0x39, 0x1f, 0xb8, 0xae, 0x72, 0x4d, 0xf3, 0x89, 0x2d, 0x08, 0x07, 0x47, + 0xe7, 0x57, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x72, 0x57, 0x3c, 0x55, 0x1c, 0xac, 0x25, 0x80, 0x86, 0x1d, + 0xe6, 0x36, 0xa9, 0x53, 0x2c, 0x1c, 0x1a, 0x20, 0x89, 0x58, 0xca, 0xc2, + 0xac, 0x15, 0xd9, 0x64, 0xb5, 0x94, 0xcd, 0x5e, 0xa9, 0xd5, 0xea, 0x45, + 0x5b, 0x52, 0x59, 0xfa, 0xb9, 0x54, 0xdf, 0xa8, 0x20, 0xa6, 0xd5, 0x89, + 0xf4, 0xa4, 0x81, 0xd7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x04, 0x2f, 0x39, 0xc4, 0x34, 0x5b, 0xd2, 0x8a, + 0xa8, 0xcc, 0x90, 0x7d, 0x81, 0xe4, 0x4f, 0x5d, 0x1a, 0x20, 0x0d, 0xa1, + 0x0b, 0x52, 0x2b, 0x64, 0xbf, 0xea, 0x12, 0x36, 0xf5, 0x8e, 0xd8, 0x10, + 0xb3, 0x2b, 0x7e, 0x70, 0xef, 0x1e, 0x5b, 0x0a, 0xa0, 0x46, 0x57, 0xcb, + 0xc0, 0xb5, 0xed, 0xd2, 0x22, 0x97, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, + 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x0e, 0x65, 0xce, 0x52, 0x34, 0x25, + 0xc4, 0x9a, 0x71, 0x9e, 0x26, 0x69, 0xdd, 0xf6, 0x67, 0x76, 0x1a, 0x20, + 0xcf, 0xc4, 0x6c, 0xd6, 0xfe, 0x62, 0x0d, 0xd8, 0x2b, 0x80, 0x18, 0x7b, + 0x3c, 0x55, 0x47, 0xcd, 0xe9, 0xc1, 0x18, 0x37, 0x0c, 0x30, 0x94, 0xad, + 0xff, 0x22, 0xae, 0x0b, 0x2f, 0xa2, 0xb6, 0x68, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x6b, 0x13, 0x45, 0xfb, + 0x4a, 0xcd, 0xe2, 0xb1, 0xa7, 0x18, 0x7c, 0xac, 0x33, 0xaf, 0xcb, 0xcc, + 0x1a, 0x20, 0x8c, 0x6f, 0xec, 0xf3, 0x24, 0x73, 0x90, 0xe9, 0xb5, 0x6e, + 0x34, 0xd6, 0x54, 0x8b, 0x53, 0xec, 0x8a, 0x7a, 0x14, 0xef, 0x78, 0xb0, + 0xae, 0x0c, 0x58, 0x56, 0x04, 0x36, 0x83, 0x41, 0x26, 0x2d, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0x8e, 0xce, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x4e, 0x2d, 0x78, 0x20, 0x9a, 0x57, 0x5f, 0x86, + 0x5e, 0x40, 0xc1, 0xcb, 0x48, 0x54, 0x2a, 0x3d, 0x1a, 0x50, 0x64, 0x5e, + 0xd5, 0xdd, 0xff, 0x13, 0xf8, 0x75, 0x24, 0x09, 0x87, 0x7a, 0x88, 0x02, + 0xaa, 0xff, 0x2e, 0x17, 0x7c, 0x7e, 0x33, 0x5c, 0x08, 0xd0, 0x3f, 0x52, + 0x23, 0x63, 0x7e, 0xce, 0xed, 0x68, 0x9e, 0xc3, 0x56, 0xe5, 0x2e, 0x9f, + 0xd0, 0x3e, 0x74, 0x9d, 0x5f, 0x0c, 0x09, 0x32, 0x6f, 0x07, 0xcc, 0xab, + 0x78, 0x13, 0xc2, 0xa1, 0x77, 0x01, 0xf0, 0xc6, 0xbc, 0xa2, 0x0b, 0xd1, + 0x71, 0x0a, 0xa5, 0x1f, 0x0b, 0xb9, 0x32, 0x19, 0xb6, 0x92, 0xac, 0x54, + 0x97, 0xea, 0x97, 0x16, 0x05, 0xaa, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xf3, 0x19, 0xc1, 0xd4, 0x9a, 0xc0, + 0x79, 0xa3, 0x29, 0xbd, 0x93, 0xc7, 0x89, 0x59, 0x0b, 0xc8, 0x1a, 0x20, + 0x5d, 0x38, 0x9a, 0x9c, 0x61, 0x8b, 0x8b, 0xb6, 0x9d, 0xe3, 0xb8, 0x84, + 0xe9, 0x0f, 0xf0, 0x40, 0x91, 0x64, 0xd6, 0x73, 0x66, 0xdd, 0xa4, 0x43, + 0x80, 0xa1, 0x93, 0x8c, 0x87, 0x66, 0x9a, 0xaf, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x4d, 0xf3, 0xd0, 0xe0, + 0xed, 0x20, 0x30, 0x65, 0x76, 0xb4, 0x1c, 0xd7, 0x27, 0x72, 0x20, 0x72, + 0x1a, 0x20, 0x53, 0x35, 0xaa, 0x84, 0x1f, 0x84, 0x5b, 0xaf, 0xd5, 0xf6, + 0xf1, 0xf7, 0x28, 0x75, 0x36, 0xb9, 0xdd, 0x03, 0xa3, 0xce, 0x35, 0x69, + 0xc7, 0x93, 0xa5, 0x24, 0xbe, 0xb1, 0xfe, 0xb4, 0x06, 0x6a, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x71, 0xfc, + 0x8d, 0xac, 0x69, 0x8e, 0x61, 0x84, 0x71, 0x59, 0x1a, 0x74, 0x7c, 0x4d, + 0x1a, 0x5f, 0x1a, 0x20, 0xe4, 0x24, 0xc2, 0xde, 0x31, 0xd4, 0x82, 0x3b, + 0x01, 0xda, 0x20, 0x30, 0x74, 0x65, 0x6b, 0xe4, 0xa4, 0x43, 0xaf, 0x13, + 0x2e, 0xc9, 0x0c, 0xc0, 0x1a, 0xd1, 0xbc, 0xd7, 0xc0, 0x52, 0xd7, 0x65, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0xec, 0x82, 0x20, 0x86, 0xae, 0x20, 0xfb, 0xb8, 0xad, 0x57, 0x7d, 0x52, + 0x8f, 0xa3, 0x73, 0xc0, 0x1a, 0x20, 0xac, 0x59, 0x9d, 0xed, 0x08, 0xdc, + 0x2e, 0x84, 0x5b, 0xf2, 0x5f, 0x6e, 0x6f, 0xe7, 0xea, 0xb4, 0x12, 0x0f, + 0x6d, 0x0b, 0x71, 0x94, 0x56, 0x1b, 0xf1, 0x9f, 0x23, 0xa0, 0xfb, 0x5f, + 0xfe, 0x00, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xe7, 0x62, 0x11, 0x21, 0xab, 0x8e, 0x38, 0x1e, 0x02, 0x91, + 0xac, 0xc5, 0xcc, 0x6d, 0x86, 0xb6, 0x1a, 0x20, 0xf3, 0x35, 0x5c, 0x5f, + 0x1b, 0xd7, 0xf8, 0x7e, 0xfc, 0xc5, 0xd9, 0xa8, 0x32, 0xae, 0x89, 0xa5, + 0x53, 0xa2, 0x8f, 0x22, 0x0c, 0x09, 0x70, 0xfd, 0x6c, 0xb5, 0xba, 0xa5, + 0x38, 0xe7, 0xd7, 0x83, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xa6, 0xce, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x2c, 0xad, 0x0b, 0x34, 0x00, 0x00, 0x00, 0x2a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x2c, 0xad, 0x0b, 0x34, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x37, 0x46, 0x31, 0x34, 0x42, 0x42, 0x45, 0x31, + 0x31, 0x41, 0x32, 0x37, 0x32, 0x45, 0x37, 0x32, 0x32, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x46, 0x31, 0x34, 0x42, 0x42, 0x45, 0x31, 0x31, 0x41, + 0x32, 0x37, 0x32, 0x45, 0x37, 0x32, 0x32, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x27, 0x6e, 0x0f, 0xca, 0xd3, 0x79, + 0x6f, 0x67, 0x08, 0x3a, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x99, 0xcf, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xfd, 0xd3, 0x61, 0x81, 0x6d, 0x36, 0x4b, 0x61, + 0x66, 0xee, 0x81, 0xcd, 0x9a, 0x9d, 0xd3, 0x39, 0x1a, 0x50, 0x36, 0x2d, + 0xde, 0xef, 0xae, 0x06, 0xda, 0x0d, 0xb3, 0xaf, 0x88, 0xe4, 0xe1, 0xe7, + 0xdb, 0x11, 0x7f, 0xd7, 0x52, 0x3d, 0x9f, 0x50, 0xf4, 0xb1, 0x94, 0xe3, + 0x17, 0x6d, 0x12, 0x7a, 0x4b, 0x15, 0xce, 0x7b, 0x50, 0x68, 0x0b, 0xea, + 0x10, 0x21, 0x31, 0x98, 0x35, 0xf3, 0x32, 0x38, 0x9f, 0x73, 0xbd, 0x31, + 0x70, 0x68, 0x9d, 0x6a, 0xfd, 0xdd, 0xda, 0x9d, 0x97, 0x37, 0x52, 0x79, + 0x41, 0xa0, 0xb0, 0x1b, 0x44, 0xf1, 0xa3, 0x7f, 0xa6, 0xdd, 0x0b, 0x8b, + 0x39, 0x26, 0xd9, 0x6a, 0x3d, 0x11, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xac, 0x3b, 0x52, 0x9a, 0xfd, 0x52, + 0x00, 0x68, 0xbf, 0x14, 0x8a, 0x45, 0x06, 0x83, 0x7a, 0xe7, 0x1a, 0x20, + 0xcb, 0x50, 0xad, 0xb7, 0xe8, 0x38, 0xc6, 0xed, 0xcb, 0x21, 0x02, 0x04, + 0xb4, 0x9a, 0xf5, 0xf7, 0x45, 0x16, 0xd2, 0x1c, 0x6e, 0xd9, 0xad, 0xf6, + 0xe1, 0x6d, 0x20, 0xba, 0xbf, 0x1b, 0xc0, 0x72, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x2b, 0xab, 0x35, 0xde, + 0xb5, 0xf3, 0xdd, 0xa2, 0xc8, 0x4b, 0x2a, 0x08, 0x98, 0xd9, 0x14, 0x8b, + 0x1a, 0x20, 0xd2, 0x59, 0x00, 0xce, 0x7d, 0x42, 0x23, 0xab, 0xba, 0xc9, + 0xe3, 0x5c, 0x25, 0xc7, 0x08, 0x1e, 0xb2, 0xb1, 0x12, 0x90, 0x7d, 0x90, + 0x80, 0xa3, 0x6e, 0xfc, 0x0b, 0x6d, 0x2a, 0x0c, 0x50, 0x8d, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x8b, 0x2b, + 0x09, 0xf3, 0x68, 0xcd, 0xb2, 0xce, 0xcd, 0x93, 0x5a, 0x1c, 0x02, 0xc0, + 0xc1, 0x64, 0x1a, 0x20, 0x64, 0x82, 0xa3, 0x8c, 0x4b, 0x42, 0xd5, 0xee, + 0x25, 0x4f, 0x30, 0xd7, 0x08, 0x1b, 0xeb, 0x60, 0xa9, 0xac, 0x79, 0xb9, + 0xd8, 0x09, 0x54, 0xf4, 0x1c, 0x0b, 0xa2, 0xcc, 0xd1, 0xc9, 0x28, 0x18, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0xa4, 0xf8, 0xcc, 0x3a, 0xd6, 0x3e, 0x3b, 0x7c, 0x8e, 0x3a, 0x25, 0xc7, + 0x28, 0x64, 0xd8, 0x02, 0x1a, 0x20, 0x05, 0x69, 0xb5, 0x8a, 0x16, 0x2c, + 0xd2, 0x7d, 0xa5, 0xb0, 0x76, 0x66, 0x5c, 0xa1, 0x87, 0x8b, 0x6e, 0x8f, + 0xe1, 0x7c, 0x2c, 0x5f, 0xe4, 0x04, 0x38, 0xe1, 0x81, 0xf1, 0x26, 0x58, + 0x50, 0x3f, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xf4, 0xa9, 0x88, 0xb1, 0x86, 0xa5, 0x7c, 0x00, 0xea, 0x52, + 0xe7, 0x33, 0x2a, 0x4a, 0x9c, 0x06, 0x1a, 0x20, 0xa3, 0xdf, 0x0d, 0xe6, + 0x69, 0x4c, 0x4f, 0xa6, 0x8f, 0x2a, 0xee, 0x8c, 0x72, 0x8a, 0xc2, 0x29, + 0xe3, 0x33, 0x83, 0x57, 0x6c, 0xb7, 0xea, 0x38, 0xc0, 0x88, 0x9b, 0x4a, + 0x4c, 0x79, 0x10, 0xfc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x99, 0xcf, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, + 0x39, 0x32, 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, 0x39, 0x32, + 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0x8c, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x6b, 0xc6, 0x7d, 0x1c, 0x7f, 0xc1, 0x76, 0x0b, + 0xb3, 0xe6, 0x59, 0x1d, 0x25, 0x5f, 0xc2, 0xdc, 0x1a, 0x50, 0xa5, 0xeb, + 0xc5, 0xc3, 0x5c, 0xb8, 0x45, 0x85, 0x5e, 0x38, 0x07, 0x03, 0x7a, 0xd9, + 0x45, 0xf4, 0x5a, 0x06, 0xe7, 0xdf, 0xfb, 0xb0, 0x0e, 0x31, 0x82, 0x74, + 0xc1, 0x6e, 0x43, 0x1a, 0x22, 0x1c, 0xea, 0x35, 0x95, 0x31, 0x7f, 0xd7, + 0x96, 0x07, 0x61, 0x47, 0x2d, 0xb7, 0x4a, 0x13, 0xcb, 0xcd, 0x40, 0x57, + 0xcc, 0xf3, 0x8c, 0x4b, 0xa1, 0x74, 0x2b, 0x14, 0xa6, 0xea, 0xc2, 0xf8, + 0xae, 0x5a, 0x53, 0x89, 0x8a, 0xf3, 0x86, 0xa7, 0x33, 0xd6, 0xb6, 0xa2, + 0xa5, 0x68, 0x60, 0x79, 0x14, 0x3e, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x80, 0x0c, 0xdf, 0x19, 0xea, 0x58, + 0xa2, 0x50, 0xe8, 0xce, 0xc6, 0x06, 0x80, 0x2a, 0x5c, 0x84, 0x1a, 0x20, + 0x40, 0xe4, 0x12, 0x47, 0x9c, 0x34, 0x3b, 0xb2, 0xe4, 0x69, 0x3e, 0x49, + 0x4b, 0xe7, 0x8b, 0xc3, 0xdc, 0xa2, 0x00, 0xdf, 0x30, 0x79, 0x29, 0x28, + 0x0e, 0xa2, 0xd0, 0x25, 0x6b, 0x0e, 0x9e, 0xec, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xa2, 0x74, 0x2c, 0x5f, + 0xba, 0x1a, 0xe9, 0xf6, 0x61, 0x8c, 0xb0, 0x9e, 0xd9, 0x17, 0x39, 0x94, + 0x1a, 0x20, 0xdd, 0x94, 0x8d, 0xb6, 0x64, 0x20, 0xf2, 0xe9, 0xaa, 0xac, + 0xbb, 0x31, 0xd3, 0xa7, 0x3a, 0x85, 0xe0, 0xfe, 0xa7, 0x67, 0xc5, 0xf2, + 0x03, 0x3a, 0x1a, 0xbf, 0x8b, 0xd0, 0xb2, 0xf0, 0x78, 0x14, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xdd, 0x32, + 0xac, 0x99, 0x4a, 0xe7, 0x1d, 0x82, 0x49, 0x08, 0x85, 0x00, 0xa9, 0xf8, + 0xcd, 0xcf, 0x1a, 0x20, 0x55, 0x8e, 0xf0, 0x73, 0x60, 0x84, 0xa7, 0x1e, + 0x4c, 0xf5, 0xa9, 0xda, 0xb9, 0x5f, 0x46, 0xc8, 0xfc, 0xb1, 0x50, 0x0a, + 0xd0, 0x59, 0x0f, 0xd9, 0xeb, 0x50, 0xc8, 0xf8, 0x6d, 0x92, 0x9d, 0xcf, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x6c, 0x8b, 0x1a, 0x62, 0x04, 0x58, 0x13, 0x34, 0x84, 0x90, 0xfb, 0xf4, + 0xf2, 0xb0, 0xb1, 0x18, 0x1a, 0x20, 0x90, 0x50, 0xe1, 0x2e, 0xec, 0xbd, + 0x70, 0x55, 0x60, 0x6e, 0x40, 0x4c, 0x71, 0x03, 0x11, 0x2f, 0x03, 0xb4, + 0x26, 0x49, 0xd8, 0x07, 0x49, 0x47, 0x28, 0x90, 0xc4, 0x64, 0xeb, 0x95, + 0xdc, 0xeb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0x4f, 0x69, 0x0e, 0x19, 0xab, 0x00, 0x7b, 0xb5, 0x5b, 0x38, + 0x30, 0xe2, 0x83, 0x30, 0x88, 0xc6, 0x1a, 0x20, 0x67, 0xfb, 0x45, 0xae, + 0x7b, 0x55, 0x6d, 0xd0, 0xe8, 0xf6, 0xe7, 0xa3, 0x7f, 0x4e, 0xde, 0x6a, + 0x68, 0x65, 0x17, 0x82, 0x64, 0xc4, 0x22, 0x24, 0xbd, 0x9e, 0xf6, 0xa0, + 0x83, 0x6e, 0x36, 0xe9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0x8c, 0xd0, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, + 0x44, 0x44, 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, 0x44, 0x44, + 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc1, 0xf0, 0xf1, 0x8a, 0x9b, 0x9b, + 0x09, 0x4f, 0x67, 0xfe, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xff, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x25, 0x3d, 0xc5, 0xb7, 0xe6, 0xde, 0xdd, 0xfa, + 0x0f, 0x40, 0xba, 0x09, 0x57, 0xce, 0x08, 0xae, 0x1a, 0x50, 0x54, 0xd6, + 0xc6, 0x4c, 0xb6, 0xe5, 0x0a, 0xd0, 0x13, 0xb0, 0x58, 0x4c, 0x85, 0xd2, + 0x36, 0x14, 0x02, 0xb4, 0xba, 0x93, 0x40, 0x59, 0x5b, 0x43, 0x1a, 0x98, + 0xe8, 0x54, 0x54, 0x26, 0x75, 0x39, 0x9b, 0x4c, 0xfc, 0x10, 0x80, 0xab, + 0xf8, 0xde, 0x34, 0x81, 0xe8, 0x31, 0x85, 0xeb, 0x02, 0xe1, 0x14, 0xe6, + 0xab, 0x93, 0x72, 0xbb, 0x19, 0x5c, 0xfb, 0xa7, 0x1e, 0xc0, 0x14, 0xa4, + 0xb3, 0x91, 0x68, 0x10, 0xbd, 0x27, 0x94, 0x6b, 0x78, 0x91, 0x8a, 0xda, + 0x5d, 0xf3, 0x15, 0x46, 0xe8, 0x1a, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xf2, 0x8f, 0x7b, 0x68, 0x7b, 0x61, + 0xfe, 0xcd, 0xa1, 0x87, 0xbd, 0x89, 0xe7, 0x98, 0xff, 0x6b, 0x1a, 0x20, + 0x3c, 0x7a, 0xab, 0xfd, 0xc1, 0x61, 0xe3, 0xd4, 0x68, 0xa4, 0x45, 0x13, + 0x05, 0x68, 0xe8, 0x68, 0x6c, 0x85, 0xd7, 0x3a, 0xc0, 0xdd, 0x37, 0xe6, + 0x79, 0x26, 0x96, 0xa3, 0x10, 0x85, 0x2d, 0x2a, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xea, 0xf1, 0x68, 0x99, + 0x78, 0x02, 0xea, 0xd8, 0x00, 0x33, 0xcc, 0x9f, 0x3b, 0x3f, 0xba, 0x8a, + 0x1a, 0x20, 0xbd, 0x2b, 0xe1, 0xbf, 0x1e, 0xd6, 0x50, 0xe1, 0x89, 0xec, + 0xbb, 0x5c, 0xef, 0xd9, 0xdc, 0x8e, 0x3e, 0x2e, 0x2f, 0xf7, 0xb2, 0xc9, + 0xe2, 0x6d, 0xb7, 0x77, 0x6d, 0x47, 0x5e, 0x5e, 0x85, 0x62, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x18, 0xc8, + 0x46, 0x96, 0x5a, 0x25, 0xef, 0x28, 0xa7, 0xd6, 0xbe, 0xc7, 0xfc, 0x8a, + 0x2e, 0xe9, 0x1a, 0x20, 0x6b, 0xf1, 0x7d, 0xf9, 0x11, 0xd9, 0xca, 0xc1, + 0x45, 0xe1, 0x35, 0x20, 0x3f, 0x4a, 0xb2, 0xa5, 0x20, 0x5e, 0xdc, 0x09, + 0x51, 0x2b, 0x5b, 0xd1, 0x24, 0xf8, 0x68, 0x7c, 0xde, 0x4f, 0x4d, 0x13, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x72, 0x9c, 0xe7, 0x79, 0xa7, 0xc3, 0x81, 0x8a, 0xa1, 0x19, 0x05, 0x9f, + 0x15, 0x3a, 0x3f, 0x95, 0x1a, 0x20, 0xc6, 0x60, 0x36, 0x87, 0xe0, 0x3c, + 0x60, 0xfa, 0x83, 0x6a, 0x5e, 0xc0, 0xcf, 0xec, 0x00, 0xd5, 0xf6, 0xf7, + 0x9d, 0xac, 0xb5, 0x97, 0x47, 0xf1, 0xf5, 0xfc, 0x54, 0x0d, 0xa5, 0xde, + 0x33, 0xe5, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0x66, 0x30, 0x54, 0x2a, 0x1f, 0x9c, 0x85, 0xdc, 0xe4, 0xfb, + 0x32, 0x03, 0xf3, 0x83, 0x95, 0x8f, 0x1a, 0x20, 0x54, 0xe0, 0x1f, 0x33, + 0xe1, 0x22, 0xaf, 0xfe, 0xef, 0xde, 0xf0, 0x32, 0xcc, 0xa6, 0x12, 0x48, + 0x21, 0x0e, 0x46, 0x07, 0x63, 0x56, 0xcd, 0xa3, 0x63, 0x78, 0x5f, 0xdc, + 0xe3, 0x2d, 0xe0, 0x11, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xff, 0xd0, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, + 0x35, 0x42, 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, 0x35, 0x42, + 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xf2, 0xd1, 0x92, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x51, 0x07, 0x58, 0xf5, 0xf6, 0xb7, 0xa2, 0x85, + 0xaf, 0xee, 0xf3, 0xc4, 0x3f, 0xf0, 0xa8, 0xad, 0x1a, 0x50, 0xac, 0x41, + 0x97, 0xf0, 0x7a, 0x6d, 0x36, 0x0f, 0xf3, 0xa9, 0xc0, 0x0d, 0x1a, 0xa2, + 0xd3, 0x42, 0xd8, 0x88, 0x86, 0xe7, 0x86, 0xc0, 0x34, 0xa9, 0x0e, 0x03, + 0x4d, 0x92, 0x9f, 0x98, 0xf9, 0xb4, 0xee, 0x51, 0x3e, 0xbc, 0xc2, 0x88, + 0xf2, 0x67, 0x53, 0x61, 0xac, 0xe6, 0x68, 0x13, 0x5a, 0x48, 0xa0, 0x03, + 0xa9, 0xa4, 0xbd, 0xcc, 0x67, 0x41, 0x3d, 0xf6, 0x27, 0x6a, 0x85, 0x52, + 0x71, 0x79, 0xfc, 0xb0, 0x9e, 0x76, 0x45, 0x7e, 0x5a, 0x9c, 0x32, 0x63, + 0xd1, 0x76, 0x06, 0x6e, 0x1d, 0x38, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd2, 0xdc, 0x9f, 0x98, 0x96, 0xea, + 0x12, 0xee, 0x56, 0x3e, 0x52, 0x4b, 0xcd, 0x34, 0x61, 0x3a, 0x1a, 0x20, + 0xc0, 0x9a, 0x54, 0x60, 0x77, 0xb7, 0xec, 0x97, 0x88, 0x95, 0xca, 0x99, + 0x74, 0x89, 0xc0, 0xc4, 0x41, 0x0f, 0x84, 0x77, 0xa3, 0x10, 0x85, 0x81, + 0x37, 0xbc, 0x8c, 0x93, 0x76, 0x74, 0x62, 0x6b, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, + 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x29, 0x69, 0x9e, 0x99, + 0xc6, 0xd7, 0x9f, 0x6b, 0x68, 0x2f, 0x18, 0x20, 0x34, 0x57, 0x3f, 0xd4, + 0x1a, 0x20, 0xc6, 0x4f, 0xba, 0x10, 0x83, 0xe7, 0xaa, 0x6d, 0xcd, 0xca, + 0x42, 0x4c, 0x76, 0xe8, 0xc2, 0xb1, 0xee, 0x10, 0x88, 0x95, 0x54, 0x01, + 0x84, 0xe1, 0xca, 0xcb, 0x61, 0x6b, 0x7c, 0x10, 0x89, 0xc1, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xa1, 0x31, + 0x9d, 0xb0, 0x28, 0x50, 0x81, 0xcf, 0x39, 0x5c, 0xf9, 0xef, 0xbb, 0x7a, + 0x80, 0x43, 0x1a, 0x20, 0xda, 0x26, 0xa7, 0xbc, 0x31, 0x2e, 0x93, 0x24, + 0x9a, 0x40, 0x6c, 0x03, 0x44, 0xdd, 0x07, 0x22, 0x9d, 0x8e, 0x2e, 0x2a, + 0xca, 0xcd, 0xc2, 0xdd, 0x4b, 0x44, 0x88, 0x73, 0x88, 0x28, 0xef, 0x2c, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x9a, 0x20, 0xd8, 0x07, 0xe4, 0xcb, 0x75, 0x93, 0x22, 0xe8, 0xe9, 0x80, + 0x78, 0x30, 0xbb, 0x9f, 0x1a, 0x20, 0x56, 0xcc, 0x79, 0x52, 0xf1, 0xf2, + 0x77, 0xab, 0x6c, 0x20, 0xb3, 0x7a, 0xca, 0x39, 0x03, 0x92, 0xe0, 0x18, + 0x6f, 0x9e, 0x42, 0xdf, 0x72, 0x75, 0x54, 0x15, 0xd3, 0x3f, 0x81, 0x35, + 0xb9, 0x25, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xae, 0x99, 0x37, 0xde, 0xee, 0x48, 0x60, 0x01, 0x70, 0xdf, + 0xd4, 0xd3, 0xc4, 0x07, 0xd6, 0x49, 0x1a, 0x20, 0x71, 0xa1, 0xc6, 0x91, + 0x32, 0xa2, 0x21, 0x52, 0x91, 0xdc, 0xfd, 0x06, 0x7e, 0x2a, 0x83, 0xf8, + 0x6e, 0x14, 0xbe, 0xf1, 0xf9, 0xc4, 0x20, 0xee, 0x86, 0x38, 0x5d, 0x7f, + 0x6d, 0x6c, 0x6f, 0x7a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xf2, 0xd1, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, + 0x30, 0x38, 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, 0x30, 0x38, + 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x95, 0x14, 0x20, 0x6a, 0xff, 0x32, + 0x03, 0xbc, 0x6c, 0xe6, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0x93, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x7a, 0xb6, 0x67, 0x56, 0x7f, 0x74, 0x16, 0x7c, + 0xce, 0x39, 0x23, 0x56, 0xc0, 0x6c, 0xb3, 0xd6, 0x1a, 0x50, 0x01, 0xb2, + 0x17, 0x38, 0xa4, 0xfb, 0x20, 0xbc, 0xde, 0x96, 0x6b, 0xae, 0x37, 0x8a, + 0x15, 0xcc, 0x21, 0xb3, 0xd3, 0xb8, 0x99, 0xdd, 0x5d, 0x34, 0x14, 0xd2, + 0xe4, 0x4b, 0xcc, 0xf4, 0xed, 0x91, 0x48, 0x78, 0x73, 0x9a, 0x76, 0xba, + 0xa6, 0xb6, 0xae, 0xe7, 0xa1, 0x7d, 0x51, 0x16, 0xb5, 0xc6, 0xb5, 0x33, + 0xdd, 0x80, 0x77, 0x6f, 0x0b, 0x4e, 0xed, 0xab, 0xaf, 0xa6, 0xd5, 0x68, + 0x7b, 0x59, 0x14, 0x64, 0xe3, 0x11, 0x71, 0x05, 0x67, 0x24, 0x02, 0xc7, + 0xf1, 0xb7, 0xf8, 0x56, 0x35, 0xbe, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xce, 0x52, 0x02, 0xd9, 0x13, 0x7f, + 0xa4, 0x05, 0x11, 0xb1, 0x9e, 0x18, 0x0d, 0x8f, 0x5e, 0x7e, 0x1a, 0x20, + 0x27, 0x22, 0xb8, 0xee, 0x70, 0x3a, 0xab, 0x80, 0x89, 0xfc, 0x34, 0xa4, + 0x8f, 0x75, 0x53, 0x6e, 0x60, 0xb9, 0x9e, 0x8d, 0xdd, 0x76, 0x89, 0xd6, + 0xdc, 0x3b, 0xe7, 0x62, 0x99, 0x61, 0x48, 0xfa, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, + 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x5d, 0x78, 0xfa, 0x39, + 0x09, 0xf1, 0xcb, 0x6a, 0x69, 0x8a, 0xed, 0x8e, 0xaf, 0xa6, 0x5d, 0xcc, + 0x1a, 0x20, 0xf1, 0xa7, 0x66, 0xe8, 0xc3, 0x63, 0xbb, 0x63, 0x85, 0x08, + 0xaa, 0x71, 0xbe, 0x1a, 0x24, 0x80, 0xf9, 0x24, 0x93, 0x88, 0x2c, 0x33, + 0xce, 0x0c, 0x50, 0xe1, 0xc6, 0xdc, 0x7f, 0xed, 0x45, 0x59, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x98, 0xfb, + 0x14, 0x6c, 0xc0, 0x5e, 0x4b, 0x75, 0xd0, 0x1f, 0x77, 0xbe, 0xf9, 0x90, + 0x92, 0xd6, 0x1a, 0x20, 0xd8, 0x39, 0x84, 0xa0, 0x2e, 0x6e, 0xf4, 0x92, + 0xcb, 0xa1, 0x36, 0x53, 0xdf, 0x73, 0x7b, 0xbe, 0x5b, 0xf5, 0xf8, 0x77, + 0xe6, 0x0b, 0x25, 0x4c, 0x5d, 0xf5, 0x48, 0x15, 0x90, 0xc7, 0xfb, 0xf8, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x49, 0x04, 0x91, 0x23, 0xfb, 0x96, 0xbd, 0xbe, 0xe0, 0x7d, 0xf6, 0x9b, + 0x0c, 0xa3, 0x80, 0x99, 0x1a, 0x20, 0x03, 0x41, 0xef, 0x8d, 0xbc, 0xe8, + 0x64, 0xa7, 0xb4, 0x98, 0x84, 0xb5, 0x3b, 0xdb, 0x04, 0x04, 0x10, 0x27, + 0x96, 0x0a, 0x6b, 0x04, 0x7f, 0x60, 0xef, 0xfa, 0x2c, 0x5f, 0x50, 0x6c, + 0xbc, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xd1, 0xfc, 0xd1, 0x29, 0x11, 0x1a, 0x90, 0x8b, 0xcc, 0xe9, + 0xce, 0x1a, 0x2e, 0x47, 0x7e, 0x0c, 0x1a, 0x20, 0xe7, 0x66, 0x27, 0xae, + 0x94, 0x90, 0x5c, 0x99, 0x05, 0x04, 0x7d, 0xb5, 0xca, 0x81, 0x62, 0x6f, + 0x11, 0x01, 0x8d, 0xca, 0x50, 0x4c, 0xbb, 0x99, 0xf5, 0xd6, 0x94, 0x36, + 0x81, 0x0e, 0xfe, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x93, 0xd2, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, + 0x37, 0x35, 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, 0x37, 0x35, + 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xb4, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xbd, 0x7f, 0xe0, 0x8a, + 0xad, 0x90, 0x35, 0x02, 0xc2, 0x23, 0x20, 0x63, 0xf5, 0x48, 0x10, 0xf8, + 0x1a, 0x50, 0xd5, 0x31, 0xf7, 0x5c, 0x0f, 0x1c, 0xf7, 0xbc, 0xf5, 0xe2, + 0xe2, 0x58, 0xaf, 0xd3, 0xca, 0x3b, 0x28, 0x93, 0x9f, 0x23, 0xc6, 0x8a, + 0x5c, 0xeb, 0x61, 0x0d, 0xb9, 0x7d, 0xf4, 0xe6, 0xf0, 0x0c, 0x21, 0x35, + 0x7e, 0x3c, 0x2a, 0x21, 0x92, 0xb2, 0xa2, 0x71, 0xc9, 0x86, 0x3c, 0x7c, + 0x58, 0x96, 0x9c, 0xa8, 0x1e, 0x56, 0x03, 0x24, 0xb3, 0x1a, 0x5e, 0xc0, + 0x2d, 0x97, 0x5a, 0x9c, 0xa4, 0x0e, 0xc7, 0xf5, 0xb2, 0x6d, 0x0b, 0x47, + 0x2e, 0x10, 0x5f, 0xd0, 0x02, 0xed, 0x7e, 0x4a, 0x17, 0x61, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xa6, 0xf5, + 0x96, 0x0d, 0x4f, 0xce, 0xfe, 0x51, 0xe2, 0x26, 0x73, 0xb9, 0xa0, 0x30, + 0xb9, 0x27, 0x1a, 0x20, 0x81, 0x05, 0xda, 0xee, 0x9a, 0xd7, 0x02, 0xd6, + 0x5d, 0xc5, 0xcb, 0x6e, 0x41, 0xd8, 0x8c, 0x41, 0x1b, 0x04, 0x69, 0x0f, + 0xca, 0x69, 0x06, 0x46, 0xe2, 0x79, 0xc4, 0x38, 0x12, 0xd0, 0x3b, 0x77, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xa3, 0xc9, 0xae, 0xf8, 0xb2, 0x01, 0x33, 0xfb, 0x53, 0x70, 0xc9, 0x97, + 0x35, 0x07, 0x45, 0xf0, 0x1a, 0x20, 0xbe, 0xf1, 0xdb, 0x30, 0x01, 0x64, + 0x02, 0xe4, 0xe4, 0xb5, 0x03, 0xb5, 0xb3, 0x20, 0xb4, 0xdc, 0x3b, 0xaa, + 0x9c, 0x6c, 0x5d, 0x4a, 0x65, 0x6d, 0xd1, 0x58, 0x87, 0xfb, 0xe1, 0x0e, + 0x98, 0x96, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0x4e, 0x0b, 0x87, 0x07, 0x85, 0x84, 0xc4, 0xcd, 0x71, 0xd5, + 0xad, 0x63, 0x72, 0x47, 0x33, 0xfc, 0x1a, 0x20, 0x15, 0xbd, 0xcf, 0xd5, + 0xd7, 0xda, 0x5b, 0x25, 0x84, 0xb8, 0x1e, 0x31, 0x49, 0xf2, 0x63, 0x79, + 0x9b, 0x95, 0xb5, 0x19, 0x88, 0x43, 0x86, 0x03, 0x0e, 0x2f, 0x55, 0x6b, + 0xe1, 0xe0, 0x29, 0x5a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x27, 0x4d, 0xaa, 0xb0, 0x19, 0x5d, 0x8d, 0x97, + 0x08, 0x8d, 0x00, 0x23, 0x32, 0x8e, 0x10, 0x97, 0x1a, 0x20, 0x3a, 0x38, + 0x9d, 0x66, 0x1c, 0x62, 0x58, 0x75, 0xdd, 0x08, 0x6e, 0x77, 0x87, 0x34, + 0x74, 0x78, 0xc8, 0x0d, 0x43, 0xf0, 0x21, 0x8c, 0xc4, 0x0d, 0x8c, 0xef, + 0xb0, 0x9e, 0x25, 0x08, 0xdc, 0x4c, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, + 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x89, 0x5f, 0xd2, 0xe7, 0x12, 0xef, + 0x92, 0xe1, 0x34, 0x4a, 0xa6, 0xda, 0xff, 0xc4, 0xeb, 0xf3, 0x1a, 0x20, + 0x9f, 0xae, 0x4a, 0xbb, 0xee, 0x52, 0x30, 0x6a, 0x61, 0x94, 0x05, 0xa8, + 0x82, 0xaf, 0xc2, 0xe4, 0x38, 0xe5, 0x82, 0xbf, 0xf6, 0xfc, 0x06, 0x6f, + 0x4c, 0x5a, 0x45, 0xcc, 0x81, 0xee, 0xab, 0x92, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xb4, + 0xd2, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7b, 0x1b, 0xdd, 0xcb, 0x00, 0x00, 0x00, 0x36, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7b, 0x1b, 0xdd, 0xcb, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x26, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x88, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x46, 0x44, 0x31, 0x41, 0x43, 0x46, 0x33, 0x46, + 0x39, 0x32, 0x34, 0x38, 0x46, 0x39, 0x32, 0x36, 0x33, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x44, 0x31, 0x41, 0x43, 0x46, 0x33, 0x46, 0x39, 0x32, + 0x34, 0x38, 0x46, 0x39, 0x32, 0x36, 0x33, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x0d, 0x38, 0x79, 0xc3, 0xc5, 0xd7, + 0x37, 0x92, 0xa3, 0x35, 0x38, 0x00, 0x40, 0x00, 0x48, 0x8e, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xb3, 0x65, 0xfc, 0xf8, + 0xd5, 0x82, 0xe7, 0x12, 0x78, 0x14, 0x0a, 0xfb, 0x1c, 0x95, 0xdf, 0x30, + 0x1a, 0x50, 0xba, 0x5d, 0xa2, 0xd6, 0xc3, 0xfd, 0x04, 0x23, 0x1e, 0x07, + 0xda, 0x92, 0x81, 0xa8, 0xc9, 0x1d, 0x72, 0x2e, 0x40, 0x33, 0xee, 0x30, + 0xac, 0x8b, 0x3f, 0x2b, 0x83, 0x46, 0x2a, 0xf0, 0x7e, 0x5e, 0x35, 0x35, + 0xb4, 0x29, 0xd0, 0x5e, 0xae, 0xc1, 0x0b, 0x98, 0xae, 0xc3, 0xe0, 0x03, + 0x18, 0xd1, 0xce, 0x35, 0x43, 0x12, 0xee, 0xd3, 0x49, 0x7e, 0x00, 0x08, + 0x5b, 0x5f, 0x8b, 0x0d, 0x1d, 0xef, 0x57, 0x1c, 0xa5, 0x96, 0x9d, 0x26, + 0xb0, 0xb8, 0x98, 0xdb, 0x24, 0x53, 0xe4, 0x7d, 0xf3, 0xe6, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x4f, 0xf4, + 0x3b, 0x8f, 0xa3, 0x78, 0x33, 0x81, 0x5d, 0x82, 0x7f, 0xe8, 0xe2, 0xcb, + 0x59, 0x0a, 0x1a, 0x20, 0x6c, 0x39, 0x8b, 0xef, 0x75, 0xea, 0x74, 0x19, + 0x8a, 0x34, 0x6c, 0xef, 0x43, 0xa4, 0x9d, 0x6f, 0x24, 0x4b, 0x4d, 0x8d, + 0xf9, 0x97, 0xfa, 0xb0, 0x2c, 0x5f, 0xc7, 0x61, 0x2a, 0xb2, 0x50, 0x42, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x81, 0x88, 0x6a, 0x03, 0x18, 0x4a, 0xa7, 0x3a, 0x08, 0xd8, 0x6f, 0x14, + 0xc5, 0xc0, 0x37, 0x9b, 0x1a, 0x20, 0x8a, 0xf0, 0x93, 0xa8, 0x89, 0xe9, + 0x69, 0x4a, 0x1a, 0x62, 0x72, 0x16, 0x2f, 0xe8, 0x98, 0x84, 0x95, 0x95, + 0x6a, 0xd2, 0x21, 0x08, 0x0f, 0xb1, 0xb6, 0x69, 0x20, 0x6b, 0xee, 0x0d, + 0xc5, 0x8d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0xd6, 0x28, 0x78, 0x5a, 0xc6, 0xff, 0x4c, 0xa1, 0xf7, 0xf6, + 0xfc, 0x0e, 0xc5, 0xdd, 0xc1, 0xc0, 0x1a, 0x20, 0xba, 0x10, 0x64, 0x59, + 0xba, 0xf9, 0x4c, 0x7e, 0xe4, 0x14, 0x2e, 0x5c, 0xb1, 0xab, 0xdf, 0xe4, + 0x4f, 0x88, 0xde, 0x42, 0xb6, 0xc8, 0xd2, 0x1e, 0xbd, 0x75, 0x37, 0x9a, + 0x33, 0x5f, 0x80, 0xaa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x47, 0x32, 0x86, 0xf8, 0xaf, 0x43, 0xd7, 0xfa, + 0xfd, 0xac, 0x36, 0xd5, 0x64, 0x36, 0x1d, 0xcf, 0x1a, 0x20, 0x2d, 0xf4, + 0x07, 0x5a, 0x61, 0x5e, 0x83, 0xfc, 0x6d, 0x4d, 0x5b, 0xe4, 0x98, 0x1a, + 0xff, 0x83, 0xac, 0x13, 0xab, 0x49, 0x4d, 0x68, 0xbb, 0x5d, 0xe8, 0xe9, + 0xa9, 0x0f, 0xce, 0x75, 0xa4, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, + 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x6e, 0x6a, 0x0c, 0x1c, 0x4d, 0x57, + 0x50, 0x17, 0x5d, 0xc4, 0xb3, 0x93, 0x74, 0x5c, 0x39, 0xe6, 0x1a, 0x20, + 0xf2, 0x99, 0xc1, 0x94, 0x54, 0xe7, 0x98, 0x24, 0x9e, 0x92, 0xeb, 0xb8, + 0x08, 0xd6, 0x71, 0x60, 0x2d, 0x6e, 0x96, 0x56, 0x6c, 0x37, 0x2f, 0x7e, + 0xd0, 0x26, 0xc6, 0x74, 0x2e, 0x8a, 0xf3, 0x68, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x8e, + 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x00, 0xc2, 0xfa, 0xf0, 0x00, 0x00, 0x00, 0x38, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x00, 0xc2, 0xfa, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x31, 0x32, 0x30, 0x45, 0x43, 0x37, 0x39, 0x35, + 0x43, 0x46, 0x42, 0x44, 0x32, 0x45, 0x31, 0x44, 0x33, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x32, 0x30, 0x45, 0x43, 0x37, 0x39, 0x35, 0x43, 0x46, + 0x42, 0x44, 0x32, 0x45, 0x31, 0x44, 0x33, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xe8, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x0b, 0x38, + 0x0e, 0x91, 0xd2, 0xb4, 0xad, 0x6b, 0x21, 0xb3, 0x92, 0xf8, 0x17, 0x43, + 0x99, 0x8d, 0x1a, 0x50, 0x16, 0x44, 0xce, 0x7a, 0x37, 0x0f, 0xb3, 0xd0, + 0xc3, 0x53, 0xaf, 0x9d, 0xba, 0x77, 0x53, 0x40, 0xd7, 0x17, 0xf0, 0x41, + 0xa9, 0x51, 0x1c, 0x84, 0x78, 0x6a, 0x97, 0x2f, 0xa3, 0x2b, 0x17, 0x86, + 0x9c, 0x2e, 0xca, 0x81, 0xbe, 0x73, 0x9e, 0xf6, 0x5d, 0xbc, 0xe1, 0x56, + 0x43, 0x56, 0xa9, 0x3c, 0x50, 0x36, 0x55, 0x04, 0x62, 0x33, 0x8d, 0xc2, + 0x2b, 0xfd, 0x2a, 0x8c, 0xd7, 0xbf, 0xaf, 0x6e, 0x94, 0x55, 0x66, 0x01, + 0x4a, 0xb8, 0xe9, 0xdf, 0xad, 0x96, 0xf5, 0x4e, 0x93, 0xf2, 0x87, 0x07, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xf7, 0xf9, 0x1e, 0xa1, 0x45, 0x0f, 0x4f, 0xe9, 0xb3, 0xa3, 0xae, 0xe2, + 0x79, 0xc9, 0x97, 0xd2, 0x1a, 0x20, 0x25, 0x09, 0xf9, 0xc6, 0x8b, 0xe6, + 0xb6, 0xcf, 0xf6, 0x13, 0x15, 0x0a, 0x11, 0xdb, 0x8e, 0x68, 0x89, 0x42, + 0x25, 0xea, 0xf6, 0xc2, 0xc2, 0x51, 0x89, 0xc8, 0x41, 0x79, 0xb1, 0xdf, + 0xd0, 0xe4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x97, 0xa1, 0x40, 0x54, 0x64, 0x38, 0x2c, 0x01, 0x5f, 0x05, + 0x7b, 0xf6, 0xf0, 0xa2, 0x9b, 0x02, 0x1a, 0x20, 0xff, 0xea, 0x46, 0x74, + 0xec, 0xe8, 0x9d, 0xb7, 0x7f, 0x02, 0xa1, 0xf1, 0x39, 0x4d, 0x8c, 0x99, + 0x13, 0x54, 0x66, 0x62, 0xd1, 0xfb, 0x7f, 0x7a, 0x59, 0x64, 0x95, 0xf4, + 0xab, 0x26, 0x67, 0xce, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x14, 0x49, 0xc9, 0x42, 0x5b, 0x28, 0x9b, 0x28, + 0x3a, 0x8a, 0x4c, 0xb5, 0x5f, 0xdb, 0xc6, 0x1d, 0x1a, 0x20, 0xe0, 0x73, + 0x2f, 0x07, 0xce, 0x3a, 0x88, 0xaa, 0x49, 0x34, 0xcc, 0xac, 0xd0, 0x44, + 0x06, 0xab, 0x44, 0xae, 0x93, 0x18, 0x05, 0x8f, 0x38, 0xd9, 0xb5, 0xe6, + 0xc6, 0x83, 0x45, 0x55, 0xfa, 0x7b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, + 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x73, 0x45, 0x32, 0x30, 0xea, 0x13, + 0x80, 0x5f, 0x6f, 0x5a, 0x08, 0xa4, 0x39, 0xbe, 0x8c, 0x3d, 0x1a, 0x20, + 0x6a, 0xb1, 0x81, 0xf7, 0x90, 0x07, 0xe5, 0x22, 0x96, 0x13, 0x01, 0x44, + 0xbb, 0xcd, 0xc9, 0xf1, 0xe5, 0x9d, 0x46, 0x83, 0xca, 0x72, 0xfe, 0x17, + 0x76, 0xc1, 0x81, 0x5c, 0x8b, 0x2e, 0x18, 0x04, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x19, 0x00, 0x00, 0x44, + 0x37, 0x42, 0x27, 0xab, 0x92, 0xb9, 0x27, 0xaa, 0x3e, 0x0a, 0x38, 0x2c, + 0x1a, 0x20, 0xa4, 0x36, 0xb0, 0x4f, 0xec, 0xeb, 0x63, 0x02, 0x14, 0xe2, + 0xa6, 0xb1, 0xeb, 0xf7, 0xd7, 0x52, 0xf8, 0xfa, 0x79, 0x14, 0x5e, 0xe4, + 0xd0, 0x12, 0xc1, 0x20, 0x76, 0x0f, 0x3d, 0x57, 0xb9, 0x21, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xe8, 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x46, 0x0a, 0xd8, 0x38, 0x00, 0x00, 0x00, 0x3a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x46, 0x0a, 0xd8, 0x38, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x45, 0x43, 0x36, 0x45, 0x34, 0x41, 0x37, 0x32, + 0x43, 0x42, 0x42, 0x31, 0x36, 0x34, 0x33, 0x37, 0x33, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x43, 0x36, 0x45, 0x34, 0x41, 0x37, 0x32, 0x43, 0x42, + 0x42, 0x31, 0x36, 0x34, 0x33, 0x37, 0x33, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc5, 0x4d, 0x91, 0xe8, 0x46, 0x4e, + 0xfd, 0x2e, 0x7e, 0x71, 0x38, 0x00, 0x40, 0x00, 0x48, 0xf6, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xef, 0x6c, + 0x04, 0x79, 0xe1, 0xd4, 0xc5, 0x6c, 0x49, 0x4f, 0x78, 0xaf, 0x67, 0xa4, + 0x1d, 0xd8, 0x1a, 0x50, 0xee, 0x13, 0x1a, 0x17, 0x9d, 0xf9, 0x7e, 0x7f, + 0xa4, 0x3d, 0x18, 0xfd, 0xcb, 0x67, 0x4c, 0x4b, 0x58, 0x8c, 0xd8, 0x1d, + 0xe9, 0xcf, 0x6c, 0x26, 0xb1, 0xf7, 0x4c, 0xd5, 0x0a, 0x8d, 0x84, 0x77, + 0x71, 0x88, 0x87, 0x26, 0x94, 0x1c, 0xf6, 0x50, 0xe4, 0xec, 0xc3, 0x5d, + 0x92, 0xd5, 0xef, 0xc3, 0x5d, 0x11, 0x57, 0x13, 0x01, 0x09, 0x06, 0xa8, + 0x55, 0x46, 0xae, 0x04, 0x8a, 0x46, 0x38, 0xc0, 0xe9, 0x14, 0x6b, 0xa1, + 0xff, 0x66, 0x5a, 0xc7, 0xa4, 0xd6, 0xba, 0x32, 0xf2, 0x41, 0x9c, 0xd9, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x45, 0x95, 0x30, 0x46, 0x5b, 0xcb, 0x93, 0x70, 0x52, 0xac, 0x5e, 0x7a, + 0x05, 0xed, 0xa4, 0xcb, 0x1a, 0x20, 0x21, 0x8b, 0xfd, 0xb1, 0x20, 0x48, + 0xb8, 0x19, 0x96, 0x54, 0x8f, 0x08, 0xe9, 0xc1, 0x6b, 0x7b, 0xf2, 0x58, + 0x29, 0xa3, 0x5c, 0x13, 0x02, 0x13, 0xc9, 0xb1, 0x07, 0x35, 0x05, 0xdf, + 0x57, 0xfa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x6b, 0x79, 0xe3, 0xa2, 0xf0, 0x10, 0xcb, 0x45, 0x17, 0x39, + 0xa8, 0xdd, 0x3b, 0x48, 0xeb, 0xbf, 0x1a, 0x20, 0xa9, 0x82, 0x1e, 0xed, + 0xab, 0x6d, 0x30, 0x32, 0x3d, 0x69, 0x81, 0x74, 0x02, 0xf3, 0xca, 0x73, + 0x4e, 0xb8, 0x95, 0x3c, 0x3c, 0x94, 0x2e, 0xeb, 0xe5, 0xba, 0xa8, 0x8f, + 0x59, 0x52, 0xbb, 0x61, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x59, 0x5d, 0xf1, 0x64, 0x66, 0x12, 0x54, 0x84, + 0xfb, 0xa6, 0xda, 0x74, 0xe5, 0xb1, 0xc8, 0xd7, 0x1a, 0x20, 0xd8, 0x44, + 0x63, 0x88, 0x84, 0x16, 0xe6, 0x42, 0xbf, 0x61, 0x84, 0xf5, 0x31, 0xd9, + 0x96, 0xc8, 0x28, 0x5f, 0xa5, 0x7a, 0xd9, 0xf6, 0x61, 0xa0, 0x69, 0xc3, + 0x8d, 0xaf, 0xc4, 0x0a, 0x30, 0x6d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, + 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x26, 0xdd, 0x54, 0x90, 0x33, 0xcb, + 0x01, 0x45, 0x3d, 0xb1, 0xee, 0x8f, 0x34, 0x67, 0x2a, 0x22, 0x1a, 0x20, + 0x88, 0xc5, 0x00, 0x50, 0xa5, 0x57, 0x21, 0x96, 0x21, 0xca, 0x5f, 0x78, + 0xa2, 0x2e, 0x47, 0xfe, 0xf1, 0xba, 0xaf, 0x60, 0x3f, 0xa7, 0xd9, 0x3a, + 0x9a, 0xa3, 0xb1, 0xb8, 0x88, 0xfe, 0x7e, 0x9b, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xb0, 0x8b, 0x6a, 0x50, + 0x7a, 0x71, 0x81, 0x6a, 0x62, 0xdf, 0xf8, 0xfc, 0x1d, 0x2a, 0xad, 0xfe, + 0x1a, 0x20, 0x3d, 0x69, 0x81, 0x74, 0xc0, 0xde, 0xc3, 0xc9, 0xa9, 0xe6, + 0xef, 0x0e, 0xe8, 0xab, 0x51, 0x8c, 0x58, 0x08, 0x8a, 0x17, 0xb7, 0xb4, + 0xf0, 0x8e, 0xbd, 0xad, 0xe6, 0xf1, 0x5a, 0x2c, 0xb6, 0x9a, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xf6, 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x3c, 0x48, 0xdb, 0x3c, 0x00, 0x00, 0x00, 0x3c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x3c, 0x48, 0xdb, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x32, 0x34, 0x31, 0x30, 0x39, 0x39, 0x32, 0x35, + 0x34, 0x36, 0x45, 0x30, 0x33, 0x38, 0x44, 0x31, 0x33, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x34, 0x31, 0x30, 0x39, 0x39, 0x32, 0x35, 0x34, 0x36, + 0x45, 0x30, 0x33, 0x38, 0x44, 0x31, 0x33, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x84, 0xd4, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x31, 0xcd, 0x05, 0xfb, + 0x9e, 0xd9, 0x3b, 0x3a, 0xb9, 0xf3, 0xa4, 0x7b, 0xec, 0x46, 0xd4, 0xa9, + 0x1a, 0x50, 0x57, 0xfa, 0x64, 0xcd, 0xf9, 0x5a, 0x7f, 0x6e, 0xbe, 0x1d, + 0x87, 0x1e, 0xf8, 0xa4, 0xb4, 0x0d, 0x94, 0x48, 0xd0, 0xd7, 0xea, 0x94, + 0x06, 0x20, 0x4a, 0x3a, 0x95, 0xc0, 0xa9, 0x8b, 0x61, 0x69, 0x5f, 0x96, + 0xb1, 0x64, 0x19, 0xb0, 0x92, 0x3a, 0x8c, 0x43, 0x76, 0x97, 0x17, 0x29, + 0xe6, 0x2d, 0xb6, 0xd9, 0xd9, 0x60, 0x92, 0x88, 0x39, 0xec, 0x2a, 0xfd, + 0xdf, 0x4e, 0xa1, 0x5a, 0xfc, 0x5b, 0x1d, 0x54, 0x79, 0x53, 0xe0, 0x82, + 0xd4, 0x87, 0x9f, 0x10, 0xa8, 0x6e, 0x82, 0xf3, 0x69, 0x40, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x88, 0x54, + 0xc8, 0x17, 0x7a, 0x7b, 0x97, 0x01, 0x37, 0x14, 0x9b, 0x07, 0x52, 0x76, + 0x52, 0xcb, 0x1a, 0x20, 0xc5, 0x11, 0x0c, 0xe1, 0xb2, 0x44, 0xe8, 0x4d, + 0x66, 0x94, 0x7a, 0x50, 0x52, 0x46, 0x1d, 0x80, 0x04, 0x5b, 0x43, 0x8b, + 0xb6, 0x7f, 0x31, 0x5b, 0x77, 0xab, 0xfd, 0x69, 0x2b, 0x8e, 0x95, 0xa2, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x2e, 0x36, 0xd2, 0x04, 0xcb, 0xe8, 0xba, 0x12, 0x47, 0xc4, 0x39, 0xe0, + 0x1c, 0x81, 0x6b, 0x92, 0x1a, 0x20, 0x10, 0x43, 0xbd, 0x39, 0xd5, 0x78, + 0x3e, 0xb6, 0x7f, 0xed, 0xa1, 0x35, 0xc2, 0x71, 0x45, 0x17, 0x42, 0xc0, + 0xe3, 0xd4, 0x15, 0xc6, 0x38, 0x1c, 0xf7, 0x87, 0x6a, 0xd8, 0x5c, 0x4d, + 0x25, 0x66, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0x1d, 0x76, 0xc6, 0xf8, 0x85, 0xf5, 0x12, 0xea, 0x2a, 0xf2, + 0x34, 0x1c, 0x29, 0xb8, 0x4a, 0x35, 0x1a, 0x20, 0x8a, 0x1f, 0x7f, 0x82, + 0x7a, 0x65, 0x9a, 0xa2, 0x8f, 0x9d, 0x45, 0xc8, 0x13, 0x47, 0x37, 0x40, + 0x92, 0xcd, 0xd5, 0x4d, 0xb1, 0x32, 0x40, 0x37, 0x54, 0xac, 0x7a, 0x80, + 0x8a, 0x5a, 0x24, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x80, 0x6e, 0x8d, 0xa8, 0x65, 0x78, 0x35, 0xba, + 0xd3, 0xe0, 0xe2, 0x31, 0x4a, 0x02, 0xc3, 0x0c, 0x1a, 0x20, 0x20, 0x5a, + 0x11, 0x14, 0x3f, 0x5e, 0xa2, 0x4d, 0x8d, 0x33, 0xac, 0xb4, 0xde, 0xc0, + 0x56, 0xec, 0x2e, 0x1c, 0x82, 0xe5, 0xf3, 0xa9, 0xf8, 0x39, 0xcc, 0x0c, + 0x55, 0x29, 0xd1, 0x62, 0xbf, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, + 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x9a, 0xf7, 0x38, 0xb6, 0x4e, 0xe4, + 0x1e, 0x02, 0xd7, 0x3f, 0xd7, 0x0f, 0x30, 0x9d, 0xd9, 0xab, 0x1a, 0x20, + 0xbf, 0xd2, 0x85, 0x0b, 0x38, 0xa3, 0xaa, 0x8d, 0x5b, 0xb5, 0x22, 0xb3, + 0xd2, 0xb6, 0xa6, 0x69, 0xc2, 0x7b, 0x78, 0x18, 0xa8, 0x4e, 0x01, 0x3c, + 0x54, 0xb5, 0xb7, 0x95, 0x1a, 0x6d, 0x90, 0x15, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0x84, + 0xd4, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x01, 0x6d, 0x4d, 0xe9, 0x00, 0x00, 0x00, 0x3e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x01, 0x6d, 0x4d, 0xe9, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x26, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x88, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x43, 0x45, 0x44, 0x36, 0x41, 0x32, 0x35, 0x45, + 0x42, 0x42, 0x34, 0x37, 0x45, 0x42, 0x34, 0x45, 0x33, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x45, 0x44, 0x36, 0x41, 0x32, 0x35, 0x45, 0x42, 0x42, + 0x34, 0x37, 0x45, 0x42, 0x34, 0x45, 0x33, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xa0, 0xb4, 0xb6, 0xf2, 0x6f, 0xf4, + 0x2b, 0x4a, 0x44, 0xa2, 0x38, 0x00, 0x40, 0x00, 0x48, 0xaa, 0xd4, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x1d, 0x4b, 0xf4, 0x13, + 0xa0, 0xa5, 0x7a, 0xcf, 0x9c, 0x76, 0xd8, 0xbb, 0xc0, 0x8e, 0x05, 0x56, + 0x1a, 0x50, 0x8e, 0x9c, 0x6e, 0x24, 0xee, 0xec, 0x26, 0xa6, 0xa4, 0xdd, + 0xe5, 0x21, 0x5c, 0x34, 0xd1, 0x61, 0x3b, 0x32, 0x56, 0x2d, 0xb3, 0x75, + 0xa4, 0x7f, 0x9e, 0xa6, 0xaa, 0xf0, 0xba, 0xaa, 0x4a, 0xf3, 0x18, 0x42, + 0xaa, 0x2a, 0x64, 0xfd, 0x59, 0xdd, 0x28, 0xd7, 0xd1, 0xe6, 0xe1, 0xbe, + 0x4d, 0x03, 0xf4, 0x20, 0x98, 0x0f, 0x89, 0xba, 0x14, 0x44, 0xb3, 0x1a, + 0xd7, 0xa8, 0x2f, 0x83, 0x1d, 0xb9, 0x44, 0xd3, 0xdf, 0x8b, 0x57, 0x03, + 0xd1, 0x4d, 0x7c, 0x16, 0xf1, 0x64, 0xc7, 0x83, 0xac, 0x61, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xe9, 0x14, + 0x26, 0x43, 0x41, 0xfd, 0x86, 0x00, 0x58, 0x04, 0x6f, 0xec, 0xdc, 0x0e, + 0x11, 0x69, 0x1a, 0x20, 0x9c, 0x67, 0xb1, 0x9b, 0x2b, 0x18, 0x47, 0x48, + 0xc3, 0x67, 0x72, 0xdd, 0x77, 0x01, 0xa6, 0x7c, 0x70, 0x83, 0xe2, 0xac, + 0x0c, 0xf6, 0xcb, 0xae, 0x05, 0xf5, 0xa4, 0x42, 0x37, 0x1e, 0x56, 0x54, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xe1, 0xca, 0xfc, 0xa1, 0x93, 0x0b, 0xea, 0x64, 0x0f, 0xe9, 0x6b, 0x9e, + 0xeb, 0xc1, 0x66, 0x3d, 0x1a, 0x20, 0xe2, 0xc5, 0x3c, 0x15, 0x7c, 0x75, + 0x9a, 0x4f, 0x87, 0x5d, 0x45, 0xa5, 0x76, 0x57, 0x7d, 0xb7, 0x90, 0x5f, + 0x28, 0x29, 0x6d, 0x60, 0x01, 0xc8, 0x01, 0x96, 0x59, 0xa4, 0xd6, 0x2b, + 0xf1, 0xf8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0xa7, 0x14, 0xf2, 0x34, 0xcf, 0x02, 0x2e, 0xc3, 0xbf, 0x71, + 0xdf, 0x38, 0x0a, 0x32, 0xab, 0x99, 0x1a, 0x20, 0xbe, 0x55, 0x02, 0xff, + 0x3e, 0x8e, 0x0a, 0xd6, 0x9e, 0x40, 0x0c, 0xb3, 0x58, 0xee, 0x87, 0x08, + 0x96, 0x7e, 0xff, 0xc8, 0xa6, 0xd4, 0x29, 0x94, 0x88, 0x7b, 0x4c, 0x19, + 0x9e, 0x43, 0xd2, 0xaa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x52, 0xed, 0x82, 0x9e, 0xeb, 0x39, 0xa0, 0x78, + 0xae, 0x9c, 0x98, 0x35, 0xf9, 0xfa, 0x5f, 0x37, 0x1a, 0x20, 0xe9, 0x8c, + 0x84, 0xe2, 0x4d, 0x08, 0x87, 0x45, 0xeb, 0x24, 0xc0, 0x56, 0x68, 0x46, + 0x2e, 0xfb, 0x60, 0xe0, 0x30, 0x02, 0xad, 0x10, 0x55, 0x40, 0x7b, 0x33, + 0xf1, 0x17, 0xeb, 0x6a, 0x12, 0xd0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, + 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x64, 0xb4, 0xa4, 0xa5, 0x59, 0x06, + 0xfa, 0x4e, 0xfd, 0x09, 0xa8, 0xc9, 0x4b, 0x9c, 0x5e, 0x30, 0x1a, 0x20, + 0xd1, 0x1b, 0x6f, 0x9a, 0x42, 0x5d, 0x51, 0x7a, 0xe3, 0x2f, 0x86, 0x04, + 0x1d, 0xff, 0xb0, 0xf1, 0x66, 0x74, 0x80, 0xa8, 0x18, 0x3f, 0x9a, 0x60, + 0x89, 0x49, 0x98, 0x47, 0xcd, 0xd7, 0x8f, 0xda, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xaa, + 0xd4, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} +////////////////////////////////////////////////////////////////////// +// Renewal Tests. +// A few renewal examples from filter *PIG*:*CdmUseCase*. +// Note: running these cases generates many renewals. It should be +// ok to only test one or two. +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xbd, 0xce, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x04, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0x82, 0xcf, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, + 0x39, 0x32, 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, 0x39, 0x32, + 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0x8c, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xa3, 0xd0, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, + 0x44, 0x44, 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, 0x44, 0x44, + 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0xc1, 0xf0, 0xf1, 0x8a, 0x9b, 0x9b, + 0x09, 0x4f, 0x67, 0xfe, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xff, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x0a, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, + 0x0a, 0x48, 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x96, 0xd1, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, + 0x35, 0x42, 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, 0x35, 0x42, + 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xf2, 0xd1, 0x92, + 0xa2, 0x06, 0x12, 0x0b, 0x08, 0x01, 0x18, 0x00, 0x38, 0x80, 0xe7, 0x84, + 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xee, 0xcf, 0x57, 0x52, 0x00, + 0x00, 0x00, 0x08, 0x20, 0x83, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, + 0x30, 0x38, 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, 0x30, 0x38, + 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0x95, 0x14, 0x20, 0x6a, 0xff, 0x32, + 0x03, 0xbc, 0x6c, 0xe6, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0x93, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x38, 0x80, + 0xe7, 0x84, 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x91, 0xcb, 0x74, + 0x71, 0x00, 0x00, 0x00, 0x00, 0x20, 0xa4, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, + 0x37, 0x35, 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, 0x37, 0x35, + 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x03, 0x38, 0x00, 0x40, 0x00, 0x48, 0xb4, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0a, 0x08, 0x01, 0x18, 0x01, 0x38, 0x1e, 0x48, 0x0a, + 0x50, 0x0a, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x74, 0x6c, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, + 0x00, 0x08, 0x20, 0xea, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 40; + RunTest(); +} +////////////////////////////////////////////////////////////////////// +} // namespace + +} // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_golden_v18.cpp b/oemcrypto/odk/test/odk_golden_v18.cpp new file mode 100644 index 0000000..c1adfb1 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v18.cpp @@ -0,0 +1,4574 @@ +// Copyright 2023 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" + +namespace wvodk_test { + +namespace { + +using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::ODK_RenewalRequest; + +using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize::CreateCoreLicenseResponseFromProto; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; +using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; + +class ODKGoldenProvisionV18 : public ::testing::Test { + protected: + void RunTest() { + ODK_ProvisioningRequest core_provisioning_request; + EXPECT_TRUE(CoreProvisioningRequestFromMessage(core_request_, + &core_provisioning_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, provisioning_response_, core_provisioning_request, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV18 : public ::testing::Test { + protected: + void RunTest() { + ODK_LicenseRequest core_license_request; + EXPECT_TRUE( + CoreLicenseRequestFromMessage(core_request_, &core_license_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreLicenseResponseFromProto( + features, serialized_license_, core_license_request, + core_request_sha256_, nonce_required_, uses_padding_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + bool nonce_required_ = true; + bool uses_padding_ = true; // This will change for v19. + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV18 : public ::testing::Test { + protected: + void RunTest() { + ODK_RenewalRequest core_renewal_request; + EXPECT_TRUE( + CoreRenewalRequestFromMessage(core_request_, &core_renewal_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreRenewalResponse(features, core_renewal_request, + renewal_duration_seconds_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + uint64_t renewal_duration_seconds_; + std::string core_request_; + std::string core_response_; + std::string renewal_; +}; + +// README (for ODK maintainers): Set the environment variable +// DUMP_GOLDEN_DATA="yes" +// Then set the environment variable GTEST_FILTER to the test you want to run. +// Run the script for the platform we want. E.g. run_fake_l1_tests, +// run_prov30_tests or run_prov40_tests. Look for the autogenerated code in +// $CDM_DIR/out/testbed/debug/*_data.cpp. If you are updating the ODK library, +// and you have to change the code above, then you're fine. If you have to +// change the code below then there is probably a backwards compatibility +// problem. + +////////////////////////////////////////////////////////////////////// +// Provisioning tests. +// One provisioning example from each of fake-l1 (with keybox), prov20ecc +// and prov30. For v18, Prov 4.0 does not use a core message. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0xcf, 0x3a, 0x5f, 0x1b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x12, + 0xcf, 0x3a, 0x5f, 0x1b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xcc, 0x78, 0xcb, 0xbc, 0xf8, 0xb6, 0x81, 0xfb, 0x5c, + 0x39, 0xf0, 0xef, 0x36, 0xea, 0x95, 0x47, 0x23, 0x84, 0x25, 0xb2, 0xba, + 0x6a, 0xe3, 0xed, 0x74, 0xdf, 0x38, 0xe7, 0x93, 0x3e, 0x48, 0xac, 0x92, + 0x13, 0x95, 0xa0, 0x78, 0x0d, 0x4c, 0x8f, 0xb8, 0x01, 0xe8, 0x7b, 0xc9, + 0x55, 0xc6, 0x03, 0x28, 0x33, 0xa4, 0x8c, 0x16, 0xc7, 0x6c, 0xa4, 0xae, + 0xb4, 0x5e, 0xd9, 0xea, 0x84, 0x29, 0xf2, 0xa7, 0x6a, 0xe8, 0xe6, 0x1c, + 0x56, 0xd6, 0x01, 0xea, 0x31, 0xc7, 0x94, 0x71, 0x9c, 0x53, 0x43, 0x75, + 0x94, 0xfe, 0x89, 0x70, 0x7b, 0xd5, 0xf7, 0xcf, 0x3d, 0xc9, 0x7b, 0x1a, + 0x56, 0xd2, 0x8b, 0x1b, 0x44, 0xf8, 0x51, 0x36, 0x57, 0x33, 0x7a, 0x3f, + 0x8d, 0xa5, 0x9d, 0x97, 0x4a, 0x02, 0x90, 0x62, 0x93, 0xc9, 0x02, 0x74, + 0x2c, 0x8d, 0xc1, 0x95, 0xef, 0xcc, 0x71, 0xd0, 0xc7, 0x1e, 0xff, 0x67, + 0x75, 0x84, 0x44, 0x18, 0xa1, 0x98, 0xdd, 0xca, 0x55, 0x2b, 0x75, 0x33, + 0xfc, 0x50, 0x87, 0x6c, 0xbb, 0x72, 0x5a, 0xc7, 0xcf, 0x9d, 0xed, 0x60, + 0x28, 0x29, 0x77, 0x14, 0xd7, 0x2e, 0xb2, 0x27, 0x37, 0xa7, 0x5b, 0x80, + 0x5c, 0xe8, 0x22, 0xe8, 0xde, 0x93, 0xe4, 0x79, 0xa9, 0x2d, 0xb4, 0xfc, + 0x57, 0x1a, 0xa6, 0x2b, 0xb9, 0xc6, 0x22, 0x51, 0x9e, 0x2d, 0x56, 0x00, + 0x6d, 0xc6, 0x79, 0x7a, 0x6f, 0xf4, 0x53, 0xe5, 0xc4, 0x27, 0x94, 0xa0, + 0x4b, 0x83, 0x1a, 0x43, 0xb0, 0x4b, 0x13, 0x3c, 0x56, 0x5d, 0x1c, 0x98, + 0x0d, 0xab, 0xbd, 0x7b, 0xd9, 0x4e, 0x26, 0x19, 0x69, 0xaf, 0x5a, 0xcd, + 0xcf, 0x3e, 0xae, 0xc2, 0x39, 0x8c, 0xa0, 0xb4, 0x9d, 0x72, 0xd4, 0x98, + 0xdc, 0x53, 0x92, 0x3f, 0xc8, 0xd2, 0x7e, 0xfd, 0x00, 0xfb, 0x22, 0x8e, + 0xdc, 0xc2, 0x09, 0xd3, 0xb6, 0x0c, 0x0e, 0xe7, 0x04, 0xd2, 0x2b, 0x98, + 0x4d, 0x7c, 0x9a, 0xae, 0x4e, 0xa4, 0x84, 0x3c, 0x44, 0x10, 0x65, 0x90, + 0xdc, 0x1b, 0x82, 0xd0, 0x38, 0xb1, 0x40, 0x02, 0xf7, 0xf0, 0xbb, 0xcf, + 0x8a, 0x6b, 0xd3, 0xd0, 0x88, 0x52, 0xb4, 0x2e, 0x92, 0xa3, 0xcb, 0x65, + 0xff, 0xbd, 0x5c, 0xe5, 0x6a, 0xba, 0x7c, 0x67, 0x6f, 0x52, 0xa9, 0xf4, + 0xde, 0xf1, 0x47, 0xca, 0x0c, 0x25, 0xcd, 0xa8, 0x37, 0x88, 0x10, 0x08, + 0xef, 0x0a, 0x30, 0x53, 0xed, 0xe2, 0x7c, 0x1a, 0x55, 0x89, 0x6c, 0x7d, + 0xfb, 0x6a, 0x71, 0xda, 0x0f, 0x02, 0xf1, 0x69, 0x85, 0x07, 0x5b, 0xbd, + 0x7d, 0xe7, 0x5c, 0x21, 0xd3, 0xfc, 0xb6, 0x80, 0xcb, 0x63, 0x77, 0xdf, + 0x24, 0x12, 0x33, 0x86, 0x5d, 0xd0, 0xa5, 0xaf, 0x21, 0x52, 0x2c, 0xaf, + 0x4d, 0xbe, 0xcc, 0x3d, 0x14, 0x96, 0x97, 0x04, 0xb5, 0x7c, 0xf3, 0x44, + 0x82, 0x63, 0xea, 0x17, 0xa2, 0x09, 0xaa, 0x24, 0xc2, 0xdf, 0x04, 0xd4, + 0x3f, 0xb0, 0x67, 0xbc, 0x4c, 0xe2, 0x0e, 0xad, 0xfc, 0xe6, 0xa0, 0x9d, + 0x8c, 0xb6, 0x40, 0x09, 0x82, 0x9f, 0xe3, 0xda, 0x47, 0xb5, 0xbf, 0x0d, + 0xb4, 0xa7, 0x2b, 0xee, 0xc2, 0x89, 0x34, 0x33, 0x76, 0xa6, 0x3d, 0xbe, + 0xd6, 0x81, 0xa5, 0x94, 0xb9, 0x81, 0x90, 0xae, 0x89, 0xe4, 0x10, 0xbd, + 0x7c, 0xbe, 0x81, 0xbc, 0x18, 0x05, 0xb4, 0x13, 0xf1, 0xe8, 0xba, 0xdb, + 0x3e, 0x04, 0xc4, 0xb3, 0x31, 0x14, 0x19, 0xec, 0xe9, 0x16, 0x69, 0x10, + 0xbf, 0x64, 0xb0, 0x94, 0x26, 0xd2, 0xd7, 0x01, 0xd0, 0x8b, 0x53, 0xf8, + 0xd8, 0x54, 0xdb, 0x6e, 0x0f, 0x2d, 0xc6, 0x99, 0x06, 0xbf, 0xfe, 0x9e, + 0x35, 0x83, 0x4c, 0xda, 0xb5, 0x90, 0x71, 0xc4, 0x90, 0xeb, 0x01, 0x83, + 0xde, 0x6d, 0xfc, 0xaf, 0x04, 0x5f, 0xd6, 0x25, 0x4d, 0x8a, 0x93, 0x47, + 0xac, 0x7d, 0x52, 0xea, 0xfe, 0x34, 0xad, 0xce, 0x2d, 0xd5, 0xd7, 0x78, + 0xce, 0xe5, 0x8e, 0x5c, 0x00, 0x2e, 0xc9, 0x6c, 0x48, 0x6e, 0x4f, 0x19, + 0x6f, 0x3f, 0xa8, 0x79, 0x6c, 0x6e, 0x1f, 0xd9, 0x9d, 0x9f, 0xf4, 0x62, + 0x25, 0x84, 0x35, 0x30, 0xf2, 0xd2, 0xbd, 0x2a, 0xec, 0x2d, 0xc3, 0xa3, + 0x02, 0xff, 0x9b, 0xfd, 0x6b, 0x8e, 0x0b, 0x16, 0x18, 0xf2, 0x99, 0xb8, + 0x15, 0x9a, 0x1c, 0x8f, 0x89, 0x02, 0x07, 0xed, 0x66, 0x69, 0x35, 0x13, + 0x25, 0xf6, 0xfb, 0x30, 0x8c, 0x94, 0xb6, 0x98, 0xc0, 0x8b, 0xfd, 0x47, + 0xbe, 0x66, 0x84, 0x51, 0x59, 0x6d, 0x1c, 0x00, 0x7a, 0xa1, 0x35, 0xf4, + 0x67, 0xf1, 0xa6, 0xc4, 0x30, 0xb4, 0x85, 0x74, 0x2e, 0x3e, 0x28, 0x22, + 0x51, 0xfe, 0x54, 0x88, 0xcc, 0x8a, 0xe4, 0x04, 0xc6, 0x10, 0xbd, 0x5b, + 0x91, 0x02, 0xb0, 0x37, 0x7d, 0x3b, 0xcd, 0x98, 0x2e, 0x8c, 0x5f, 0x63, + 0x7e, 0x58, 0x58, 0x18, 0x13, 0x1d, 0x32, 0x29, 0x3e, 0xb8, 0x95, 0xed, + 0x2b, 0xc1, 0xd0, 0xab, 0x33, 0x9c, 0x82, 0xa9, 0xcf, 0xcf, 0x21, 0x2e, + 0x7c, 0x05, 0xe7, 0xa7, 0xbb, 0xc1, 0x63, 0x4a, 0x1e, 0xb5, 0x04, 0x13, + 0x30, 0x34, 0xa1, 0x8b, 0x5a, 0x84, 0x53, 0x66, 0x42, 0xed, 0xc3, 0xd7, + 0x14, 0xf5, 0xf4, 0x19, 0x78, 0x95, 0xd1, 0x16, 0xc9, 0x5c, 0xbd, 0x05, + 0xf9, 0xe0, 0xe0, 0x96, 0x8c, 0x51, 0x3f, 0xb4, 0x38, 0x78, 0x59, 0x79, + 0xe8, 0xbc, 0x66, 0x26, 0xc2, 0x46, 0xee, 0xbb, 0x58, 0xfa, 0x06, 0xfe, + 0x24, 0x54, 0x8c, 0x06, 0xe5, 0xc1, 0x58, 0x74, 0x22, 0xb6, 0x94, 0x17, + 0xe6, 0x27, 0x09, 0xab, 0x5b, 0x89, 0x3a, 0xbd, 0x29, 0x8b, 0xc7, 0xf4, + 0x67, 0x51, 0x79, 0xf7, 0x34, 0x2c, 0xb1, 0x84, 0x5f, 0xd8, 0x46, 0xf6, + 0x30, 0xc3, 0xf6, 0xb6, 0x11, 0x2d, 0x0a, 0x6f, 0x0c, 0x54, 0x37, 0x13, + 0x26, 0x4c, 0x17, 0xe8, 0x08, 0x68, 0x84, 0xea, 0xad, 0x48, 0x8b, 0x65, + 0x20, 0xa5, 0x3e, 0x54, 0x15, 0x25, 0xae, 0xb6, 0x2f, 0xae, 0xf3, 0x4f, + 0xb5, 0x5a, 0xb2, 0x26, 0xb6, 0xcb, 0xe4, 0xcf, 0x30, 0x4b, 0x79, 0xba, + 0xd3, 0xd4, 0xb5, 0x7e, 0xe5, 0xc4, 0x2f, 0xf7, 0x39, 0xd6, 0x75, 0xd6, + 0xb2, 0x8d, 0xab, 0x44, 0xe5, 0x5e, 0x0f, 0x87, 0xa2, 0x1d, 0xc0, 0x1e, + 0xa4, 0xe4, 0xf4, 0x90, 0x47, 0x40, 0xb8, 0xec, 0x3d, 0x7e, 0x9a, 0x90, + 0x8c, 0x56, 0x92, 0x82, 0xd7, 0x37, 0xe2, 0x50, 0x39, 0x29, 0xc4, 0x6c, + 0xa6, 0x57, 0xfc, 0xfc, 0xe1, 0x5e, 0xa4, 0x5b, 0xa8, 0xec, 0x05, 0x09, + 0xfd, 0xcf, 0x4f, 0xb7, 0x82, 0x4e, 0xb1, 0xfc, 0x95, 0x74, 0x0a, 0x17, + 0xdc, 0xc5, 0xc4, 0x1e, 0x6a, 0x60, 0x9f, 0x62, 0x77, 0x31, 0x69, 0xdc, + 0x2d, 0x13, 0x2a, 0x6b, 0xa3, 0x0c, 0x69, 0xfd, 0x7d, 0x1f, 0x52, 0xde, + 0xbb, 0xfd, 0x4d, 0x94, 0xf2, 0x55, 0xfb, 0x3b, 0x28, 0xd0, 0xc1, 0x5d, + 0xe4, 0xe9, 0x72, 0xa3, 0x70, 0x08, 0x00, 0xc5, 0x07, 0x37, 0x89, 0x50, + 0xd7, 0x08, 0x42, 0x39, 0x10, 0xa6, 0xb9, 0xb5, 0x23, 0x3d, 0xd7, 0xd3, + 0x7b, 0x94, 0x45, 0x11, 0x0f, 0x60, 0x0a, 0x55, 0x28, 0xb9, 0x16, 0xfa, + 0x53, 0xa1, 0x7c, 0x6d, 0x19, 0x8b, 0xad, 0x11, 0x5e, 0x67, 0xb1, 0xba, + 0xc9, 0x71, 0x9b, 0xf8, 0x43, 0x3d, 0x98, 0xe5, 0x5f, 0x49, 0x90, 0xf3, + 0x6c, 0x59, 0x67, 0xea, 0x1f, 0xe1, 0x61, 0x57, 0x1d, 0xb5, 0x31, 0x3f, + 0x24, 0x4e, 0x42, 0x4a, 0xfd, 0x28, 0xea, 0x46, 0x62, 0x4a, 0x89, 0xa8, + 0xd6, 0x62, 0x5e, 0x51, 0x16, 0x69, 0x83, 0x23, 0x51, 0x91, 0x2b, 0x27, + 0xe0, 0xf0, 0x76, 0x1b, 0x6f, 0x67, 0xf6, 0xfc, 0x03, 0xf0, 0x45, 0x94, + 0xed, 0xd2, 0x6f, 0xcc, 0x2c, 0x24, 0xdd, 0x5a, 0x2e, 0xa6, 0xac, 0xf2, + 0x25, 0x5a, 0x61, 0x62, 0xff, 0x30, 0x34, 0xd3, 0x6e, 0xde, 0x15, 0x19, + 0xe2, 0xde, 0x9c, 0xfb, 0x77, 0x73, 0x3c, 0x11, 0xd6, 0x69, 0x78, 0x4e, + 0x37, 0x88, 0x61, 0xe4, 0xfd, 0x42, 0xf6, 0x5f, 0xc0, 0x00, 0x8a, 0x14, + 0x71, 0xc4, 0x7f, 0x54, 0xc3, 0xd8, 0x87, 0x6a, 0x08, 0x92, 0x3d, 0x2d, + 0x57, 0x0c, 0x0f, 0x56, 0x57, 0x02, 0xa9, 0x1f, 0x74, 0xcc, 0x96, 0x65, + 0x90, 0x17, 0xbf, 0xf5, 0x30, 0x19, 0x27, 0x37, 0xea, 0xe1, 0xe9, 0xa7, + 0xbe, 0x92, 0x9d, 0x88, 0xe1, 0x39, 0x92, 0x49, 0x1e, 0xc7, 0x18, 0x31, + 0x8f, 0x9f, 0x68, 0x2f, 0x56, 0x7d, 0x63, 0xb1, 0x8a, 0xe5, 0xba, 0x23, + 0x75, 0x1b, 0x3f, 0xd0, 0x71, 0xad, 0x74, 0x1a, 0x02, 0xc5, 0x21, 0x10, + 0x3f, 0x06, 0x7c, 0x36, 0x3d, 0x65, 0x98, 0x16, 0xc2, 0x90, 0x1a, 0xe6, + 0x4c, 0xa8, 0x52, 0xe1, 0x64, 0xde, 0xd9, 0xa7, 0x04, 0x2d, 0x32, 0x36, + 0xeb, 0x5c, 0xa7, 0x95, 0x15, 0x91, 0x15, 0x9a, 0x1f, 0x7f, 0x5c, 0xa3, + 0x55, 0x04, 0x2b, 0x9f, 0x89, 0xd0, 0x8e, 0xac, 0x4f, 0x95, 0x13, 0x8b, + 0x9c, 0x56, 0x6c, 0x9f, 0x82, 0xe0, 0x5a, 0x44, 0x83, 0x89, 0x25, 0x34, + 0x60, 0x86, 0x37, 0xd7, 0x58, 0x71, 0xa2, 0x21, 0x4f, 0x6a, 0x27, 0xff, + 0xf4, 0x02, 0x2b, 0x31, 0xd8, 0xec, 0x5a, 0x7d, 0xe8, 0x55, 0x19, 0x12, + 0x10, 0x26, 0x06, 0x38, 0x1f, 0xe5, 0x86, 0x4d, 0x00, 0x08, 0x3c, 0x7a, + 0x49, 0x29, 0xfd, 0x0b, 0x77, 0x1a, 0xaa, 0x0b, 0x0a, 0xeb, 0x03, 0x08, + 0x02, 0x12, 0x10, 0x7c, 0xb4, 0x9f, 0x98, 0x7a, 0x63, 0x5e, 0x1e, 0x0a, + 0x52, 0x18, 0x46, 0x94, 0x58, 0x2d, 0x6e, 0x18, 0xec, 0xf5, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xaa, 0x2e, 0x47, 0xb8, 0x48, 0x93, 0xf1, 0x45, 0x3f, 0xca, 0x0f, + 0xbc, 0xdf, 0x3a, 0x3f, 0x44, 0x82, 0xee, 0x0c, 0xd3, 0xc3, 0x8f, 0xeb, + 0x8c, 0xda, 0x35, 0xa7, 0x39, 0x20, 0xff, 0xd5, 0x4a, 0x71, 0x50, 0xfd, + 0x22, 0x4a, 0x9e, 0x1a, 0x51, 0x33, 0x90, 0xa8, 0xf3, 0xe9, 0xe1, 0x66, + 0xa8, 0xcd, 0x8f, 0xfb, 0x23, 0x27, 0x94, 0xb5, 0xd7, 0x79, 0xbd, 0x03, + 0x98, 0x74, 0x6c, 0x7e, 0xfc, 0x8a, 0x85, 0x4e, 0x5f, 0x98, 0x33, 0x77, + 0x67, 0xb9, 0xc8, 0x90, 0xc4, 0xfc, 0x63, 0x1f, 0x45, 0xd7, 0x67, 0x9f, + 0x1f, 0xf1, 0x9e, 0x30, 0x36, 0xd6, 0xd2, 0x31, 0x73, 0x4c, 0x64, 0x20, + 0x61, 0x18, 0x1c, 0xe8, 0xad, 0x65, 0xdb, 0x6e, 0x8e, 0xb5, 0x80, 0x22, + 0x98, 0xe2, 0xcb, 0x65, 0x28, 0xc1, 0xd0, 0x24, 0xc0, 0x9d, 0xf6, 0x94, + 0x02, 0x74, 0x16, 0x1e, 0xe2, 0x0e, 0xf0, 0x37, 0x41, 0x59, 0x00, 0x3a, + 0x76, 0x25, 0x67, 0xb3, 0x77, 0xcf, 0xcc, 0x1f, 0xbf, 0x3d, 0x30, 0x42, + 0xa6, 0xf1, 0xb6, 0x7b, 0x5f, 0x3b, 0x5d, 0x88, 0x13, 0x9a, 0xe1, 0xbf, + 0x05, 0x74, 0x72, 0x33, 0x94, 0x9e, 0x5a, 0xc9, 0x29, 0x09, 0x04, 0x46, + 0x3f, 0x7c, 0x8d, 0xe8, 0xd2, 0xc1, 0x69, 0xb2, 0xb4, 0x0d, 0xca, 0x5f, + 0x6c, 0x7e, 0x99, 0x28, 0x8c, 0x77, 0x07, 0xec, 0x7c, 0xe2, 0x4f, 0xc0, + 0x90, 0xd2, 0xac, 0x76, 0x87, 0x8e, 0x99, 0x39, 0x19, 0x67, 0x96, 0x18, + 0xc9, 0xe6, 0xc8, 0xd4, 0x18, 0xd9, 0x13, 0x85, 0xbc, 0xee, 0x93, 0xdd, + 0xf2, 0x2b, 0xf2, 0x15, 0x40, 0x8d, 0xf2, 0x78, 0xc6, 0x69, 0xc5, 0xe3, + 0x05, 0x6e, 0x28, 0x40, 0xe4, 0x11, 0xcf, 0x20, 0xee, 0x53, 0xea, 0x62, + 0x5f, 0x57, 0x89, 0xf5, 0xe2, 0x77, 0x52, 0x18, 0x4d, 0x39, 0xcc, 0x84, + 0x73, 0x5a, 0x18, 0x22, 0x81, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x52, 0xaa, 0x01, 0x08, 0x01, 0x10, 0x00, + 0x1a, 0x81, 0x01, 0x04, 0x5d, 0xc0, 0xcb, 0x28, 0xe6, 0x81, 0x2d, 0xc6, + 0xc1, 0x5f, 0x8e, 0x3e, 0x6c, 0x4e, 0xfc, 0xf5, 0x7e, 0x1e, 0xfa, 0xf7, + 0x9b, 0x0d, 0x99, 0x48, 0x40, 0x25, 0x9d, 0x2e, 0x9a, 0x26, 0x5a, 0xa4, + 0xae, 0xd4, 0xd1, 0xee, 0x42, 0x61, 0xc7, 0x44, 0x92, 0x25, 0x55, 0x27, + 0x23, 0x9f, 0x40, 0xc2, 0x28, 0xe7, 0xd2, 0x00, 0x52, 0x07, 0xb7, 0xf0, + 0xe7, 0x56, 0x7f, 0xd6, 0xcb, 0x89, 0x8a, 0x6d, 0x7f, 0xf9, 0x2e, 0x0e, + 0xf8, 0x69, 0x1a, 0xa3, 0x5f, 0xbd, 0xd1, 0xd1, 0x98, 0xf8, 0x3f, 0x6f, + 0x94, 0x72, 0x29, 0x50, 0x6e, 0x5e, 0xdd, 0xc6, 0x1e, 0xf5, 0xfd, 0xe8, + 0x2c, 0x19, 0x22, 0x28, 0xcc, 0x3a, 0x98, 0x7a, 0x9e, 0x28, 0x3d, 0x52, + 0xbf, 0xc4, 0x72, 0xd7, 0x9b, 0x7e, 0xdf, 0xb6, 0x1a, 0x81, 0x05, 0x7d, + 0x6b, 0x5f, 0xcc, 0xa9, 0x16, 0x3d, 0x07, 0x4b, 0xa3, 0xa2, 0xbc, 0x5f, + 0x22, 0x20, 0x8a, 0x81, 0x2c, 0xe3, 0x90, 0x4f, 0x05, 0x09, 0xef, 0xbb, + 0xf6, 0x6e, 0xdd, 0x04, 0x3e, 0x6d, 0x7e, 0x93, 0x5d, 0x59, 0x2c, 0xc6, + 0x6d, 0xde, 0x7c, 0xe0, 0x24, 0xf6, 0x5d, 0x40, 0x3d, 0x09, 0x12, 0x80, + 0x02, 0x0d, 0x3a, 0x4b, 0xe8, 0x5b, 0x15, 0xdd, 0x25, 0x5a, 0x6f, 0x00, + 0xa7, 0xad, 0x43, 0xc5, 0x48, 0x65, 0x06, 0x1b, 0x47, 0xd2, 0xef, 0xd0, + 0xd1, 0x56, 0xca, 0x9f, 0x2a, 0xe4, 0xae, 0x49, 0x69, 0x1f, 0x2e, 0x07, + 0x58, 0x2a, 0xfd, 0x33, 0xd6, 0x11, 0x9b, 0x18, 0xe5, 0x53, 0x6a, 0x6a, + 0x23, 0x2c, 0x9d, 0x3d, 0xb0, 0x36, 0x76, 0x82, 0x0e, 0x1f, 0xd8, 0x06, + 0x66, 0x84, 0x5d, 0x53, 0x9b, 0x84, 0x01, 0x04, 0x7b, 0xa0, 0x81, 0x16, + 0x75, 0x22, 0xdc, 0x36, 0xaf, 0x6f, 0xc3, 0xd5, 0xe4, 0x1b, 0x0e, 0x16, + 0xba, 0x15, 0xea, 0xd1, 0xeb, 0xad, 0x0b, 0x2b, 0x9a, 0xd6, 0x83, 0xf8, + 0xfb, 0x7d, 0xa1, 0x3a, 0x6c, 0xcf, 0x59, 0x4c, 0x38, 0xcc, 0x6b, 0x47, + 0xba, 0x41, 0x52, 0x22, 0xdb, 0x82, 0x8b, 0xfb, 0xe6, 0xc2, 0xc6, 0x42, + 0x92, 0x48, 0xa1, 0x9a, 0x68, 0x7b, 0xbf, 0x32, 0xe4, 0xf2, 0xcf, 0x6e, + 0x22, 0xae, 0x1e, 0x47, 0x0d, 0x09, 0x65, 0x2b, 0x8f, 0xc5, 0x8e, 0x82, + 0x33, 0x53, 0xa1, 0xd6, 0xd2, 0x8a, 0x46, 0x82, 0xf9, 0x17, 0xd3, 0xa4, + 0x5e, 0x61, 0xf9, 0xd5, 0xbd, 0xae, 0x40, 0xaf, 0x38, 0xe1, 0xbe, 0xb7, + 0x58, 0x76, 0x24, 0x65, 0x9e, 0x69, 0x10, 0x83, 0x98, 0xcd, 0xbf, 0x34, + 0x4a, 0x11, 0x72, 0xd3, 0xa4, 0x4d, 0xe2, 0x7f, 0xaa, 0x4f, 0xbb, 0x1c, + 0xae, 0x44, 0x22, 0x12, 0xdc, 0x63, 0xd7, 0x3a, 0xb0, 0xd4, 0xe5, 0xec, + 0x37, 0xec, 0x36, 0xf1, 0xc9, 0x42, 0xef, 0x76, 0x99, 0xe3, 0x8a, 0xd5, + 0x8a, 0x84, 0xbf, 0x4a, 0x60, 0x63, 0xc9, 0xc1, 0xe9, 0x86, 0xce, 0xbf, + 0xff, 0xa5, 0xc8, 0xa5, 0x2f, 0xc8, 0xb1, 0x80, 0xdb, 0x09, 0x18, 0xd5, + 0x10, 0xc0, 0x0a, 0x96, 0xaf, 0x9f, 0x23, 0xb3, 0x6a, 0x52, 0x85, 0xfc, + 0x2c, 0xa7, 0xa5, 0xa1, 0x89, 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, + 0x01, 0x12, 0x10, 0x65, 0x80, 0x2c, 0x9b, 0x62, 0x5e, 0x5a, 0x31, 0x9c, + 0x33, 0xdc, 0x1c, 0xb7, 0xc3, 0xc6, 0xd4, 0x18, 0xe3, 0xa5, 0xbd, 0xd0, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xb8, 0x05, 0x02, 0x04, 0x3c, 0x2a, 0x8a, 0x0f, 0xd8, 0xd2, 0x5c, + 0x61, 0x3e, 0x1e, 0x3e, 0x3b, 0x5e, 0x34, 0x9f, 0x33, 0x2f, 0x04, 0x51, + 0x6a, 0x75, 0x10, 0xd3, 0x80, 0x21, 0xa5, 0x62, 0x9b, 0x9a, 0xa0, 0x27, + 0xae, 0xad, 0x3c, 0x75, 0x9b, 0x7a, 0xfe, 0x70, 0xbe, 0xd6, 0x5f, 0x3d, + 0xf6, 0x86, 0x0f, 0xf5, 0xeb, 0x60, 0xb9, 0x83, 0xa3, 0xff, 0xa3, 0x3f, + 0xde, 0x06, 0xf3, 0xb7, 0x30, 0x14, 0xdf, 0xc8, 0x45, 0xab, 0x37, 0x1c, + 0x66, 0x00, 0x56, 0x2e, 0x9d, 0x90, 0x4f, 0x84, 0x2b, 0x8b, 0xa4, 0xa5, + 0xd9, 0x20, 0x0f, 0xfa, 0x3e, 0xd4, 0x5d, 0x70, 0x55, 0x20, 0xa5, 0xc3, + 0x72, 0xa8, 0x89, 0xf9, 0xe3, 0x14, 0x38, 0x62, 0x34, 0xc6, 0x89, 0x7a, + 0xe6, 0x55, 0x85, 0x1f, 0xcd, 0x9a, 0xdb, 0x4e, 0xf9, 0x12, 0x6c, 0x78, + 0x38, 0x6e, 0xa9, 0x3b, 0xcb, 0x25, 0xba, 0x3e, 0xc4, 0x75, 0xc5, 0x5c, + 0x60, 0x8e, 0x77, 0x1c, 0x76, 0x3a, 0xb0, 0x25, 0x06, 0xf9, 0xb0, 0x72, + 0x52, 0xd6, 0xab, 0xf7, 0xea, 0x64, 0xb1, 0xeb, 0xde, 0x7b, 0x95, 0xc6, + 0x40, 0x76, 0x90, 0x53, 0x3b, 0xd6, 0x89, 0x0b, 0x92, 0x74, 0xc1, 0x60, + 0x66, 0xf7, 0x4f, 0xc4, 0x01, 0xea, 0x35, 0x5f, 0x0a, 0x02, 0x10, 0x68, + 0x14, 0xd4, 0x9b, 0xf0, 0xc8, 0x9e, 0x6e, 0x1f, 0x8d, 0xb2, 0xa4, 0x78, + 0x41, 0xcd, 0x0d, 0xad, 0x79, 0x32, 0x96, 0xa1, 0x07, 0xc3, 0x62, 0x23, + 0x40, 0x4f, 0x2b, 0xf1, 0xfc, 0xa1, 0x6f, 0xd0, 0xa4, 0xb9, 0x82, 0x63, + 0x4d, 0xb6, 0x24, 0x07, 0xf8, 0xf1, 0x4a, 0xca, 0xe3, 0xb0, 0x5a, 0x03, + 0x8b, 0xd3, 0xe4, 0xbb, 0xba, 0xe4, 0x39, 0x1b, 0xbf, 0xa7, 0xa4, 0x7f, + 0xb9, 0xd0, 0x1d, 0xe8, 0x57, 0xea, 0x88, 0xe5, 0xe3, 0x6e, 0xe3, 0x6e, + 0x24, 0x58, 0x59, 0xfc, 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x12, 0x80, 0x03, 0x7e, 0x06, 0x58, 0x1a, 0x01, 0x91, 0x84, 0xab, + 0x57, 0x2a, 0xfd, 0xca, 0xdd, 0xd0, 0x3f, 0x16, 0x1c, 0xe6, 0x82, 0x00, + 0xf8, 0xe6, 0xf8, 0xad, 0x16, 0x19, 0x47, 0x36, 0x0b, 0xc8, 0xd4, 0x9c, + 0x0d, 0x68, 0x00, 0x9b, 0x1c, 0x46, 0x44, 0xf9, 0xb3, 0xf3, 0xfb, 0x6d, + 0xdf, 0xd9, 0x2e, 0xf9, 0x2d, 0xe6, 0x2d, 0x41, 0xd4, 0x59, 0xd2, 0x9d, + 0x81, 0xbf, 0xae, 0xf3, 0x97, 0x0a, 0x3a, 0x39, 0xd2, 0x5b, 0x26, 0x62, + 0xec, 0xb0, 0x3b, 0x2d, 0xa7, 0xb6, 0x83, 0x02, 0xfa, 0xa6, 0xdd, 0x98, + 0xd9, 0x5a, 0x14, 0x3c, 0xc8, 0xc1, 0xcb, 0x6a, 0xdd, 0xa7, 0x6d, 0x2e, + 0xe9, 0xc3, 0x72, 0x3f, 0xaf, 0x95, 0xa2, 0x9c, 0xdc, 0x3e, 0x96, 0x8b, + 0x68, 0x21, 0xa9, 0x1c, 0x05, 0x1c, 0xa2, 0x80, 0xa8, 0x66, 0x69, 0x71, + 0x0a, 0x1a, 0xd7, 0xa4, 0x4b, 0xf9, 0x21, 0x80, 0x27, 0x46, 0x0d, 0xf6, + 0x94, 0xe2, 0xe9, 0x27, 0x03, 0x96, 0xdf, 0x22, 0x19, 0x63, 0xf2, 0x1e, + 0xe6, 0xaa, 0x22, 0x0a, 0x5e, 0xe4, 0xa4, 0xd0, 0xfe, 0xb3, 0xd5, 0x3e, + 0xb5, 0x73, 0x2f, 0x8f, 0x91, 0xe9, 0xa9, 0x6b, 0x3b, 0x8b, 0xe2, 0x84, + 0xc5, 0x13, 0x39, 0xea, 0x28, 0x4d, 0x4d, 0x0e, 0xdd, 0x55, 0xb6, 0xad, + 0x56, 0xf7, 0x41, 0x64, 0x20, 0xe0, 0x5e, 0x05, 0x9f, 0x97, 0x34, 0xa9, + 0x6b, 0xe2, 0x5a, 0xa4, 0x45, 0x60, 0xdb, 0xa8, 0xc3, 0x87, 0x55, 0xa4, + 0x2a, 0x82, 0xbd, 0x7f, 0x88, 0xed, 0xd1, 0x9d, 0xf3, 0x46, 0xa6, 0x67, + 0xb3, 0x3b, 0x81, 0x14, 0xc7, 0x6a, 0x88, 0x38, 0xc4, 0x23, 0xd8, 0x24, + 0xa5, 0x0b, 0x23, 0x25, 0x1a, 0x08, 0x81, 0x36, 0xd6, 0xe8, 0xf4, 0x75, + 0x29, 0x9d, 0x2a, 0xfd, 0x46, 0xce, 0xa5, 0x1b, 0x5c, 0xbd, 0xf7, 0x89, + 0xa5, 0x72, 0x12, 0x5c, 0xd2, 0x4f, 0xbb, 0x81, 0x3b, 0x38, 0x7a, 0x10, + 0xcd, 0x2a, 0x30, 0xe3, 0x44, 0x76, 0x34, 0xab, 0x34, 0x08, 0xf9, 0x6b, + 0x9c, 0xf3, 0xd9, 0x88, 0x96, 0xd4, 0x05, 0xf3, 0xf5, 0x40, 0xd9, 0xc5, + 0x79, 0x62, 0x76, 0x0f, 0xcd, 0x17, 0x7c, 0xdd, 0x10, 0x1e, 0xb8, 0xa4, + 0x14, 0x8b, 0x9c, 0x29, 0xce, 0xd5, 0xea, 0xd6, 0x45, 0xa9, 0x5b, 0x69, + 0x8f, 0x1c, 0xdc, 0x6e, 0x1d, 0xb6, 0x67, 0x8b, 0x85, 0x07, 0x41, 0x86, + 0x08, 0x0d, 0x68, 0xd1, 0x3c, 0xd3, 0x7e, 0x07, 0xb1, 0x6d, 0xe3, 0x70, + 0xcd, 0x9a, 0xfb, 0x9b, 0x25, 0x56, 0x4a, 0x73, 0xa3, 0x0e, 0x2a, 0xf8, + 0x08, 0x5e, 0xa3, 0x7d, 0x31, 0x0c, 0x47, 0x4f, 0x0e, 0x67, 0xac, 0x00, + 0xca, 0x99, 0x2a, 0x52, 0x96, 0xfa, 0xed, 0xad, 0x7a, 0xa0, 0x6e, 0xcd, + 0x79, 0x0f, 0x1e, 0x3d, 0x42, 0x65, 0x58, 0xfa, 0x98, 0x38, 0x3e, 0x3c, + 0xd2, 0xed, 0x48, 0x30, 0x20, 0x02, 0x22, 0x04, 0x1b, 0x5f, 0x3a, 0xcf, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_RSA_Private_Key; + RunTest(); +} + +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov20ecc) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0xac, 0x0a, 0xc5, 0x83, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x12, + 0xac, 0x0a, 0xc5, 0x83, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x95, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0x90, 0x01, 0x81, 0x65, 0x7c, 0xa2, 0x52, 0x38, 0x6e, 0x34, 0x7e, + 0x52, 0x27, 0xfb, 0xcc, 0x3e, 0x6b, 0x16, 0x58, 0x3a, 0xde, 0x26, 0x5c, + 0x41, 0x95, 0x03, 0xdb, 0x25, 0xd9, 0x48, 0x41, 0xeb, 0xc0, 0xef, 0x04, + 0xd3, 0x41, 0xa9, 0x16, 0xc7, 0xf5, 0x68, 0x22, 0x53, 0x61, 0xde, 0x81, + 0xc0, 0x73, 0x9f, 0x12, 0x2a, 0x40, 0x65, 0x46, 0xdd, 0x6e, 0xdb, 0x72, + 0xac, 0x4b, 0x20, 0x6e, 0x71, 0x62, 0x6e, 0x86, 0x2f, 0x98, 0x1b, 0xec, + 0x7e, 0xd7, 0x1d, 0x79, 0xc7, 0x57, 0x28, 0x9f, 0x71, 0x48, 0xb0, 0x9c, + 0xff, 0x59, 0xa8, 0x97, 0xb0, 0x11, 0x56, 0xfa, 0x70, 0x9e, 0x3e, 0x40, + 0xda, 0x80, 0x64, 0xa6, 0x20, 0xaf, 0x5c, 0x73, 0xe2, 0x39, 0x26, 0xb7, + 0xd1, 0xa3, 0x52, 0x08, 0xe7, 0xa7, 0xac, 0x31, 0xc2, 0x5b, 0x72, 0x28, + 0x00, 0x30, 0xfe, 0x10, 0xbe, 0x3d, 0xec, 0x16, 0xe0, 0xd1, 0x4a, 0xd5, + 0x6e, 0x46, 0xef, 0x8d, 0xde, 0xb6, 0xc1, 0x8a, 0x0e, 0xde, 0xaf, 0xe7, + 0x5b, 0x03, 0xc3, 0x12, 0x10, 0x8f, 0xef, 0xc7, 0x4f, 0x16, 0x00, 0xae, + 0x22, 0xb8, 0x65, 0xf3, 0x3d, 0x63, 0x36, 0x3a, 0x01, 0x1a, 0xca, 0x07, + 0x0a, 0xb8, 0x02, 0x08, 0x02, 0x12, 0x10, 0x48, 0x4c, 0x97, 0x33, 0xdd, + 0x59, 0x35, 0xad, 0x65, 0x6f, 0xbf, 0x74, 0xa0, 0x5d, 0x51, 0xbb, 0x18, + 0x8b, 0xdc, 0x95, 0xa2, 0x06, 0x22, 0x5b, 0x30, 0x59, 0x30, 0x13, 0x06, + 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x42, 0x60, + 0x66, 0x81, 0x7c, 0x62, 0x5b, 0x89, 0x52, 0x73, 0xae, 0xc0, 0xcc, 0x5d, + 0x28, 0x5a, 0x82, 0xb2, 0xea, 0xea, 0xd8, 0x8c, 0x77, 0xab, 0x32, 0x5d, + 0x51, 0xb5, 0xe4, 0xae, 0x53, 0x8e, 0xc9, 0xde, 0x97, 0x7e, 0x8e, 0x47, + 0xd6, 0xb9, 0xb7, 0x49, 0x1a, 0xee, 0x3d, 0xc7, 0x3e, 0x81, 0x96, 0x83, + 0xef, 0x19, 0xe7, 0xbc, 0xdf, 0x76, 0x6a, 0x3e, 0xe9, 0x54, 0x15, 0x0a, + 0x04, 0xd8, 0x28, 0xd9, 0xd4, 0x01, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, + 0x76, 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x48, 0x02, 0x52, 0xaa, + 0x01, 0x08, 0x01, 0x10, 0x00, 0x1a, 0x81, 0x01, 0x04, 0xb8, 0x88, 0x06, + 0x02, 0x12, 0x58, 0x1b, 0x04, 0x6a, 0x25, 0x3a, 0x68, 0xd2, 0xeb, 0x61, + 0xe2, 0x4f, 0xa1, 0x4d, 0x55, 0x39, 0x85, 0x4c, 0xb1, 0xfe, 0x04, 0x01, + 0xd4, 0x5f, 0x2e, 0xd2, 0x80, 0xde, 0x27, 0xd2, 0x37, 0x54, 0x04, 0x85, + 0x8b, 0xfa, 0x4a, 0x31, 0x7f, 0x4b, 0x8d, 0x74, 0xfe, 0xd5, 0xdc, 0x85, + 0x36, 0xd5, 0x0c, 0xc6, 0x4e, 0x3b, 0x7a, 0xd6, 0xe9, 0x5d, 0x49, 0x41, + 0x9f, 0x00, 0xac, 0x89, 0x6e, 0x73, 0x75, 0x86, 0xfe, 0x9a, 0xa2, 0x50, + 0xf2, 0x19, 0xcf, 0xf5, 0x2e, 0x75, 0x21, 0x3a, 0x09, 0x76, 0x21, 0x6e, + 0x03, 0xa6, 0x46, 0x0f, 0xff, 0xa2, 0xfb, 0xf1, 0xa2, 0xbe, 0x62, 0x19, + 0x0e, 0xdc, 0x0d, 0x82, 0xb7, 0x20, 0x95, 0x81, 0x3c, 0xad, 0xa8, 0x3e, + 0x18, 0x20, 0x58, 0xc9, 0x4d, 0x75, 0xf0, 0x45, 0xa7, 0x8c, 0x9b, 0xc5, + 0xbb, 0x31, 0xa0, 0xd9, 0x25, 0x22, 0x20, 0x03, 0x0c, 0x37, 0x13, 0xa7, + 0x1a, 0x35, 0x44, 0x7c, 0x57, 0x7b, 0xfb, 0x47, 0x6d, 0x4b, 0x40, 0xf8, + 0xe8, 0x4b, 0x66, 0x44, 0x0d, 0x99, 0xe8, 0x0a, 0xcf, 0x00, 0x25, 0xdd, + 0xfd, 0x38, 0xbb, 0x12, 0x66, 0x30, 0x64, 0x02, 0x30, 0x20, 0x0e, 0x49, + 0x58, 0x0b, 0x5b, 0x5e, 0x6f, 0x9b, 0xa8, 0x78, 0x55, 0xce, 0xde, 0x43, + 0xef, 0x57, 0xa7, 0x86, 0xc2, 0x28, 0x76, 0xbf, 0x54, 0xc8, 0x99, 0x72, + 0x71, 0xdd, 0x14, 0xc7, 0x72, 0xf1, 0x1e, 0xcc, 0x6c, 0x2d, 0x75, 0xfd, + 0x99, 0x84, 0x34, 0xa4, 0x99, 0x39, 0x79, 0xe5, 0x28, 0x02, 0x30, 0x33, + 0x20, 0x1e, 0xc4, 0x98, 0x75, 0xe7, 0xac, 0x6f, 0xb2, 0x90, 0x3b, 0xe1, + 0x12, 0xd1, 0x8b, 0x88, 0xbf, 0xd6, 0x27, 0x6d, 0x80, 0x2a, 0x90, 0xd6, + 0x8d, 0xfd, 0x3c, 0x61, 0xfb, 0x45, 0xb2, 0xce, 0x8e, 0x6d, 0x65, 0x0d, + 0x61, 0x78, 0xf4, 0x0d, 0x8f, 0xbb, 0x47, 0xa7, 0xf7, 0x45, 0xca, 0x1a, + 0xa2, 0x04, 0x0a, 0x9a, 0x01, 0x08, 0x01, 0x12, 0x10, 0xc6, 0x10, 0x80, + 0x8e, 0xce, 0x58, 0x74, 0x5c, 0x0f, 0xb3, 0xda, 0x8c, 0xeb, 0x33, 0x3d, + 0x8a, 0x18, 0xed, 0xad, 0xab, 0x97, 0x06, 0x22, 0x78, 0x30, 0x76, 0x30, + 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, + 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0x0b, 0x5c, 0xca, + 0xda, 0x33, 0x99, 0x3b, 0xf6, 0xd9, 0xa7, 0xec, 0x5c, 0x91, 0xb5, 0x1d, + 0x07, 0x63, 0x38, 0x25, 0xad, 0x59, 0x2c, 0x14, 0x00, 0xf2, 0xc7, 0x5f, + 0x36, 0xec, 0xa0, 0x68, 0x21, 0xa2, 0xbd, 0x8a, 0xd3, 0xb2, 0x0c, 0x76, + 0x90, 0xef, 0x99, 0xe9, 0x57, 0xc6, 0x60, 0x1c, 0x3d, 0x89, 0x03, 0xd6, + 0xe1, 0xb3, 0x5d, 0x83, 0x94, 0xe9, 0x39, 0xea, 0xd5, 0xac, 0x00, 0x5b, + 0x4a, 0x14, 0xd7, 0xc2, 0x08, 0xa8, 0x1c, 0x05, 0xe2, 0x3b, 0x50, 0xe9, + 0x8c, 0x64, 0x32, 0x92, 0xa8, 0x5f, 0x7e, 0x33, 0xd6, 0x99, 0xcd, 0x09, + 0xe6, 0x18, 0x13, 0x2f, 0x16, 0x3a, 0x7e, 0xbf, 0xa8, 0x28, 0xd9, 0xd4, + 0x01, 0x48, 0x03, 0x12, 0x80, 0x03, 0x81, 0x6f, 0xdc, 0x22, 0x5d, 0x32, + 0x26, 0x9e, 0x8b, 0x54, 0x18, 0x11, 0x11, 0x1f, 0xa4, 0x4f, 0x58, 0x95, + 0xd0, 0x74, 0x19, 0xd3, 0x72, 0xa5, 0x5b, 0x30, 0xe5, 0xa9, 0x8f, 0x11, + 0x99, 0x1a, 0x0d, 0x9c, 0x27, 0xd9, 0xc8, 0xe7, 0xff, 0xf0, 0x08, 0xc7, + 0xcf, 0xb2, 0x94, 0x94, 0xd4, 0x56, 0x7f, 0xf5, 0xd8, 0x31, 0x9e, 0xd6, + 0xd1, 0x3f, 0xbc, 0x52, 0x48, 0x30, 0x33, 0x61, 0x41, 0x5b, 0x3d, 0xa6, + 0xf5, 0xb1, 0xd0, 0x73, 0x53, 0x75, 0x16, 0xf4, 0xb7, 0xe0, 0x6f, 0x2e, + 0xe1, 0x34, 0x63, 0x96, 0x72, 0x79, 0x72, 0xe8, 0xf8, 0x4a, 0x37, 0xf4, + 0x73, 0xbb, 0x8e, 0x5e, 0x73, 0x6c, 0xdd, 0x14, 0x2d, 0xe8, 0xb6, 0xc0, + 0xf2, 0xbb, 0x34, 0xca, 0x6d, 0x9c, 0x1b, 0xde, 0xf6, 0x48, 0xe2, 0xce, + 0xd7, 0x98, 0x42, 0x51, 0x03, 0x3a, 0x54, 0x74, 0x0d, 0xcf, 0x2d, 0xc4, + 0x77, 0x6b, 0x5d, 0x7a, 0xd0, 0xf0, 0x1a, 0xec, 0x59, 0xa8, 0xb7, 0x87, + 0x2c, 0x3d, 0x5a, 0xd2, 0x4d, 0x2d, 0xf8, 0xc6, 0x71, 0x87, 0x0d, 0xda, + 0x88, 0x93, 0xf7, 0x60, 0xd9, 0xd9, 0x3d, 0x4b, 0x8d, 0x6c, 0x43, 0x57, + 0x17, 0x7e, 0x89, 0xc6, 0x56, 0x4c, 0xd4, 0x51, 0xe7, 0x8a, 0x7d, 0x91, + 0x73, 0xda, 0xfa, 0x32, 0xb7, 0xd5, 0xdf, 0xb9, 0xe4, 0x45, 0x22, 0x45, + 0xc5, 0x8b, 0x5e, 0x0f, 0xe9, 0x77, 0x8c, 0x8e, 0xd6, 0x18, 0x02, 0xad, + 0x47, 0xd4, 0x22, 0xdc, 0x9e, 0xf1, 0xbb, 0xf1, 0x5b, 0x9f, 0x5d, 0xde, + 0xa8, 0x16, 0xfa, 0x80, 0x33, 0xa8, 0x31, 0x36, 0x71, 0xb1, 0x04, 0x7b, + 0xc2, 0x88, 0xe9, 0x9b, 0xc5, 0xd2, 0x32, 0xd4, 0x0c, 0xef, 0xfe, 0x4d, + 0x5a, 0xe9, 0x85, 0xb5, 0x00, 0x7e, 0x67, 0xd5, 0xe9, 0x16, 0x1b, 0x97, + 0xc5, 0xea, 0xf6, 0xfe, 0x52, 0xc9, 0x04, 0xd0, 0x07, 0xe8, 0x49, 0x6e, + 0x3e, 0x9f, 0x1f, 0xdb, 0xb1, 0xfe, 0x7a, 0x40, 0xd6, 0x07, 0x71, 0x20, + 0x83, 0x22, 0x29, 0x20, 0x4b, 0xa5, 0x56, 0xac, 0x78, 0x2a, 0x76, 0x1b, + 0xe8, 0x08, 0x3e, 0x1b, 0xf8, 0x4f, 0xae, 0xc6, 0x45, 0x5d, 0x2b, 0xdc, + 0x1f, 0x0b, 0x22, 0xdb, 0x77, 0xd7, 0xf4, 0xde, 0x5e, 0xa8, 0x0c, 0x43, + 0x92, 0xb6, 0xa6, 0x09, 0x0d, 0xc9, 0xce, 0xcb, 0xf8, 0xb3, 0x0d, 0x05, + 0x25, 0xf0, 0xee, 0x5f, 0x8a, 0xc7, 0xf4, 0x0f, 0xf1, 0xb6, 0x59, 0x48, + 0xa8, 0xd0, 0x46, 0xec, 0xdf, 0x73, 0xb7, 0xfe, 0x2b, 0xda, 0x6a, 0xe6, + 0x52, 0x4c, 0xc4, 0x5b, 0xd3, 0xf3, 0x40, 0x76, 0xbf, 0xc9, 0x7a, 0x85, + 0xe1, 0x68, 0xce, 0x69, 0x53, 0x43, 0xc9, 0x3f, 0x86, 0xdb, 0x5d, 0x98, + 0x8e, 0xdb, 0x3c, 0x4a, 0x4f, 0xc6, 0x18, 0x73, 0x00, 0xf4, 0xb3, 0x93, + 0xec, 0x37, 0x16, 0x73, 0xbb, 0x74, 0x20, 0x03, 0x20, 0x02, 0x22, 0x04, + 0x83, 0xc5, 0x0a, 0xac, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_ECC_Private_Key; + RunTest(); +} + +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0x7f, 0x32, 0x70, 0x49, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x12, + 0x7f, 0x32, 0x70, 0x49, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x09, 0xec, 0x00, 0x00, 0x01, 0x00, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xea, 0x1f, 0x31, 0x8d, 0x3c, 0xa8, 0xa5, 0x43, 0x25, + 0xf6, 0x92, 0xb0, 0x49, 0x4b, 0xdc, 0x4b, 0x17, 0x61, 0x0e, 0x1d, 0x8c, + 0x85, 0x00, 0x21, 0x35, 0x84, 0x54, 0x56, 0x53, 0x0a, 0x34, 0x08, 0x34, + 0x87, 0x67, 0x03, 0xa6, 0x07, 0x72, 0x11, 0x23, 0x36, 0xcd, 0x5a, 0x84, + 0x24, 0x48, 0x6a, 0x6c, 0x71, 0x5e, 0xf0, 0x28, 0x24, 0xaf, 0x83, 0xbb, + 0x4f, 0x54, 0x38, 0xc3, 0x3d, 0xfc, 0xb7, 0x79, 0x01, 0x87, 0xf2, 0x6e, + 0xac, 0xfe, 0x80, 0x5d, 0xcb, 0xbe, 0x95, 0x29, 0x76, 0x79, 0xda, 0xf6, + 0xd4, 0x7b, 0x7a, 0xd9, 0xb4, 0x32, 0xd3, 0xa8, 0x6d, 0x14, 0xc0, 0xac, + 0x36, 0xab, 0x77, 0xc3, 0xbd, 0xd5, 0x79, 0x72, 0x0b, 0x21, 0xc9, 0x44, + 0x07, 0x57, 0x86, 0x43, 0xe1, 0x2a, 0x3e, 0x8e, 0x7e, 0x1d, 0x50, 0x64, + 0x09, 0x0f, 0x0c, 0x76, 0x0b, 0xb6, 0x36, 0xe0, 0x64, 0x62, 0x4e, 0xda, + 0xc1, 0x56, 0x08, 0x8b, 0x13, 0x3d, 0x80, 0x3f, 0x26, 0x0e, 0xa0, 0x4a, + 0xc5, 0x95, 0x51, 0xcd, 0x15, 0x41, 0x44, 0x17, 0x78, 0xc6, 0xec, 0x00, + 0x5b, 0x47, 0xad, 0x21, 0xf7, 0x4b, 0x98, 0xed, 0x1d, 0x82, 0x6d, 0x22, + 0xfc, 0xcb, 0x07, 0x69, 0x7c, 0x96, 0x57, 0xd7, 0x01, 0xe1, 0xc3, 0x64, + 0x92, 0xc8, 0xc0, 0xe1, 0x00, 0x31, 0xc2, 0xf9, 0x44, 0x37, 0x5c, 0x60, + 0xe3, 0x4f, 0x61, 0x79, 0xec, 0x7d, 0xed, 0xb6, 0xfa, 0x05, 0x1b, 0xf4, + 0xd5, 0xb5, 0x15, 0xb4, 0x03, 0xab, 0x36, 0xc5, 0xb8, 0xcc, 0xd1, 0x58, + 0x21, 0xfe, 0x1f, 0xa7, 0x75, 0xaa, 0xbe, 0x8e, 0x7b, 0x47, 0x93, 0x7c, + 0xf2, 0x28, 0xbd, 0x07, 0x26, 0x38, 0x99, 0x5d, 0x2b, 0x39, 0xad, 0x67, + 0x26, 0x1d, 0xee, 0xb5, 0xd5, 0x84, 0x5c, 0x6d, 0x2a, 0x21, 0x2b, 0x17, + 0x8a, 0x33, 0x1c, 0x57, 0x64, 0xd2, 0x59, 0x85, 0x6c, 0xae, 0xd1, 0x4d, + 0x8a, 0x90, 0xcd, 0xc2, 0xd4, 0x75, 0xb8, 0x1a, 0x27, 0xbb, 0xa5, 0x6e, + 0xb6, 0xe2, 0x79, 0xa8, 0x4c, 0xb0, 0x89, 0x5a, 0xe8, 0x96, 0x7f, 0xf0, + 0x21, 0x57, 0xec, 0x16, 0x83, 0x46, 0x2c, 0x52, 0xec, 0xb7, 0xee, 0x5b, + 0x16, 0xbd, 0x11, 0xd3, 0xa8, 0x6c, 0x33, 0x43, 0x9e, 0x63, 0x4c, 0x60, + 0x33, 0xcd, 0xc2, 0xad, 0x1f, 0xfa, 0x16, 0x9d, 0xea, 0x37, 0x96, 0x76, + 0x61, 0x7a, 0x81, 0x1f, 0x10, 0xa6, 0x77, 0x5e, 0x8a, 0x0f, 0xe0, 0xbf, + 0x17, 0x25, 0x63, 0x90, 0x88, 0x9d, 0xa0, 0xcf, 0xe1, 0x79, 0xa2, 0x68, + 0x5a, 0x79, 0x98, 0x17, 0xac, 0x83, 0x3d, 0x37, 0xd2, 0x60, 0x56, 0x05, + 0x71, 0x33, 0xbf, 0xe6, 0x14, 0x39, 0x38, 0xb3, 0xc9, 0xa4, 0x8c, 0xc5, + 0x50, 0x77, 0xbf, 0x6e, 0xc2, 0xa7, 0x44, 0x49, 0x8e, 0x68, 0x79, 0xd2, + 0x66, 0x3b, 0xba, 0xad, 0x05, 0x39, 0xeb, 0x27, 0xc9, 0xbf, 0xa2, 0x31, + 0x31, 0x52, 0x71, 0xdd, 0xe2, 0x24, 0xbe, 0xc5, 0xcc, 0x0a, 0x19, 0xc9, + 0x98, 0x75, 0xde, 0xc2, 0x21, 0x74, 0x63, 0x71, 0xb0, 0x33, 0xbc, 0x3f, + 0xfb, 0x01, 0x43, 0xb9, 0x53, 0xf7, 0xcd, 0x02, 0xeb, 0xca, 0x4f, 0x1c, + 0xb0, 0xdf, 0x1a, 0xcf, 0x04, 0xb0, 0x49, 0xaf, 0xce, 0x23, 0x0a, 0x4e, + 0x61, 0x29, 0xe9, 0x92, 0xea, 0x9c, 0x35, 0xed, 0xb4, 0x7c, 0x40, 0x92, + 0x7d, 0x55, 0xf8, 0x3e, 0xc1, 0xf0, 0x36, 0xd7, 0xca, 0xee, 0xa1, 0x5d, + 0x56, 0xf2, 0x8a, 0x1e, 0xce, 0xcc, 0xb6, 0x86, 0x39, 0x6d, 0x87, 0xdc, + 0x85, 0xbc, 0x56, 0xdc, 0xf5, 0x2e, 0x17, 0xa0, 0xf2, 0x9d, 0xc3, 0xdd, + 0xa3, 0x56, 0xd8, 0x8e, 0x00, 0x8a, 0xb6, 0x27, 0x87, 0xe0, 0x8e, 0x79, + 0x13, 0x05, 0x48, 0xd2, 0xb0, 0x21, 0x8d, 0x86, 0xb3, 0x7a, 0xef, 0xea, + 0x4f, 0x57, 0x6a, 0xe0, 0xb5, 0x59, 0xe2, 0x80, 0xa8, 0x0f, 0x60, 0x05, + 0x1b, 0x9e, 0x55, 0xc1, 0x64, 0xab, 0x7f, 0x63, 0xf4, 0x02, 0x5a, 0xb5, + 0x58, 0xa9, 0xbc, 0x43, 0x28, 0x41, 0xaa, 0x8a, 0x5b, 0xde, 0xd1, 0x88, + 0xb3, 0x52, 0x39, 0x4d, 0x6c, 0x3f, 0x6e, 0x88, 0x11, 0x80, 0xda, 0xa1, + 0x8a, 0x04, 0x5d, 0x30, 0x98, 0xc4, 0xe8, 0x28, 0x90, 0x4d, 0x9b, 0x92, + 0x61, 0x9f, 0xdb, 0xf1, 0x9b, 0xbf, 0xd4, 0xd9, 0x83, 0x74, 0x6f, 0xee, + 0x95, 0x2e, 0x64, 0x05, 0x84, 0xf5, 0x51, 0xb6, 0xc9, 0x3f, 0xf8, 0xbd, + 0xf9, 0x21, 0x92, 0x2f, 0x08, 0xe1, 0x43, 0x13, 0x94, 0x97, 0x18, 0x50, + 0x7f, 0x3f, 0x85, 0xf9, 0x15, 0xab, 0x6a, 0x17, 0x3c, 0x5a, 0x5e, 0x26, + 0xf1, 0x47, 0xdd, 0x06, 0x58, 0x40, 0x27, 0x5d, 0x2f, 0xe6, 0xa1, 0x91, + 0xb2, 0xfd, 0xdb, 0x49, 0x89, 0x7e, 0x78, 0x85, 0x81, 0xfc, 0x6d, 0xf8, + 0x29, 0x7a, 0x1f, 0x76, 0x69, 0xb1, 0x17, 0x2f, 0xb9, 0x29, 0x17, 0x55, + 0x25, 0x2e, 0x7c, 0xca, 0xdc, 0x1d, 0xee, 0xb0, 0x8f, 0xf6, 0x62, 0x5d, + 0x05, 0xe2, 0xb4, 0x47, 0x83, 0x1c, 0xbe, 0x69, 0x85, 0x7b, 0xc9, 0xd9, + 0x95, 0x2f, 0x2a, 0xa1, 0x79, 0x9b, 0xeb, 0x93, 0x5f, 0x1a, 0xa9, 0x0f, + 0x1a, 0xaf, 0xfb, 0x3a, 0xee, 0x0a, 0x69, 0x69, 0xab, 0x33, 0xbb, 0x2b, + 0x6b, 0x53, 0x77, 0xd8, 0xd9, 0xcc, 0x60, 0xe3, 0xbe, 0x6d, 0x24, 0x4f, + 0x0c, 0x0b, 0x6f, 0x09, 0x4d, 0xa3, 0x64, 0x47, 0x71, 0x07, 0x23, 0x3a, + 0x11, 0xd5, 0x2b, 0xc6, 0x13, 0xf8, 0xe7, 0x2b, 0x88, 0x94, 0xfe, 0x70, + 0xe8, 0x40, 0x16, 0x7f, 0x3a, 0xac, 0x06, 0xa1, 0x44, 0xa3, 0xa9, 0xd2, + 0xff, 0xb7, 0xa1, 0x86, 0x95, 0x15, 0x2b, 0xc5, 0x83, 0x10, 0xb8, 0x72, + 0x14, 0x24, 0x97, 0x8a, 0xf5, 0x45, 0xa8, 0x1b, 0x1c, 0xfa, 0x52, 0xab, + 0x25, 0x8a, 0x2c, 0xed, 0x48, 0x8f, 0xe4, 0x3b, 0xc1, 0x61, 0xcb, 0xb6, + 0x85, 0xb1, 0x32, 0x57, 0xaf, 0x3e, 0x5a, 0x14, 0x93, 0xc9, 0xd3, 0x97, + 0xc0, 0x6e, 0x67, 0x22, 0xfe, 0x3c, 0xf3, 0x79, 0xaa, 0x4e, 0x35, 0x84, + 0x7d, 0x27, 0xd0, 0x84, 0x53, 0x1d, 0x91, 0xba, 0x3b, 0x06, 0x36, 0xa6, + 0xdd, 0xbd, 0x9e, 0x91, 0x31, 0x88, 0xed, 0xee, 0x8c, 0xe9, 0x68, 0x9c, + 0x00, 0x52, 0x1a, 0xbb, 0x45, 0x75, 0x2f, 0x9a, 0x81, 0xf7, 0xe8, 0xf8, + 0x76, 0x71, 0xd3, 0x3e, 0x9b, 0x7e, 0x13, 0x92, 0x6a, 0x70, 0x55, 0x3f, + 0x48, 0xef, 0xbd, 0xd6, 0x9f, 0x5e, 0x9c, 0x0c, 0x68, 0x22, 0xba, 0x71, + 0x7d, 0x36, 0x11, 0xe1, 0xe5, 0xd8, 0x00, 0xa8, 0xce, 0x2c, 0x89, 0x79, + 0xbf, 0x5b, 0x02, 0xac, 0xda, 0xd4, 0x68, 0x4f, 0xdf, 0x8d, 0xe3, 0x07, + 0x38, 0x39, 0xd1, 0xe0, 0x4d, 0xb4, 0xdc, 0x79, 0x2c, 0x04, 0x68, 0xb4, + 0xed, 0x53, 0x2e, 0x2e, 0x0e, 0xbe, 0xee, 0xae, 0x33, 0xad, 0x80, 0x9c, + 0x77, 0x9d, 0xc1, 0x61, 0x9c, 0x5e, 0x19, 0x72, 0x51, 0xeb, 0xc8, 0x1c, + 0xc9, 0xd2, 0xd3, 0x54, 0x6f, 0xe6, 0x88, 0x37, 0x2b, 0x35, 0x00, 0xb1, + 0xd4, 0x8b, 0xa6, 0xb2, 0x1b, 0x73, 0x5b, 0xdf, 0x93, 0xb2, 0x96, 0x77, + 0x4b, 0x2d, 0xf2, 0x9f, 0xf7, 0xd0, 0xb4, 0x78, 0x5d, 0xe5, 0x6d, 0x6c, + 0xa3, 0xd0, 0xf5, 0xc7, 0xd2, 0x00, 0x2f, 0xa2, 0xfc, 0x0c, 0xb0, 0x9f, + 0x63, 0x53, 0xe9, 0x08, 0xc1, 0x51, 0x85, 0x73, 0x6a, 0xfa, 0x01, 0xe5, + 0xf6, 0x7c, 0xcb, 0xdd, 0x53, 0x53, 0x47, 0xa1, 0xb8, 0x64, 0xb1, 0xda, + 0xd7, 0xd7, 0xef, 0x9a, 0x62, 0x53, 0x8f, 0x4b, 0xbe, 0x0f, 0x3c, 0x12, + 0x3b, 0x2c, 0xda, 0x5b, 0x12, 0x43, 0x81, 0xf5, 0x3c, 0x8a, 0x21, 0x0f, + 0x52, 0x6b, 0x81, 0x85, 0xaa, 0xbd, 0xae, 0x3f, 0x2f, 0x46, 0x2b, 0x4a, + 0x19, 0x6b, 0xa2, 0x69, 0x2f, 0xbe, 0x50, 0x79, 0x71, 0xa1, 0x03, 0x0d, + 0x29, 0xe5, 0xc0, 0xe5, 0xc4, 0x32, 0x77, 0x4c, 0xbb, 0x3b, 0xb7, 0x8e, + 0xa4, 0xc5, 0xd7, 0x58, 0x83, 0x40, 0x25, 0x20, 0x8e, 0xa0, 0x7f, 0x9a, + 0x9f, 0x62, 0x2f, 0xb1, 0xce, 0x95, 0x53, 0x29, 0xd3, 0x39, 0xd4, 0x7a, + 0xe6, 0x96, 0x73, 0x5f, 0x65, 0xbe, 0x8e, 0x8c, 0x59, 0x88, 0xf4, 0x1b, + 0x40, 0x13, 0xca, 0x74, 0x39, 0x6f, 0xef, 0x08, 0xbc, 0xdb, 0x9a, 0x1c, + 0x38, 0xa7, 0x67, 0x2f, 0x96, 0x78, 0x87, 0x3a, 0xfa, 0xf7, 0x29, 0x16, + 0x1d, 0x73, 0x6b, 0x1f, 0xdf, 0x1d, 0x91, 0xd3, 0x93, 0x1f, 0xef, 0x06, + 0xa1, 0xef, 0x19, 0x28, 0x61, 0xe0, 0x09, 0xae, 0x69, 0xa3, 0x41, 0x2f, + 0x28, 0x35, 0x00, 0xe4, 0xd3, 0x85, 0xc4, 0x69, 0x34, 0x63, 0xee, 0xc7, + 0xa0, 0x31, 0x02, 0x92, 0x63, 0x54, 0xeb, 0x24, 0x68, 0xf8, 0x44, 0x80, + 0x86, 0x9b, 0x21, 0xf0, 0x85, 0xb0, 0x84, 0xaa, 0xe8, 0xe3, 0xf0, 0x3a, + 0x61, 0xe8, 0x5d, 0xf6, 0x66, 0xac, 0x05, 0xd1, 0xc0, 0x4b, 0x5d, 0xe0, + 0xa8, 0x63, 0xf6, 0xcd, 0xba, 0x97, 0x40, 0x55, 0xa0, 0xe7, 0x3b, 0xc2, + 0x2e, 0x05, 0x61, 0x06, 0x89, 0x18, 0x5f, 0x22, 0xb7, 0x00, 0x3f, 0x63, + 0xed, 0xcb, 0x8d, 0x2c, 0xf5, 0xc5, 0x6e, 0xb4, 0xca, 0x4f, 0x83, 0x12, + 0x10, 0x99, 0x21, 0x38, 0x4a, 0xd4, 0x11, 0x68, 0x1a, 0xfc, 0x9c, 0xd2, + 0xea, 0xc2, 0xaa, 0x60, 0xcb, 0x1a, 0xfb, 0x09, 0x0a, 0xbe, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x35, 0x7f, 0x7a, 0xfa, 0x7d, 0x33, 0x42, 0x33, 0x1c, + 0x8c, 0xd1, 0x07, 0xdd, 0xc7, 0x5a, 0x96, 0x18, 0xad, 0xf6, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xbc, 0x6d, 0x9d, 0x5a, 0xd1, 0x9f, 0x64, 0xca, 0xb2, 0x2c, 0x8f, + 0x69, 0x1d, 0xa5, 0x41, 0x3a, 0xcc, 0x01, 0x86, 0xf7, 0x69, 0x77, 0x25, + 0x58, 0xed, 0x4a, 0xbe, 0xbd, 0x24, 0x73, 0xd9, 0xa3, 0x21, 0xac, 0x6e, + 0xf1, 0x12, 0xf0, 0x3c, 0xcc, 0x12, 0x09, 0x46, 0x15, 0x2f, 0xd7, 0xbd, + 0x9e, 0x06, 0xd3, 0x44, 0x72, 0xe7, 0x33, 0x3a, 0xa7, 0x1e, 0xab, 0x4a, + 0x73, 0x09, 0x45, 0xf7, 0x7e, 0x94, 0x6b, 0xb2, 0xc8, 0xf2, 0xea, 0xd6, + 0xf1, 0xfe, 0x20, 0xd2, 0x34, 0x5b, 0x02, 0x9e, 0x41, 0xae, 0x56, 0xa9, + 0x3d, 0x17, 0xa4, 0x68, 0x16, 0xda, 0xb5, 0xe7, 0x9b, 0x2c, 0xc6, 0xf8, + 0x51, 0x1f, 0x34, 0xd5, 0x16, 0x67, 0x77, 0x17, 0x95, 0xbf, 0x3d, 0x19, + 0x1e, 0xe0, 0x02, 0x76, 0xab, 0xa1, 0xbd, 0x0a, 0x88, 0xc1, 0x3c, 0x51, + 0xc2, 0x71, 0x1b, 0x28, 0x90, 0x74, 0x6e, 0x06, 0xb1, 0x04, 0xa2, 0x4f, + 0xae, 0x43, 0x03, 0xce, 0xf8, 0x31, 0x97, 0x04, 0xf6, 0x74, 0xae, 0xb8, + 0x82, 0x8e, 0x6c, 0x08, 0x4f, 0xbf, 0x2b, 0xac, 0x45, 0xdc, 0x19, 0x41, + 0x2b, 0x64, 0x53, 0x4d, 0x10, 0x5a, 0x36, 0x46, 0xba, 0xd5, 0xae, 0xa1, + 0xdb, 0xce, 0x42, 0x60, 0xa6, 0xe4, 0x80, 0x65, 0x8c, 0xed, 0x29, 0x89, + 0x8b, 0xe9, 0x3b, 0xe6, 0x33, 0xb1, 0xf1, 0x63, 0x3a, 0x6c, 0x91, 0x49, + 0x6b, 0xd6, 0xc1, 0x1a, 0x52, 0x55, 0x5d, 0x03, 0x9e, 0x92, 0xa3, 0x15, + 0x84, 0x1c, 0x3a, 0x39, 0x80, 0x9a, 0x7a, 0x70, 0xe0, 0xd0, 0x2d, 0x52, + 0xf0, 0x04, 0x7e, 0x88, 0xb5, 0x2d, 0x8e, 0x97, 0x85, 0x88, 0xb3, 0x3d, + 0xb4, 0xd4, 0x21, 0x41, 0x0d, 0x4b, 0x92, 0xb9, 0x77, 0xb1, 0xff, 0x10, + 0x56, 0x8a, 0x0d, 0x94, 0xbe, 0x5b, 0x77, 0x2e, 0x5f, 0xd7, 0x63, 0xdd, + 0xbc, 0x87, 0x1c, 0x67, 0x93, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x12, 0x80, 0x02, 0x34, 0xdf, 0x8b, 0x7b, + 0x40, 0x3f, 0x6b, 0xbe, 0xb7, 0x47, 0x72, 0x7e, 0x9c, 0x8e, 0x5b, 0xc1, + 0x4a, 0x4e, 0xe7, 0x60, 0x72, 0x43, 0x51, 0x5e, 0x1d, 0x3e, 0x82, 0x53, + 0x89, 0x6a, 0x4f, 0x48, 0x8d, 0x50, 0xd1, 0x74, 0x2c, 0x3d, 0x6d, 0xa0, + 0xf0, 0xc9, 0x4e, 0x80, 0xcb, 0xf6, 0x12, 0xb2, 0xf0, 0xc1, 0x03, 0xa0, + 0x8e, 0xb6, 0x1b, 0x75, 0x94, 0x72, 0x42, 0x0d, 0x8e, 0xa9, 0x94, 0xd7, + 0x5b, 0x17, 0x9d, 0x3a, 0xad, 0x09, 0x5b, 0x0d, 0x29, 0x08, 0x67, 0xaf, + 0xee, 0x72, 0x65, 0x03, 0xa5, 0xe2, 0xf4, 0x49, 0xd2, 0x8c, 0x26, 0x7c, + 0x5e, 0xb3, 0x42, 0x90, 0x57, 0xe2, 0x28, 0x26, 0xb2, 0x9e, 0x32, 0x6b, + 0xdd, 0x2b, 0x2f, 0x12, 0x64, 0xea, 0xd0, 0x6b, 0xd8, 0xf7, 0x53, 0x21, + 0x57, 0x2f, 0x12, 0x1d, 0xc7, 0x88, 0x0a, 0xfb, 0x70, 0x3d, 0x9b, 0x15, + 0xd1, 0xdb, 0x6c, 0xe7, 0x25, 0xf3, 0x87, 0xdd, 0xa0, 0x3b, 0xc1, 0x99, + 0x33, 0xbe, 0x50, 0x36, 0x5b, 0x50, 0x62, 0x0a, 0xc4, 0xae, 0x09, 0x36, + 0x32, 0x8e, 0x19, 0xdc, 0x79, 0x80, 0xd4, 0xe0, 0x82, 0xa2, 0x73, 0xf3, + 0x5f, 0x69, 0x56, 0xcc, 0xe2, 0x29, 0xbd, 0xae, 0x9d, 0xc8, 0x15, 0xdb, + 0xf8, 0xb2, 0xda, 0xfb, 0x04, 0xac, 0x45, 0xaa, 0x6d, 0x3b, 0x7b, 0x26, + 0x87, 0xa5, 0xee, 0x34, 0x46, 0x81, 0x0e, 0xb4, 0x37, 0x2e, 0x6b, 0x8e, + 0x60, 0xc5, 0x6e, 0xec, 0x88, 0x5a, 0x71, 0x34, 0x80, 0x1a, 0xc5, 0x4b, + 0x6c, 0x07, 0x01, 0x2a, 0x39, 0x50, 0x9b, 0x67, 0xa3, 0xc1, 0x5c, 0xee, + 0x9f, 0x8e, 0xd7, 0x3e, 0xe4, 0x7f, 0xd4, 0x11, 0x86, 0xa4, 0x38, 0xa9, + 0xdf, 0x7f, 0xb7, 0x1e, 0x50, 0xe1, 0x34, 0xbe, 0x01, 0x69, 0x5e, 0xad, + 0xbf, 0xcf, 0xba, 0xc8, 0x9d, 0x04, 0x42, 0xf7, 0x3f, 0xf2, 0xaa, 0x92, + 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, 0x01, 0x12, 0x10, 0x6b, 0x99, + 0x4c, 0x4a, 0x94, 0x73, 0x2e, 0x0c, 0x81, 0xca, 0xcc, 0x34, 0x71, 0xcf, + 0x8a, 0x63, 0x18, 0xe1, 0xa7, 0xbd, 0xd0, 0x05, 0x22, 0x8e, 0x02, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbc, 0xfa, 0x43, 0x1b, + 0xaa, 0xbb, 0xd9, 0xb7, 0x5b, 0xb8, 0xec, 0xf6, 0xf0, 0xb6, 0xb1, 0xa6, + 0xc3, 0xd1, 0x45, 0xb8, 0x6e, 0x40, 0x85, 0xa0, 0xcf, 0x24, 0x68, 0x91, + 0xc2, 0x45, 0x8d, 0x4e, 0xf2, 0x42, 0x9e, 0xaa, 0x72, 0xed, 0x86, 0xdc, + 0xfb, 0x85, 0x29, 0x3f, 0x90, 0xb0, 0xc5, 0x12, 0x4e, 0x42, 0x0b, 0xce, + 0xfa, 0x0f, 0x83, 0x1a, 0x4c, 0xe9, 0xc9, 0xc1, 0x0b, 0x12, 0xeb, 0xc7, + 0xc5, 0x1a, 0xd5, 0xa1, 0x8d, 0x26, 0x6d, 0x78, 0x87, 0x2d, 0xc2, 0x63, + 0x84, 0x6c, 0x5e, 0x78, 0xd8, 0x0a, 0x78, 0x68, 0xc2, 0x82, 0x40, 0x0a, + 0xf7, 0x02, 0x63, 0x97, 0xec, 0x1c, 0x08, 0x91, 0x2b, 0xc2, 0xa7, 0xe9, + 0x17, 0xb8, 0x7b, 0x84, 0xed, 0xdc, 0x5c, 0x6c, 0x11, 0x38, 0xb4, 0x18, + 0xff, 0x11, 0x32, 0xd4, 0x34, 0x48, 0xc0, 0xa0, 0x47, 0x2d, 0x81, 0xe2, + 0xb6, 0x41, 0xe9, 0xd4, 0x5a, 0xf1, 0x75, 0x3d, 0x94, 0xf7, 0xb7, 0xf6, + 0x3b, 0x35, 0x78, 0x9c, 0x72, 0x7b, 0x12, 0xe0, 0x73, 0xd9, 0x92, 0x3d, + 0x23, 0xe6, 0xa2, 0x50, 0x95, 0xcc, 0xbc, 0x8b, 0xef, 0xa3, 0x09, 0x85, + 0x85, 0xb8, 0x74, 0xa8, 0x10, 0xab, 0x0a, 0x18, 0x35, 0x7d, 0x27, 0x5c, + 0x6a, 0x52, 0x0e, 0x5b, 0xb9, 0xa9, 0x2c, 0xee, 0xdf, 0x6e, 0xa3, 0x49, + 0xbf, 0x32, 0x3a, 0x6a, 0xe2, 0x72, 0xe4, 0xdd, 0x6f, 0xfb, 0x89, 0xf3, + 0xdf, 0xa6, 0x4a, 0x52, 0x8a, 0x9d, 0xd5, 0x49, 0x04, 0x33, 0xd2, 0xa2, + 0xca, 0x74, 0x3b, 0x2c, 0x34, 0xf1, 0x12, 0x2f, 0x85, 0xc3, 0x3c, 0x4f, + 0x73, 0x1f, 0x2c, 0x8a, 0xd2, 0x6f, 0xa4, 0xb7, 0x91, 0xf9, 0x5f, 0x79, + 0x04, 0x9c, 0x69, 0xe6, 0x62, 0xab, 0x15, 0x91, 0x23, 0x0e, 0x62, 0xbc, + 0x80, 0x1f, 0x97, 0x5f, 0x33, 0xe7, 0x33, 0x9e, 0x91, 0xf6, 0xdc, 0xfb, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, 0x3d, 0x12, 0x80, 0x03, 0x0e, + 0x78, 0x2b, 0x14, 0x53, 0x5c, 0x82, 0x9a, 0x00, 0x8d, 0x49, 0x18, 0x5e, + 0x21, 0xb6, 0xfb, 0xeb, 0xa7, 0xee, 0x10, 0x26, 0x75, 0x6f, 0xcd, 0x45, + 0xe8, 0x64, 0x72, 0x56, 0x9e, 0x39, 0x3d, 0x7e, 0x6a, 0x70, 0x5d, 0xf1, + 0x4a, 0xc0, 0x23, 0x66, 0x07, 0x04, 0x4c, 0x8d, 0x18, 0xf7, 0xa7, 0xc5, + 0xc3, 0x18, 0x3f, 0x72, 0xf4, 0xfd, 0xad, 0xb5, 0xc6, 0x8b, 0x77, 0x2e, + 0x20, 0xfb, 0xe4, 0x7b, 0xef, 0x79, 0xef, 0xcd, 0x7f, 0x21, 0x9c, 0x32, + 0xcf, 0xf4, 0xc8, 0xee, 0xfa, 0x81, 0x38, 0x7e, 0x36, 0xec, 0xdd, 0x29, + 0x94, 0xc3, 0xb7, 0x25, 0x6e, 0x77, 0x90, 0x81, 0xbe, 0x6c, 0x16, 0x75, + 0x83, 0x33, 0x41, 0x78, 0x74, 0xb3, 0x54, 0xa4, 0xe6, 0x1c, 0x95, 0xa2, + 0x1c, 0x2b, 0x93, 0x6c, 0xb7, 0xd3, 0x37, 0x31, 0x57, 0xa8, 0x95, 0xce, + 0x0e, 0x16, 0xc0, 0xbb, 0x4e, 0x23, 0xca, 0x23, 0x2a, 0x66, 0x4c, 0xe5, + 0xac, 0xc3, 0x0a, 0xe3, 0x31, 0x32, 0x53, 0xad, 0x2c, 0x70, 0x1d, 0x5a, + 0x20, 0x27, 0xf2, 0x6f, 0x0c, 0x53, 0x7b, 0x71, 0x77, 0x94, 0x5c, 0x28, + 0xc3, 0xf3, 0x3e, 0x48, 0x5f, 0x1a, 0xa2, 0x18, 0xf3, 0x53, 0xb4, 0xa5, + 0x3c, 0xb1, 0x9c, 0x67, 0x39, 0x68, 0x8d, 0xfa, 0x96, 0x8f, 0x6f, 0xdd, + 0x29, 0x35, 0xbc, 0x2c, 0x0d, 0xe5, 0xd7, 0xff, 0x25, 0x2d, 0xcd, 0x3f, + 0xdc, 0xb9, 0xa0, 0xaf, 0x5a, 0x41, 0x3c, 0xce, 0xa9, 0xab, 0x75, 0xee, + 0xf2, 0xbe, 0xee, 0xa8, 0x3b, 0x29, 0xaf, 0x07, 0xbf, 0x84, 0xbd, 0xdd, + 0xe3, 0x83, 0x42, 0xd5, 0x40, 0x8d, 0x39, 0xcf, 0x4d, 0xa9, 0xa3, 0x0c, + 0xd8, 0xbc, 0xfc, 0x32, 0xa5, 0x03, 0x63, 0x22, 0x82, 0xde, 0x3d, 0x1d, + 0xd9, 0x54, 0xd8, 0xcc, 0x57, 0x10, 0x8b, 0xbe, 0xc3, 0xae, 0x52, 0xbc, + 0xaf, 0x17, 0x62, 0xe7, 0x9f, 0x42, 0x75, 0xb8, 0x92, 0x7f, 0x61, 0xd8, + 0x08, 0x57, 0x40, 0x10, 0x2c, 0x85, 0x96, 0x97, 0x48, 0x14, 0xde, 0xb0, + 0x5f, 0xf9, 0xc6, 0xde, 0xfc, 0x25, 0x9c, 0x4d, 0x6e, 0x52, 0x54, 0xf0, + 0xa2, 0xa5, 0xfc, 0x32, 0x45, 0x75, 0x94, 0xbe, 0xe9, 0x57, 0x2a, 0xb8, + 0x6e, 0xab, 0x0f, 0xf5, 0x0c, 0x9a, 0xf9, 0x29, 0x06, 0x65, 0x54, 0xd8, + 0x93, 0x98, 0x3a, 0x5c, 0x71, 0x52, 0x0d, 0xf3, 0x4b, 0xc4, 0xc5, 0xbd, + 0x34, 0xb3, 0x58, 0xcf, 0x83, 0x94, 0xf0, 0x60, 0xb7, 0x91, 0x56, 0xff, + 0x21, 0x7d, 0x03, 0xeb, 0xc9, 0x09, 0x0c, 0x45, 0x6d, 0xa0, 0xaa, 0xd3, + 0x58, 0xc6, 0xea, 0x9d, 0x2c, 0xfc, 0xd3, 0x0a, 0x43, 0x62, 0x66, 0x4d, + 0xdc, 0x25, 0xe2, 0x7f, 0x7e, 0x39, 0x33, 0x82, 0x97, 0x30, 0xfe, 0xdd, + 0x4d, 0x64, 0x56, 0xff, 0xf1, 0x76, 0xc2, 0x78, 0x0b, 0xce, 0xb3, 0x22, + 0x04, 0x49, 0x70, 0x32, 0x7f, 0x2a, 0x80, 0x02, 0x4a, 0x5c, 0x04, 0x01, + 0xf6, 0xa8, 0xcb, 0x49, 0x2f, 0xed, 0x48, 0x46, 0x15, 0xad, 0xa8, 0x0b, + 0x01, 0xb1, 0xf4, 0xcc, 0x79, 0x08, 0xb6, 0x82, 0x46, 0x3e, 0xdd, 0xc8, + 0x66, 0x4a, 0x84, 0xb3, 0xcb, 0x6a, 0xfb, 0xc4, 0x70, 0xca, 0xdf, 0x29, + 0x90, 0x25, 0x2a, 0x28, 0xd3, 0x7d, 0xcb, 0x3e, 0x95, 0x4e, 0xf8, 0x92, + 0xa2, 0xce, 0xe6, 0x21, 0x8e, 0x49, 0x29, 0x41, 0x0c, 0x64, 0x8c, 0x75, + 0xd6, 0x95, 0x69, 0xa0, 0xeb, 0x7d, 0xc9, 0x12, 0x60, 0x16, 0x31, 0xc9, + 0x9b, 0x40, 0xad, 0x58, 0x15, 0x1a, 0x9f, 0x81, 0xc1, 0x16, 0xec, 0x10, + 0xa4, 0x5a, 0x4e, 0xd0, 0x97, 0x60, 0xa0, 0x36, 0xc9, 0xfe, 0x42, 0x65, + 0xea, 0xd9, 0xf8, 0xa8, 0x3d, 0x19, 0xfe, 0xde, 0x1f, 0x57, 0x94, 0xf8, + 0x32, 0xab, 0xca, 0x9b, 0xfe, 0x5c, 0x21, 0x37, 0xb1, 0xc4, 0xf0, 0x2a, + 0x5a, 0xd7, 0x6a, 0xab, 0xd9, 0x7d, 0xd7, 0xa0, 0xb8, 0xb7, 0x35, 0x05, + 0xe7, 0xf4, 0xa7, 0xfc, 0xf9, 0x46, 0xe1, 0x84, 0x39, 0x14, 0x4c, 0xaa, + 0x69, 0x04, 0x39, 0x4a, 0x0b, 0xfb, 0x89, 0x9a, 0x39, 0x0b, 0x8c, 0xb4, + 0xd9, 0x3e, 0x96, 0xef, 0x7a, 0xb5, 0x13, 0xc7, 0x4e, 0x57, 0x3a, 0xd8, + 0xc9, 0x58, 0x0b, 0x76, 0xea, 0x21, 0xd3, 0x98, 0x26, 0xe7, 0xbb, 0x46, + 0xe4, 0x06, 0x91, 0x08, 0xf0, 0x10, 0xd6, 0x95, 0x31, 0x7f, 0x47, 0x95, + 0x79, 0x2b, 0xb8, 0x84, 0xeb, 0x9a, 0xc7, 0x89, 0x48, 0x12, 0xd3, 0x64, + 0xbe, 0x57, 0xfd, 0xc4, 0x26, 0x60, 0xc0, 0x01, 0xb7, 0x23, 0x40, 0xff, + 0x3d, 0x41, 0x51, 0xe8, 0x63, 0x74, 0x2d, 0xa5, 0x99, 0xaa, 0x73, 0xc0, + 0xad, 0xa5, 0xf7, 0x8d, 0x9a, 0xae, 0x13, 0xc9, 0x9b, 0x0e, 0x98, 0x0f, + 0xe7, 0xa7, 0x80, 0x5d, 0xf1, 0xe2, 0xf2, 0x27, 0x12, 0x34, 0x2f, 0x0c, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_RSA_Private_Key; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenLicenseV18, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xd5, 0xb0, 0xe6, 0x63, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x99, 0x00, 0x02, 0x00, 0x12, + 0xd5, 0xb0, 0xe6, 0x63, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x02, 0x12, 0x08, 0xc2, 0xb4, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x33, 0x45, 0x44, 0x46, 0x41, 0x33, + 0x37, 0x36, 0x46, 0x46, 0x44, 0x31, 0x31, 0x37, 0x45, 0x31, 0x30, 0x33, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x90, + 0x1c, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, + 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x00, 0xd5, 0xb0, 0xe6, 0x63, 0xa0, 0x00, 0x00, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd4, + 0x66, 0x29, 0xee, 0x8b, 0x7c, 0x4e, 0x3b, 0x7e, 0x05, 0x51, 0xaf, 0xb8, + 0x94, 0xf4, 0xa7, 0xdc, 0xc7, 0x91, 0xb1, 0x3c, 0xbf, 0x9c, 0xb4, 0xf0, + 0x98, 0x18, 0xa4, 0xed, 0x97, 0xcd, 0xf9, 0x12, 0x10, 0xdb, 0x10, 0x29, + 0x51, 0xba, 0x34, 0x50, 0x67, 0x56, 0xbe, 0xe6, 0x8e, 0x31, 0x47, 0x90, + 0xa6, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x8c, 0xe5, 0x92, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = false; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xea, 0x26, 0x31, 0x90, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x99, 0x00, 0x02, 0x00, 0x12, + 0xea, 0x26, 0x31, 0x90, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x26, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x49, 0x32, 0x16, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x57, 0x69, 0x74, 0x68, 0x50, + 0x53, 0x54, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x41, 0x31, 0x42, 0x34, 0x37, + 0x45, 0x41, 0x34, 0x44, 0x42, 0x30, 0x30, 0x34, 0x30, 0x31, 0x30, 0x30, + 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x6c, 0x21, 0x6a, 0x29, 0x1a, 0x78, 0x10, 0xd8, + 0xa0, 0x83, 0x56, 0x61, 0x43, 0x0d, 0x71, 0x29, 0xe7, 0x65, 0x34, 0x41, + 0xa5, 0x8b, 0x47, 0x19, 0x8d, 0x33, 0x2d, 0xb5, 0xbb, 0xfd, 0x6c, 0x30, + 0xa6, 0x01, 0x7d, 0xb2, 0x27, 0x53, 0xfa, 0x6d, 0xa5, 0x91, 0x59, 0x7c, + 0xf7, 0x25, 0x3d, 0x94, 0x44, 0xd0, 0x08, 0xba, 0x29, 0x80, 0xca, 0x02, + 0xb2, 0x84, 0x70, 0x8b, 0xb1, 0x4a, 0xcf, 0x0a, 0x1a, 0x03, 0xf2, 0x2d, + 0xa0, 0x07, 0x7f, 0x57, 0xbb, 0xf4, 0xe0, 0x33, 0x61, 0xd4, 0x92, 0x3a, + 0x12, 0x10, 0xe9, 0xc4, 0x28, 0x4e, 0x79, 0x62, 0x1a, 0x43, 0x99, 0xe6, + 0x99, 0x4f, 0xbf, 0x2e, 0x04, 0xb8, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xea, 0x26, + 0x31, 0x90, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x4d, 0xad, 0x9d, 0x20, + 0x56, 0xbe, 0x73, 0x9d, 0xbd, 0x78, 0x62, 0x79, 0x20, 0x63, 0x07, 0x34, + 0xa2, 0x79, 0x8e, 0x6f, 0x07, 0x82, 0x39, 0x98, 0x8d, 0xcf, 0x33, 0x40, + 0xc8, 0xb2, 0x32, 0x8a, 0x12, 0x10, 0x23, 0xa0, 0xc0, 0x02, 0xa1, 0x77, + 0x01, 0x80, 0xb3, 0xbc, 0xee, 0x5d, 0xf7, 0xb3, 0xd5, 0x3f, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x20, 0x8c, 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x60, 0xa7, 0x85, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x02, 0x00, 0x12, + 0x60, 0xa7, 0x85, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xcb, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x41, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x52, 0x32, 0x1f, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x48, 0x57, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x28, + 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x0a, 0x20, 0x30, 0x44, 0x41, 0x31, 0x30, 0x33, 0x41, 0x34, + 0x35, 0x34, 0x43, 0x46, 0x42, 0x46, 0x43, 0x46, 0x30, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x90, 0x1c, 0x28, + 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, + 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, + 0x50, 0x95, 0xe5, 0x5f, 0x39, 0xfc, 0x34, 0x15, 0x00, 0x87, 0x88, 0x86, + 0x3d, 0x5a, 0x3b, 0xa2, 0xad, 0x51, 0x7d, 0xbc, 0xe0, 0x72, 0x99, 0x13, + 0xeb, 0x9d, 0x5c, 0xda, 0x92, 0x99, 0x5b, 0xe1, 0x3a, 0xc5, 0xe1, 0xc6, + 0x0b, 0x7b, 0x7e, 0x04, 0x4c, 0x17, 0x49, 0x26, 0x3a, 0xc4, 0xb1, 0xfb, + 0xec, 0x38, 0xce, 0x27, 0xc7, 0x54, 0x3b, 0x80, 0xec, 0xb1, 0x8e, 0xc9, + 0x5c, 0xa0, 0x70, 0xa1, 0x4d, 0x72, 0xee, 0xd6, 0x43, 0xfa, 0x28, 0xfe, + 0x58, 0x0a, 0x89, 0xe0, 0x0d, 0x8b, 0xe1, 0xe6, 0xbd, 0x12, 0x10, 0x93, + 0x88, 0x4d, 0xad, 0x48, 0x45, 0x49, 0x2b, 0x3d, 0x1a, 0xe8, 0xe8, 0xb3, + 0x60, 0x56, 0x8f, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x60, 0xa7, 0x85, 0x0d, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0c, 0xd1, 0x21, 0xd5, 0xed, 0x86, 0xf2, + 0xf5, 0x00, 0xd7, 0xd1, 0x23, 0x29, 0x58, 0x3c, 0x0c, 0x14, 0x25, 0x9c, + 0xe4, 0x1f, 0x28, 0xc6, 0xc2, 0x7d, 0x8a, 0x21, 0xa0, 0xb6, 0x81, 0x34, + 0x85, 0x12, 0x10, 0x73, 0x6e, 0x1b, 0x2c, 0x67, 0xa4, 0x8e, 0x1d, 0xe1, + 0xc1, 0x8b, 0x5e, 0x86, 0x51, 0xf6, 0x24, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x60, 0xa7, 0x85, 0x0d, 0xac, 0x00, 0x40, + 0x10, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x05, 0x20, + 0x02, 0x1a, 0x20, 0x84, 0x6e, 0x3d, 0x07, 0x57, 0x27, 0x4e, 0xd6, 0x1c, + 0x89, 0xeb, 0xe9, 0x9b, 0xba, 0x3a, 0x65, 0xbf, 0x60, 0xe9, 0x96, 0x66, + 0xee, 0xc1, 0xbf, 0xa5, 0xc8, 0x24, 0x4e, 0x58, 0x28, 0x93, 0x81, 0x12, + 0x10, 0xac, 0x3f, 0x24, 0x40, 0xa5, 0x05, 0x66, 0x3c, 0x77, 0x98, 0xf0, + 0xce, 0x29, 0xed, 0xa6, 0xa5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x20, + 0x8c, 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x8a, 0x97, 0xdf, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x8a, 0x97, 0xdf, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xbb, 0xbe, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x43, 0x38, 0x42, 0x32, 0x39, 0x37, + 0x33, 0x43, 0x38, 0x33, 0x35, 0x43, 0x32, 0x43, 0x32, 0x30, 0x30, 0x43, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xf1, 0x2c, + 0xbc, 0x3b, 0x17, 0x0f, 0x1c, 0xcd, 0xa6, 0xe5, 0xf6, 0x4b, 0xb2, 0xf2, + 0xd1, 0xbc, 0x19, 0x30, 0x1a, 0xa1, 0xc5, 0x9d, 0x0f, 0xba, 0xd7, 0x42, + 0x5c, 0xca, 0x96, 0xcf, 0x94, 0x79, 0x12, 0x10, 0xb7, 0xa8, 0xb0, 0xe3, + 0xdc, 0x06, 0x9f, 0xb0, 0x93, 0x59, 0x91, 0xf7, 0x48, 0xc3, 0x6f, 0x40, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, + 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x1d, 0xf6, 0x3a, 0x48, + 0xc4, 0x4b, 0x74, 0x6d, 0x79, 0x67, 0x9b, 0x16, 0xdb, 0x08, 0x92, 0x9c, + 0x08, 0x2c, 0x90, 0x70, 0x75, 0x38, 0x5e, 0x62, 0x39, 0xfc, 0x85, 0xc3, + 0x21, 0x96, 0x4b, 0x21, 0x12, 0x10, 0x4d, 0xcc, 0x09, 0x05, 0x88, 0x2c, + 0x92, 0xd4, 0x9e, 0x4b, 0x9b, 0x21, 0xd3, 0xea, 0x77, 0x50, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xdd, 0xc1, 0x7b, 0x64, 0x3b, 0xdf, + 0x15, 0x56, 0x5a, 0x7d, 0xd1, 0xcb, 0x3a, 0xf5, 0xbb, 0xcd, 0x96, 0x89, + 0x12, 0xb2, 0xe7, 0xf7, 0x4c, 0xe3, 0x2c, 0xb4, 0x41, 0x54, 0xc3, 0xe6, + 0x8b, 0x3a, 0x12, 0x10, 0xfc, 0x3b, 0xae, 0x9f, 0x0c, 0x76, 0x3d, 0x25, + 0x81, 0x38, 0x64, 0xc6, 0xa6, 0x37, 0x6c, 0x4d, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xb9, 0xd9, 0x58, 0x45, 0xa9, 0x41, 0x23, 0xf6, + 0x79, 0x8c, 0x02, 0x8f, 0x70, 0xc6, 0xb5, 0x09, 0xb7, 0x02, 0xf5, 0x37, + 0xf2, 0xeb, 0x66, 0x43, 0x92, 0x56, 0x2a, 0xe8, 0x37, 0x50, 0x40, 0x74, + 0x12, 0x10, 0x34, 0x3f, 0xf8, 0x2f, 0x7f, 0x13, 0x58, 0xf6, 0x76, 0x12, + 0xcb, 0xc8, 0x9d, 0xce, 0x0a, 0x63, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x1d, 0x4a, 0xa0, 0xb2, 0x00, 0xb0, 0x41, 0xa3, 0xf2, 0xe5, + 0x4f, 0xf8, 0x19, 0x20, 0xe5, 0x35, 0xb1, 0x03, 0x65, 0xca, 0xe9, 0x76, + 0x07, 0x0d, 0xbc, 0xfc, 0xc3, 0xa1, 0xa4, 0x9b, 0x28, 0xe2, 0x12, 0x10, + 0x29, 0xb9, 0x38, 0x4d, 0x17, 0x06, 0x80, 0x42, 0x27, 0xb2, 0xdb, 0x59, + 0x01, 0x0f, 0x5d, 0x89, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x8c, + 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0xf4, 0x18, 0xc2, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0xf4, 0x18, 0xc2, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0xc8, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x50, 0x32, 0x1d, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x61, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, + 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x0a, 0x20, 0x39, 0x45, 0x36, 0x35, 0x39, 0x36, 0x32, 0x34, 0x36, 0x35, + 0x33, 0x32, 0x31, 0x36, 0x37, 0x36, 0x30, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, + 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, 0x28, 0x00, 0x30, 0x00, + 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xfd, 0x23, + 0x53, 0x7d, 0xef, 0x21, 0xc4, 0x41, 0xd9, 0x91, 0xf7, 0xa1, 0x0b, 0x59, + 0x8e, 0x3c, 0x01, 0x6a, 0xa9, 0x61, 0x4e, 0x41, 0x01, 0xa5, 0x83, 0x09, + 0xe4, 0x6c, 0x00, 0xe5, 0xbd, 0x8d, 0xa2, 0x2d, 0x3e, 0x60, 0x04, 0xaf, + 0xd9, 0xf2, 0x26, 0x2e, 0xc2, 0x90, 0xad, 0x20, 0xec, 0xb1, 0x59, 0xa6, + 0xac, 0xf1, 0xae, 0x41, 0xea, 0x30, 0x4d, 0x26, 0x4a, 0x9e, 0x7d, 0xb6, + 0x49, 0x9c, 0x56, 0x7d, 0x15, 0xa4, 0x87, 0x5d, 0x8e, 0x8d, 0xa8, 0x04, + 0xb1, 0xd9, 0x35, 0xec, 0xe2, 0x28, 0x12, 0x10, 0xb8, 0x54, 0x5f, 0x94, + 0x08, 0xe2, 0xfb, 0x04, 0x1b, 0x37, 0x88, 0xf3, 0xa7, 0x04, 0x4f, 0x60, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xce, 0xaa, 0x42, 0x05, 0x73, 0x6a, 0x3f, 0x91, 0xd4, 0x59, + 0xfb, 0xa4, 0xed, 0x70, 0xc4, 0x52, 0x1b, 0xfa, 0xd0, 0x9f, 0x65, 0x60, + 0x0c, 0xee, 0xa5, 0x93, 0x79, 0x56, 0x4d, 0x99, 0x66, 0xad, 0x12, 0x10, + 0x3d, 0xab, 0x36, 0xe6, 0xcd, 0xe5, 0xcc, 0x8a, 0x3b, 0xb9, 0x6f, 0x1c, + 0xd7, 0xad, 0x17, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0xe2, 0x32, 0x82, 0xee, 0xfd, 0x30, 0x86, 0x68, 0xb7, 0xce, 0x0b, 0x68, + 0x7b, 0xcb, 0x83, 0xb4, 0xff, 0xa5, 0x9e, 0xa9, 0xcf, 0x11, 0x95, 0x49, + 0xf8, 0xea, 0x8b, 0x6e, 0x58, 0x9b, 0x4e, 0x0b, 0x12, 0x10, 0x91, 0x14, + 0x07, 0x38, 0xdd, 0x0a, 0xc3, 0xf6, 0xa6, 0x11, 0x61, 0x7a, 0x92, 0x61, + 0xf0, 0x5c, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x48, 0x07, + 0xdd, 0x06, 0xf2, 0x01, 0x7b, 0xa1, 0x7a, 0x5a, 0xee, 0x4a, 0x73, 0x79, + 0x7d, 0x51, 0x60, 0x4a, 0x84, 0xb6, 0x15, 0xae, 0x61, 0xbd, 0xdc, 0xe6, + 0xc6, 0x7f, 0x19, 0xf1, 0xdc, 0x30, 0x12, 0x10, 0xc6, 0x67, 0x0a, 0x18, + 0x38, 0xc6, 0x3b, 0xb9, 0x9a, 0xc3, 0x89, 0xbe, 0x87, 0xdd, 0xf8, 0x02, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, + 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x09, 0x89, 0x2c, 0x1f, + 0x09, 0x67, 0x21, 0xe2, 0x8f, 0x58, 0x5e, 0xab, 0x45, 0x07, 0xdf, 0x92, + 0x38, 0x8a, 0xa9, 0x93, 0x5d, 0xcd, 0xba, 0x37, 0x22, 0x50, 0x78, 0x8c, + 0x0d, 0x56, 0x83, 0xcb, 0x12, 0x10, 0xd6, 0x1c, 0x3c, 0xf8, 0xbb, 0xdb, + 0xbc, 0x96, 0xec, 0x78, 0x07, 0x36, 0x8a, 0x09, 0x1d, 0x31, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xc1, 0xf8, 0xd9, 0xfd, 0x70, 0xb4, + 0x8a, 0x36, 0xbb, 0x0f, 0x20, 0x7d, 0x99, 0xb0, 0x8a, 0x1f, 0x49, 0x59, + 0xd9, 0x76, 0xd3, 0x10, 0x6e, 0x74, 0xea, 0x3a, 0x11, 0xc2, 0x5a, 0xc0, + 0x95, 0x87, 0x12, 0x10, 0x9a, 0x39, 0xb1, 0xa7, 0x58, 0x34, 0x90, 0x41, + 0x5d, 0xb2, 0x86, 0x8e, 0x43, 0x87, 0x06, 0x43, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xb2, 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xb9, 0x93, 0x15, 0xdf, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xb9, 0x93, 0x15, 0xdf, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x9e, 0xf9, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x46, 0x31, 0x44, 0x43, 0x33, 0x46, + 0x37, 0x43, 0x42, 0x32, 0x37, 0x46, 0x36, 0x42, 0x34, 0x39, 0x31, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x09, 0xd2, + 0x95, 0xac, 0x6d, 0x8d, 0xa8, 0x93, 0x1f, 0x8d, 0x99, 0x6c, 0xa7, 0x97, + 0xd6, 0x74, 0x4c, 0x12, 0x65, 0x2e, 0x28, 0xce, 0x56, 0x61, 0xfe, 0x1f, + 0x4c, 0xa2, 0x16, 0xdb, 0xa2, 0xc0, 0x12, 0x10, 0xad, 0xf5, 0x6f, 0xa0, + 0x90, 0xbc, 0xec, 0x90, 0x45, 0x9a, 0x26, 0x89, 0xfa, 0x0e, 0x05, 0xe9, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, + 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x38, 0xf3, 0x56, 0x63, + 0x38, 0x08, 0xd9, 0xa9, 0xc4, 0x6c, 0x2b, 0xc7, 0xf4, 0x20, 0x96, 0xc6, + 0xfc, 0xe9, 0x77, 0x2c, 0x2f, 0x3b, 0x4c, 0x95, 0x29, 0x72, 0x77, 0x89, + 0xfb, 0x00, 0x5a, 0xba, 0x12, 0x10, 0x04, 0xc0, 0xd8, 0x71, 0x49, 0x0f, + 0xe8, 0x5a, 0xbe, 0x79, 0x8b, 0x26, 0xff, 0x0e, 0xea, 0x32, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, 0x05, 0xcd, 0x54, 0xd0, 0x57, + 0xd7, 0x20, 0x73, 0xfb, 0xc9, 0x17, 0x6a, 0x00, 0x97, 0x2c, 0x46, 0xef, + 0xac, 0x89, 0x76, 0x6e, 0x9d, 0x75, 0x1c, 0x77, 0x0d, 0x78, 0x4f, 0x92, + 0x8a, 0x66, 0x12, 0x10, 0x20, 0xb2, 0xd6, 0xe0, 0xdb, 0x28, 0x17, 0xd0, + 0x6c, 0x73, 0x43, 0x61, 0x26, 0x85, 0x6b, 0xff, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x1f, 0x33, 0xf5, 0x6b, 0x0b, 0x3d, 0x66, 0x80, + 0xd7, 0xfc, 0x54, 0xc0, 0x0b, 0x62, 0x64, 0x3a, 0x86, 0x9b, 0xb2, 0x59, + 0x7f, 0xaa, 0x60, 0xb9, 0x63, 0x1f, 0x61, 0xf1, 0xeb, 0xdd, 0xd5, 0x6a, + 0x12, 0x10, 0x57, 0xe6, 0x99, 0x9b, 0x03, 0x81, 0x00, 0x53, 0x19, 0xbb, + 0x33, 0xf5, 0x46, 0xe8, 0xea, 0xe7, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x5d, 0xb3, 0x31, 0x70, 0x1a, 0x43, 0x40, 0xd8, 0x5c, 0xfa, + 0x2f, 0x33, 0x24, 0x0a, 0x9c, 0xa4, 0xd1, 0xc6, 0x7a, 0x78, 0x06, 0x79, + 0x77, 0xc9, 0x91, 0x32, 0x1d, 0x50, 0xae, 0x22, 0xaa, 0x04, 0x12, 0x10, + 0xc4, 0x0f, 0x3e, 0x4c, 0xef, 0x41, 0xb0, 0xd2, 0x55, 0x6d, 0x58, 0x8c, + 0x67, 0x61, 0x32, 0x14, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xd8, + 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xbc, 0xec, 0x1a, 0x0e, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xbc, 0xec, 0x1a, 0x0e, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0xd2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xaa, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x5a, 0x32, 0x27, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x69, + 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, + 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, + 0x36, 0x44, 0x38, 0x46, 0x38, 0x37, 0x31, 0x34, 0x36, 0x45, 0x32, 0x42, + 0x44, 0x31, 0x39, 0x37, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, 0x28, 0x28, 0x30, 0x00, 0x38, 0x00, + 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, + 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x88, 0x47, 0xab, 0x96, + 0x76, 0x99, 0xbc, 0xd2, 0xf8, 0xef, 0xb2, 0xcf, 0x1f, 0x30, 0xc4, 0x2e, + 0x14, 0x74, 0xee, 0x87, 0x04, 0x39, 0x62, 0x92, 0xcf, 0xbd, 0x86, 0xb0, + 0x21, 0xd2, 0x38, 0xa0, 0x6d, 0x3f, 0xe4, 0x15, 0x91, 0xbb, 0xda, 0xe0, + 0x21, 0x98, 0x23, 0xc4, 0x32, 0x2a, 0x47, 0x5a, 0xa1, 0x96, 0x5e, 0xae, + 0xf4, 0x6f, 0xc3, 0x2b, 0x88, 0xdc, 0xe3, 0x2a, 0x76, 0x96, 0x33, 0xd7, + 0xff, 0x9f, 0x39, 0x06, 0x43, 0x49, 0x4d, 0xdc, 0x04, 0xcd, 0x39, 0xe7, + 0x18, 0xde, 0x10, 0xe0, 0x12, 0x10, 0xa7, 0x26, 0xd7, 0x8e, 0xbf, 0xcc, + 0xbb, 0x23, 0xb5, 0xdd, 0xb2, 0x21, 0x63, 0x97, 0x67, 0x91, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x21, 0xe3, 0xf4, 0xb8, 0x06, 0x1a, 0x58, 0x7a, 0xf1, 0x2e, 0x1b, 0x1e, + 0xc3, 0x0e, 0x16, 0x98, 0x68, 0xb4, 0x64, 0x51, 0xca, 0xa3, 0x32, 0x93, + 0x29, 0xb7, 0xb7, 0x1a, 0x1b, 0xdf, 0xf7, 0x83, 0x12, 0x10, 0x3d, 0xb1, + 0x0b, 0x85, 0x88, 0x4c, 0xf7, 0x90, 0xd2, 0xb9, 0xa5, 0x29, 0x40, 0x26, + 0xe5, 0x0b, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xde, 0x6f, + 0x93, 0xf4, 0x98, 0x0a, 0xd6, 0x51, 0x7b, 0x13, 0x3e, 0x78, 0xbb, 0xf4, + 0xb1, 0xf7, 0xa9, 0x3b, 0xcc, 0x0a, 0xc7, 0x47, 0xaa, 0x36, 0xa7, 0xa4, + 0x6c, 0x95, 0x37, 0xbd, 0xa5, 0x71, 0x12, 0x10, 0x89, 0x36, 0xbf, 0x1b, + 0x08, 0x80, 0x93, 0xa6, 0x16, 0x19, 0x1c, 0x1d, 0x12, 0xee, 0xbc, 0xfa, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, + 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xea, 0x7e, 0x0f, 0x41, + 0x82, 0x35, 0xab, 0xbd, 0x29, 0xa6, 0xb0, 0x6b, 0x71, 0xde, 0x44, 0x63, + 0xd0, 0xd4, 0xcf, 0xb7, 0xb0, 0xac, 0xa7, 0x13, 0xb0, 0x32, 0xad, 0x59, + 0x17, 0x0f, 0x12, 0x09, 0x12, 0x10, 0xf6, 0x90, 0x09, 0xf1, 0xb0, 0x2a, + 0xf5, 0xf7, 0x59, 0x5b, 0x80, 0x70, 0x61, 0x9c, 0x52, 0x4b, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xba, 0xbe, 0x6e, 0x4f, 0x61, 0x3a, + 0xea, 0xb8, 0x1f, 0xc8, 0x4e, 0xc3, 0x89, 0x62, 0xc7, 0xc6, 0x66, 0xb6, + 0x46, 0x0b, 0xac, 0x83, 0x70, 0xd7, 0x9b, 0x06, 0x64, 0x18, 0xe9, 0x1c, + 0xf7, 0xdb, 0x12, 0x10, 0xb2, 0xb3, 0x5d, 0x04, 0xd3, 0xfc, 0xf5, 0xd6, + 0x9d, 0x45, 0x30, 0x93, 0xab, 0x0a, 0xb0, 0x8c, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x72, 0xff, 0xef, 0x83, 0xc9, 0x46, 0x33, 0xa3, + 0x9f, 0x9d, 0x12, 0xf0, 0xac, 0xad, 0xc0, 0x11, 0x0f, 0x22, 0x54, 0xe5, + 0x46, 0x95, 0xe3, 0x9e, 0x24, 0x34, 0x2c, 0x38, 0x4f, 0x33, 0xaf, 0xb3, + 0x12, 0x10, 0x9b, 0xe8, 0xf0, 0x81, 0x44, 0x2d, 0x03, 0x83, 0x41, 0x96, + 0xa2, 0x2f, 0x27, 0x1c, 0x01, 0xbb, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x20, 0xec, 0xe5, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x6b, 0xd9, 0xcf, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x6b, 0xd9, 0xcf, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x3c, 0xff, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x41, 0x31, 0x41, 0x36, 0x46, 0x44, + 0x32, 0x33, 0x35, 0x39, 0x30, 0x31, 0x36, 0x38, 0x31, 0x41, 0x31, 0x34, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x25, 0xcf, + 0x8b, 0xa2, 0xd5, 0xaa, 0x7b, 0x7b, 0x03, 0x9c, 0xbc, 0x83, 0x08, 0xe2, + 0xbd, 0xdd, 0xab, 0xd4, 0x32, 0x13, 0x75, 0xa1, 0x3f, 0x89, 0x73, 0x89, + 0x7b, 0x7f, 0xae, 0x91, 0x75, 0xdc, 0x12, 0x10, 0xb6, 0xed, 0xbf, 0x9e, + 0xf9, 0xae, 0xae, 0x70, 0x91, 0xf9, 0x75, 0x8c, 0xa6, 0xf2, 0x0c, 0xf3, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, + 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcf, 0xf5, 0xf1, 0xa0, + 0x71, 0x28, 0x33, 0x90, 0xb7, 0xf3, 0x5c, 0xf3, 0xab, 0xd2, 0xc9, 0x06, + 0xf4, 0xd8, 0x02, 0xf1, 0x0a, 0xe3, 0x35, 0x11, 0xd8, 0x43, 0x49, 0x3f, + 0xab, 0x11, 0x66, 0x56, 0x12, 0x10, 0xa0, 0xff, 0xb1, 0x20, 0xe9, 0xc1, + 0xc4, 0xcb, 0x5a, 0x6b, 0xc8, 0x14, 0xd1, 0x93, 0x92, 0xbf, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7e, 0xa7, 0x9a, 0xea, 0xb1, 0x3f, + 0xbb, 0x43, 0x8f, 0x87, 0x6f, 0xc3, 0x22, 0x08, 0xb2, 0xf8, 0xdc, 0x23, + 0xf0, 0xe7, 0x39, 0xd5, 0xf3, 0xcd, 0x8c, 0x61, 0xaf, 0xc5, 0x5e, 0xed, + 0x2a, 0xb8, 0x12, 0x10, 0x16, 0x35, 0xe9, 0x61, 0x87, 0x0d, 0xeb, 0xc0, + 0x49, 0x23, 0x1e, 0x81, 0x6d, 0x4c, 0x0f, 0x3d, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xbc, 0x0d, 0x2c, 0xc4, 0xea, 0x97, 0x35, 0x58, + 0x2d, 0x68, 0x59, 0xe9, 0x5a, 0xde, 0x62, 0x4d, 0x2c, 0x3f, 0xd6, 0xf5, + 0xd4, 0x9d, 0x0c, 0xd4, 0x12, 0x94, 0xa4, 0xee, 0x18, 0xe3, 0x6c, 0x84, + 0x12, 0x10, 0x1f, 0x33, 0xdf, 0xba, 0xfb, 0x62, 0xc3, 0x89, 0xa5, 0x42, + 0xd1, 0x0f, 0x2f, 0x9a, 0xe0, 0x5d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xc6, 0x7a, 0xc8, 0x0b, 0x86, 0x53, 0x8f, 0x95, 0xf0, 0x42, + 0x84, 0xc4, 0xc0, 0x1b, 0x95, 0x71, 0x16, 0x50, 0x32, 0xb2, 0x9e, 0xa5, + 0x0d, 0xbd, 0xe2, 0xb5, 0x30, 0x24, 0xc4, 0x7f, 0x83, 0x20, 0x12, 0x10, + 0x35, 0xc1, 0xcd, 0x22, 0x49, 0x39, 0x68, 0xf5, 0xdc, 0xb6, 0xc4, 0x01, + 0x60, 0xa7, 0x66, 0x12, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x80, + 0xe6, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xe0, 0xac, 0x6c, 0xd3, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xe0, 0xac, 0x6c, 0xd3, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x48, 0x61, 0x72, 0x64, 0x54, 0x77, 0x6f, + 0x48, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x45, 0x42, 0x33, + 0x35, 0x33, 0x37, 0x41, 0x41, 0x35, 0x31, 0x33, 0x31, 0x44, 0x43, 0x43, + 0x43, 0x31, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x67, 0x27, 0x5d, 0xad, 0xc3, 0x2a, 0xd0, + 0x1c, 0xaf, 0xc4, 0x98, 0x00, 0x78, 0xd8, 0x8e, 0x44, 0x57, 0x56, 0xfa, + 0x43, 0x7a, 0x66, 0x68, 0x85, 0x72, 0xb0, 0xd7, 0x78, 0x9a, 0x64, 0xbb, + 0xd6, 0x72, 0x17, 0x03, 0x45, 0x3e, 0xd4, 0xbd, 0xf1, 0x8e, 0x10, 0xa3, + 0xe6, 0x9c, 0x7f, 0xf9, 0x74, 0x11, 0x2b, 0x0f, 0xe5, 0x43, 0x74, 0x65, + 0x4e, 0x5b, 0x75, 0x06, 0x1b, 0x34, 0x31, 0x4c, 0xf3, 0x1b, 0xd4, 0xf6, + 0xf4, 0x3b, 0x1c, 0x33, 0xdc, 0x12, 0x72, 0xde, 0x23, 0x1b, 0xee, 0x38, + 0x4c, 0x12, 0x10, 0x98, 0xa6, 0x43, 0x34, 0xc4, 0x6f, 0xf5, 0x9d, 0x06, + 0x3a, 0x11, 0x1b, 0x7f, 0xa3, 0x43, 0x15, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x64, 0x9b, 0xdf, + 0x37, 0x92, 0x73, 0xc0, 0xe9, 0x42, 0x0f, 0x66, 0x22, 0x8e, 0xaf, 0x52, + 0x8d, 0x4b, 0x51, 0xe8, 0xc9, 0x93, 0xcb, 0x0e, 0x6a, 0x97, 0x09, 0xb6, + 0xd2, 0x66, 0x71, 0x04, 0x6a, 0x12, 0x10, 0xe7, 0x24, 0x8f, 0xd8, 0x17, + 0x35, 0x7f, 0xdd, 0x4c, 0xcb, 0xeb, 0x7d, 0x0b, 0xf5, 0x2b, 0xd8, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, + 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x87, 0x32, 0xb2, 0x84, 0x23, + 0x9e, 0x58, 0x74, 0x2b, 0x1a, 0xee, 0x70, 0x33, 0x7a, 0xb8, 0x92, 0x59, + 0x83, 0x27, 0xfd, 0x88, 0xd2, 0x27, 0x58, 0xaf, 0x5a, 0xc6, 0x80, 0x0f, + 0xe6, 0xaf, 0x52, 0x12, 0x10, 0x67, 0x5e, 0x28, 0xe7, 0x03, 0x03, 0x02, + 0x25, 0x6c, 0xb3, 0x6b, 0x5d, 0x6d, 0x17, 0xfd, 0xb4, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x11, 0xbe, 0xe2, 0x5d, 0xbf, 0xaf, 0x99, + 0x15, 0xf0, 0x92, 0x9f, 0x73, 0x14, 0x5a, 0xe0, 0xf4, 0x1d, 0x18, 0xe5, + 0xcb, 0x75, 0x94, 0xa3, 0x1f, 0xc1, 0x6b, 0x29, 0x41, 0x96, 0xac, 0x5b, + 0xfb, 0x12, 0x10, 0xa9, 0x96, 0x6f, 0x3f, 0x71, 0x6d, 0x82, 0x97, 0xe6, + 0x1a, 0x8f, 0xd7, 0x80, 0x8c, 0x1c, 0xed, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x3f, 0x3e, 0x52, 0x34, 0xbb, 0x73, 0x2f, 0x87, 0x13, + 0xcd, 0x5e, 0xfb, 0x07, 0x0a, 0xd9, 0x59, 0x39, 0x8c, 0x6a, 0x0c, 0x24, + 0x46, 0xeb, 0xf4, 0xce, 0x98, 0x3e, 0x58, 0x80, 0x9e, 0xb2, 0x5e, 0x12, + 0x10, 0x08, 0x0d, 0xdf, 0x40, 0x1f, 0xe2, 0x80, 0x39, 0xf6, 0x00, 0xee, + 0x13, 0x7e, 0xdc, 0x66, 0x36, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xcb, 0x38, 0x5c, 0xe5, 0x50, 0xae, 0x40, 0xad, 0x0b, 0x43, 0xa8, + 0xda, 0x6a, 0x9c, 0x05, 0xd2, 0x75, 0x3a, 0x4e, 0x36, 0xf2, 0xa8, 0x31, + 0xe1, 0x5d, 0xec, 0xca, 0x78, 0x74, 0x94, 0xcf, 0x90, 0x12, 0x10, 0x36, + 0x0c, 0x71, 0x35, 0xba, 0xaa, 0x72, 0xd4, 0x44, 0x49, 0x59, 0xa4, 0xdc, + 0x93, 0xf6, 0xf7, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x98, 0xe6, + 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x89, 0xaa, 0xf3, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x89, 0xaa, 0xf3, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x0b, 0xfa, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x45, 0x35, 0x30, 0x45, 0x31, 0x39, + 0x33, 0x46, 0x45, 0x46, 0x43, 0x41, 0x42, 0x37, 0x33, 0x42, 0x31, 0x38, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x8c, 0x9d, + 0x9b, 0x6a, 0x42, 0x78, 0x1a, 0x23, 0x63, 0x6d, 0x33, 0x03, 0x4b, 0x40, + 0x6f, 0x11, 0xd2, 0xfd, 0x53, 0x71, 0x1b, 0xed, 0x57, 0x6a, 0xb2, 0x90, + 0x6a, 0x95, 0x0a, 0x96, 0xa7, 0xa6, 0x12, 0x10, 0xcf, 0x6c, 0xff, 0xe6, + 0xee, 0xfb, 0x2b, 0xbf, 0x00, 0xce, 0x19, 0x9b, 0xcb, 0x4f, 0x5d, 0x68, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, + 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xee, 0xbb, 0x14, 0x48, + 0xe5, 0xbf, 0x02, 0xba, 0xe7, 0x04, 0xfe, 0xd9, 0xb8, 0x27, 0xc1, 0xd0, + 0x2a, 0x2f, 0x3e, 0x3a, 0x0b, 0x63, 0x93, 0xf4, 0xb5, 0x5c, 0x76, 0x10, + 0xe9, 0xd5, 0xb6, 0xbb, 0x12, 0x10, 0x75, 0x8f, 0xbf, 0x03, 0xf6, 0x48, + 0xd1, 0x17, 0x4c, 0x77, 0xdc, 0x38, 0xca, 0x24, 0x8d, 0x88, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xed, 0xd6, 0xe0, 0x57, 0xb1, 0xf3, + 0xd1, 0x78, 0x2f, 0x70, 0x0e, 0x13, 0xff, 0xc6, 0x8c, 0x46, 0x01, 0x87, + 0xfd, 0x50, 0x10, 0x21, 0x69, 0x54, 0x21, 0x5e, 0x32, 0x22, 0x79, 0x16, + 0x97, 0xe0, 0x12, 0x10, 0x33, 0x86, 0x55, 0xf6, 0xde, 0x28, 0x2a, 0x57, + 0x7d, 0x1b, 0x23, 0x5f, 0xf8, 0xe8, 0x6a, 0x57, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x79, 0x9c, 0xa1, 0xcb, 0xc1, 0x90, 0x92, 0xff, + 0xe7, 0x2e, 0x3f, 0x5e, 0x00, 0x0f, 0x94, 0x43, 0xb7, 0xe8, 0x08, 0x7a, + 0xd4, 0xaa, 0xcf, 0xb8, 0xe4, 0x3a, 0x55, 0x55, 0xa2, 0xe1, 0x62, 0x7a, + 0x12, 0x10, 0x50, 0x1f, 0xa9, 0xad, 0xbe, 0x02, 0xc9, 0x45, 0xae, 0xa8, + 0x4d, 0x14, 0x89, 0x65, 0x24, 0x5e, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xb4, 0xce, 0x8c, 0x83, 0xda, 0xb6, 0x2f, 0x70, 0x2c, 0x26, + 0xe4, 0xfa, 0x53, 0x18, 0xe6, 0xa9, 0x6e, 0x62, 0x67, 0x99, 0xf2, 0x96, + 0xfa, 0xcf, 0x05, 0xd4, 0x04, 0x33, 0x87, 0x79, 0x1e, 0x46, 0x12, 0x10, + 0xa3, 0x73, 0x28, 0x41, 0x77, 0xa6, 0x5c, 0xc2, 0xde, 0xe5, 0xb2, 0xbb, + 0x2a, 0xb7, 0x1a, 0xa7, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xb0, + 0xe6, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x43, 0xea, 0x2d, 0x91, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x43, 0xea, 0x2d, 0x91, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x48, 0x61, 0x72, 0x64, 0x54, 0x77, 0x6f, + 0x53, 0x6f, 0x66, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x37, 0x37, 0x33, + 0x45, 0x44, 0x34, 0x33, 0x42, 0x30, 0x45, 0x42, 0x46, 0x38, 0x44, 0x39, + 0x39, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x52, 0x1e, 0x3c, 0x1d, 0x11, 0x35, 0xda, + 0xe5, 0x50, 0xa9, 0x90, 0xa6, 0x61, 0xbb, 0x49, 0xaf, 0x97, 0xbb, 0x14, + 0xf0, 0x5e, 0xbc, 0x34, 0xe4, 0x28, 0x30, 0xa8, 0x5d, 0x7b, 0x5e, 0x86, + 0x7f, 0xff, 0x45, 0x27, 0xd0, 0x71, 0x47, 0x3a, 0xb4, 0xbd, 0xa1, 0xed, + 0x35, 0xee, 0xe9, 0x51, 0x35, 0xb9, 0x50, 0xd3, 0x12, 0xef, 0xa6, 0x2d, + 0xe5, 0xb9, 0x28, 0xea, 0xb4, 0xd5, 0xa1, 0xc7, 0xd0, 0x88, 0xcc, 0x69, + 0x15, 0x54, 0xff, 0x82, 0x0e, 0x49, 0x28, 0x05, 0x3f, 0x16, 0x8c, 0xbb, + 0x1c, 0x12, 0x10, 0x42, 0x07, 0x9e, 0xe0, 0xa1, 0x15, 0x2e, 0xc2, 0x61, + 0x15, 0x61, 0xa5, 0x5d, 0x14, 0xd3, 0x96, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, + 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x88, 0x73, 0xab, + 0x7b, 0x78, 0x40, 0x6c, 0xdb, 0x91, 0x1f, 0xab, 0x1e, 0xcd, 0x82, 0xe5, + 0x35, 0xd4, 0x4d, 0x73, 0x00, 0x7a, 0x23, 0x4c, 0x94, 0x81, 0x91, 0xcc, + 0xfb, 0x85, 0x0b, 0x91, 0x69, 0x12, 0x10, 0x0f, 0xd6, 0xcd, 0x74, 0xfa, + 0xb1, 0xc6, 0x75, 0xbe, 0xd3, 0x5b, 0xaa, 0x6e, 0xc6, 0x7e, 0xc5, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, + 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb0, 0x90, 0xfb, 0xee, 0x67, + 0x8b, 0xd2, 0x5c, 0xc7, 0xb7, 0x0d, 0x75, 0x18, 0x3e, 0x16, 0xbd, 0xd9, + 0x79, 0x81, 0x78, 0x98, 0xd4, 0x28, 0x1c, 0x5c, 0x02, 0x73, 0x7d, 0x34, + 0x74, 0xe6, 0xc3, 0x12, 0x10, 0x8e, 0xac, 0x28, 0xb7, 0xaf, 0x6c, 0x0c, + 0x86, 0xfa, 0xca, 0x50, 0xa7, 0x8b, 0xbc, 0xa2, 0x52, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb4, 0x4c, 0xc4, 0x8e, 0x9d, 0xa8, 0xae, + 0x95, 0x15, 0xe9, 0x73, 0x22, 0xfe, 0xa8, 0x94, 0x9a, 0xeb, 0xe6, 0xd3, + 0xaa, 0x84, 0xaf, 0x19, 0x6e, 0x76, 0xa3, 0x72, 0x33, 0x1a, 0x9c, 0xf3, + 0x83, 0x12, 0x10, 0xed, 0x21, 0x55, 0xca, 0x58, 0xfc, 0xcd, 0x0f, 0x53, + 0xc0, 0xac, 0xdc, 0xca, 0x64, 0xc8, 0x7c, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0xbd, 0x7c, 0xdf, 0xc3, 0x46, 0x14, 0xb4, 0xbe, 0x35, + 0x91, 0xde, 0x41, 0xee, 0x04, 0x75, 0x16, 0x6b, 0xe6, 0x25, 0x13, 0x51, + 0xd7, 0x05, 0x81, 0xd9, 0xd2, 0x74, 0xa7, 0xc8, 0xad, 0x16, 0xb3, 0x12, + 0x10, 0x27, 0xa4, 0x71, 0x7b, 0xe6, 0xc4, 0x45, 0x30, 0xea, 0x22, 0xdf, + 0x2c, 0x2e, 0x4f, 0x62, 0xe5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x3a, 0xe2, 0xa9, 0x3a, 0xb3, 0x16, 0x7f, 0xdd, 0xa0, 0x0b, 0x5b, + 0x09, 0xf0, 0xd3, 0xa9, 0xd9, 0x46, 0x7a, 0x02, 0xc1, 0xa2, 0xee, 0x9a, + 0x43, 0x87, 0xda, 0xcb, 0x50, 0x71, 0x97, 0x72, 0x80, 0x12, 0x10, 0x3b, + 0xbe, 0x4c, 0xfc, 0x5c, 0x9c, 0xb6, 0x73, 0x6b, 0x3d, 0x65, 0x12, 0xce, + 0x73, 0x9f, 0x35, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc8, 0xe6, + 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xbd, 0xfa, 0x35, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xbd, 0xfa, 0x35, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xa9, 0xff, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x41, 0x41, 0x31, 0x30, 0x36, 0x33, + 0x35, 0x39, 0x39, 0x34, 0x36, 0x43, 0x30, 0x36, 0x39, 0x46, 0x31, 0x43, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x43, 0x6c, + 0xbb, 0x90, 0x68, 0xa0, 0xb9, 0xb3, 0x0a, 0xc4, 0x8a, 0xb5, 0xa4, 0xe0, + 0xd5, 0x04, 0x10, 0x9e, 0x76, 0xbd, 0xac, 0x3b, 0xbe, 0x8b, 0x0e, 0x74, + 0x3d, 0xfb, 0x2d, 0xcd, 0x71, 0x24, 0x12, 0x10, 0x4e, 0x14, 0xa2, 0x79, + 0xb9, 0xe6, 0x00, 0x76, 0xf6, 0x07, 0x35, 0xa2, 0x17, 0x2f, 0x67, 0x63, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, + 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x35, 0xa1, 0x98, 0x43, + 0x76, 0x9e, 0x28, 0x79, 0x05, 0xcc, 0x81, 0x43, 0x7d, 0x30, 0x96, 0xd9, + 0x2a, 0xba, 0xc5, 0x6d, 0x28, 0x74, 0xb2, 0x28, 0xbd, 0x58, 0x46, 0x43, + 0xe3, 0xd5, 0xec, 0xf4, 0x12, 0x10, 0x52, 0xc9, 0x3d, 0xd0, 0x79, 0x84, + 0x6f, 0x28, 0xb1, 0x37, 0x77, 0x35, 0x6f, 0x56, 0x43, 0x41, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xa3, 0xe0, 0xff, 0x2b, 0xbc, 0x43, + 0xd9, 0x53, 0xbe, 0xa6, 0x02, 0x0c, 0x40, 0x9f, 0x6e, 0x38, 0x0e, 0x91, + 0x2e, 0xac, 0x29, 0x22, 0x4a, 0xe2, 0x45, 0x6c, 0x3a, 0x7d, 0x13, 0x49, + 0xb3, 0x78, 0x12, 0x10, 0x0e, 0xf1, 0x6c, 0x28, 0xe2, 0x60, 0xbb, 0x78, + 0xc2, 0x39, 0x41, 0x81, 0x2a, 0xab, 0x02, 0x59, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xd5, 0x7e, 0x38, 0x92, 0x1e, 0xe3, 0x47, 0x56, + 0x59, 0x9d, 0x91, 0xeb, 0x37, 0x43, 0x92, 0x04, 0xe7, 0x47, 0xa2, 0x3a, + 0x2e, 0x3c, 0x10, 0x1e, 0x73, 0xfb, 0x98, 0xd8, 0xe2, 0x73, 0xbe, 0x1e, + 0x12, 0x10, 0x7a, 0x8e, 0x64, 0xd8, 0x95, 0xf0, 0xe1, 0x63, 0xb8, 0xd8, + 0xfc, 0x27, 0x21, 0x19, 0x40, 0xda, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x7d, 0x36, 0x11, 0xef, 0x63, 0x68, 0xfb, 0x01, 0xa6, 0xcc, + 0xec, 0x3c, 0x7d, 0x67, 0x6c, 0x9e, 0x93, 0x0b, 0x4d, 0x92, 0xbc, 0xf9, + 0xb0, 0xd9, 0x4a, 0xda, 0xe0, 0x75, 0x58, 0x30, 0x88, 0x4d, 0x12, 0x10, + 0x19, 0xb0, 0xb1, 0x14, 0xce, 0x54, 0x65, 0x4f, 0xfa, 0x87, 0x70, 0x23, + 0xa7, 0xad, 0x10, 0x26, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xe0, + 0xe6, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xc2, 0xd9, 0x80, 0xde, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xc2, 0xd9, 0x80, 0xde, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x53, 0x6f, 0x66, 0x74, 0x54, 0x77, 0x6f, + 0x48, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x44, 0x32, 0x39, + 0x35, 0x45, 0x43, 0x35, 0x33, 0x37, 0x43, 0x38, 0x30, 0x30, 0x33, 0x34, + 0x43, 0x31, 0x45, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x5e, 0xce, 0x69, 0xc0, 0x21, 0x8f, 0x81, + 0xdd, 0xbc, 0xf5, 0xac, 0x66, 0x2c, 0xd1, 0x67, 0x7d, 0x3e, 0xca, 0xd3, + 0xdc, 0x52, 0x7d, 0xf6, 0x4f, 0x21, 0xaa, 0xd8, 0x21, 0x01, 0x9c, 0xf7, + 0x21, 0xd5, 0x81, 0xa0, 0x45, 0x58, 0x9e, 0xcb, 0x40, 0x6a, 0x2a, 0x92, + 0x06, 0xd8, 0xef, 0xb7, 0xf8, 0x6a, 0x63, 0x22, 0x49, 0xcf, 0x74, 0x87, + 0x82, 0xca, 0xe9, 0x9f, 0xaf, 0x7d, 0x15, 0x7e, 0x24, 0x3f, 0x77, 0x0a, + 0xea, 0x5c, 0xc2, 0xd7, 0xfa, 0x80, 0x09, 0xcc, 0xe2, 0x2a, 0xfb, 0x2f, + 0x2d, 0x12, 0x10, 0x13, 0x0a, 0x55, 0x40, 0xa6, 0x36, 0xd5, 0x19, 0x25, + 0x2e, 0xe0, 0x5c, 0x9c, 0x02, 0x8b, 0x0e, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, + 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xdf, 0xda, 0x08, + 0x71, 0xfa, 0x80, 0x50, 0x59, 0x97, 0x11, 0x70, 0x74, 0xdb, 0x6f, 0x7f, + 0x5a, 0xbb, 0xd4, 0x92, 0x59, 0xca, 0xa9, 0x88, 0x35, 0xec, 0x24, 0x87, + 0xbc, 0x9a, 0x8c, 0x0b, 0x1e, 0x12, 0x10, 0x62, 0xd4, 0xfa, 0xfd, 0xf9, + 0x56, 0x49, 0xa3, 0x0f, 0x82, 0x2b, 0x22, 0xf2, 0xb3, 0xc5, 0xe0, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, + 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd2, 0x1b, 0xeb, 0x5b, 0xd4, + 0x4d, 0xec, 0xd2, 0x13, 0x88, 0xc9, 0x19, 0xfd, 0xd1, 0x1d, 0x0f, 0x01, + 0x4e, 0xcb, 0xcb, 0x23, 0xdc, 0xe2, 0x65, 0x29, 0x4a, 0x53, 0x72, 0xf4, + 0x86, 0x8b, 0x91, 0x12, 0x10, 0xa4, 0x28, 0x55, 0xf5, 0xdb, 0x3a, 0x7a, + 0x79, 0x15, 0x14, 0x36, 0xd4, 0xc0, 0x12, 0xa7, 0x7d, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x71, 0x74, 0xa1, 0xb0, 0x90, 0x81, 0xfb, + 0x38, 0x37, 0xee, 0x76, 0xd3, 0xce, 0xe4, 0xb1, 0xf5, 0xb6, 0xe3, 0xc0, + 0xa5, 0x33, 0xfc, 0x72, 0x6b, 0x7e, 0xb1, 0x70, 0x1e, 0xb5, 0xf6, 0x0a, + 0x3d, 0x12, 0x10, 0x4d, 0x54, 0x9a, 0x85, 0xf6, 0x1e, 0x39, 0x9a, 0x92, + 0x62, 0x07, 0x15, 0xb3, 0x16, 0x3c, 0xa3, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x18, 0x5a, 0x83, 0xdf, 0x56, 0x5b, 0xb1, 0xec, 0x57, + 0x99, 0x21, 0xda, 0xf4, 0x20, 0xad, 0x46, 0x53, 0x81, 0x62, 0x10, 0x66, + 0x92, 0x03, 0xc4, 0x75, 0x10, 0x32, 0xa0, 0xe5, 0x21, 0x68, 0xe9, 0x12, + 0x10, 0x3d, 0xa9, 0x5c, 0xf8, 0xe2, 0x2b, 0x8a, 0xab, 0xfe, 0xff, 0x25, + 0xfe, 0x9a, 0xab, 0x8c, 0x3c, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xe6, 0xb2, 0x40, 0x8d, 0xc9, 0x90, 0x6b, 0x96, 0xb0, 0x37, 0x87, + 0x53, 0x08, 0xef, 0xf3, 0x59, 0x06, 0x34, 0xf3, 0xb8, 0x48, 0x05, 0x19, + 0x26, 0x12, 0x73, 0x46, 0xd0, 0x88, 0xdf, 0xd4, 0x8d, 0x12, 0x10, 0xf0, + 0xcc, 0xf0, 0xd8, 0xf1, 0x62, 0xdb, 0x42, 0x49, 0xaf, 0x3e, 0x1b, 0xe1, + 0xbc, 0x8b, 0x64, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xf8, 0xe6, + 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0x75, 0x72, 0xd7, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0x75, 0x72, 0xd7, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x78, 0xfa, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x31, 0x41, 0x39, 0x42, 0x31, 0x38, + 0x38, 0x31, 0x44, 0x33, 0x32, 0x42, 0x35, 0x42, 0x42, 0x30, 0x32, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd5, 0x47, + 0xa3, 0xf2, 0x91, 0x78, 0xa8, 0xbe, 0xd9, 0xc5, 0x1c, 0x28, 0xb3, 0xf7, + 0x65, 0x41, 0xd5, 0x27, 0x1d, 0x74, 0x40, 0x90, 0x33, 0xfb, 0x74, 0x16, + 0x2b, 0xf6, 0x18, 0xee, 0xee, 0x73, 0x12, 0x10, 0x2f, 0xd1, 0x4e, 0xd4, + 0x4f, 0x59, 0x12, 0xb4, 0x2e, 0xe4, 0x9b, 0xcb, 0xb3, 0x75, 0x70, 0xa7, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, + 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xda, 0x53, 0x3b, 0x6c, + 0x9d, 0xfc, 0xc0, 0x62, 0x64, 0x2e, 0x03, 0xc5, 0xbb, 0xdd, 0xd6, 0xcd, + 0x6c, 0x8e, 0x70, 0x47, 0x4b, 0xec, 0x57, 0x26, 0x43, 0x7b, 0x2c, 0x0c, + 0xda, 0xc5, 0x5b, 0x97, 0x12, 0x10, 0xc5, 0x52, 0xe5, 0x73, 0xac, 0x07, + 0x4f, 0xde, 0x8f, 0x73, 0x68, 0x69, 0x51, 0x00, 0x8a, 0x22, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x1d, 0xd9, 0xbb, 0x09, 0xb1, 0xe3, + 0x5b, 0x85, 0xc9, 0x1a, 0xf6, 0x5f, 0xec, 0x5e, 0x7e, 0xd7, 0xa0, 0xfe, + 0x67, 0x64, 0x87, 0xb1, 0x7e, 0xfb, 0xb3, 0x6c, 0x4a, 0xb1, 0x46, 0x0d, + 0xa8, 0xcc, 0x12, 0x10, 0x1f, 0x9e, 0xea, 0x2a, 0xa7, 0x60, 0x20, 0xb9, + 0x4d, 0x38, 0xca, 0x67, 0x9f, 0x0f, 0xdf, 0x15, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xc9, 0xb8, 0xc6, 0x06, 0x65, 0x33, 0x08, 0xaf, + 0xbf, 0x5a, 0xff, 0x77, 0xf8, 0x5f, 0xa2, 0xff, 0x8a, 0xaf, 0x81, 0x6f, + 0xb5, 0xf7, 0x9d, 0x2e, 0x9a, 0xda, 0x21, 0xf2, 0x30, 0x3c, 0xeb, 0xb5, + 0x12, 0x10, 0xa4, 0x30, 0x98, 0x92, 0xb2, 0x43, 0xe7, 0x37, 0xf4, 0xa2, + 0xd9, 0x50, 0x83, 0x9e, 0x63, 0x0e, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x2e, 0x5b, 0x72, 0xa7, 0x41, 0xff, 0xd6, 0x5a, 0xe8, 0xe9, + 0x4d, 0x22, 0x25, 0x87, 0x50, 0xee, 0x95, 0xdc, 0xf9, 0x9b, 0x03, 0x83, + 0x1d, 0x9d, 0xb0, 0x55, 0xc0, 0xbd, 0x7a, 0x4c, 0x80, 0xd0, 0x12, 0x10, + 0x92, 0x62, 0x33, 0x68, 0x92, 0xd5, 0x1f, 0xda, 0x35, 0x84, 0xfa, 0x31, + 0x5f, 0xdb, 0x20, 0xae, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x90, + 0xe7, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x68, 0xb3, 0xd7, 0x92, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x68, 0xb3, 0xd7, 0x92, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x53, 0x6f, 0x66, 0x74, 0x54, 0x77, 0x6f, + 0x53, 0x6f, 0x66, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, 0x45, 0x43, + 0x46, 0x35, 0x43, 0x36, 0x44, 0x39, 0x30, 0x43, 0x32, 0x31, 0x38, 0x35, + 0x46, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x68, 0xfe, 0x0c, 0x61, 0x12, 0xd1, 0x77, + 0xe4, 0x1c, 0xaf, 0x5d, 0x97, 0x19, 0xcd, 0xb5, 0x6e, 0xe9, 0x22, 0xe4, + 0x23, 0x9a, 0xc5, 0x2a, 0x47, 0xc4, 0x16, 0x2c, 0x0d, 0x0c, 0x39, 0xad, + 0x96, 0xe5, 0x4b, 0x30, 0x9f, 0x62, 0xb8, 0xa4, 0x4b, 0x8c, 0x50, 0xb3, + 0x38, 0x9f, 0x2a, 0xbf, 0x3f, 0x0b, 0x30, 0xcc, 0x76, 0xbe, 0xd5, 0x7f, + 0x4e, 0x22, 0x94, 0x47, 0xc8, 0xab, 0xa6, 0x01, 0xb6, 0xae, 0xde, 0x0a, + 0xfc, 0x2a, 0xfc, 0x13, 0x47, 0x59, 0xc6, 0xbc, 0xa9, 0x9e, 0x98, 0x80, + 0xec, 0x12, 0x10, 0x60, 0x94, 0x62, 0x02, 0x71, 0xc9, 0x06, 0x51, 0xeb, + 0xce, 0x10, 0xc7, 0x6a, 0xe0, 0xbd, 0x2c, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, + 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x82, 0xe9, 0x8d, + 0xdf, 0xf0, 0x4b, 0x17, 0x83, 0x64, 0x16, 0xc6, 0xdf, 0xc6, 0xc9, 0xfc, + 0x9b, 0x3f, 0xff, 0xdf, 0x20, 0x0e, 0xea, 0xba, 0x23, 0x9d, 0x43, 0x81, + 0xbb, 0xbe, 0x70, 0x84, 0x27, 0x12, 0x10, 0xa7, 0x3d, 0x76, 0x35, 0x6f, + 0xf2, 0x4d, 0x92, 0xc8, 0x4a, 0x93, 0x98, 0x40, 0x0d, 0x4b, 0xb5, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, + 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3c, 0x5b, 0x9b, 0x21, 0x54, + 0x98, 0xf2, 0x2e, 0x8e, 0xdb, 0xa2, 0x43, 0xaa, 0x8b, 0xe3, 0x19, 0xe7, + 0xa7, 0x04, 0xb0, 0x76, 0x48, 0x36, 0xad, 0x18, 0x32, 0x90, 0x83, 0x28, + 0x9a, 0x90, 0xd8, 0x12, 0x10, 0x75, 0xa5, 0xa5, 0xbb, 0x0c, 0xd5, 0xbc, + 0x6a, 0xb0, 0x38, 0xed, 0xc2, 0x08, 0x27, 0x54, 0xe3, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xca, 0x25, 0x06, 0xd4, 0x8a, 0xd0, 0xae, + 0xe7, 0x56, 0xa1, 0xe4, 0x2c, 0x08, 0xad, 0x30, 0xec, 0x2b, 0xb7, 0x33, + 0xff, 0x1b, 0x25, 0x6c, 0xa1, 0x9f, 0x00, 0xfd, 0xec, 0x77, 0x6b, 0xc8, + 0x1a, 0x12, 0x10, 0xa2, 0x24, 0x3f, 0x95, 0x36, 0x32, 0x2c, 0xf8, 0xeb, + 0xa2, 0x3b, 0x45, 0x33, 0x8c, 0x8b, 0xc5, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x43, 0xbc, 0x0c, 0x2f, 0x5f, 0xae, 0x42, 0x3c, 0x9e, + 0xc3, 0x71, 0x55, 0x59, 0x47, 0xa2, 0x59, 0xb7, 0xf3, 0x2f, 0xe6, 0x05, + 0x2b, 0xb9, 0x4f, 0x11, 0x2e, 0x3e, 0x3f, 0x34, 0xda, 0x28, 0xa9, 0x12, + 0x10, 0xc6, 0xf0, 0x32, 0xd0, 0x8e, 0x0a, 0x5d, 0xc0, 0xfd, 0x34, 0x25, + 0xa2, 0xb0, 0x56, 0xfb, 0x17, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xb7, 0xe3, 0xb9, 0x2b, 0x00, 0x73, 0xc1, 0x82, 0xba, 0xec, 0xb8, + 0xc3, 0x73, 0xa7, 0xbc, 0x00, 0x4a, 0x31, 0xab, 0x6b, 0x44, 0x62, 0xc9, + 0xd7, 0x95, 0x12, 0xb2, 0xd9, 0x68, 0xd3, 0xdb, 0x10, 0x12, 0x10, 0x2e, + 0xac, 0x1c, 0x95, 0x86, 0x02, 0x05, 0xec, 0xf5, 0xa1, 0xc6, 0x47, 0xd3, + 0x09, 0x17, 0x22, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa8, 0xe7, + 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xaa, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, 0x37, 0x33, + 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, 0x44, 0x42, 0x32, + 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, 0x0f, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x6d, 0xef, 0xff, 0x94, 0x3d, 0xce, 0xf7, 0xeb, + 0x9e, 0x99, 0x37, 0x3e, 0x0a, 0x33, 0xf5, 0x5b, 0x22, 0xcf, 0xe0, 0x75, + 0xfc, 0xda, 0x96, 0xd5, 0x4e, 0x22, 0x6f, 0x0f, 0x59, 0x72, 0xad, 0x38, + 0xea, 0x32, 0x66, 0xa4, 0x36, 0x42, 0x70, 0x58, 0x1b, 0xa2, 0xb4, 0x77, + 0x9e, 0xe2, 0x5e, 0x97, 0xa4, 0x9d, 0xcf, 0xc5, 0x72, 0x61, 0xbe, 0xf9, + 0x43, 0xb9, 0x24, 0x68, 0x31, 0x38, 0x8d, 0x55, 0x17, 0xa0, 0x13, 0xce, + 0x41, 0xab, 0x8a, 0xdd, 0xf2, 0x0d, 0xd9, 0x61, 0x58, 0x03, 0x90, 0xea, + 0x12, 0x10, 0xa3, 0x5a, 0xbc, 0xca, 0x8a, 0x41, 0x40, 0xdb, 0x77, 0xbc, + 0x54, 0xb4, 0xe6, 0x0f, 0x6e, 0xd9, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, + 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xae, 0x95, 0x75, 0xaa, + 0xe8, 0x44, 0xd8, 0x7b, 0x50, 0xce, 0x53, 0x02, 0xb8, 0xc2, 0x72, 0xb9, + 0xd5, 0xc9, 0xb9, 0x1d, 0x51, 0x9d, 0xa9, 0x15, 0xc0, 0xf1, 0x20, 0xfc, + 0x74, 0xf5, 0xe8, 0x14, 0x12, 0x10, 0xda, 0x8b, 0x62, 0x3e, 0x69, 0x54, + 0x7e, 0xf0, 0x33, 0x20, 0x2d, 0xdd, 0x7c, 0x34, 0x27, 0x4f, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb5, 0x10, 0xbb, 0x3a, 0xf3, 0xad, + 0xf6, 0xe6, 0x7f, 0xfd, 0xa8, 0x92, 0x4d, 0x84, 0xe7, 0x91, 0x34, 0x39, + 0x19, 0x4e, 0x28, 0xc1, 0x49, 0x83, 0x9a, 0xe1, 0x5d, 0x8b, 0x70, 0x22, + 0x26, 0x4e, 0x12, 0x10, 0x69, 0x75, 0x1d, 0x55, 0x68, 0xa2, 0x75, 0x38, + 0x50, 0x4e, 0xa5, 0x43, 0x26, 0x91, 0x82, 0x43, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x3c, 0xc9, 0x9b, 0x1f, 0x43, 0x19, 0x1a, 0x31, + 0xbb, 0x01, 0xde, 0x65, 0x6e, 0x85, 0xfe, 0x6f, 0x0c, 0x12, 0x93, 0x14, + 0xbb, 0x63, 0x53, 0x0b, 0xaa, 0x96, 0x9a, 0x91, 0xfc, 0x75, 0x13, 0xda, + 0x12, 0x10, 0xf2, 0x26, 0x92, 0x82, 0xbe, 0x77, 0xc9, 0x64, 0x52, 0x7a, + 0x04, 0x90, 0xbb, 0xb3, 0x53, 0xb5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x30, 0x45, 0xd5, 0xb3, 0x99, 0x59, 0x4f, 0xab, 0x1f, 0xa5, + 0xa6, 0x8e, 0xab, 0x64, 0x55, 0x87, 0x58, 0xbe, 0xc6, 0x2b, 0x0d, 0xc7, + 0x40, 0xaf, 0xc9, 0x77, 0xb8, 0x3f, 0x79, 0x74, 0x96, 0x5c, 0x12, 0x10, + 0x8c, 0x53, 0xb4, 0x34, 0x31, 0x45, 0x3d, 0x82, 0x8c, 0xf3, 0x32, 0xc0, + 0xe2, 0xad, 0x1a, 0xff, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x2f, 0x3e, 0xc1, 0x5d, 0x94, 0xe6, 0x4b, 0xbe, 0x57, 0xc6, 0xb6, 0xa6, + 0xbd, 0x6a, 0x78, 0x94, 0xb8, 0x94, 0xe3, 0x7f, 0x8b, 0x23, 0x46, 0xb0, + 0x3b, 0x28, 0x10, 0xb5, 0x64, 0x1c, 0x1b, 0x6c, 0x12, 0x10, 0x94, 0x09, + 0xfb, 0x98, 0x64, 0x06, 0x1a, 0xdf, 0xcd, 0x72, 0xae, 0x2c, 0xbd, 0x44, + 0x82, 0x6f, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc0, 0xe7, 0x92, + 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x90, 0x7f, 0xd2, 0x4a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x90, 0x7f, 0xd2, 0x4a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0xd2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xaa, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x52, + 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, + 0x41, 0x35, 0x45, 0x46, 0x41, 0x31, 0x44, 0x35, 0x33, 0x37, 0x41, 0x41, + 0x46, 0x34, 0x44, 0x32, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x01, 0x20, 0xb4, 0x01, 0x28, 0x00, 0x30, 0x00, 0x38, 0x0a, + 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, + 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xf7, 0x41, 0x5c, 0x07, + 0x70, 0xa9, 0xae, 0xff, 0x5f, 0x94, 0xcb, 0x02, 0xc1, 0xf5, 0xb9, 0x28, + 0xbd, 0x85, 0x9f, 0x70, 0x31, 0xfb, 0xa7, 0x83, 0x2f, 0x98, 0xda, 0x3d, + 0xba, 0x56, 0xfe, 0xcb, 0x91, 0x5b, 0x10, 0x8e, 0xdc, 0x54, 0xb0, 0x57, + 0xee, 0x43, 0x13, 0xbf, 0xab, 0x36, 0xc0, 0x71, 0xe3, 0x3b, 0xc3, 0x53, + 0xe3, 0xfa, 0xab, 0xef, 0x9e, 0xd8, 0xf8, 0xc0, 0x06, 0xdd, 0x5d, 0x0f, + 0x18, 0xc3, 0x42, 0x6b, 0xc0, 0x38, 0x5c, 0x9a, 0x33, 0xd6, 0xc6, 0x10, + 0x64, 0xc3, 0x9b, 0x18, 0x12, 0x10, 0x5f, 0xf3, 0x4b, 0x13, 0xef, 0xda, + 0x3c, 0xa0, 0x33, 0xf1, 0x84, 0xfa, 0x0e, 0x84, 0xeb, 0x6d, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0xf1, 0x1f, 0x0e, 0x77, 0xdc, 0x5e, 0xcf, 0x90, 0xb9, 0x0c, 0x83, 0x24, + 0x3a, 0x45, 0x30, 0xa0, 0x6f, 0x28, 0xd6, 0x5d, 0x8e, 0x7d, 0xa2, 0xdf, + 0x06, 0x11, 0x01, 0x03, 0x29, 0x8d, 0x71, 0x27, 0x12, 0x10, 0x1b, 0x6e, + 0x88, 0xf0, 0xed, 0xe5, 0x26, 0xc4, 0x0a, 0xa9, 0x58, 0xa4, 0x19, 0xa5, + 0x63, 0x4d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, + 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x8c, 0xb3, + 0x69, 0x30, 0x19, 0x30, 0x96, 0xdf, 0x98, 0xab, 0xd3, 0xf2, 0x75, 0xbd, + 0xd4, 0x6d, 0x3d, 0xf2, 0x31, 0x13, 0x4e, 0xd5, 0xbd, 0xb1, 0xac, 0xf3, + 0xc2, 0xd5, 0x82, 0x52, 0xfd, 0xbe, 0x12, 0x10, 0x94, 0x67, 0x49, 0x7f, + 0x6e, 0xd8, 0x51, 0x96, 0x70, 0xb1, 0x88, 0xb0, 0x74, 0xe8, 0xa4, 0xbc, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, + 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x27, 0x6a, 0x20, 0x08, + 0x26, 0x8a, 0xed, 0xad, 0xf9, 0x2b, 0xae, 0xd7, 0x29, 0x78, 0x65, 0x01, + 0x91, 0xd8, 0x53, 0x69, 0xc7, 0x6d, 0x2b, 0xaa, 0xaa, 0xc7, 0xc7, 0x04, + 0xbf, 0x82, 0x5e, 0xda, 0x12, 0x10, 0xd2, 0x27, 0xe2, 0x0f, 0x36, 0x36, + 0x95, 0x91, 0x6e, 0xd9, 0x51, 0x7d, 0xf2, 0xb4, 0x01, 0xb6, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x18, 0x7a, 0x0b, 0x3f, 0x15, 0x41, + 0x9b, 0x06, 0xa8, 0xca, 0x83, 0x02, 0x62, 0x1e, 0x95, 0x25, 0x65, 0x40, + 0xe7, 0xca, 0x19, 0x70, 0x52, 0x89, 0xfc, 0xdf, 0x98, 0x50, 0xd8, 0x7b, + 0x71, 0x68, 0x12, 0x10, 0x37, 0xdd, 0xd1, 0xc1, 0xc9, 0x60, 0xb8, 0xe5, + 0xcc, 0x07, 0xc7, 0x2c, 0xeb, 0x0d, 0xe5, 0x89, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xbd, 0xb0, 0xbe, 0x82, 0x4f, 0x3f, 0x05, 0x65, + 0x48, 0xee, 0x9a, 0x2c, 0xa3, 0x9d, 0xe0, 0x9a, 0x69, 0xb7, 0x3f, 0xe1, + 0x1a, 0xc9, 0xfe, 0x3c, 0x6f, 0xd5, 0x2b, 0x17, 0x54, 0xcb, 0xd2, 0x94, + 0x12, 0x10, 0x77, 0x0e, 0x54, 0x27, 0x4b, 0xd6, 0x20, 0x17, 0xb2, 0xae, + 0xe7, 0x1e, 0x03, 0xcc, 0xea, 0x55, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x20, 0xb3, 0xe8, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xaa, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x42, 0x44, 0x43, 0x35, + 0x37, 0x34, 0x39, 0x37, 0x34, 0x45, 0x39, 0x36, 0x31, 0x35, 0x36, 0x32, + 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, 0x0f, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0xfd, 0x36, 0xa7, 0x75, 0xab, 0xd5, 0x44, 0xf4, + 0x09, 0xfc, 0x08, 0x7a, 0xe6, 0xf9, 0xcc, 0x03, 0x13, 0x3d, 0xf2, 0x04, + 0x45, 0xb5, 0xbe, 0xac, 0x94, 0x6c, 0xcb, 0x53, 0xe4, 0x12, 0xf7, 0x14, + 0xb9, 0x88, 0x31, 0x94, 0x9b, 0x28, 0xc8, 0xe9, 0x37, 0x42, 0xe0, 0x55, + 0x45, 0xc0, 0x44, 0x7f, 0x7f, 0x4d, 0x84, 0x62, 0xbf, 0x0a, 0x5b, 0x1b, + 0x6c, 0x99, 0xb3, 0x21, 0x7d, 0x85, 0x75, 0x15, 0x65, 0x76, 0x86, 0x7c, + 0x54, 0xca, 0x3a, 0xdd, 0x80, 0xaa, 0x68, 0x12, 0xc5, 0x32, 0x93, 0xcd, + 0x12, 0x10, 0xcd, 0xf6, 0xfc, 0xfa, 0x31, 0x8f, 0x67, 0x91, 0x14, 0xc2, + 0x98, 0x67, 0x35, 0xa2, 0x20, 0xa0, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, + 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x72, 0xab, 0xf2, 0xf4, + 0xe0, 0x16, 0x30, 0x3a, 0xbf, 0x03, 0x3d, 0xa6, 0x3a, 0x88, 0x63, 0xc9, + 0xef, 0xda, 0x15, 0xc3, 0xdc, 0x45, 0x30, 0xde, 0x54, 0x56, 0x26, 0x08, + 0xde, 0xaa, 0x4b, 0xbd, 0x12, 0x10, 0x32, 0x3d, 0x48, 0x43, 0xc2, 0xcc, + 0x9c, 0x7c, 0x31, 0x20, 0xe4, 0xb8, 0xc1, 0xb7, 0x08, 0xbc, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x50, 0xa5, 0x46, 0xbd, 0xe0, 0xdb, + 0x52, 0x81, 0xa6, 0xb9, 0xb9, 0x32, 0x54, 0xe9, 0x65, 0x0c, 0x4d, 0x2e, + 0xbf, 0x2a, 0xe8, 0x13, 0x15, 0xa6, 0x3e, 0x30, 0xa1, 0x59, 0xd8, 0x5c, + 0x88, 0xff, 0x12, 0x10, 0x87, 0x57, 0x61, 0x95, 0xff, 0xc5, 0xff, 0x42, + 0xd8, 0xe8, 0xb9, 0xe8, 0x14, 0x06, 0x39, 0x59, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x5a, 0x85, 0xa7, 0x6a, 0x4f, 0x56, 0x2f, 0x89, + 0x46, 0x29, 0x24, 0xfd, 0x7b, 0xc1, 0x2c, 0xe8, 0x31, 0x5b, 0x41, 0xbd, + 0x07, 0x9e, 0x88, 0xf2, 0xfc, 0x5f, 0x5a, 0x88, 0x77, 0x0c, 0x3e, 0x05, + 0x12, 0x10, 0x3a, 0x22, 0x79, 0x11, 0xea, 0x97, 0x0f, 0xdf, 0xa0, 0x78, + 0x0c, 0x44, 0x7b, 0xf7, 0x98, 0x5d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x5f, 0x19, 0x3f, 0x95, 0x73, 0x12, 0x95, 0x31, 0x9f, 0x26, + 0x1b, 0x99, 0xac, 0x2f, 0x8c, 0xff, 0xba, 0x41, 0x61, 0xf7, 0x8a, 0xab, + 0xa6, 0x98, 0x57, 0xd8, 0x3a, 0xeb, 0x70, 0x5e, 0xfc, 0x98, 0x12, 0x10, + 0x31, 0x1b, 0x09, 0x47, 0xed, 0xd5, 0x43, 0x16, 0x7c, 0x83, 0x00, 0xa4, + 0x08, 0xfc, 0xa4, 0xd3, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x23, 0x66, 0x4c, 0x9c, 0xf2, 0x01, 0xa2, 0xd3, 0xaf, 0x57, 0x78, 0x4c, + 0xee, 0x31, 0xf8, 0x6a, 0xd9, 0xf8, 0x73, 0x97, 0xda, 0x61, 0xa0, 0x50, + 0xa0, 0x8d, 0xca, 0x51, 0xc2, 0x95, 0x98, 0xcd, 0x12, 0x10, 0x1e, 0xe5, + 0x64, 0x2c, 0xf0, 0x43, 0x34, 0x46, 0xe4, 0x03, 0x88, 0x3b, 0xca, 0xcb, + 0x62, 0x20, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa6, 0xe9, 0x92, + 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x61, 0xa5, 0xde, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x61, 0xa5, 0xde, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xdb, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x51, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x3f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x93, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x3d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x2b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x09, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb3, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xa1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x29, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x62, 0x32, 0x2f, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x52, + 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x62, + 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, + 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x46, 0x30, 0x35, + 0x42, 0x30, 0x42, 0x31, 0x32, 0x42, 0x32, 0x33, 0x39, 0x32, 0x33, 0x37, + 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, + 0x20, 0x00, 0x28, 0xb4, 0x01, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, + 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0xfe, 0xf1, 0xfc, 0xf9, 0x6a, 0xbe, 0xbe, + 0xd2, 0xc4, 0x28, 0x0b, 0x35, 0x5b, 0x2b, 0x52, 0xe4, 0x9f, 0x24, 0x8a, + 0xd9, 0x02, 0xd1, 0x6f, 0xc3, 0xa6, 0x48, 0x94, 0x5d, 0x87, 0x57, 0xbc, + 0x48, 0x86, 0xf4, 0x16, 0xa7, 0xee, 0xd9, 0x2e, 0x1c, 0xb8, 0xb8, 0x15, + 0xc9, 0xdf, 0x13, 0x19, 0x13, 0x48, 0xb0, 0x03, 0xdc, 0xc4, 0xc9, 0x45, + 0x45, 0xbb, 0x0d, 0x87, 0xda, 0xa8, 0x23, 0x40, 0xcc, 0x49, 0x14, 0x44, + 0xd7, 0x7a, 0x98, 0x73, 0x10, 0x37, 0x9e, 0x1c, 0xeb, 0x3d, 0x06, 0x89, + 0x65, 0x12, 0x10, 0x55, 0x50, 0x69, 0xf5, 0x3a, 0xd9, 0xc6, 0x7e, 0xbf, + 0xe7, 0x16, 0xea, 0x62, 0xf0, 0x44, 0x93, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, + 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x60, 0xb6, 0x80, + 0xd1, 0xc8, 0x62, 0x11, 0x9e, 0x57, 0x94, 0xf0, 0xb1, 0xd5, 0x48, 0x2f, + 0xe6, 0x9f, 0xaf, 0xb4, 0x12, 0xb7, 0xd9, 0x66, 0x4e, 0x7d, 0x61, 0xb4, + 0x3c, 0x76, 0xf7, 0x7e, 0x6e, 0x12, 0x10, 0x7c, 0xda, 0x3f, 0xef, 0x08, + 0xf1, 0xd7, 0x70, 0x28, 0x2f, 0x23, 0x09, 0xa4, 0x60, 0xc6, 0x75, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, + 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x39, 0x7e, 0x04, 0xe1, 0xd6, + 0x52, 0xd0, 0x4a, 0x3b, 0x49, 0x43, 0xc6, 0xbf, 0x70, 0x8b, 0xed, 0xb5, + 0x94, 0x79, 0x67, 0xa0, 0x49, 0x35, 0x6c, 0x5e, 0xe3, 0x77, 0x49, 0xde, + 0xd2, 0x3e, 0xdd, 0x12, 0x10, 0x52, 0xad, 0xc6, 0x5e, 0x20, 0x9e, 0x12, + 0xbd, 0x3d, 0x6f, 0x7e, 0xba, 0x24, 0x6f, 0x4e, 0x72, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd2, 0x45, 0x8b, 0x97, 0x7b, 0xcd, 0xac, + 0x67, 0x11, 0x8f, 0x78, 0xca, 0xdf, 0x77, 0xbb, 0x42, 0x90, 0xb1, 0x56, + 0x14, 0xda, 0x61, 0xc0, 0x30, 0x3c, 0x05, 0xc5, 0xb0, 0xbb, 0xd3, 0x8f, + 0x2e, 0x12, 0x10, 0x6a, 0x03, 0x4c, 0x60, 0x44, 0x47, 0xfb, 0x23, 0xb2, + 0xf2, 0xae, 0x28, 0xb9, 0x11, 0x68, 0xd5, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x00, 0xdb, 0x10, 0x5b, 0x15, 0x6e, 0x51, 0xca, 0x1e, + 0xb6, 0x2e, 0x33, 0x19, 0x79, 0x14, 0xa8, 0xf8, 0x34, 0xbb, 0x59, 0x03, + 0x41, 0x56, 0x43, 0xcb, 0x84, 0xf3, 0x39, 0x7d, 0x1c, 0xb8, 0x5c, 0x12, + 0x10, 0x93, 0x65, 0x95, 0xd4, 0x54, 0x19, 0x8c, 0xcd, 0xe4, 0x66, 0x16, + 0x10, 0xd3, 0xb8, 0x09, 0xe4, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x13, 0xb8, 0x60, 0xc7, 0xcd, 0x84, 0xd0, 0x1e, 0x23, 0x05, 0x9c, + 0xb6, 0xdc, 0x69, 0x30, 0x6f, 0xd9, 0x34, 0xa0, 0xa5, 0x09, 0xc5, 0x69, + 0x7a, 0xf5, 0x8d, 0x81, 0xc9, 0x93, 0xe0, 0xb9, 0x4a, 0x12, 0x10, 0x01, + 0x98, 0xc8, 0xf7, 0xfc, 0x66, 0xb4, 0xf3, 0xc0, 0x3e, 0xa7, 0x29, 0x88, + 0x48, 0x0f, 0xf9, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x99, 0xea, + 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xa9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x81, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x42, 0x44, 0x46, 0x30, 0x45, + 0x34, 0x42, 0x39, 0x30, 0x34, 0x32, 0x41, 0x42, 0x38, 0x30, 0x41, 0x32, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x0f, 0x28, 0x3c, 0x30, 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, + 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, + 0x01, 0x1a, 0x50, 0xa1, 0x7b, 0x9a, 0x06, 0x24, 0x4e, 0x5e, 0x63, 0x05, + 0xab, 0x1e, 0xf8, 0xd2, 0x18, 0xe3, 0x0a, 0xec, 0xe5, 0xef, 0xb2, 0x3a, + 0xe8, 0x1a, 0x1a, 0x8f, 0xe9, 0x2a, 0x17, 0x2c, 0x32, 0xdb, 0x59, 0xca, + 0xa9, 0x05, 0x23, 0x20, 0x9c, 0xa1, 0x5b, 0xa3, 0x72, 0xed, 0x04, 0xde, + 0xd5, 0x17, 0xd4, 0x78, 0x52, 0x73, 0x1e, 0x7d, 0x42, 0xcb, 0x62, 0x6d, + 0xa4, 0x99, 0xc0, 0x66, 0x71, 0x87, 0x2a, 0xed, 0xfc, 0x4e, 0xff, 0x15, + 0x23, 0x13, 0x98, 0xaa, 0x29, 0x20, 0x54, 0x44, 0x9e, 0xbb, 0x34, 0x12, + 0x10, 0x83, 0xa9, 0x0f, 0x5c, 0xb9, 0x63, 0x19, 0x2c, 0x21, 0xdf, 0xb2, + 0x7f, 0x43, 0xa8, 0x5d, 0xbb, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, + 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x2d, 0x6e, 0x41, 0xea, 0x05, + 0xc4, 0xd5, 0xea, 0x7e, 0xa3, 0xb6, 0x29, 0x0f, 0x27, 0x21, 0x31, 0xae, + 0xbc, 0x7f, 0x48, 0x71, 0xd2, 0xce, 0xc6, 0xc3, 0xe0, 0x1a, 0xb0, 0xdf, + 0x13, 0xa0, 0x3d, 0x12, 0x10, 0x7b, 0x87, 0x16, 0x1e, 0x9c, 0xcd, 0x51, + 0xae, 0x23, 0x96, 0x7a, 0x8b, 0x7e, 0xe5, 0xe6, 0x60, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, + 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xc5, 0x78, 0x21, 0x56, 0xe3, 0xd4, 0xcb, + 0x40, 0x6d, 0xc0, 0xc9, 0x90, 0xae, 0xe2, 0x8a, 0x58, 0x6f, 0x21, 0x68, + 0x7e, 0x5d, 0x1b, 0xed, 0x03, 0xd2, 0xb7, 0xb9, 0x5b, 0x26, 0x6d, 0xbc, + 0x3e, 0x12, 0x10, 0x97, 0x67, 0x9f, 0x8a, 0x5d, 0xf5, 0xe6, 0x3c, 0xdc, + 0x6c, 0xf0, 0xac, 0x86, 0xfc, 0xeb, 0x20, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, + 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x27, 0x7b, 0x6a, 0x8e, 0xdc, 0xee, 0xbf, 0x5e, 0x9a, + 0x34, 0x96, 0xbf, 0x85, 0xc0, 0x50, 0xce, 0x0f, 0x3a, 0xf7, 0x5b, 0xc1, + 0x02, 0xc5, 0x18, 0xcd, 0xc3, 0xe0, 0x3d, 0x66, 0x80, 0x88, 0xe7, 0x12, + 0x10, 0x4f, 0xa4, 0xe2, 0x7c, 0x38, 0x76, 0xa6, 0x2f, 0xe9, 0xd0, 0x04, + 0x02, 0x51, 0x25, 0x52, 0xfd, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x4b, 0x4e, 0xdc, 0x72, 0xb5, 0x45, 0x2c, 0x8b, 0x2d, 0xf8, 0x10, + 0x28, 0x2d, 0xef, 0x43, 0xf9, 0x81, 0x37, 0xb4, 0x05, 0x3a, 0x83, 0x0b, + 0x2d, 0xa6, 0x9c, 0x8d, 0x80, 0x05, 0x37, 0xa3, 0x6f, 0x12, 0x10, 0x15, + 0x45, 0x60, 0xaf, 0xb9, 0x42, 0x5d, 0xd5, 0xb2, 0x64, 0x76, 0x26, 0x24, + 0xdb, 0x06, 0x59, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xbd, + 0x16, 0x1e, 0x17, 0x8b, 0x0c, 0xb9, 0x59, 0x10, 0x63, 0x5b, 0xcb, 0x40, + 0x98, 0xba, 0xe4, 0x98, 0xce, 0x1f, 0xd4, 0x7c, 0x13, 0x87, 0x43, 0x05, + 0x07, 0xf8, 0xf4, 0xa8, 0x9a, 0x3f, 0xa6, 0x12, 0x10, 0x34, 0xa4, 0x3b, + 0x05, 0x69, 0x18, 0x16, 0x22, 0x4f, 0x05, 0xbc, 0xc8, 0x4e, 0x18, 0x43, + 0xe1, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x8c, 0xeb, 0x92, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x4b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x39, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x17, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaf, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x25, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xad, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x79, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x5d, 0x32, 0x2a, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x63, + 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, + 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x0a, 0x20, 0x39, 0x35, 0x31, 0x38, 0x34, 0x35, 0x33, 0x39, 0x36, + 0x34, 0x31, 0x31, 0x46, 0x31, 0x45, 0x38, 0x32, 0x45, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, 0x28, 0x3c, 0x30, + 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, 0x00, 0x58, 0x01, 0x60, + 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xdc, + 0x72, 0x77, 0xc9, 0x58, 0xc5, 0xf9, 0x02, 0x40, 0xec, 0xe6, 0x7a, 0x7a, + 0x1c, 0xef, 0x40, 0x6a, 0x5c, 0x05, 0xf9, 0xa7, 0x64, 0x0e, 0xa2, 0xa4, + 0x3c, 0xab, 0x16, 0xbe, 0xd0, 0x0a, 0xf2, 0x93, 0x23, 0x76, 0x6e, 0xe5, + 0xe3, 0x29, 0x2a, 0x9e, 0x90, 0x52, 0x63, 0xcf, 0x80, 0x05, 0x91, 0x9f, + 0x04, 0x99, 0x26, 0x59, 0x77, 0x17, 0xba, 0x6e, 0xec, 0x49, 0x76, 0xa7, + 0xe8, 0xea, 0x7d, 0x25, 0x20, 0xbc, 0xcb, 0x8b, 0x2e, 0xdb, 0x42, 0x18, + 0x61, 0xc6, 0xb4, 0x79, 0x56, 0xcd, 0x36, 0x12, 0x10, 0x0b, 0x0c, 0xca, + 0xf6, 0x53, 0x4c, 0x0d, 0xf7, 0xde, 0x66, 0x75, 0x6c, 0xa3, 0xb1, 0xc5, + 0x34, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x9b, 0xcc, 0xa8, 0xe2, 0x9e, 0x5e, 0x24, 0xfb, 0x66, + 0x5e, 0xd5, 0xc1, 0x75, 0x9a, 0xf9, 0x6b, 0x64, 0x1f, 0xed, 0xdf, 0x9b, + 0x09, 0x73, 0x0c, 0xfa, 0xbe, 0x21, 0xf2, 0x37, 0x85, 0x59, 0x87, 0x12, + 0x10, 0x99, 0xaa, 0xfb, 0x08, 0xc6, 0x23, 0x58, 0x1a, 0xf1, 0x98, 0x30, + 0x0f, 0x72, 0xae, 0x1b, 0xe6, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x52, 0x2c, 0x88, 0xf6, 0x1f, 0xe8, 0xa7, 0xf2, 0x79, 0x21, 0x49, + 0x55, 0x55, 0x17, 0x27, 0x30, 0x51, 0x3c, 0x4d, 0xe5, 0xe7, 0x48, 0x19, + 0xc8, 0xa0, 0x2a, 0x2c, 0xec, 0xff, 0xc6, 0x8f, 0x7d, 0x12, 0x10, 0xae, + 0xfc, 0x48, 0x7c, 0x84, 0xbf, 0x33, 0xc8, 0xe2, 0xc0, 0x0e, 0x2e, 0x38, + 0x3d, 0x4a, 0xb7, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x54, + 0xd9, 0x6b, 0x58, 0x99, 0xb5, 0x8c, 0x59, 0x8a, 0xd3, 0xbc, 0x6c, 0x1c, + 0x50, 0xbd, 0xea, 0x5e, 0xa5, 0xc7, 0x8f, 0x38, 0x75, 0xfb, 0x3d, 0x78, + 0x63, 0x51, 0x4e, 0xf2, 0x7c, 0x04, 0xe3, 0x12, 0x10, 0x15, 0x04, 0xe4, + 0xce, 0x52, 0x63, 0x7c, 0x45, 0x91, 0xcd, 0xdf, 0xa2, 0xbf, 0x19, 0xd3, + 0xe5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, + 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x9e, 0xe9, 0xba, + 0x83, 0x56, 0xea, 0x25, 0x0a, 0xb3, 0xe8, 0xe1, 0x19, 0x7e, 0xa6, 0x02, + 0xaa, 0x97, 0x19, 0xfa, 0x79, 0xfc, 0x0f, 0x12, 0x16, 0xbb, 0xab, 0x89, + 0xfd, 0x73, 0x55, 0xcf, 0x78, 0x12, 0x10, 0xb9, 0xa3, 0x65, 0xe7, 0x0d, + 0x41, 0xd8, 0xb5, 0xf6, 0xde, 0xfc, 0x66, 0xe2, 0x38, 0xb6, 0x77, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, + 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3a, 0x7c, 0x35, 0x84, 0x7b, + 0x89, 0x05, 0xf2, 0x07, 0xfd, 0xe6, 0x2d, 0xfa, 0x47, 0x9e, 0xa0, 0x65, + 0x06, 0xa8, 0x0f, 0xe7, 0x9c, 0x02, 0x4a, 0x58, 0x3a, 0xb6, 0x4c, 0x61, + 0xf2, 0xc6, 0xd1, 0x12, 0x10, 0x13, 0x44, 0x08, 0xf4, 0xf9, 0x4d, 0x99, + 0x18, 0x65, 0xff, 0x40, 0x95, 0xb8, 0xa1, 0x66, 0x0b, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x20, 0xad, 0xeb, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1S_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xfe, 0xe4, 0xb3, 0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xfe, 0xe4, 0xb3, 0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xda, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, 0x44, 0x43, 0x32, 0x45, + 0x35, 0x39, 0x32, 0x32, 0x34, 0x43, 0x46, 0x45, 0x37, 0x32, 0x44, 0x33, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x14, 0x28, 0x32, 0x30, 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, + 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x90, 0x01, 0x02, + 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x64, 0xbf, 0xd5, 0x47, 0x73, 0x1a, + 0xca, 0xe6, 0x4e, 0xc8, 0x27, 0x4a, 0x85, 0xfd, 0x10, 0xb5, 0xbf, 0xf2, + 0x89, 0x7d, 0x67, 0x4c, 0xfd, 0x83, 0x2b, 0xe9, 0x9e, 0x5f, 0xf7, 0x2d, + 0xf9, 0x84, 0xd9, 0xb2, 0xa8, 0xc7, 0xdf, 0x4c, 0x53, 0xdd, 0x92, 0x96, + 0x90, 0xee, 0x80, 0xbf, 0x5b, 0xf0, 0x01, 0x87, 0x92, 0x47, 0x6e, 0x1e, + 0x0e, 0xa5, 0xf7, 0x3e, 0x5b, 0x23, 0x6d, 0x51, 0x0b, 0x95, 0xd7, 0x88, + 0xa5, 0x18, 0xa1, 0x0e, 0x27, 0xbf, 0xa3, 0xc1, 0xd1, 0xfe, 0xa8, 0xbe, + 0x5f, 0x63, 0x12, 0x10, 0xb0, 0xe8, 0x54, 0x73, 0x75, 0x49, 0xe4, 0x1b, + 0x57, 0xc4, 0xbe, 0x7b, 0x70, 0xb4, 0x1f, 0xc6, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, + 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xf6, 0x29, + 0x8e, 0x12, 0x81, 0xcb, 0x6e, 0x10, 0x67, 0xc9, 0xdc, 0xf5, 0xce, 0x65, + 0x39, 0x97, 0x68, 0xe1, 0x14, 0x7c, 0x0f, 0xc7, 0x70, 0x77, 0x3d, 0x77, + 0xbc, 0x1e, 0x55, 0x0f, 0x8b, 0x30, 0x12, 0x10, 0xd0, 0x30, 0xbc, 0xbf, + 0xca, 0x72, 0xf3, 0x33, 0x6f, 0xeb, 0x65, 0x5b, 0x4f, 0x29, 0xe3, 0x79, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, + 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xe5, 0xfc, 0x1c, 0x6e, + 0xd6, 0x40, 0x9d, 0x92, 0xf6, 0xc2, 0x5a, 0x3f, 0x8d, 0x02, 0x90, 0x29, + 0x8b, 0x52, 0x7b, 0xf0, 0xb4, 0x26, 0xb9, 0x57, 0x18, 0x7c, 0x91, 0x29, + 0xa4, 0xbf, 0x0e, 0xe0, 0x12, 0x10, 0xc5, 0x44, 0x84, 0xf2, 0x91, 0x41, + 0xb9, 0xd5, 0xf7, 0x33, 0x99, 0x3a, 0x2c, 0x01, 0x97, 0x51, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7c, 0x02, 0x54, 0xf1, 0x58, 0xa4, + 0x87, 0x4b, 0x5b, 0x5b, 0x4c, 0x7d, 0x2a, 0x37, 0xcd, 0x56, 0x75, 0x28, + 0x22, 0x1f, 0x46, 0x8e, 0xb2, 0x78, 0x74, 0x85, 0x77, 0x9a, 0x80, 0x57, + 0xd8, 0xa0, 0x12, 0x10, 0x56, 0x88, 0x6b, 0xe9, 0x49, 0xf1, 0x60, 0xb2, + 0x41, 0xa4, 0x93, 0x08, 0x39, 0x47, 0xdc, 0xea, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xb4, 0x8c, 0x7f, 0x27, 0x46, 0x7a, 0xa9, 0x2d, + 0xff, 0xcd, 0xb1, 0xa4, 0xd6, 0x0f, 0xcc, 0xbb, 0x05, 0x5c, 0xf3, 0x1f, + 0x89, 0xdf, 0x75, 0xee, 0xaf, 0xa8, 0x5a, 0x63, 0xd2, 0xf7, 0x24, 0xbe, + 0x12, 0x10, 0xbc, 0xe2, 0xe8, 0xbd, 0x43, 0x35, 0xaa, 0x37, 0xdf, 0x08, + 0x79, 0x76, 0x68, 0xc1, 0x5c, 0xff, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xd3, 0x21, 0xe6, 0x68, 0x67, 0x33, 0x42, 0xfa, 0x69, 0x83, + 0x0e, 0x72, 0x9a, 0xe9, 0xbd, 0xa3, 0xbf, 0x65, 0x89, 0x14, 0x4a, 0x42, + 0x40, 0x69, 0x97, 0xbc, 0xdd, 0x85, 0xca, 0xab, 0x7c, 0x43, 0x12, 0x10, + 0xf7, 0x87, 0xfc, 0xd1, 0x23, 0xc3, 0x78, 0xb0, 0x64, 0x2b, 0x9b, 0x21, + 0xfd, 0x8b, 0x0c, 0x5d, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xce, + 0xeb, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1S_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x89, 0x1b, 0x93, 0x4a, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x89, 0x1b, 0x93, 0x4a, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0xd4, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x4a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x9a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x10, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x52, 0x65, 0x6e, 0x65, 0x77, 0x4f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x33, + 0x39, 0x36, 0x31, 0x44, 0x41, 0x33, 0x32, 0x39, 0x31, 0x38, 0x43, 0x45, + 0x38, 0x39, 0x45, 0x33, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x01, 0x20, 0x14, 0x28, 0x32, 0x30, 0x00, 0x38, 0x0f, 0x42, + 0x00, 0x48, 0x05, 0x50, 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, + 0x01, 0x90, 0x01, 0x02, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xde, 0xdf, + 0x6d, 0x7e, 0x92, 0x6d, 0x88, 0xc2, 0x7b, 0x1f, 0x19, 0xd4, 0xce, 0xc4, + 0x29, 0x26, 0x3a, 0x5f, 0x08, 0x73, 0x4d, 0x53, 0xab, 0x19, 0x78, 0x94, + 0xd5, 0x0e, 0xa9, 0x39, 0x9d, 0x49, 0x2e, 0x1d, 0xd2, 0x35, 0x99, 0x29, + 0x45, 0xb6, 0x71, 0x62, 0x7f, 0x84, 0xef, 0x38, 0x8a, 0x4b, 0x6f, 0x95, + 0xdf, 0x77, 0x29, 0x13, 0x6c, 0x59, 0xbf, 0xcb, 0x68, 0xee, 0x86, 0x02, + 0xab, 0x5f, 0x3b, 0xd2, 0x59, 0x0f, 0x0c, 0xc9, 0xa5, 0x08, 0xaa, 0xa7, + 0xea, 0xbf, 0x04, 0xe0, 0x74, 0x10, 0x12, 0x10, 0x0f, 0x43, 0xab, 0xfd, + 0x5a, 0x22, 0x2e, 0x0c, 0x20, 0xfe, 0x1f, 0xd7, 0x26, 0xb2, 0x4b, 0x8b, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xd6, 0xad, 0x65, 0x99, 0xda, 0xab, 0xc5, 0x20, 0x9d, 0x2f, + 0xc5, 0x50, 0xbd, 0x87, 0xcd, 0x8e, 0xbf, 0xa8, 0x2c, 0x72, 0x26, 0x99, + 0xa5, 0xe5, 0xdc, 0x9f, 0x53, 0x24, 0x3a, 0x9b, 0x25, 0x00, 0x12, 0x10, + 0xf4, 0x86, 0x40, 0xc9, 0xf8, 0x07, 0x49, 0x65, 0x9d, 0x86, 0x32, 0xba, + 0x4a, 0xf6, 0x14, 0xca, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x54, 0x91, 0xb8, 0xdb, 0x8d, 0x4f, 0xbe, 0xb4, 0x1d, 0x6d, 0x2f, 0x80, + 0xdb, 0xcf, 0x08, 0xe9, 0xe3, 0x71, 0x0e, 0x81, 0x7c, 0x29, 0x2f, 0x1d, + 0xff, 0xc0, 0x10, 0x97, 0x01, 0x5a, 0x24, 0xb3, 0x12, 0x10, 0x9d, 0x99, + 0xf6, 0x9a, 0x51, 0x94, 0xe0, 0x53, 0xb3, 0xfd, 0x48, 0x3a, 0x68, 0xef, + 0xb0, 0x89, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, + 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x24, 0xd2, + 0x67, 0x90, 0xb6, 0x45, 0xf4, 0x00, 0x13, 0xf3, 0xf8, 0x1a, 0x18, 0x7e, + 0x72, 0x99, 0x42, 0xe6, 0x90, 0xa8, 0x34, 0x05, 0xa0, 0x82, 0xa1, 0x65, + 0x21, 0x60, 0x00, 0xc7, 0x08, 0x12, 0x12, 0x10, 0xac, 0x8b, 0x07, 0x6c, + 0x81, 0x40, 0xb2, 0xf6, 0xa4, 0xe4, 0xb5, 0xef, 0xb6, 0xe8, 0x1c, 0xfe, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, + 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, 0x7b, 0x3f, 0xfb, + 0x2f, 0x4f, 0xd4, 0x1a, 0x99, 0x16, 0x57, 0xdf, 0xc6, 0x9b, 0x7a, 0xb0, + 0xb0, 0x0f, 0x3a, 0x3e, 0x58, 0xed, 0x7f, 0x36, 0x24, 0x0c, 0x31, 0xee, + 0x4d, 0xba, 0x14, 0x2f, 0x12, 0x10, 0xf7, 0x91, 0xce, 0x0e, 0xca, 0x85, + 0x09, 0xc3, 0xb6, 0x8e, 0x55, 0xba, 0x57, 0x78, 0x06, 0xd5, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7e, 0xd6, 0x01, 0xe7, 0x8e, 0x9c, + 0x69, 0x62, 0x48, 0x7d, 0x87, 0x36, 0x52, 0x00, 0xb1, 0xba, 0x17, 0x17, + 0x18, 0x2f, 0xbc, 0x41, 0xed, 0x49, 0x89, 0xc8, 0xd8, 0x86, 0x7d, 0xc1, + 0x40, 0x17, 0x12, 0x10, 0xdc, 0xa2, 0x65, 0x56, 0x19, 0xec, 0x28, 0x1a, + 0x52, 0xc0, 0xee, 0xff, 0x8e, 0xd7, 0x27, 0x71, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xf9, 0xeb, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xa9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x81, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x33, 0x37, 0x34, 0x42, + 0x32, 0x38, 0x39, 0x36, 0x46, 0x31, 0x33, 0x34, 0x46, 0x33, 0x36, 0x33, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, + 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x20, + 0x01, 0x1a, 0x50, 0x3c, 0x24, 0xe5, 0xa4, 0x72, 0x7b, 0x14, 0xd1, 0x6d, + 0x16, 0x30, 0x6e, 0x1c, 0xf9, 0xe2, 0xe8, 0xad, 0x7b, 0x37, 0x8e, 0xce, + 0x2c, 0x9c, 0x02, 0xf4, 0x93, 0xb3, 0xa1, 0x51, 0x26, 0x24, 0x25, 0x8a, + 0x84, 0x5f, 0xe8, 0xbb, 0x68, 0x75, 0x80, 0xaf, 0x9c, 0x7e, 0x39, 0xc4, + 0x6e, 0xe0, 0xb0, 0xd5, 0x4c, 0x0d, 0x89, 0xb8, 0x83, 0x67, 0x72, 0x4c, + 0x4c, 0x7c, 0x83, 0x3c, 0x67, 0x0c, 0x18, 0xf9, 0x6d, 0xb9, 0xe2, 0x31, + 0x36, 0x23, 0x75, 0x5b, 0x95, 0xd5, 0xbc, 0x87, 0x63, 0x2d, 0x5f, 0x12, + 0x10, 0x07, 0xf9, 0x13, 0x26, 0x2e, 0x8e, 0xcd, 0x99, 0xcf, 0x51, 0xc7, + 0x23, 0x9d, 0x93, 0x7e, 0x17, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, + 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x08, 0x32, 0xa2, 0xe4, 0x52, + 0xe8, 0xb6, 0xe9, 0x9b, 0x35, 0x12, 0x27, 0x34, 0x61, 0xb4, 0x65, 0xa2, + 0xa0, 0x36, 0x8a, 0xe5, 0x4e, 0x87, 0xb9, 0x63, 0x88, 0x46, 0x52, 0x24, + 0x0d, 0x99, 0x81, 0x12, 0x10, 0xcd, 0xdd, 0x7d, 0x3f, 0x55, 0x1b, 0x55, + 0x4a, 0xde, 0x62, 0x11, 0x22, 0xa7, 0x6f, 0x7f, 0xf4, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, + 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x2c, 0x20, 0xca, 0x90, 0xe5, 0x74, 0xb4, + 0x51, 0x9e, 0x76, 0xb2, 0xb9, 0x9c, 0x90, 0x8c, 0xa1, 0xc7, 0x95, 0x2d, + 0xa5, 0xc4, 0x4e, 0x6f, 0x60, 0xd2, 0xe1, 0xdd, 0x48, 0x6a, 0x7c, 0xfb, + 0x7f, 0x12, 0x10, 0xbb, 0x62, 0x59, 0x12, 0x20, 0x34, 0x33, 0xbb, 0x54, + 0xc9, 0xcb, 0xeb, 0xc5, 0xd2, 0xaa, 0x81, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, + 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x63, 0x14, 0xef, 0x69, 0xdf, 0x79, 0x12, 0x54, 0x65, + 0xb2, 0x16, 0xb7, 0xe3, 0x11, 0xc0, 0x76, 0x55, 0x74, 0x46, 0x69, 0x74, + 0x43, 0x88, 0xb5, 0x05, 0x58, 0x97, 0x49, 0x31, 0x54, 0x49, 0xe9, 0x12, + 0x10, 0x4f, 0x97, 0xeb, 0x53, 0xed, 0x6c, 0xe7, 0x0c, 0x14, 0xcd, 0x90, + 0xaa, 0x7a, 0xc3, 0x37, 0xfc, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xdb, 0x37, 0x77, 0xed, 0x7a, 0xc2, 0x1e, 0x60, 0xf2, 0x82, 0xe2, + 0x7b, 0x56, 0x03, 0xb8, 0x21, 0xdd, 0xeb, 0x01, 0xf3, 0xe1, 0xa7, 0xaf, + 0x7a, 0xf5, 0x38, 0x8e, 0x1d, 0x01, 0x9d, 0x1b, 0xe4, 0x12, 0x10, 0x89, + 0x97, 0xdb, 0x38, 0x9a, 0xc9, 0x12, 0x79, 0x60, 0x37, 0x5e, 0x1a, 0x29, + 0xf9, 0x16, 0x34, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, + 0x32, 0xcf, 0x3c, 0xae, 0x98, 0x40, 0xef, 0x7f, 0xc2, 0x5b, 0x6b, 0x5f, + 0x4a, 0x2b, 0x57, 0x03, 0xfa, 0x1c, 0x1a, 0xd3, 0x9c, 0x03, 0x96, 0xf7, + 0x0a, 0x09, 0x7e, 0x88, 0xa7, 0xd5, 0x4d, 0x12, 0x10, 0xa4, 0xa0, 0x78, + 0xe7, 0x65, 0x31, 0x98, 0xbd, 0x72, 0xf4, 0xa5, 0xec, 0xc4, 0x5f, 0x15, + 0xa1, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xd0, 0xed, 0x92, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xff, 0x39, 0xcd, 0x87, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xff, 0x39, 0xcd, 0x87, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xc8, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x50, 0x32, 0x1d, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x63, 0x61, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, + 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x0a, 0x20, 0x31, 0x45, 0x43, 0x38, 0x42, 0x30, 0x30, 0x33, 0x42, 0x32, + 0x42, 0x32, 0x34, 0x30, 0x34, 0x37, 0x33, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, + 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, + 0x38, 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xbc, 0x1c, + 0x7d, 0xe8, 0x97, 0x48, 0x11, 0x56, 0x47, 0xa2, 0x80, 0xe5, 0x76, 0x69, + 0x27, 0x5e, 0x06, 0x21, 0x13, 0x66, 0xcb, 0x76, 0xb6, 0xc5, 0xbf, 0xf8, + 0xce, 0x25, 0x66, 0x31, 0x42, 0x70, 0x98, 0xad, 0xe4, 0xce, 0x4b, 0x4b, + 0x61, 0x74, 0x66, 0x50, 0x32, 0x59, 0xbb, 0x7f, 0x4a, 0xa1, 0x66, 0x3a, + 0x88, 0xd7, 0xb5, 0x35, 0xde, 0xa1, 0xb6, 0xb1, 0xe8, 0xbe, 0x05, 0xfe, + 0xcd, 0x7c, 0xe2, 0x96, 0xdc, 0xc2, 0xdf, 0x91, 0xb2, 0x90, 0x4d, 0xbb, + 0x81, 0xcb, 0x01, 0xaa, 0x42, 0xd3, 0x12, 0x10, 0x46, 0x77, 0x79, 0x61, + 0x62, 0x62, 0xed, 0xaa, 0x46, 0x5a, 0x67, 0xf2, 0x19, 0xba, 0xee, 0x9e, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x48, 0xff, 0x8e, 0x66, 0x20, 0xd1, 0xbc, 0x5b, 0x76, 0x04, + 0x2f, 0x09, 0x9b, 0xc5, 0x06, 0x7f, 0x4e, 0xb7, 0x26, 0x9f, 0x7c, 0xbc, + 0x18, 0x59, 0xc8, 0xe4, 0x80, 0xae, 0xef, 0xac, 0xe9, 0xa2, 0x12, 0x10, + 0x4c, 0x2e, 0x98, 0xba, 0xcc, 0xac, 0x5d, 0x8d, 0x39, 0x02, 0x1a, 0xcb, + 0x26, 0xea, 0x2d, 0x9a, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x93, 0x8a, 0x54, 0xea, 0xa0, 0xf6, 0x46, 0xa0, 0x30, 0x43, 0x0b, 0xab, + 0x83, 0xae, 0x5c, 0xff, 0xcb, 0xef, 0x9e, 0x6c, 0xc1, 0x60, 0x77, 0xdb, + 0xb0, 0x52, 0x41, 0x0e, 0x8f, 0x5e, 0x71, 0x61, 0x12, 0x10, 0xd9, 0x43, + 0xf4, 0xe0, 0x79, 0xb5, 0xfa, 0xaa, 0xc1, 0x1c, 0x4f, 0x06, 0xcb, 0xa7, + 0x6d, 0xf0, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, + 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcc, 0xc8, + 0xf0, 0xc2, 0x89, 0xb6, 0x55, 0xa7, 0xc8, 0x8b, 0xfc, 0x1a, 0x77, 0x31, + 0xd6, 0x2f, 0x0b, 0x9b, 0x6f, 0x80, 0x30, 0x82, 0x44, 0x90, 0x87, 0x81, + 0x4a, 0x3e, 0x08, 0xbf, 0x66, 0x0c, 0x12, 0x10, 0xba, 0xb6, 0x61, 0xb5, + 0x67, 0xaa, 0x5a, 0xfb, 0x54, 0xa9, 0xf7, 0x2d, 0x0a, 0xf5, 0x7e, 0x53, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, + 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x9b, 0xdc, 0x8d, 0x37, + 0xc5, 0x6e, 0x42, 0xe1, 0xb9, 0xd2, 0xf4, 0xa2, 0x3d, 0x35, 0xc8, 0xc9, + 0xd3, 0x98, 0xd7, 0xf4, 0x48, 0x99, 0x37, 0x29, 0x82, 0x1c, 0xd0, 0x09, + 0xf1, 0x3d, 0x6b, 0x2c, 0x12, 0x10, 0x7c, 0xdd, 0xf1, 0xf4, 0x4c, 0x0f, + 0xda, 0xf2, 0x11, 0xde, 0x1c, 0x63, 0x67, 0xf7, 0x64, 0xe3, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb6, 0x8c, 0xc4, 0xe3, 0x81, 0x2d, + 0x12, 0x8b, 0x4e, 0x34, 0xb0, 0xd1, 0x98, 0xfe, 0x3d, 0xac, 0xb9, 0x23, + 0x55, 0x2c, 0xd2, 0x92, 0x6f, 0xb8, 0x43, 0x29, 0x9e, 0xbc, 0x65, 0xf6, + 0x1c, 0xa7, 0x12, 0x10, 0x93, 0x46, 0x6d, 0x6f, 0xc4, 0x67, 0xaa, 0xa2, + 0x67, 0x00, 0x1d, 0x31, 0x4e, 0xce, 0xca, 0x56, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xaa, 0xee, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x1a, 0xb9, 0xef, 0x9e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x1a, 0xb9, 0xef, 0x9e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xf2, 0xb9, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x39, 0x41, 0x32, 0x39, 0x30, 0x42, + 0x35, 0x37, 0x43, 0x44, 0x32, 0x34, 0x34, 0x43, 0x38, 0x30, 0x34, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xe4, 0xe3, + 0x94, 0xff, 0x8b, 0x7b, 0xe0, 0x33, 0xbb, 0x8d, 0xe4, 0x12, 0xda, 0xa6, + 0xff, 0xb1, 0x0c, 0x12, 0x52, 0xb6, 0x18, 0x75, 0xca, 0x42, 0xc0, 0x79, + 0xa9, 0x1e, 0xce, 0x50, 0xe4, 0xdc, 0x12, 0x10, 0x19, 0x7a, 0x19, 0xaf, + 0x7a, 0x9d, 0x7a, 0x42, 0xcd, 0x63, 0x28, 0xdb, 0x60, 0x9b, 0xd7, 0xbb, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, + 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0a, 0xca, 0xc3, 0x4a, + 0xef, 0xc3, 0x1f, 0x88, 0xdb, 0x98, 0x0a, 0xe6, 0xfe, 0xdc, 0xd4, 0x1a, + 0xfe, 0x75, 0x70, 0x52, 0x40, 0x14, 0x8c, 0xc4, 0xfd, 0x31, 0x4e, 0x70, + 0x72, 0x0f, 0x3a, 0x16, 0x12, 0x10, 0x38, 0xa3, 0xf3, 0x06, 0x12, 0x23, + 0x3c, 0x90, 0xe6, 0x97, 0xce, 0xe5, 0x30, 0xf2, 0xf8, 0x74, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3b, 0x0e, 0xfc, 0x2d, 0x2c, 0x09, + 0xee, 0x4e, 0x26, 0xac, 0x63, 0xa2, 0x78, 0x8f, 0x07, 0xa8, 0x1e, 0xf1, + 0xeb, 0x6b, 0xc5, 0x50, 0x4f, 0xca, 0xcb, 0x73, 0xe8, 0x6a, 0xec, 0x04, + 0x0c, 0x3f, 0x12, 0x10, 0xc6, 0x14, 0xa3, 0xcf, 0xd5, 0xb7, 0x6d, 0xc7, + 0x39, 0x53, 0x3f, 0xf8, 0xf9, 0xc2, 0x8e, 0x44, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x99, 0xb7, 0x72, 0x61, 0x4a, 0x47, 0xae, 0x57, + 0x5f, 0xf6, 0xfb, 0xd2, 0x86, 0x19, 0x56, 0x65, 0x3d, 0x79, 0x6c, 0x88, + 0x9d, 0xa2, 0x06, 0xf8, 0x50, 0x21, 0xda, 0x1a, 0xdc, 0xc6, 0xac, 0xd2, + 0x12, 0x10, 0x80, 0x2c, 0xbb, 0x2f, 0x10, 0x99, 0xbf, 0xc2, 0x10, 0xfa, + 0x04, 0x32, 0xc4, 0xb8, 0xe7, 0x77, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x19, 0x97, 0xf8, 0x93, 0x7a, 0xb2, 0x45, 0xde, 0x2d, 0x9e, + 0xc5, 0x3d, 0xae, 0xf6, 0xf9, 0xf0, 0xd1, 0x42, 0xa5, 0x51, 0x59, 0xbb, + 0x00, 0x9c, 0xa8, 0xd4, 0xe4, 0x32, 0x63, 0x39, 0x17, 0x87, 0x12, 0x10, + 0x3a, 0xef, 0x60, 0x77, 0x8d, 0x75, 0xa4, 0x72, 0x6c, 0x75, 0xaa, 0x72, + 0x77, 0xde, 0x02, 0xc6, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x84, + 0xef, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x8d, 0x57, 0x68, 0x72, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x8d, 0x57, 0x68, 0x72, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x47, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x35, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x13, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xab, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x89, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x21, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x97, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x75, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x55, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x46, + 0x37, 0x33, 0x44, 0x33, 0x42, 0x32, 0x32, 0x42, 0x42, 0x41, 0x37, 0x41, + 0x34, 0x45, 0x31, 0x34, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, + 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, + 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x5d, 0x0d, 0x4a, 0x1f, 0x5f, + 0x83, 0x6c, 0xf4, 0x8f, 0x56, 0x85, 0x6f, 0x7c, 0xa1, 0x37, 0xb5, 0x26, + 0x29, 0xa0, 0x22, 0x46, 0x0b, 0xf3, 0x4e, 0xea, 0xc5, 0x71, 0x7e, 0x20, + 0x08, 0x95, 0xcb, 0x7c, 0xb1, 0x63, 0x4f, 0x5c, 0x4f, 0xd7, 0xde, 0x13, + 0x12, 0x72, 0x46, 0x30, 0x27, 0x9e, 0xad, 0x5a, 0x25, 0x8a, 0xe5, 0x64, + 0x2e, 0x48, 0xfc, 0x52, 0x95, 0x62, 0xb2, 0x4e, 0xd8, 0x6d, 0x14, 0xd4, + 0x9b, 0xd4, 0x98, 0x97, 0x68, 0x21, 0xe2, 0x0a, 0xe3, 0xcc, 0x27, 0xeb, + 0xfe, 0x47, 0x3e, 0x12, 0x10, 0x8b, 0x98, 0x83, 0x17, 0x2c, 0x86, 0x55, + 0x18, 0xbc, 0x7c, 0x65, 0x50, 0x7e, 0xb1, 0xaa, 0x53, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xed, + 0x6c, 0xeb, 0xc4, 0x44, 0xc9, 0xa2, 0x37, 0x35, 0xfc, 0xa0, 0x15, 0x5b, + 0x22, 0xd3, 0xdd, 0xb7, 0x60, 0x8f, 0x7d, 0x37, 0xfb, 0xe9, 0x46, 0x3f, + 0x54, 0x81, 0x0d, 0x19, 0xc8, 0x66, 0x1e, 0x12, 0x10, 0x96, 0xbf, 0x5c, + 0xf6, 0xe9, 0x97, 0xa9, 0x50, 0x5c, 0x66, 0x0d, 0xe7, 0x82, 0x4a, 0xed, + 0x32, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, + 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x47, 0x20, 0xd3, + 0x75, 0xd1, 0xab, 0xb1, 0x83, 0x40, 0x9a, 0xbe, 0x30, 0xcf, 0xed, 0x5e, + 0x38, 0x41, 0x1d, 0x1f, 0x24, 0x56, 0xfb, 0x68, 0x2b, 0x5c, 0x6f, 0xe4, + 0x4a, 0xba, 0x9f, 0x83, 0xd3, 0x12, 0x10, 0x23, 0xe6, 0xff, 0x76, 0x47, + 0xca, 0xb8, 0xdf, 0x87, 0x5e, 0xd6, 0xf8, 0x0e, 0x7e, 0x1b, 0x54, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, + 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x54, 0x82, 0xa0, 0x1f, 0x11, + 0x1a, 0x3a, 0x97, 0xbb, 0xb8, 0xd0, 0x5f, 0x8a, 0x1c, 0x46, 0x3f, 0xdf, + 0xeb, 0x1f, 0xa7, 0x6f, 0x76, 0x1e, 0xe4, 0x38, 0x1b, 0x2d, 0x0e, 0x16, + 0x18, 0x28, 0x2e, 0x12, 0x10, 0xc4, 0x4d, 0x7f, 0xe8, 0x06, 0x7c, 0xa7, + 0x9d, 0x8d, 0x57, 0x8e, 0x79, 0x36, 0x99, 0xd1, 0xee, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0b, 0xc5, 0x6f, 0x96, 0xd3, 0x5c, 0xeb, + 0x9f, 0xce, 0xe2, 0x5e, 0xcc, 0x18, 0x4b, 0x16, 0x93, 0x30, 0x4c, 0x54, + 0x93, 0xf7, 0xc2, 0x44, 0x6a, 0x55, 0x7d, 0xa9, 0x8f, 0xb4, 0x87, 0xe6, + 0xef, 0x12, 0x10, 0xfc, 0x24, 0x24, 0x57, 0xcd, 0xd5, 0x88, 0xbc, 0x8b, + 0x2b, 0x68, 0x39, 0x11, 0x07, 0xec, 0x05, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0xb7, 0xc4, 0xda, 0xb3, 0x69, 0xa9, 0xb8, 0x00, 0xce, + 0xf1, 0xae, 0x14, 0x78, 0xe3, 0xcd, 0x53, 0x04, 0x6a, 0x53, 0x3a, 0x21, + 0xb4, 0xf8, 0x93, 0xa5, 0x01, 0x90, 0x3f, 0x96, 0xf7, 0x03, 0x3f, 0x12, + 0x10, 0x94, 0x6b, 0xeb, 0xf2, 0xd4, 0x31, 0xf2, 0x53, 0x7e, 0x87, 0xff, + 0x92, 0x32, 0x98, 0x14, 0xba, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, + 0x92, 0xef, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x10, 0x13, 0x2c, 0xd0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x10, 0x13, 0x2c, 0xd0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x45, 0xbd, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x37, 0x37, 0x33, 0x46, 0x46, 0x38, + 0x38, 0x37, 0x45, 0x43, 0x41, 0x41, 0x41, 0x46, 0x35, 0x44, 0x34, 0x34, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, + 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x76, 0x44, + 0x2f, 0xe8, 0xe6, 0xc6, 0x69, 0xd7, 0xe6, 0x58, 0x52, 0xa2, 0x55, 0x21, + 0xff, 0x35, 0x18, 0x6e, 0xf4, 0xd1, 0xcf, 0xf7, 0xa6, 0x3f, 0x28, 0x1b, + 0x9c, 0xb9, 0x7c, 0xd5, 0x55, 0xf3, 0x12, 0x10, 0x84, 0x64, 0x82, 0xfd, + 0x48, 0xb2, 0x95, 0x64, 0x40, 0xfb, 0xdb, 0x52, 0xf0, 0x65, 0xeb, 0x4c, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, + 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xca, 0x46, 0xaa, 0xa0, + 0x09, 0x72, 0x53, 0x17, 0x0d, 0x87, 0x93, 0xef, 0x04, 0x54, 0x58, 0x2f, + 0x23, 0xfc, 0x5b, 0xa2, 0x3b, 0xf4, 0x92, 0x85, 0x20, 0x7c, 0x70, 0x89, + 0x74, 0x8b, 0xa7, 0xdf, 0x12, 0x10, 0x89, 0xe6, 0x26, 0xe0, 0xea, 0x66, + 0xc9, 0xfe, 0xe5, 0x00, 0x49, 0x97, 0xb1, 0x44, 0x5f, 0xd0, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x49, 0x88, 0xb9, 0x28, 0x94, 0xb7, + 0x79, 0x98, 0x26, 0xcb, 0x73, 0xa7, 0x46, 0x7a, 0xad, 0xff, 0x67, 0x6f, + 0xd6, 0x6d, 0xb1, 0xa4, 0xbf, 0x77, 0x00, 0x47, 0x41, 0x5b, 0x46, 0xb8, + 0xd7, 0x8c, 0x12, 0x10, 0x6e, 0x4c, 0x66, 0x7f, 0xf8, 0x13, 0x1a, 0xe7, + 0x39, 0x37, 0x0a, 0x10, 0xbf, 0x2e, 0x3f, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xd4, 0x6e, 0xdd, 0x52, 0x3a, 0xef, 0x82, 0x79, + 0xb0, 0xc2, 0x65, 0x82, 0x1a, 0x95, 0x42, 0x7a, 0xaf, 0x08, 0x20, 0xeb, + 0x6b, 0x8d, 0xc8, 0x66, 0x76, 0x82, 0xee, 0x21, 0x20, 0x98, 0x94, 0xd1, + 0x12, 0x10, 0x1f, 0xd3, 0x15, 0x4c, 0xaa, 0xd4, 0xa4, 0xea, 0x38, 0x26, + 0xaf, 0x2b, 0x83, 0x8d, 0xb9, 0x41, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x02, 0xb7, 0xe2, 0x66, 0x85, 0x9c, 0x89, 0xc5, 0x1a, 0xc2, + 0x64, 0xd1, 0xad, 0x54, 0xe1, 0x8c, 0xc6, 0x58, 0xa2, 0xef, 0x16, 0x6c, + 0xba, 0x07, 0x53, 0x3a, 0xf4, 0xf0, 0x91, 0xdb, 0x98, 0xfa, 0x12, 0x10, + 0x66, 0x4e, 0xc3, 0xd9, 0x5b, 0xd1, 0xae, 0x03, 0x7c, 0x7d, 0x02, 0x3d, + 0x46, 0x63, 0x5b, 0x8a, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa0, + 0xef, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x6c, 0x30, 0xc9, 0x6a, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x6c, 0x30, 0xc9, 0x6a, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x56, 0x32, 0x23, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, + 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x46, 0x33, 0x30, 0x42, + 0x34, 0x32, 0x34, 0x45, 0x37, 0x32, 0x45, 0x39, 0x44, 0x42, 0x31, 0x34, + 0x34, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, + 0x20, 0x28, 0x28, 0x28, 0x30, 0x28, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x88, 0x49, 0x61, 0x40, 0xdb, 0x33, 0x95, 0x3c, + 0x00, 0x45, 0xe8, 0x2a, 0x7f, 0x4f, 0x19, 0xf5, 0xa9, 0x95, 0x0c, 0x87, + 0x9a, 0x3a, 0x07, 0xac, 0x9b, 0x2d, 0xc1, 0xe7, 0x33, 0x3f, 0x02, 0xcd, + 0xab, 0xa8, 0x28, 0x59, 0x4a, 0x87, 0xe8, 0x34, 0x2e, 0x59, 0xb5, 0xbf, + 0x0d, 0x5a, 0xea, 0x48, 0x92, 0xb5, 0x6a, 0x4d, 0x9f, 0x3b, 0x05, 0x77, + 0x1e, 0xf0, 0xc6, 0x86, 0x7f, 0xf6, 0xda, 0x86, 0x63, 0xa1, 0x83, 0xcb, + 0xa8, 0x42, 0xa6, 0x8f, 0x1d, 0x51, 0x7e, 0x30, 0x3d, 0x8e, 0x9d, 0xd3, + 0x12, 0x10, 0xa8, 0x5d, 0x94, 0xdf, 0x84, 0xa9, 0x21, 0xfe, 0x34, 0xf5, + 0x1c, 0x46, 0x91, 0x3f, 0x5a, 0xd3, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, + 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcd, 0xf2, 0x1a, 0x88, + 0x12, 0x76, 0x9c, 0xe3, 0xa4, 0xd2, 0x4e, 0xb4, 0x47, 0x7e, 0x5f, 0xbd, + 0x3d, 0xf3, 0xb6, 0x8b, 0x08, 0x2a, 0x08, 0xd2, 0x8c, 0x48, 0xc1, 0x2a, + 0x7d, 0xea, 0x7c, 0x1d, 0x12, 0x10, 0xcc, 0x3a, 0x0a, 0x97, 0x77, 0x32, + 0x0a, 0x3e, 0xba, 0x4e, 0x4b, 0x49, 0x0c, 0x31, 0x20, 0xbf, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x4f, 0xab, 0x30, 0xee, 0xcb, 0xd8, + 0x98, 0x92, 0x98, 0x9e, 0x68, 0xc6, 0xec, 0x62, 0x10, 0xbd, 0x77, 0x1b, + 0xdd, 0x76, 0xf9, 0x3d, 0x54, 0xbd, 0x4d, 0xdf, 0xc1, 0x2c, 0x1b, 0x99, + 0xc4, 0xbc, 0x12, 0x10, 0x9e, 0xc1, 0x2c, 0xe9, 0x27, 0x28, 0x8e, 0x10, + 0xc3, 0x10, 0x4a, 0x29, 0x0c, 0xd4, 0xe0, 0xf3, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x12, 0x21, 0x5b, 0x6b, 0x76, 0xe1, 0xb1, 0x54, + 0xee, 0x90, 0xb5, 0x9e, 0x07, 0x52, 0x83, 0x90, 0x6e, 0x59, 0xed, 0x1b, + 0x7c, 0xda, 0xa5, 0x54, 0xd7, 0xed, 0x8b, 0x2a, 0x1d, 0x71, 0xeb, 0x11, + 0x12, 0x10, 0xd2, 0x5b, 0xd0, 0x80, 0x0e, 0x79, 0x33, 0xc2, 0xfb, 0xf6, + 0x5c, 0xc8, 0xbf, 0x70, 0x4b, 0xfb, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x12, 0xfc, 0x46, 0xad, 0xa8, 0x4a, 0xa6, 0x32, 0x3f, 0xbd, + 0x56, 0x2c, 0xc5, 0xd7, 0x9e, 0x4b, 0xd1, 0x58, 0x5d, 0xdb, 0x11, 0x4c, + 0x98, 0xde, 0x7e, 0xfa, 0x76, 0x53, 0xfd, 0x26, 0x16, 0x3d, 0x12, 0x10, + 0x70, 0x32, 0x63, 0x16, 0x9d, 0xf9, 0xe6, 0xbd, 0x98, 0x15, 0x4d, 0xa5, + 0x64, 0x37, 0x80, 0xdf, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x73, 0x93, 0xe0, 0xf1, 0x39, 0xcb, 0x32, 0xc1, 0xb7, 0x33, 0x0f, 0x1f, + 0x98, 0xd2, 0x7c, 0x88, 0xc0, 0x8c, 0xcb, 0x5e, 0x9f, 0x75, 0xe7, 0xb7, + 0x6b, 0x0c, 0x30, 0x8b, 0x7a, 0xb0, 0x90, 0xff, 0x12, 0x10, 0x31, 0x6b, + 0xc7, 0xf8, 0x79, 0xa1, 0x32, 0xbd, 0x66, 0x86, 0x11, 0x42, 0x8c, 0xcc, + 0x8d, 0x21, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc6, 0xef, 0x92, + 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// Renewal Tests. +// A few renewal examples from filter *PIG*:*CdmUseCase*. +// Note: running these cases generates many renewals. It should be +// ok to only test one or two. +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, + 0x37, 0x33, 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, + 0x44, 0x42, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xd7, 0xe7, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x04, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, + 0x37, 0x33, 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, + 0x44, 0x42, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0x9c, 0xe8, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x02, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x42, 0x44, + 0x43, 0x35, 0x37, 0x34, 0x39, 0x37, 0x34, 0x45, 0x39, 0x36, 0x31, + 0x35, 0x36, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xd4, 0xe9, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LimitedDurationLicense_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x42, 0x44, 0x46, 0x30, 0x45, + 0x34, 0x42, 0x39, 0x30, 0x34, 0x32, 0x41, 0x42, 0x38, 0x30, 0x41, 0x32, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, + 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, + 0x20, 0x9d, 0xeb, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LimitedDurationLicense_Case1_1_3) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x5d, 0x32, 0x2a, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x63, + 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x01, + 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x0a, 0x20, 0x39, 0x35, 0x31, 0x38, 0x34, 0x35, 0x33, 0x39, 0x36, + 0x34, 0x31, 0x31, 0x46, 0x31, 0x45, 0x38, 0x32, 0x45, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, + 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x20, 0xbe, 0xeb, 0x92, + 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1L_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x84, 0x57, 0x13, 0x9e, 0x00, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x84, 0x57, 0x13, 0x9e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x31, 0x35, 0x34, 0x39, + 0x42, 0x42, 0x46, 0x44, 0x36, 0x45, 0x36, 0x38, 0x42, 0x32, 0x37, 0x33, + 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, + 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, + 0x20, 0x85, 0xed, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1L_1_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0xb8, 0xfc, 0x76, 0x3a, 0x00, 0x00, 0x00, 0x3e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0xb8, 0xfc, 0x76, 0x3a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x52, 0x65, 0x6e, 0x65, 0x77, 0x4f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x01, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x30, + 0x45, 0x42, 0x34, 0x39, 0x44, 0x34, 0x37, 0x39, 0x32, 0x32, 0x37, 0x32, + 0x33, 0x31, 0x45, 0x33, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, + 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, + 0x84, 0x0f, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xb0, 0xed, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_Heartbeat_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x31, 0x28, 0x03, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x33, 0x37, + 0x34, 0x42, 0x32, 0x38, 0x39, 0x36, 0x46, 0x31, 0x33, 0x34, 0x46, + 0x33, 0x36, 0x33, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x00, 0x20, 0x86, 0xee, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 40; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +} // namespace + +} // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_test.cpp b/oemcrypto/odk/test/odk_test.cpp index 6cd9319..71073fc 100644 --- a/oemcrypto/odk/test/odk_test.cpp +++ b/oemcrypto/odk/test/odk_test.cpp @@ -4,6 +4,7 @@ #include "odk.h" +#include #include #include #include @@ -17,6 +18,7 @@ #include "core_message_serialize_proto.h" #include "core_message_types.h" #include "gtest/gtest.h" +#include "odk_overflow.h" #include "odk_structs.h" #include "odk_structs_priv.h" #include "odk_test_helper.h" @@ -332,12 +334,21 @@ TEST(OdkTest, NullRequestTest) { &nonce_values, nullptr, 0uL, nullptr)); // Null device id in provisioning request is ok - uint8_t message[ODK_PROVISIONING_REQUEST_SIZE] = {0}; - core_message_length = ODK_PROVISIONING_REQUEST_SIZE; - EXPECT_EQ(OEMCrypto_SUCCESS, - ODK_PrepareCoreProvisioningRequest( - message, ODK_PROVISIONING_REQUEST_SIZE, &core_message_length, - &nonce_values, &counter_info)); + if (nonce_values.api_major_version > 17) { + uint8_t message[ODK_PROVISIONING_REQUEST_SIZE] = {0}; + core_message_length = ODK_PROVISIONING_REQUEST_SIZE; + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioningRequest( + message, ODK_PROVISIONING_REQUEST_SIZE, &core_message_length, + &nonce_values, &counter_info)); + } else { + uint8_t message[ODK_PROVISIONING_REQUEST_SIZE_V17] = {0}; + core_message_length = ODK_PROVISIONING_REQUEST_SIZE_V17; + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioningRequest( + message, ODK_PROVISIONING_REQUEST_SIZE_V17, + &core_message_length, &nonce_values, &counter_info)); + } // Null device info in provisioning 4.0 request is ok uint8_t message_prov4[ODK_PROVISIONING40_REQUEST_SIZE] = {0}; @@ -883,7 +894,10 @@ TEST(OdkTest, ParseRenewalErrorTimer) { uint32_t buf_size = 0; ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, &buf_size); - params.clock_values.time_of_renewal_request = 0; + // Set the time for the last renewal request, as seen in clock_values, to be + // after the time in the request. + // TODO: b/290249855 - This is reversed. It should be +5. + params.clock_values.time_of_renewal_request = params.playback_clock - 5; OEMCryptoResult err = ODK_ParseRenewal( buf, buf_size, buf_size, &(params.core_message.nonce_values), params.system_time, &(params.timer_limits), &(params.clock_values), @@ -976,13 +990,32 @@ TEST_P(OdkVersionTest, LicenseResponseRoundtrip) { &(params.clock_values), &(params.core_message.nonce_values), &(params.parsed_license), nullptr); }; + + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = params.parsed_license.enc_mac_keys_iv; + parsed_license.enc_mac_keys = params.parsed_license.enc_mac_keys; + parsed_license.pst = params.parsed_license.pst; + parsed_license.srm_restriction_data = + params.parsed_license.srm_restriction_data; + parsed_license.license_type = params.parsed_license.license_type; + parsed_license.nonce_required = params.parsed_license.nonce_required; + parsed_license.timer_limits = params.parsed_license.timer_limits; + parsed_license.watermarking = params.parsed_license.watermarking; + parsed_license.dtcp2_required = params.parsed_license.dtcp2_required; + parsed_license.renewal_delay_base = params.parsed_license.renewal_delay_base; + parsed_license.key_array_length = params.parsed_license.key_array_length; + std::vector key_array; + for (size_t i = 0; i < params.parsed_license.key_array_length; i++) { + key_array.push_back(params.parsed_license.key_array[i]); + } + parsed_license.key_array = key_array.data(); const std::string request_hash_string( reinterpret_cast(request_hash_read), sizeof(request_hash_read)); auto kdo_prepare_func = [&](const ODK_LicenseRequest& core_request, std::string* oemcrypto_core_message) { - return CreateCoreLicenseResponse(features_, params.parsed_license, - core_request, request_hash_string, + return CreateCoreLicenseResponse(features_, parsed_license, core_request, + request_hash_string, oemcrypto_core_message); }; ValidateResponse(GetParam(), &(params.core_message), @@ -990,6 +1023,84 @@ TEST_P(OdkVersionTest, LicenseResponseRoundtrip) { kdo_prepare_func); } +// Serialize and de-serialize license response with more keys than +// ODK_MAX_NUM_KEYS. +TEST_P(OdkVersionTest, LicenseResponseRoundtripMoreThanMaxKeys) { + ODK_LicenseResponseParams params; + ODK_SetDefaultLicenseResponseParams(¶ms, + GetParam().response_major_version); + SetRequestVersion(¶ms); + // For v17, we do not use the hash to verify the request. However, the server + // needs to be backwards compatible, so it still needs to pass the hash into + // CreateCoreLiceseseResponse below. Save a copy of params.request_hash as it + // will be zero out during the test + uint8_t request_hash_read[ODK_SHA256_HASH_SIZE]; + memcpy(request_hash_read, params.request_hash, sizeof(request_hash_read)); + uint8_t* buf = nullptr; + uint32_t buf_size = 0; + ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, + &buf_size); + + uint8_t* zero = new uint8_t[buf_size]{}; + size_t bytes_read = 0; + // zero-out input + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_IterFields(ODK_READ, zero, buf_size, &bytes_read, + params.extra_fields)); + + // Parse buf with odk + const OEMCryptoResult parse_result = ODK_ParseLicense( + buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, + params.usage_entry_present, 0, &(params.timer_limits), + &(params.clock_values), &(params.core_message.nonce_values), + &(params.parsed_license), nullptr); + EXPECT_EQ(OEMCrypto_SUCCESS, parse_result); + + size_t size_out = 0; + if (parse_result != OEMCrypto_SUCCESS) { + ODK_IterFields(ODK_FieldMode::ODK_DUMP, buf, buf_size, &size_out, + params.extra_fields); + } + + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = params.parsed_license.enc_mac_keys_iv; + parsed_license.enc_mac_keys = params.parsed_license.enc_mac_keys; + parsed_license.pst = params.parsed_license.pst; + parsed_license.srm_restriction_data = + params.parsed_license.srm_restriction_data; + parsed_license.license_type = params.parsed_license.license_type; + parsed_license.nonce_required = params.parsed_license.nonce_required; + parsed_license.timer_limits = params.parsed_license.timer_limits; + parsed_license.watermarking = params.parsed_license.watermarking; + parsed_license.dtcp2_required = params.parsed_license.dtcp2_required; + parsed_license.renewal_delay_base = params.parsed_license.renewal_delay_base; + parsed_license.key_array_length = ODK_MAX_NUM_KEYS + 1; + std::vector key_array; + for (size_t i = 0; i < ODK_MAX_NUM_KEYS + 1; i++) { + OEMCrypto_KeyObject key = {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}; + key_array.push_back(key); + } + parsed_license.key_array = key_array.data(); + const std::string request_hash_string( + reinterpret_cast(request_hash_read), + sizeof(request_hash_read)); + + // serialize odk output to oemcrypto_core_message + std::string oemcrypto_core_message; + ODK_LicenseRequest core_request = {}; + core_request.api_major_version = GetParam().request_major_version; + core_request.api_minor_version = GetParam().request_minor_version; + core_request.nonce = params.core_message.nonce_values.nonce; + core_request.session_id = params.core_message.nonce_values.session_id; + bool result = + CreateCoreLicenseResponse(features_, parsed_license, core_request, + request_hash_string, &oemcrypto_core_message); + EXPECT_FALSE(result); + + delete[] buf; + delete[] zero; +} + TEST_P(OdkVersionTest, RenewalResponseRoundtrip) { ODK_RenewalResponseParams params; ODK_SetDefaultRenewalResponseParams(¶ms); @@ -1105,20 +1216,22 @@ std::vector TestCases() { // number. {16, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 16, 5}, {17, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 17, 2}, - {18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 1}, + {18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 3}, // Here are some known good versions. Make extra sure they work. {ODK_MAJOR_VERSION, 16, 3, 16, 3}, {ODK_MAJOR_VERSION, 16, 4, 16, 4}, {ODK_MAJOR_VERSION, 16, 5, 16, 5}, {ODK_MAJOR_VERSION, 17, 1, 17, 1}, {ODK_MAJOR_VERSION, 17, 2, 17, 2}, - {ODK_MAJOR_VERSION, 18, 0, 18, 0}, + {ODK_MAJOR_VERSION, 18, 1, 18, 1}, + {ODK_MAJOR_VERSION, 18, 2, 18, 2}, + {ODK_MAJOR_VERSION, 18, 3, 18, 3}, {0, 16, 3, 16, 3}, {0, 16, 4, 16, 4}, {0, 16, 5, 16, 5}, {0, 17, 1, 17, 1}, {0, 17, 2, 17, 2}, - {0, 18, 0, 17, 2}, // Change to 18 when the default version is updated. + {0, 18, 3, 18, 3}, // Change to 19 when the default version is updated. }; return test_cases; } @@ -1143,7 +1256,11 @@ TEST(OdkSizeTest, LicenseRequest) { &core_message_length, &nonce_values, &counter_info)); // the core_message_length should be appropriately set - EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE, core_message_length); + if (nonce_values.api_major_version > 17) { + EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE, core_message_length); + } else { + EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE_V17, core_message_length); + } } TEST(OdkSizeTest, RenewalRequest) { @@ -1207,7 +1324,11 @@ TEST(OdkSizeTest, ProvisioningRequest) { &core_message_length, &nonce_values, &counter_info)); // the core_message_length should be appropriately set - EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE, core_message_length); + if (nonce_values.api_major_version > 17) { + EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE, core_message_length); + } else { + EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE_V17, core_message_length); + } } // Verify the version string contains the right version numbers. @@ -1221,6 +1342,37 @@ TEST(OdkTest, CheckReleaseVersion) { << "Version mismatch in odk_structs.h"; } +TEST(OdkOverflowTest, SubtractU64) { + uint64_t result = 0; + EXPECT_FALSE(odk_sub_overflow_u64(10, 5, &result)); + EXPECT_EQ(result, static_cast(10 - 5)); + EXPECT_TRUE(odk_sub_overflow_u64(5, 10, &result)); +} + +TEST(OdkOverflowTest, AddU64) { + uint64_t result = 0; + EXPECT_FALSE(odk_add_overflow_u64(2, 2, &result)); + EXPECT_EQ(result, static_cast(2 + 2)); + EXPECT_TRUE(odk_add_overflow_u64(0xffffffffffffffff, 1, &result)); + EXPECT_TRUE(odk_add_overflow_u64(1, 0xffffffffffffffff, &result)); +} + +TEST(OdkOverflowTest, AddUX) { + size_t result = 0; + EXPECT_FALSE(odk_add_overflow_ux(2, 2, &result)); + EXPECT_EQ(result, static_cast(2 + 2)); + EXPECT_TRUE(odk_add_overflow_ux(SIZE_MAX, 1, &result)); + EXPECT_TRUE(odk_add_overflow_ux(1, SIZE_MAX, &result)); +} + +TEST(OdkOverflowTest, MultiplyUX) { + size_t result = 0; + EXPECT_FALSE(odk_mul_overflow_ux(2, 7, &result)); + EXPECT_EQ(result, static_cast(2 * 7)); + EXPECT_TRUE(odk_mul_overflow_ux(SIZE_MAX >> 1, 4, &result)); + EXPECT_TRUE(odk_mul_overflow_ux(4, SIZE_MAX >> 1, &result)); +} + } // namespace } // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_test.gypi b/oemcrypto/odk/test/odk_test.gypi index 0cb8a00..1b5c5e7 100644 --- a/oemcrypto/odk/test/odk_test.gypi +++ b/oemcrypto/odk/test/odk_test.gypi @@ -4,6 +4,9 @@ { 'sources': [ + 'odk_golden_v16.cpp', + 'odk_golden_v17.cpp', + 'odk_golden_v18.cpp', 'odk_test.cpp', 'odk_test_helper.cpp', 'odk_test_helper.h', diff --git a/oemcrypto/opk/build/ree-sources.mk b/oemcrypto/opk/build/ree-sources.mk index a589520..307dc46 100644 --- a/oemcrypto/opk/build/ree-sources.mk +++ b/oemcrypto/opk/build/ree-sources.mk @@ -211,7 +211,9 @@ oemcrypto_unittests_sources += \ $(oemcrypto_unittests_dir)/oemcrypto_corpus_generator_helper.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_session_tests_helper.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_basic_test.cpp \ + $(oemcrypto_unittests_dir)/oemcrypto_cast_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_decrypt_test.cpp \ + $(oemcrypto_unittests_dir)/oemcrypto_generic_crypto_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_license_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_provisioning_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_usage_table_test.cpp \ diff --git a/oemcrypto/opk/build/tee-sources.mk b/oemcrypto/opk/build/tee-sources.mk index 38123d8..9f96daf 100644 --- a/oemcrypto/opk/build/tee-sources.mk +++ b/oemcrypto/opk/build/tee-sources.mk @@ -109,6 +109,7 @@ wtpi_serialization_tee_includes += \ serialization_tee_sources += \ $(serialization_dir)/tee/GEN_dispatcher.c \ $(serialization_dir)/tee/GEN_tee_serializer.c \ + $(serialization_dir)/tee/special_case_request_handlers.c \ $(serialization_dir)/tee/tee_special_cases.c \ $(serialization_dir)/tee/tee_os_type.c \ $(serialization_dir)/tee/tee_version.c \ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto.c index afa83c2..79b5125 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto.c @@ -88,13 +88,14 @@ static OEMCryptoResult FreeContentAndEntitlementKeys( "OEMCrypto is not yet initialized"); ABORT_IF_NULL(session); OEMCryptoResult result = OEMCrypto_SUCCESS; - OEMCryptoResult free_key_result = result; for (size_t i = 0; i < session->num_content_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->content_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->content_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; } for (size_t i = 0; i < session->num_entitlement_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->entitlement_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->entitlement_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; } session->num_content_keys = 0; @@ -108,9 +109,9 @@ static OEMCryptoResult FreeEntitledContentKeys( "OEMCrypto is not yet initialized"); ABORT_IF_NULL(session); OEMCryptoResult result = OEMCrypto_SUCCESS; - OEMCryptoResult free_key_result = result; for (size_t i = 0; i < session->num_entitled_content_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->entitled_content_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->entitled_content_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; session->entitlement_keys[i] = (EntitlementKeyInfo){0}; } @@ -182,6 +183,7 @@ cleanup:; // TODO(b/225216277): When result is not OEMCrypto_ERROR_NOT_IMPLEMENTED // above, uncomment this check // if (result == OEMCrypto_SUCCESS) + // NOLINTNEXTLINE result = free_key_result; free_key_result = FreeMacAndEncryptionKeys(session_context); // TODO(b/225216277): When result is not OEMCrypto_ERROR_NOT_IMPLEMENTED @@ -280,7 +282,7 @@ static OEMCryptoResult RewrapDeviceDRMKeyCommon(OEMCryptoSession* session, return result; } -static OEMCryptoResult RewrapDeviceDRMKeyKeybox( +static OEMCryptoResult RewrapDeviceDRMKey( OEMCryptoSession* session_context, const uint8_t* message, size_t message_length, const uint8_t* signature, size_t signature_length, const uint8_t* enc_drm_key, size_t enc_drm_key_length, @@ -288,8 +290,17 @@ static OEMCryptoResult RewrapDeviceDRMKeyKeybox( uint8_t* wrapped_drm_key, size_t wrapped_drm_key_length) { ABORT_IF(g_opk_system_state != SYSTEM_INITIALIZED, "OEMCrypto is not yet initialized"); - ABORT_IF(WTPI_GetProvisioningMethod() != OEMCrypto_Keybox, - "This function is only valid on Provisioning 2.0 devices"); + const bool is_prov_2 = (WTPI_GetProvisioningMethod() == OEMCrypto_Keybox); + const bool is_prov_4 = + (WTPI_GetProvisioningMethod() == OEMCrypto_BootCertificateChain); + const bool supports_cast = + ((WTPI_SupportedCertificates() & OEMCrypto_Supports_RSA_CAST) != 0); + + // this function is for Prov 2 devices, or Prov 4 with cast + const bool can_continue = is_prov_2 || (is_prov_4 && supports_cast); + ABORT_IF(!can_continue, + "This function is only valid on Provisioning 2.0 devices, or " + "Provisioning 4.0 devices that support Cast"); ABORT_IF_NULL(session_context); ABORT_IF_NULL(message); @@ -458,7 +469,6 @@ OEMCryptoResult OEMCrypto_Initialize(void) { // provisioned with a keybox. In that case, we log the error and continue. // A production system will fail later on when it tries to validate the // keybox. - result = OEMCrypto_SUCCESS; } OPKI_InitializeSessionTable(); @@ -648,7 +658,7 @@ OEMCryptoResult OEMCrypto_GenerateDerivedKeys(OEMCrypto_SESSION session, LOGE("Failed to derive mac and encryption keys from keybox with result: %u", result); } -cleanup : { +cleanup: { OEMCryptoResult free_key_result = WTPI_K1_FreeKeyHandle(keybox_key); if (result == OEMCrypto_SUCCESS) result = free_key_result; if (result != OEMCrypto_SUCCESS) { @@ -1226,7 +1236,7 @@ static OEMCryptoResult LoadKeysNoSignature( } if (crypto_memcmp(message + srm_restriction_data.offset, kSrmVerification, - sizeof(kSrmVerification))) { + sizeof(kSrmVerification)) != 0) { LOGE("SRM verification failed"); return OEMCrypto_ERROR_INVALID_CONTEXT; } @@ -1465,100 +1475,6 @@ OEMCryptoResult OEMCrypto_LoadLicense(OEMCrypto_SESSION session, return OPKI_SetStatePostCall(session_context, API_LOADLICENSE); } -OEMCryptoResult OEMCrypto_LoadKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const uint8_t* signature, size_t signature_length, - OEMCrypto_Substring enc_mac_keys_iv, OEMCrypto_Substring enc_mac_keys, - size_t key_array_length, const OEMCrypto_KeyObject* key_array, - OEMCrypto_Substring pst, OEMCrypto_Substring srm_restriction_data, - OEMCrypto_LicenseType license_type) { - if (g_opk_system_state != SYSTEM_INITIALIZED) { - LOGE("OEMCrypto is not yet initialized"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - if (OPKI_GetSessionType(session) != SESSION_TYPE_OEMCRYPTO) { - LOGE("Unexpected session type."); - return OEMCrypto_ERROR_INVALID_SESSION; - } - OEMCryptoSession* session_context = NULL; - OEMCryptoResult result = OPKI_GetSession(session, &session_context); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get session with result: %u, session = %u", result, - session); - return result; - } - ABORT_IF(session_context == NULL, - "OPKI_GetSession() provided invalid output."); - result = OPKI_CheckStatePreCall(session_context, API_LOADKEYS); - if (result != OEMCrypto_SUCCESS) return result; - - RETURN_INVALID_CONTEXT_IF_NULL(message); - RETURN_INVALID_CONTEXT_IF_ZERO(message_length); - RETURN_INVALID_CONTEXT_IF_NULL(signature); - if (signature_length != SHA256_DIGEST_LENGTH) { - LOGE("signature_length is not the length of a SHA256 digest"); - return OEMCrypto_ERROR_SIGNATURE_FAILURE; - } - RETURN_INVALID_CONTEXT_IF_NULL(key_array); - RETURN_INVALID_CONTEXT_IF_ZERO(key_array_length); - - if (license_type != OEMCrypto_ContentLicense && - license_type != OEMCrypto_EntitlementLicense) { - LOGE("Invalid license type: %u", license_type); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - /* Check state before we check signature. State is change in - * LoadKeysNoSignature. */ - if (session_context->response_loaded) { - return OEMCrypto_ERROR_LICENSE_RELOAD; - } - - result = OPKI_VerifySignatureWithMacKeyServer(session_context, message, - message_length, signature); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to verify signature with server mac key, error: %u", result); - return result; - } - - result = LoadKeysNoSignature( - session_context, message, message_length, enc_mac_keys_iv, enc_mac_keys, - key_array_length, key_array, pst, srm_restriction_data, license_type); - if (result != OEMCrypto_SUCCESS) return result; - - /* Update clock values using the duration for the loaded key. */ - SymmetricKey* key = NULL; - const int kIndex = 0; - switch (session_context->license_type) { - case OEMCrypto_ContentLicense: - if (session_context->num_content_keys == 0) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - key = session_context->content_keys[kIndex]; - break; - case OEMCrypto_EntitlementLicense: - if (session_context->num_entitlement_keys == 0) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - key = session_context->entitlement_keys[kIndex]; - break; - default: - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - const uint32_t duration = key ? key->key_control_block.duration : 0; - uint64_t now; - result = WTPI_GetTrustedTime(&now); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get trusted time with result: %u", result); - return result; - } - result = ODK_InitializeV15Values( - &session_context->timer_limits, &session_context->clock_values, - &session_context->nonce_values, duration, now); - if (result != OEMCrypto_SUCCESS) return result; - return OPKI_SetStatePostCall(session_context, API_LOADKEYS); -} - OEMCryptoResult OEMCrypto_LoadEntitledContentKeys( OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, size_t key_array_length, @@ -1611,7 +1527,6 @@ OEMCryptoResult OEMCrypto_LoadEntitledContentKeys( } } - result = OEMCrypto_SUCCESS; for (size_t i = 0; i < key_array_length; i++) { const OEMCrypto_EntitledContentKeyObject key_object = key_array[i]; SymmetricKey* entitlement_key = OPKI_FindKeyFromTable( @@ -1769,87 +1684,6 @@ OEMCryptoResult OEMCrypto_LoadRenewal(OEMCrypto_SESSION session, return result; } -OEMCryptoResult OEMCrypto_RefreshKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const uint8_t* signature, size_t signature_length, size_t key_array_length, - const OEMCrypto_KeyRefreshObject* key_array) { - if (g_opk_system_state != SYSTEM_INITIALIZED) { - LOGE("OEMCrypto is not yet initialized"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - if (OPKI_GetSessionType(session) != SESSION_TYPE_OEMCRYPTO) { - LOGE("Unexpected session type."); - return OEMCrypto_ERROR_INVALID_SESSION; - } - OEMCryptoSession* session_context = NULL; - OEMCryptoResult result = OPKI_GetSession(session, &session_context); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get session with result: %u, session = %u", result, - session); - return result; - } - ABORT_IF(session_context == NULL, - "OPKI_GetSession() provided invalid output."); - result = OPKI_CheckStatePreCall(session_context, API_REFRESHKEYS); - if (result != OEMCrypto_SUCCESS) return result; - - RETURN_INVALID_CONTEXT_IF_NULL(message); - RETURN_INVALID_CONTEXT_IF_ZERO(message_length); - RETURN_INVALID_CONTEXT_IF_NULL(signature); - if (signature_length != SHA256_DIGEST_LENGTH) { - LOGE("signature_length is not the length of a SHA256 digest"); - return OEMCrypto_ERROR_SIGNATURE_FAILURE; - } - RETURN_INVALID_CONTEXT_IF_NULL(key_array); - RETURN_INVALID_CONTEXT_IF_ZERO(key_array_length); - - /* We only use the first key object to update the entire license. Since we - * know num_keys > 0 after the last if statement, we can assume index is not - * out of bounds. */ - static const size_t kIndex = 0; - if (!IsSubstrInRange(message_length, key_array[kIndex].key_id, true) || - !IsSubstrInRange(message_length, key_array[kIndex].key_control, false) || - !IsSubstrInRange(message_length, key_array[kIndex].key_control_iv, - true) || - key_array[kIndex].key_id.length > KEY_ID_MAX_SIZE || - key_array[kIndex].key_control.length < KEY_CONTROL_SIZE || - (key_array[kIndex].key_control_iv.length != 0 && - key_array[kIndex].key_control_iv.length != KEY_IV_SIZE)) { - LOGE("Invalid substring range for key: %zu", kIndex); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - if (!session_context->refresh_valid) { - LOGE("Invalid key refresh"); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - result = OPKI_VerifySignatureWithMacKeyServer(session_context, message, - message_length, signature); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to verify signature with server mac key, error: %u", result); - return result; - } - - result = OEMCrypto_SUCCESS; - const uint8_t* key_id = NULL; - const uint8_t* key_control_iv = NULL; - if (key_array[kIndex].key_id.length != 0) { - key_id = message + key_array[kIndex].key_id.offset; - } - if (key_array[kIndex].key_control_iv.length != 0) { - key_control_iv = message + key_array[kIndex].key_control_iv.offset; - } - result = OPKI_RefreshKey( - session_context, key_id, key_array[kIndex].key_id.length, - message + key_array[kIndex].key_control.offset, key_control_iv); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to refresh key with result: %u", result); - return result; - } - return OPKI_SetStatePostCall(session_context, API_REFRESHKEYS); -} - OEMCryptoResult OEMCrypto_QueryKeyControl(OEMCrypto_SESSION session, const uint8_t* content_key_id, size_t content_key_id_length, @@ -2144,10 +1978,10 @@ OEMCryptoResult OEMCrypto_CopyBuffer( LOGE("OEMCrypto is not yet initialized"); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } + if (data_length == 0) return OEMCrypto_SUCCESS; /* We don't need to check the session, CopyBuffer should be allowed for all session states since it doesn't access any state data. */ RETURN_INVALID_CONTEXT_IF_NULL(data_addr); - RETURN_INVALID_CONTEXT_IF_ZERO(data_length); RETURN_INVALID_CONTEXT_IF_NULL(dest_buffer_desc); OEMCryptoResult result; @@ -2499,8 +2333,24 @@ OEMCryptoResult OEMCrypto_WrapKeyboxOrOEMCert( OEMCryptoResult OEMCrypto_InstallKeyboxOrOEMCert(const uint8_t* keybox, size_t length) { +// This API is only allowed in factory mode. +#ifdef FACTORY_BUILD_ONLY // TODO(b/225216277): We currently only support keyboxes. return WTPI_UnwrapValidateAndInstallKeybox(keybox, length); +#else + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#endif +} + +OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature(const uint8_t* signature, + size_t signature_length) { +// This API is only allowed in factory mode. +#ifdef FACTORY_BUILD_ONLY + // TODO: add implementation. + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#else + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#endif } OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(void) { @@ -2694,8 +2544,6 @@ OEMCryptoResult OEMCrypto_BuildInformation(char* buffer, XSTR(OPK_CONFIG_CAN_DISABLE_ANALOG_DISPLAY)"\"," "\"OPK_CONFIG_MAX_HDCP_CAPABILITY\":\"" XSTR(OPK_CONFIG_MAX_HDCP_CAPABILITY)"\"," - "\"OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT\":\"" - XSTR(OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT)"\"," "\"OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT\":\"" XSTR(OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT)"\"," "\"OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO\":\"" @@ -3052,6 +2900,10 @@ OEMCryptoResult OEMCrypto_LoadProvisioning( LOGE("Encrypted private key length is too large to handle."); return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (parsed_response.enc_private_key.length == 0) { + LOGE("Encrypted private key length is zero."); + return OEMCrypto_ERROR_INVALID_CONTEXT; + } if (parsed_response.enc_private_key_iv.length != KEY_IV_SIZE) { LOGE("Encrypted private key iv has invalid length: %zu", parsed_response.enc_private_key_iv.length); @@ -3077,8 +2929,11 @@ OEMCryptoResult OEMCrypto_LoadProvisioning( const uint8_t* message_body = message + core_message_length; const OEMCrypto_ProvisioningMethod provisioning_method = WTPI_GetProvisioningMethod(); - if (provisioning_method == OEMCrypto_Keybox) { - result = RewrapDeviceDRMKeyKeybox( + + // RewrapDeviceDRMKey only intended for Prov 4 with cast, or Prov 2. + if (provisioning_method == OEMCrypto_Keybox || + provisioning_method == OEMCrypto_BootCertificateChain) { + result = RewrapDeviceDRMKey( session_context, message, message_length, signature, signature_length, message_body + parsed_response.enc_private_key.offset, parsed_response.enc_private_key.length, @@ -3862,11 +3717,73 @@ OEMCryptoResult OEMCrypto_ReassociateEntitledKeySession( OEMCryptoSession* entitlement_session_context = NULL; /* entitlement_session must be present to be associated to. */ result = OPKI_GetSession(entitlement_session, &entitlement_session_context); - if (result != OEMCrypto_SUCCESS || entitlement_session_context == NULL) { + if (result != OEMCrypto_SUCCESS) { LOGE("Failed to get session with result: %u, session = %u", result, entitlement_session); return result; } + /* Validations to be done before re-associating an entitled key session to a + * new entitlement session: + * 1. at least one entitled key is supposed to have its entitlement key found + * in the new session + * 2. for any entitled key, if its entitlement key is found in the new + * session, then the key control block should remain unchanged in the new + * session, compared to the one in the existing entitlement session */ + bool key_found = false; + for (uint32_t i = 0; i < key_session_context->num_entitled_content_keys; + i++) { + /* Gets the entitlement key info that the current entitled key associates + * with. */ + const EntitlementKeyInfo* key_info = + &key_session_context->entitlement_keys[i]; + /* Finds the entitlement key in the new entitlement session. It is ok if an + * entitled key doesn't have an entitlement key in the new entitlement + * session. The entitled key will be ignored in this case. */ + for (uint32_t k = 0; k < entitlement_session_context->num_entitlement_keys; + k++) { + const SymmetricKey* entitlement_key = + entitlement_session_context->entitlement_keys[k]; + if (key_info->entitlement_key_id_size == entitlement_key->key_id_size && + memcmp(key_info->entitlement_key_id, entitlement_key->key_id, + key_info->entitlement_key_id_size) == 0) { + /* Found at least one entitlement key in new session. */ + key_found = true; + /* Get the existing entitlement session to which the key session is + * currently associated. */ + OEMCryptoSession* old_entitlement_session_context = NULL; + result = OPKI_GetSession(key_session_context->entitlement_session_id, + &old_entitlement_session_context); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to get session with result: %u, session = %u", result, + key_session_context->entitlement_session_id); + return result; + } + SymmetricKey* old_entitlement_key = NULL; + result = OPKI_GetEntitlementKey( + old_entitlement_session_context, key_info->entitlement_key_id, + key_info->entitlement_key_id_size, &old_entitlement_key); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to get session entitlement key with result: %u", result); + return result; + } + /* Make sure the key control block is not changed. */ + const KeyControlBlock* control_block = + &entitlement_key->key_control_block; + const KeyControlBlock* old_control_block = + &old_entitlement_key->key_control_block; + if (control_block->control_bits != old_control_block->control_bits || + control_block->duration != old_control_block->duration) { + return OEMCrypto_ERROR_INVALID_SESSION; + } + break; + } + } // loop entitlement keys + } // loop entitled keys + if (!key_found) { + LOGE("Failed to find entitlement keys in session = %u", + entitlement_session); + return OEMCrypto_ERROR_INVALID_SESSION; + } key_session_context->entitlement_session_id = entitlement_session; return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h b/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h index 02a74e1..f178463 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h @@ -34,7 +34,7 @@ // version bumps to v17.1, the first released OPK implementation would be // v17.1.0 #define API_MAJOR_VERSION 18 -#define API_MINOR_VERSION 1 +#define API_MINOR_VERSION 3 #define OPK_PATCH_VERSION 0 #endif /* OEMCRYPTO_TA_OEMCRYPTO_API_MACROS_H_ */ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c index ae83ae4..d70952e 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c @@ -31,21 +31,18 @@ OEMCryptoResult OPKI_ParseKeyControlBlock(const uint8_t* kcb, key_control_block.control_bits = extract_field_from_KCB(kcb, 3); const char* verification = key_control_block.verification; - if (memcmp(verification, "kc18", 4) && /* add in version 18 api */ - memcmp(verification, "kc17", 4) && /* add in version 17 api */ - memcmp(verification, "kc16", 4) && /* add in version 16 api */ - memcmp(verification, "kc15", 4) && /* add in version 15 api */ - memcmp(verification, "kc14", 4) && /* add in version 14 api */ - memcmp(verification, "kc13", 4) && /* add in version 13 api */ - memcmp(verification, "kc12", 4) && /* add in version 12 api */ - memcmp(verification, "kc11", 4) && /* add in version 11 api */ - memcmp(verification, "kc10", 4) && /* add in version 10 api */ - memcmp(verification, "kc09", 4) && /* add in version 9 api */ - memcmp(verification, "kctl", 4)) { /* original verification */ - key_control_block.valid = false; - } else { - key_control_block.valid = true; - } + key_control_block.valid = + memcmp(verification, "kc18", 4) == 0 || /* add in version 18 api */ + memcmp(verification, "kc17", 4) == 0 || /* add in version 17 api */ + memcmp(verification, "kc16", 4) == 0 || /* add in version 16 api */ + memcmp(verification, "kc15", 4) == 0 || /* add in version 15 api */ + memcmp(verification, "kc14", 4) == 0 || /* add in version 14 api */ + memcmp(verification, "kc13", 4) == 0 || /* add in version 13 api */ + memcmp(verification, "kc12", 4) == 0 || /* add in version 12 api */ + memcmp(verification, "kc11", 4) == 0 || /* add in version 11 api */ + memcmp(verification, "kc10", 4) == 0 || /* add in version 10 api */ + memcmp(verification, "kc09", 4) == 0 || /* add in version 9 api */ + memcmp(verification, "kctl", 4) == 0; /* original verification */ *out = key_control_block; return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c index cdedc97..c4e7f77 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c @@ -52,7 +52,6 @@ OEMCryptoResult OPK_ParseDestBufferDesc( OEMCryptoResult OPK_CheckOutputBounds(const OPK_OutputBuffer* output_buffer, size_t offset, size_t size) { ABORT_IF_NULL(output_buffer); - ABORT_IF_ZERO(size); ABORT_IF(!OPK_IsOutputBufferValid(output_buffer), "Invalid output buffer."); const size_t max_allowed = WTPI_MaxOutputSizeForDecrypt(); diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c index 251ed2e..27d2511 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c @@ -60,4 +60,14 @@ bool OPK_SubOverflowUX(size_t a, size_t b, size_t* c) { return true; } +bool OPK_AddOverflowUintptr(uintptr_t a, uintptr_t b, uintptr_t* c) { + if (UINTPTR_MAX - a >= b) { + if (c) { + *c = a + b; + } + return false; + } + return true; +} + #endif diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h index ab0b98c..2912678 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h @@ -48,6 +48,12 @@ NO_IGNORE_RESULT static inline bool OPK_SubOverflowUX(size_t a, size_t b, return __builtin_sub_overflow(a, b, c); } +NO_IGNORE_RESULT static inline bool OPK_AddOverflowUintptr(uintptr_t a, + uintptr_t b, + uintptr_t* c) { + return __builtin_add_overflow(a, b, c); +} + #else /* The builtins are not available, so use our implementations. */ @@ -56,6 +62,8 @@ NO_IGNORE_RESULT bool OPK_SubOverflowU32(uint32_t a, uint32_t b, uint32_t* c); NO_IGNORE_RESULT bool OPK_SubOverflowU64(uint64_t a, uint64_t b, uint64_t* c); NO_IGNORE_RESULT bool OPK_AddOverflowUX(size_t a, size_t b, size_t* c); NO_IGNORE_RESULT bool OPK_SubOverflowUX(size_t a, size_t b, size_t* c); +NO_IGNORE_RESULT bool OPK_AddOverflowUintptr(uintptr_t a, uintptr_t b, + uintptr_t* c); #endif /* __has_builtin(__builtin_add_overflow) || COMPATIBLE_WITH_GCC(5) */ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c index 36828a4..32bcb0c 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c @@ -156,6 +156,7 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case (SESSION_OPENED): case (SESSION_INSTALL_OEM_PRIVATE_KEY): case (SESSION_PREPARING_REQUEST): + case (SESSION_LOAD_DRM_RSA_KEY): case (SESSION_LOAD_OEM_RSA_KEY): return OEMCrypto_SUCCESS; default: @@ -174,6 +175,7 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, } case API_LOADPROVISIONING: switch (session->state) { + case (SESSION_LOAD_DRM_RSA_KEY): case (SESSION_WAIT_FOR_PROVISIONING): return OEMCrypto_SUCCESS; default: @@ -192,6 +194,8 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case (SESSION_OPENED): case (SESSION_PREPARING_REQUEST): case (SESSION_USAGE_ENTRY_LOADED): + // Prov 4 OEM private key installed at beginning of session + case (SESSION_INSTALL_OEM_PRIVATE_KEY): // Provisioning 4 skips LoadProvisioning case (SESSION_WAIT_FOR_PROVISIONING): // This can happen when using testing the CDM with a pre-provisioned @@ -319,6 +323,9 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case API_MOVEENTRY: switch (session->state) { case (SESSION_USAGE_ENTRY_LOADED): + case (SESSION_OPENED): + case (SESSION_WAIT_FOR_LICENSE): + case (SESSION_LOAD_DRM_RSA_KEY): return OEMCrypto_SUCCESS; default: goto err; @@ -1159,8 +1166,7 @@ OEMCryptoResult OPKI_EnforceOutputRestrictions(KeyControlBlock control) { const uint8_t required_hdcp = (control.control_bits & CONTROL_HDCP_VERSION_MASK) >> CONTROL_HDCP_VERSION_SHIFT; - if (!IsHdcpLevelSufficient(required_hdcp, capability) || - capability == HDCP_NONE) { + if (!IsHdcpLevelSufficient(required_hdcp, capability)) { return OEMCrypto_ERROR_INSUFFICIENT_HDCP; } } @@ -1333,12 +1339,14 @@ NO_IGNORE_RESULT static OEMCryptoResult ComputeDecryptHash( return result; } } - result = WTPI_Crc32Cont_OutputBuffer( - output_buffer, current_offset, subsample_length, - decrypt_hash->current_hash, &decrypt_hash->current_hash); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to compute CRC32 with result: %u", result); - return result; + if (subsample_length > 0) { + result = WTPI_Crc32Cont_OutputBuffer( + output_buffer, current_offset, subsample_length, + decrypt_hash->current_hash, &decrypt_hash->current_hash); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to compute CRC32 with result: %u", result); + return result; + } } if (OEMCrypto_LastSubsample & subsample->subsample_flags) { if (decrypt_hash->current_hash != decrypt_hash->given_hash) { diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c index 075cce5..676843c 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c @@ -156,7 +156,7 @@ NO_IGNORE_RESULT static OEMCryptoResult EncryptAndSignHeader( .buffer_size = sizeof(signed_header.buffer), .buffer = {0}, }; - uint8_t temp_buffer[PADDED_HEADER_BUFFER_SIZE]; + uint8_t temp_buffer[PADDED_HEADER_BUFFER_SIZE] = {0}; OEMCryptoResult result = OPKI_PackUsageHeader(temp_buffer, sizeof(temp_buffer), &header); if (result != OEMCrypto_SUCCESS) return result; @@ -312,7 +312,7 @@ NO_IGNORE_RESULT static OEMCryptoResult EncryptAndSignEntry( .buffer_size = sizeof(signed_entry.buffer), .buffer = {0}, }; - uint8_t temp_buffer[PADDED_ENTRY_BUFFER_SIZE]; + uint8_t temp_buffer[PADDED_ENTRY_BUFFER_SIZE] = {0}; OEMCryptoResult result = OPKI_PackUsageEntry(temp_buffer, sizeof(temp_buffer), entry); if (result != OEMCrypto_SUCCESS) return result; @@ -922,7 +922,7 @@ OEMCryptoResult OPKI_VerfiyUsageEntryPST(OEMCrypto_SESSION session_id, return OEMCrypto_ERROR_UNKNOWN_FAILURE; } if (entry->data.pst_length != pst_length || - crypto_memcmp(entry->data.pst, pst, pst_length)) { + crypto_memcmp(entry->data.pst, pst, pst_length) != 0) { return OEMCrypto_ERROR_WRONG_PST; } return OEMCrypto_SUCCESS; @@ -994,9 +994,9 @@ OEMCryptoResult OPKI_VerifyUsageEntryMacKeys( return result; } if (crypto_memcmp(entry->data.mac_key_server, wrapped_server_mac, - WRAPPED_MAC_KEY_SIZE) || + WRAPPED_MAC_KEY_SIZE) != 0 || crypto_memcmp(entry->data.mac_key_client, wrapped_client_mac, - WRAPPED_MAC_KEY_SIZE)) { + WRAPPED_MAC_KEY_SIZE) != 0) { return OEMCrypto_ERROR_WRONG_PST; } return OEMCrypto_SUCCESS; @@ -1066,7 +1066,7 @@ OEMCryptoResult OPKI_ReportUsage(OEMCrypto_SESSION session_id, pst_length != entry->data.pst_length) { return OEMCrypto_ERROR_WRONG_PST; } - if (crypto_memcmp(entry->data.pst, pst, pst_length)) { + if (crypto_memcmp(entry->data.pst, pst, pst_length) != 0) { return OEMCrypto_ERROR_WRONG_PST; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h index 7a1d416..af02c0d 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h @@ -104,20 +104,6 @@ OEMCryptoResult WTPI_GetCurrentSRMVersion(uint32_t* srm_version); */ bool WTPI_IsAntiRollbackHWPresent(void); -/** - * Returns whether or not the device was able to apply the CGMS protection for - * the device. The |cgms_field| correlates to those under the Key Control Block - * description in the OEMCrypto doc. If the cgms_field is invalid, return - * OEMCrypto_ERROR_UNKNOWN_FAILURE. Even if this function is not called, the - * device should attempt best effort for CGMS. - * - * @param[in] cgms_field: CGMS control bits. - * - * @retval OEMCrypto_SUCCESS - * @retval OEMCrypto_ERROR_UNKNOWN_FAILURE - */ -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field); - /** * Returns whether CGMS is enabled for analog output for this device. */ @@ -150,12 +136,6 @@ bool WTPI_CanDisableAnalogDisplay(void); */ bool WTPI_DisableAnalogDisplay(void); -/** - * Returns the max buffer size/max subsample size in bytes allowed for - * DecryptCENC. If there is no restriction, returns 0. - */ -size_t WTPI_MaxBufferSizeForDecrypt(void); - /** * Returns the max output size in bytes allowed for DecryptCENC and CopyBuffer. * If there is no restriction, returns 0. diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h index 54bddae..d1ad420 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h @@ -29,6 +29,20 @@ extern "C" { */ /** Returns the device unique key. + * + * The device key is a secret array of bytes that is unique per individual + * device (not just device family) and persistent across reboots. It must + * never leave the device. It is used to encrypt and decrypt the usage table + * and the DRM key. + * + * In case of a security flaw that exposes the device key, the device key + * should be renewed or regenerated as part of the security fix. + * + * For Provisioning 2, the device key is a 128-bit AES key that is part of the + * keybox. + * + * For Provisioning 4, the device key should be derived from a unique device + * secret. * * @return The device unique key. * */ diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h index 8128b40..f4ef821 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h @@ -140,17 +140,6 @@ # define OPK_CONFIG_MAX_HDCP_CAPABILITY HDCP_NO_DIGITAL_OUTPUT #endif -/** - * Maximum buffer size for DecryptCENC input in bytes. - * - * 0 means no limit. - * - * Type is size_t - */ -#ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT -# define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT 0 -#endif - /** * Maximum output size in bytes allowed for DecryptCENC. * diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c index 57f3fc5..59de36e 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c @@ -244,7 +244,7 @@ static DiceResult EncodeCoseSign1(const uint8_t* protected_attributes, // Payload. CborWriteBstr(payload_size, payload, &out); // Signature. - CborWriteBstr(/*num_elements=*/signature_size, signature, &out); + CborWriteBstr(/*data_size=*/signature_size, signature, &out); if (CborOutOverflowed(&out)) { return kDiceResultBufferTooSmall; } @@ -321,7 +321,7 @@ OEMCryptoResult DiceCoseSignAndEncodeSign1(const uint8_t* payload, #endif // CSR is defined in: -// https://source.corp.google.com/android/hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl +// https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl #define CSR_PAYLOAD_MAX_LENGTH 2048 // The max length of a string field in device CBOR map @@ -332,22 +332,22 @@ OEMCryptoResult DiceCoseSignAndEncodeSign1(const uint8_t* payload, // Device info is defined in: // https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl typedef struct { - // TSTR fields with DEVICE_TSTR_MAX_LENGTH need an extra space for null - // termination + // TSTR fields with DEVICE_TSTR_MAX_LENGTH or DEVICE_TSTR_SHORT_MAX_LENGTH + // need an extra space for null termination char brand[DEVICE_TSTR_MAX_LENGTH + 1]; char manufacturer[DEVICE_TSTR_MAX_LENGTH + 1]; char product[DEVICE_TSTR_MAX_LENGTH + 1]; char model[DEVICE_TSTR_MAX_LENGTH + 1]; char device[DEVICE_TSTR_MAX_LENGTH + 1]; - char vb_state[DEVICE_TSTR_SHORT_MAX_LENGTH]; - char bootloader_state[DEVICE_TSTR_SHORT_MAX_LENGTH]; + char vb_state[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; + char bootloader_state[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; uint8_t vbmeta_digest[64]; size_t vbmeta_digest_size; char os_version[DEVICE_TSTR_MAX_LENGTH + 1]; uint64_t system_patch_level; uint64_t boot_patch_level; uint64_t vendor_patch_level; - char security_level[DEVICE_TSTR_SHORT_MAX_LENGTH]; + char security_level[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; int64_t fused; } DeviceInfo; @@ -474,8 +474,7 @@ static OEMCryptoResult DecodeAndWriteDeviceInfo( const size_t kNumPairs = 14; OEMCryptoResult result = OEMCrypto_SUCCESS; - DeviceInfo deviceInfo; - memset(&deviceInfo, 0, sizeof(deviceInfo)); + DeviceInfo deviceInfo = {0}; for (size_t i = 0; i < item_count; ++i) { const char* raw_key; size_t key_size = 0; @@ -549,61 +548,69 @@ static OEMCryptoResult DecodeAndWriteDeviceInfo( // Write the decoded device info map. CborWriteMap(kNumPairs, cbor_csr_out); - // Write key-values in canonical order: - // boot_patch_level - // bootloader_state - // brand - // device - // fused - // manufacturer - // model - // os_version - // product - // security_level - // system_patch_level - // vb_state - // vbmeta_digest - // vendor_patch_level + // Write key-values in canonical order, which is required when the device info + // map is validated by the server. Current CBOR C library doesn't provide + // canonicalize(). Pairs are manually added to the map following CBOR map + // canonicalization rules below: + // 1. If two keys have different lengths, the shorter one sorts earlier. + // 2. If two keys have the same length, the one with the lower value in + // (byte-wise) lexical order sorts earlier. + // + // brand: 5 + // fused: 5 + // model: 5 + // device: 6 + // product: 7 + // vb_state: 8 + // os_version: 10 + // manufacturer: 12 + // vbmeta_digest: 13 + // security_level: 14 + // boot_patch_level: 16 + // bootloader_state: 16 + // system_patch_level: 18 + // vendor_patch_level: 18 + + CborWriteTstr(kBrand, cbor_csr_out); + CborWriteTstr(deviceInfo.brand, cbor_csr_out); + + CborWriteTstr(kFused, cbor_csr_out); + CborWriteInt(deviceInfo.fused, cbor_csr_out); + + CborWriteTstr(kModel, cbor_csr_out); + CborWriteTstr(deviceInfo.model, cbor_csr_out); + + CborWriteTstr(kDevice, cbor_csr_out); + CborWriteTstr(deviceInfo.device, cbor_csr_out); + + CborWriteTstr(kProduct, cbor_csr_out); + CborWriteTstr(deviceInfo.product, cbor_csr_out); + + CborWriteTstr(kVbState, cbor_csr_out); + CborWriteTstr(deviceInfo.vb_state, cbor_csr_out); + + CborWriteTstr(kOsVersion, cbor_csr_out); + CborWriteTstr(deviceInfo.os_version, cbor_csr_out); + + CborWriteTstr(kManufacturer, cbor_csr_out); + CborWriteTstr(deviceInfo.manufacturer, cbor_csr_out); + + CborWriteTstr(kVbmetaDigest, cbor_csr_out); + CborWriteBstr(deviceInfo.vbmeta_digest_size, deviceInfo.vbmeta_digest, + cbor_csr_out); + + CborWriteTstr(kSecurityLevel, cbor_csr_out); + CborWriteTstr(deviceInfo.security_level, cbor_csr_out); + CborWriteTstr(kBootPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.boot_patch_level, cbor_csr_out); CborWriteTstr(kBootloaderState, cbor_csr_out); CborWriteTstr(deviceInfo.bootloader_state, cbor_csr_out); - CborWriteTstr(kBrand, cbor_csr_out); - CborWriteTstr(deviceInfo.brand, cbor_csr_out); - - CborWriteTstr(kDevice, cbor_csr_out); - CborWriteTstr(deviceInfo.device, cbor_csr_out); - - CborWriteTstr(kFused, cbor_csr_out); - CborWriteInt(deviceInfo.fused, cbor_csr_out); - - CborWriteTstr(kManufacturer, cbor_csr_out); - CborWriteTstr(deviceInfo.manufacturer, cbor_csr_out); - - CborWriteTstr(kModel, cbor_csr_out); - CborWriteTstr(deviceInfo.model, cbor_csr_out); - - CborWriteTstr(kOsVersion, cbor_csr_out); - CborWriteTstr(deviceInfo.os_version, cbor_csr_out); - - CborWriteTstr(kProduct, cbor_csr_out); - CborWriteTstr(deviceInfo.product, cbor_csr_out); - - CborWriteTstr(kSecurityLevel, cbor_csr_out); - CborWriteTstr(deviceInfo.security_level, cbor_csr_out); - CborWriteTstr(kSystemPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.system_patch_level, cbor_csr_out); - CborWriteTstr(kVbState, cbor_csr_out); - CborWriteTstr(deviceInfo.vb_state, cbor_csr_out); - - CborWriteTstr(kVbmetaDigest, cbor_csr_out); - CborWriteBstr(deviceInfo.vbmeta_digest_size, deviceInfo.vbmeta_digest, - cbor_csr_out); - CborWriteTstr(kVendorPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.vendor_patch_level, cbor_csr_out); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c index fd4b67e..882b9fc 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c @@ -123,7 +123,7 @@ bool OPKI_DeriveKeyWithCMAC(const uint8_t* key, KeySize key_size, CMAC_CTX* cmac_ctx = CMAC_CTX_new(); if (!cmac_ctx) return false; - for (uint8_t index = 0; index < out_key_size; index += KEY_SIZE_128) { + for (int index = 0; index < (int)out_key_size; index += KEY_SIZE_128) { if (!CMAC_Init(cmac_ctx, key, key_size, cipher, 0)) { CMAC_CTX_free(cmac_ctx); return false; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c index ba70d8d..f0e56ea 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c @@ -4,6 +4,7 @@ #include "rsa_util.h" +#include "oemcrypto_compiler_attributes.h" #include "oemcrypto_key_types.h" #include "openssl/bio.h" #include "openssl/err.h" @@ -14,7 +15,7 @@ #include "wtpi_logging_interface.h" void dump_ssl_error(void) { - int count = 0; + UNUSED int count = 0; unsigned long err; while ((err = ERR_get_error())) { count++; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c index ce7b0dc..43397e9 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c @@ -47,11 +47,6 @@ bool WTPI_IsAntiRollbackHWPresent(void) { return OPK_CONFIG_HW_ANTIROLLBACK_SUPPORTED; } -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field) { - (void)cgms_field; - return OEMCrypto_ERROR_UNKNOWN_FAILURE; -} - bool WTPI_IsCGMS_AActive(void) { return false; } bool WTPI_SupportsCGMS_A(void) { return OPK_CONFIG_SUPPORTS_CGMSA; } @@ -66,10 +61,6 @@ bool WTPI_CanDisableAnalogDisplay(void) { bool WTPI_DisableAnalogDisplay(void) { return false; } -size_t WTPI_MaxBufferSizeForDecrypt(void) { - return OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT; -} - size_t WTPI_MaxOutputSizeForDecrypt(void) { return OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c index 6f6555e..909d5c0 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c @@ -10,6 +10,7 @@ #include "OEMCryptoCENCCommon.h" #include "key_mapping_interface.h" +#include "oemcrypto_check_macros.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_object_table.h" #include "oemcrypto_overflow.h" @@ -132,6 +133,10 @@ static OEMCryptoResult VerifyAndDecryptKey( static bool IsKeyValid(uint32_t index) { WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, index); + if (key == NULL) { + LOGE("Key at index %u is null", index); + return false; + } switch (key->key_type) { case CONTENT_KEY: // We cheat a little here. We also call generic crypto keys "content @@ -163,6 +168,7 @@ static OEMCryptoResult GetKeyType(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *type = key->key_type; return OEMCrypto_SUCCESS; } @@ -177,6 +183,7 @@ OEMCryptoResult WTPI_K1_GetKeySize(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *size = key->key_size; return OEMCrypto_SUCCESS; } @@ -203,6 +210,7 @@ WTPI_K2_SymmetricKey_Handle KM_LookupKeyHandle( WTPI_K2_SymmetricKey_Handle k2_key_handle = NULL; uint32_t k1_index = k1_key_handle->index; WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_index); + ABORT_IF_NULL(key); if (key->is_loaded) { uint32_t k2_index = key->index_loaded; k2_key_handle = gHandlePairTable[k2_index].k2_key_handle; @@ -236,6 +244,7 @@ OEMCryptoResult KM_PairKeyHandle(WTPI_K1_SymmetricKey_Handle k1_key_handle, if (result != OEMCrypto_SUCCESS) return result; WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_key_handle->index); + ABORT_IF_NULL(key); key->is_loaded = true; key->index_loaded = k2_index; gHandlePairTable[k2_index].k2_key_handle = k2_key_handle; @@ -250,6 +259,7 @@ static void UnpairKeyHandle(uint32_t k2_index) { if (IsKeyHandleValid(k1_key_handle)) { WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_key_handle->index); + ABORT_IF_NULL(key); key->is_loaded = false; key->index_loaded = MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c index 313dda1..61b86ea 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c @@ -11,6 +11,8 @@ #include "OEMCryptoCENCCommon.h" #include "crypto_util.h" #include "device_key_util.h" +#include "odk_util.h" +#include "oemcrypto_check_macros.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_object_table.h" #include "oemcrypto_overflow.h" @@ -109,6 +111,7 @@ static OEMCryptoResult GetKeyType(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *type = key->key_type; return OEMCrypto_SUCCESS; } @@ -159,7 +162,7 @@ static OEMCryptoResult VerifyAndDecryptKey( ABORT_IF(out_key == NULL, "Parameters are NULL or 0"); WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); - if (key == NULL) return OEMCrypto_ERROR_UNKNOWN_FAILURE; + ABORT_IF_NULL(key); ABORT_IF(out_size < (size_t)(key->key_size), "Invalid output buffer size"); const uint8_t* wrapped_data = (const uint8_t*)(&key->key_data); @@ -176,13 +179,13 @@ static OEMCryptoResult VerifyAndDecryptKey( const uint8_t* wrapped_key_data = (const uint8_t*)(&wrapped->wrapped_key_data); size_t wrapped_key_data_length = sizeof(wrapped->wrapped_key_data); - uint8_t computed_signature[SHA256_DIGEST_LENGTH]; + uint8_t computed_signature[SHA256_DIGEST_LENGTH] = {0}; if (!OPKI_HMAC_SHA256(wrapped_key_data, wrapped_key_data_length, signing_key, sizeof(signing_key), computed_signature)) { return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - if (memcmp(wrapped->signature, computed_signature, SHA256_DIGEST_LENGTH) != - 0) { + if (crypto_memcmp(wrapped->signature, computed_signature, + SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } @@ -224,6 +227,7 @@ OEMCryptoResult WTPI_K1_GetKeySize(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *size = key->key_size; return OEMCrypto_SUCCESS; } @@ -365,11 +369,11 @@ OEMCryptoResult WTPI_C1_HMAC_SHA256_Verify( if (!IsKeyHandleValid(key_handle)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } - uint8_t computed_signature[SHA256_DIGEST_LENGTH]; + uint8_t computed_signature[SHA256_DIGEST_LENGTH] = {0}; OEMCryptoResult result = WTPI_C1_HMAC_SHA256( key_handle, message, message_length, computed_signature); if (result != OEMCrypto_SUCCESS) return result; - if (memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { + if (crypto_memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } return OEMCrypto_SUCCESS; @@ -466,7 +470,6 @@ OEMCryptoResult WTPI_K1_AESDecryptAndCreateKeyHandle( (size_t)decryption_key_size, key)) { return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - if (result != OEMCrypto_SUCCESS) return result; return WTPI_K1_CreateKeyHandle(key, enc_key_length, key_type, out_key_handle); } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c index 1ce44a9..62b1143 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c @@ -27,8 +27,9 @@ NO_IGNORE_RESULT static OEMCryptoResult DecryptToOutputBuffer_CBC( const OEMCrypto_CENCEncryptPatternDesc* pattern, const uint8_t* cipher_data, size_t cipher_data_length, const OPK_OutputBuffer* output_buffer, size_t output_offset) { + if (cipher_data_length == 0) return OEMCrypto_SUCCESS; if (key_handle == NULL || initial_iv == NULL || pattern == NULL || - cipher_data == NULL || cipher_data_length == 0 || output_buffer == NULL) { + cipher_data == NULL || output_buffer == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } OEMCryptoResult result = @@ -94,9 +95,10 @@ NO_IGNORE_RESULT static OEMCryptoResult DecryptToOutputBuffer_CTR( WTPI_K1_SymmetricKey_Handle key_handle, const uint8_t* initial_iv, size_t block_offset, const uint8_t* cipher_data, size_t cipher_data_length, const OPK_OutputBuffer* output_buffer, size_t output_offset) { + if (cipher_data_length == 0) return OEMCrypto_SUCCESS; if (key_handle == NULL || initial_iv == NULL || block_offset >= AES_BLOCK_SIZE || cipher_data == NULL || - cipher_data_length == 0 || output_buffer == NULL) { + output_buffer == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } OEMCryptoResult result = @@ -231,6 +233,7 @@ OEMCryptoResult WTPI_DecryptSample( subsample->num_bytes_encrypted, &subsample_length)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (subsample_length == 0) continue; size_t current_offset; if (OPK_AddOverflowUX(starting_output_offset, offset, ¤t_offset)) { diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c index 59d8482..e13b87e 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c @@ -123,6 +123,10 @@ OEMCryptoResult WTPI_UnwrapValidateAndInstallKeybox(const uint8_t* input, result = OEMCrypto_ERROR_SHORT_BUFFER; goto cleanup; } + if (input == NULL) { + result = OEMCrypto_ERROR_INVALID_CONTEXT; + goto cleanup; + } // First, try the buffer as if is a clear keybox. memcpy(&gKeybox, input, output_length); result = WTPI_ValidateKeybox(); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c index da397a0..675a491 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c @@ -11,7 +11,6 @@ #include -#include "GEN_common_serializer.h" #include "bump_allocator.h" #include "common_special_cases.h" #include "log_macros.h" diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c index f2109aa..b9c259f 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c @@ -2011,38 +2011,6 @@ cleanup_and_return: return result; } -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field) { - pthread_mutex_lock(&api_lock); - OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_ApplyCGMS_Request(cgms_field); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_ApplyCGMS_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - API_Terminate(); - result = API_CheckResult(result); - pthread_mutex_unlock(&api_lock); - return result; -} - bool WTPI_IsCGMS_AActive(void) { pthread_mutex_lock(&api_lock); bool result = false; @@ -2229,37 +2197,6 @@ cleanup_and_return: return result; } -size_t WTPI_MaxBufferSizeForDecrypt(void) { - pthread_mutex_lock(&api_lock); - size_t result = 0; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_MaxBufferSizeForDecrypt_Request(); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_MaxBufferSizeForDecrypt_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - API_Terminate(); - pthread_mutex_unlock(&api_lock); - return result; -} - size_t WTPI_MaxOutputSizeForDecrypt(void) { pthread_mutex_lock(&api_lock); size_t result = 0; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c index a8fa099..140fa7a 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c @@ -1949,36 +1949,8 @@ void OPK_Unpack_IsAntiRollbackHWPresent_Response(ODK_Message* msg, OPK_SharedBuffer_FinalizeUnpacking(); } -ODK_Message OPK_Pack_ApplyCGMS_Request(uint8_t cgms_field) { - uint32_t api_value = 10058; /* from _tee10058 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_Pack_uint8_t(&msg, &cgms_field); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_ApplyCGMS_Response(ODK_Message* msg, OEMCryptoResult* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10058) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_uint32_t(msg, result); - if (!Is_Valid_OEMCryptoResult(*result)) { - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); - } - OPK_UnpackEOM(msg); - - if (SuccessResult(*result)) { - OPK_SharedBuffer_FinalizeUnpacking(); - } -} - ODK_Message OPK_Pack_IsCGMS_AActive_Request(void) { - uint32_t api_value = 10059; /* from _tee10059 */ + uint32_t api_value = 10058; /* from _tee10058 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -1991,7 +1963,7 @@ ODK_Message OPK_Pack_IsCGMS_AActive_Request(void) { void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10059) + if (api_value != 10058) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -1999,7 +1971,7 @@ void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_SupportsCGMS_A_Request(void) { - uint32_t api_value = 10060; /* from _tee10060 */ + uint32_t api_value = 10059; /* from _tee10059 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2012,7 +1984,7 @@ ODK_Message OPK_Pack_SupportsCGMS_A_Request(void) { void OPK_Unpack_SupportsCGMS_A_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10060) + if (api_value != 10059) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2020,7 +1992,7 @@ void OPK_Unpack_SupportsCGMS_A_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_HasAnalogDisplay_Request(void) { - uint32_t api_value = 10061; /* from _tee10061 */ + uint32_t api_value = 10060; /* from _tee10060 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2033,7 +2005,7 @@ ODK_Message OPK_Pack_HasAnalogDisplay_Request(void) { void OPK_Unpack_HasAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10061) + if (api_value != 10060) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2041,7 +2013,7 @@ void OPK_Unpack_HasAnalogDisplay_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_IsAnalogDisplayActive_Request(void) { - uint32_t api_value = 10062; /* from _tee10062 */ + uint32_t api_value = 10061; /* from _tee10061 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2054,7 +2026,7 @@ ODK_Message OPK_Pack_IsAnalogDisplayActive_Request(void) { void OPK_Unpack_IsAnalogDisplayActive_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10062) + if (api_value != 10061) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2062,7 +2034,7 @@ void OPK_Unpack_IsAnalogDisplayActive_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_CanDisableAnalogDisplay_Request(void) { - uint32_t api_value = 10063; /* from _tee10063 */ + uint32_t api_value = 10062; /* from _tee10062 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2076,7 +2048,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10063) + if (api_value != 10062) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2084,7 +2056,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, } ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void) { - uint32_t api_value = 10064; /* from _tee10064 */ + uint32_t api_value = 10063; /* from _tee10063 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2097,37 +2069,15 @@ ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void) { void OPK_Unpack_DisableAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10064) + if (api_value != 10063) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); OPK_SharedBuffer_FinalizeUnpacking(); } -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Request(void) { - uint32_t api_value = 10065; /* from _tee10065 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_MaxBufferSizeForDecrypt_Response(ODK_Message* msg, - size_t* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10065) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_size_t(msg, result); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Request(void) { - uint32_t api_value = 10066; /* from _tee10066 */ + uint32_t api_value = 10064; /* from _tee10064 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2141,7 +2091,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10066) + if (api_value != 10064) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2149,7 +2099,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, } ODK_Message OPK_Pack_IsClosedPlatform_Request(void) { - uint32_t api_value = 10067; /* from _tee10067 */ + uint32_t api_value = 10065; /* from _tee10065 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2162,7 +2112,7 @@ ODK_Message OPK_Pack_IsClosedPlatform_Request(void) { void OPK_Unpack_IsClosedPlatform_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10067) + if (api_value != 10065) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2170,7 +2120,7 @@ void OPK_Unpack_IsClosedPlatform_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_CurrentHDCPCapability_Request(void) { - uint32_t api_value = 10068; /* from _tee10068 */ + uint32_t api_value = 10066; /* from _tee10066 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2184,7 +2134,7 @@ void OPK_Unpack_CurrentHDCPCapability_Response( ODK_Message* msg, OEMCrypto_HDCP_Capability* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10068) + if (api_value != 10066) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_OEMCrypto_HDCP_Capability(msg, result); OPK_UnpackEOM(msg); @@ -2192,7 +2142,7 @@ void OPK_Unpack_CurrentHDCPCapability_Response( } ODK_Message OPK_Pack_MaxHDCPCapability_Request(void) { - uint32_t api_value = 10069; /* from _tee10069 */ + uint32_t api_value = 10067; /* from _tee10067 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2206,7 +2156,7 @@ void OPK_Unpack_MaxHDCPCapability_Response(ODK_Message* msg, OEMCrypto_HDCP_Capability* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10069) + if (api_value != 10067) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_OEMCrypto_HDCP_Capability(msg, result); OPK_UnpackEOM(msg); @@ -2214,7 +2164,7 @@ void OPK_Unpack_MaxHDCPCapability_Response(ODK_Message* msg, } ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Request(void) { - uint32_t api_value = 10070; /* from _tee10070 */ + uint32_t api_value = 10068; /* from _tee10068 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2228,7 +2178,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10070) + if (api_value != 10068) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2236,7 +2186,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Response(ODK_Message* msg, } ODK_Message OPK_Pack_MaxSampleSize_Request(void) { - uint32_t api_value = 10071; /* from _tee10071 */ + uint32_t api_value = 10069; /* from _tee10069 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2249,7 +2199,7 @@ ODK_Message OPK_Pack_MaxSampleSize_Request(void) { void OPK_Unpack_MaxSampleSize_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10071) + if (api_value != 10069) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2257,7 +2207,7 @@ void OPK_Unpack_MaxSampleSize_Response(ODK_Message* msg, size_t* result) { } ODK_Message OPK_Pack_SupportedCertificates_Request(void) { - uint32_t api_value = 10072; /* from _tee10072 */ + uint32_t api_value = 10070; /* from _tee10070 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2271,7 +2221,7 @@ void OPK_Unpack_SupportedCertificates_Response(ODK_Message* msg, uint32_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10072) + if (api_value != 10070) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); OPK_UnpackEOM(msg); @@ -2279,7 +2229,7 @@ void OPK_Unpack_SupportedCertificates_Response(ODK_Message* msg, } ODK_Message OPK_Pack_ContentDecryptBypassesTA_Request(void) { - uint32_t api_value = 10073; /* from _tee10073 */ + uint32_t api_value = 10071; /* from _tee10071 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2293,7 +2243,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10073) + if (api_value != 10071) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2302,7 +2252,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Response(ODK_Message* msg, ODK_Message OPK_Pack_GetEncryptAndSignSize_Request( uint32_t context, size_t in_length, const size_t* wrapped_length) { - uint32_t api_value = 10074; /* from _tee10074 */ + uint32_t api_value = 10072; /* from _tee10072 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2320,7 +2270,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Response(ODK_Message* msg, size_t** wrapped_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10074) + if (api_value != 10072) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); if (!Is_Valid_OEMCryptoResult(*result)) { @@ -2339,7 +2289,7 @@ ODK_Message OPK_Pack_EncryptAndSign_Request(uint32_t context, size_t data_length, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10075; /* from _tee10075 */ + uint32_t api_value = 10073; /* from _tee10073 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2359,7 +2309,7 @@ void OPK_Unpack_EncryptAndSign_Response(ODK_Message* msg, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10075) + if (api_value != 10073) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_UnpackNullable_size_t(msg, out_length); OPK_Unpack_uint32_t(msg, result); @@ -2385,7 +2335,7 @@ ODK_Message OPK_Pack_VerifyAndDecrypt_Request(uint32_t context, size_t wrapped_length, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10076; /* from _tee10076 */ + uint32_t api_value = 10074; /* from _tee10074 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2406,7 +2356,7 @@ void OPK_Unpack_VerifyAndDecrypt_Response(ODK_Message* msg, uint8_t** out, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10076) + if (api_value != 10074) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_UnpackNullable_size_t(msg, out_length); OPK_Unpack_uint32_t(msg, result); @@ -2430,7 +2380,7 @@ void OPK_Unpack_VerifyAndDecrypt_Response(ODK_Message* msg, ODK_Message OPK_Pack_VerifyAndDecryptUsageData_Legacy_Request( const uint8_t* wrapped, size_t wrapped_length, const uint8_t* signature, const uint8_t* iv, const uint8_t* out) { - uint32_t api_value = 10077; /* from _tee10077 */ + uint32_t api_value = 10075; /* from _tee10075 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2450,7 +2400,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Response( ODK_Message* msg, OEMCryptoResult* result, uint8_t** out) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10077) + if (api_value != 10075) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); if (!Is_Valid_OEMCryptoResult(*result)) { diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h index d72732b..33def3b 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h @@ -308,8 +308,6 @@ void OPK_Unpack_GetCurrentSRMVersion_Response(ODK_Message* msg, ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Request(void); void OPK_Unpack_IsAntiRollbackHWPresent_Response(ODK_Message* msg, bool* result); -ODK_Message OPK_Pack_ApplyCGMS_Request(uint8_t cgms_field); -void OPK_Unpack_ApplyCGMS_Response(ODK_Message* msg, OEMCryptoResult* result); ODK_Message OPK_Pack_IsCGMS_AActive_Request(void); void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result); ODK_Message OPK_Pack_SupportsCGMS_A_Request(void); @@ -323,9 +321,6 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, bool* result); ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void); void OPK_Unpack_DisableAnalogDisplay_Response(ODK_Message* msg, bool* result); -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Request(void); -void OPK_Unpack_MaxBufferSizeForDecrypt_Response(ODK_Message* msg, - size_t* result); ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Request(void); void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, size_t* result); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c index 31c5391..98a254a 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c @@ -1159,20 +1159,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsAntiRollbackHWPresent_Response(result); break; } - case 10058: /* WTPI_ApplyCGMS */ - { - uint8_t cgms_field; - OPK_Init_uint8_t((uint8_t*)&cgms_field); - OPK_Unpack_ApplyCGMS_Request(request, &cgms_field); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - OEMCryptoResult result; - OPK_Init_uint32_t((uint32_t*)&result); - LOGD("ApplyCGMS"); - result = WTPI_ApplyCGMS(cgms_field); - *response = OPK_Pack_ApplyCGMS_Response(result); - break; - } - case 10059: /* WTPI_IsCGMS_AActive */ + case 10058: /* WTPI_IsCGMS_AActive */ { OPK_Unpack_IsCGMS_AActive_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1183,7 +1170,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsCGMS_AActive_Response(result); break; } - case 10060: /* WTPI_SupportsCGMS_A */ + case 10059: /* WTPI_SupportsCGMS_A */ { OPK_Unpack_SupportsCGMS_A_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1194,7 +1181,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_SupportsCGMS_A_Response(result); break; } - case 10061: /* WTPI_HasAnalogDisplay */ + case 10060: /* WTPI_HasAnalogDisplay */ { OPK_Unpack_HasAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1205,7 +1192,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_HasAnalogDisplay_Response(result); break; } - case 10062: /* WTPI_IsAnalogDisplayActive */ + case 10061: /* WTPI_IsAnalogDisplayActive */ { OPK_Unpack_IsAnalogDisplayActive_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1216,7 +1203,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsAnalogDisplayActive_Response(result); break; } - case 10063: /* WTPI_CanDisableAnalogDisplay */ + case 10062: /* WTPI_CanDisableAnalogDisplay */ { OPK_Unpack_CanDisableAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1227,7 +1214,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_CanDisableAnalogDisplay_Response(result); break; } - case 10064: /* WTPI_DisableAnalogDisplay */ + case 10063: /* WTPI_DisableAnalogDisplay */ { OPK_Unpack_DisableAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1238,18 +1225,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_DisableAnalogDisplay_Response(result); break; } - case 10065: /* WTPI_MaxBufferSizeForDecrypt */ - { - OPK_Unpack_MaxBufferSizeForDecrypt_Request(request); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - size_t result; - OPK_Init_size_t((size_t*)&result); - LOGD("MaxBufferSizeForDecrypt"); - result = WTPI_MaxBufferSizeForDecrypt(); - *response = OPK_Pack_MaxBufferSizeForDecrypt_Response(result); - break; - } - case 10066: /* WTPI_MaxOutputSizeForDecrypt */ + case 10064: /* WTPI_MaxOutputSizeForDecrypt */ { OPK_Unpack_MaxOutputSizeForDecrypt_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1260,7 +1236,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxOutputSizeForDecrypt_Response(result); break; } - case 10067: /* WTPI_IsClosedPlatform */ + case 10065: /* WTPI_IsClosedPlatform */ { OPK_Unpack_IsClosedPlatform_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1271,7 +1247,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsClosedPlatform_Response(result); break; } - case 10068: /* WTPI_CurrentHDCPCapability */ + case 10066: /* WTPI_CurrentHDCPCapability */ { OPK_Unpack_CurrentHDCPCapability_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1282,7 +1258,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_CurrentHDCPCapability_Response(result); break; } - case 10069: /* WTPI_MaxHDCPCapability */ + case 10067: /* WTPI_MaxHDCPCapability */ { OPK_Unpack_MaxHDCPCapability_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1293,7 +1269,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxHDCPCapability_Response(result); break; } - case 10070: /* WTPI_MaxBufferSizeForGenericCrypto */ + case 10068: /* WTPI_MaxBufferSizeForGenericCrypto */ { OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1304,7 +1280,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxBufferSizeForGenericCrypto_Response(result); break; } - case 10071: /* WTPI_MaxSampleSize */ + case 10069: /* WTPI_MaxSampleSize */ { OPK_Unpack_MaxSampleSize_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1315,7 +1291,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxSampleSize_Response(result); break; } - case 10072: /* WTPI_SupportedCertificates */ + case 10070: /* WTPI_SupportedCertificates */ { OPK_Unpack_SupportedCertificates_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1326,7 +1302,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_SupportedCertificates_Response(result); break; } - case 10073: /* WTPI_ContentDecryptBypassesTA */ + case 10071: /* WTPI_ContentDecryptBypassesTA */ { OPK_Unpack_ContentDecryptBypassesTA_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1337,7 +1313,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_ContentDecryptBypassesTA_Response(result); break; } - case 10074: /* WTPI_GetEncryptAndSignSize */ + case 10072: /* WTPI_GetEncryptAndSignSize */ { uint32_t context; OPK_Init_uint32_t((uint32_t*)&context); @@ -1356,7 +1332,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, OPK_Pack_GetEncryptAndSignSize_Response(result, wrapped_length); break; } - case 10075: /* WTPI_EncryptAndSign */ + case 10073: /* WTPI_EncryptAndSign */ { size_t data_length; OPK_Init_size_t((size_t*)&data_length); @@ -1378,7 +1354,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_EncryptAndSign_Response(result, out, out_length); break; } - case 10076: /* WTPI_VerifyAndDecrypt */ + case 10074: /* WTPI_VerifyAndDecrypt */ { size_t wrapped_length; OPK_Init_size_t((size_t*)&wrapped_length); @@ -1401,7 +1377,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_VerifyAndDecrypt_Response(result, out, out_length); break; } - case 10077: /* WTPI_VerifyAndDecryptUsageData_Legacy */ + case 10075: /* WTPI_VerifyAndDecryptUsageData_Legacy */ { size_t wrapped_length; OPK_Init_size_t((size_t*)&wrapped_length); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c index 84c9954..de44ab9 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c @@ -1625,32 +1625,10 @@ ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Response(bool result) { return msg; } -void OPK_Unpack_ApplyCGMS_Request(ODK_Message* msg, uint8_t* cgms_field) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10058) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_Unpack_uint8_t(msg, cgms_field); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_ApplyCGMS_Response(OEMCryptoResult result) { - uint32_t api_value = 10058; /* from _tee10058 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_uint32_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10059) + if (api_value != 10058) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1659,7 +1637,7 @@ void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result) { - uint32_t api_value = 10059; /* from _tee10059 */ + uint32_t api_value = 10058; /* from _tee10058 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1671,7 +1649,7 @@ ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result) { void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10060) + if (api_value != 10059) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1680,7 +1658,7 @@ void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_SupportsCGMS_A_Response(bool result) { - uint32_t api_value = 10060; /* from _tee10060 */ + uint32_t api_value = 10059; /* from _tee10059 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1692,7 +1670,7 @@ ODK_Message OPK_Pack_SupportsCGMS_A_Response(bool result) { void OPK_Unpack_HasAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10061) + if (api_value != 10060) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1701,7 +1679,7 @@ void OPK_Unpack_HasAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_HasAnalogDisplay_Response(bool result) { - uint32_t api_value = 10061; /* from _tee10061 */ + uint32_t api_value = 10060; /* from _tee10060 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1713,7 +1691,7 @@ ODK_Message OPK_Pack_HasAnalogDisplay_Response(bool result) { void OPK_Unpack_IsAnalogDisplayActive_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10062) + if (api_value != 10061) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1722,7 +1700,7 @@ void OPK_Unpack_IsAnalogDisplayActive_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsAnalogDisplayActive_Response(bool result) { - uint32_t api_value = 10062; /* from _tee10062 */ + uint32_t api_value = 10061; /* from _tee10061 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1734,7 +1712,7 @@ ODK_Message OPK_Pack_IsAnalogDisplayActive_Response(bool result) { void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10063) + if (api_value != 10062) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1743,7 +1721,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result) { - uint32_t api_value = 10063; /* from _tee10063 */ + uint32_t api_value = 10062; /* from _tee10062 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1755,7 +1733,7 @@ ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result) { void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10064) + if (api_value != 10063) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1764,7 +1742,7 @@ void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result) { - uint32_t api_value = 10064; /* from _tee10064 */ + uint32_t api_value = 10063; /* from _tee10063 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1773,31 +1751,10 @@ ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result) { return msg; } -void OPK_Unpack_MaxBufferSizeForDecrypt_Request(ODK_Message* msg) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10065) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Response(size_t result) { - uint32_t api_value = 10065; /* from _tee10065 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_size_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10066) + if (api_value != 10064) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1806,7 +1763,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result) { - uint32_t api_value = 10066; /* from _tee10066 */ + uint32_t api_value = 10064; /* from _tee10064 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1818,7 +1775,7 @@ ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result) { void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10067) + if (api_value != 10065) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1827,7 +1784,7 @@ void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsClosedPlatform_Response(bool result) { - uint32_t api_value = 10067; /* from _tee10067 */ + uint32_t api_value = 10065; /* from _tee10065 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1839,7 +1796,7 @@ ODK_Message OPK_Pack_IsClosedPlatform_Response(bool result) { void OPK_Unpack_CurrentHDCPCapability_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10068) + if (api_value != 10066) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1849,7 +1806,7 @@ void OPK_Unpack_CurrentHDCPCapability_Request(ODK_Message* msg) { ODK_Message OPK_Pack_CurrentHDCPCapability_Response( OEMCrypto_HDCP_Capability result) { - uint32_t api_value = 10068; /* from _tee10068 */ + uint32_t api_value = 10066; /* from _tee10066 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_OEMCrypto_HDCP_Capability(&msg, &result); @@ -1861,7 +1818,7 @@ ODK_Message OPK_Pack_CurrentHDCPCapability_Response( void OPK_Unpack_MaxHDCPCapability_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10069) + if (api_value != 10067) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1871,7 +1828,7 @@ void OPK_Unpack_MaxHDCPCapability_Request(ODK_Message* msg) { ODK_Message OPK_Pack_MaxHDCPCapability_Response( OEMCrypto_HDCP_Capability result) { - uint32_t api_value = 10069; /* from _tee10069 */ + uint32_t api_value = 10067; /* from _tee10067 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_OEMCrypto_HDCP_Capability(&msg, &result); @@ -1883,7 +1840,7 @@ ODK_Message OPK_Pack_MaxHDCPCapability_Response( void OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10070) + if (api_value != 10068) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1892,7 +1849,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Response(size_t result) { - uint32_t api_value = 10070; /* from _tee10070 */ + uint32_t api_value = 10068; /* from _tee10068 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1904,7 +1861,7 @@ ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Response(size_t result) { void OPK_Unpack_MaxSampleSize_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10071) + if (api_value != 10069) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1913,7 +1870,7 @@ void OPK_Unpack_MaxSampleSize_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxSampleSize_Response(size_t result) { - uint32_t api_value = 10071; /* from _tee10071 */ + uint32_t api_value = 10069; /* from _tee10069 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1925,7 +1882,7 @@ ODK_Message OPK_Pack_MaxSampleSize_Response(size_t result) { void OPK_Unpack_SupportedCertificates_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10072) + if (api_value != 10070) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1934,7 +1891,7 @@ void OPK_Unpack_SupportedCertificates_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_SupportedCertificates_Response(uint32_t result) { - uint32_t api_value = 10072; /* from _tee10072 */ + uint32_t api_value = 10070; /* from _tee10070 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); @@ -1946,7 +1903,7 @@ ODK_Message OPK_Pack_SupportedCertificates_Response(uint32_t result) { void OPK_Unpack_ContentDecryptBypassesTA_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10073) + if (api_value != 10071) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1955,7 +1912,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_ContentDecryptBypassesTA_Response(bool result) { - uint32_t api_value = 10073; /* from _tee10073 */ + uint32_t api_value = 10071; /* from _tee10071 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1970,7 +1927,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Request(ODK_Message* msg, size_t** wrapped_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10074) + if (api_value != 10072) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1983,7 +1940,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Request(ODK_Message* msg, ODK_Message OPK_Pack_GetEncryptAndSignSize_Response( OEMCryptoResult result, const size_t* wrapped_length) { - uint32_t api_value = 10074; /* from _tee10074 */ + uint32_t api_value = 10072; /* from _tee10072 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); @@ -1998,7 +1955,7 @@ void OPK_Unpack_EncryptAndSign_Request(ODK_Message* msg, uint32_t* context, uint8_t** out, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10075) + if (api_value != 10073) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2015,7 +1972,7 @@ void OPK_Unpack_EncryptAndSign_Request(ODK_Message* msg, uint32_t* context, ODK_Message OPK_Pack_EncryptAndSign_Response(OEMCryptoResult result, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10075; /* from _tee10075 */ + uint32_t api_value = 10073; /* from _tee10073 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_PackNullable_size_t(&msg, out_length); @@ -2034,7 +1991,7 @@ void OPK_Unpack_VerifyAndDecrypt_Request(ODK_Message* msg, uint32_t* context, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10076) + if (api_value != 10074) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2051,7 +2008,7 @@ void OPK_Unpack_VerifyAndDecrypt_Request(ODK_Message* msg, uint32_t* context, ODK_Message OPK_Pack_VerifyAndDecrypt_Response(OEMCryptoResult result, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10076; /* from _tee10076 */ + uint32_t api_value = 10074; /* from _tee10074 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_PackNullable_size_t(&msg, out_length); @@ -2069,7 +2026,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Request( uint8_t** signature, uint8_t** iv, uint8_t** out) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10077) + if (api_value != 10075) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2084,7 +2041,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Request( ODK_Message OPK_Pack_VerifyAndDecryptUsageData_Legacy_Response( OEMCryptoResult result, const uint8_t* out) { - uint32_t api_value = 10077; /* from _tee10077 */ + uint32_t api_value = 10075; /* from _tee10075 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h index cc54e97..ac7c4f7 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h @@ -278,8 +278,6 @@ ODK_Message OPK_Pack_GetCurrentSRMVersion_Response(OEMCryptoResult result, const uint32_t* srm_version); void OPK_Unpack_IsAntiRollbackHWPresent_Request(ODK_Message* msg); ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Response(bool result); -void OPK_Unpack_ApplyCGMS_Request(ODK_Message* msg, uint8_t* cgms_field); -ODK_Message OPK_Pack_ApplyCGMS_Response(OEMCryptoResult result); void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg); ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result); void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg); @@ -292,8 +290,6 @@ void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg); ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result); void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg); ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result); -void OPK_Unpack_MaxBufferSizeForDecrypt_Request(ODK_Message* msg); -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Response(size_t result); void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg); ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result); void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg); diff --git a/oemcrypto/opk/ports/linux/Makefile b/oemcrypto/opk/ports/linux/Makefile index 2d10340..4c16424 100644 --- a/oemcrypto/opk/ports/linux/Makefile +++ b/oemcrypto/opk/ports/linux/Makefile @@ -55,12 +55,11 @@ oemcrypto_unittests: liboemcrypto wtpi_unittests: +$(MAKE) -C host/wtpi_unittests -.PHONY: clean -clean: - +$(MAKE) -C ta/oemcrypto_ta clean - +$(MAKE) -C ta/wtpi_test_ta clean - +$(MAKE) -C host/liboemcrypto clean - +$(MAKE) -C host/oemcrypto_helloworld clean - +$(MAKE) -C host/oemcrypto_unittests clean - +$(MAKE) -C host/wtpi_unittests clean - +.PHONY: clean clang-tidy +clean clang-tidy: + +$(MAKE) -C ta/oemcrypto_ta $@ + +$(MAKE) -C ta/wtpi_test_ta $@ + +$(MAKE) -C host/liboemcrypto $@ + +$(MAKE) -C host/oemcrypto_helloworld $@ + +$(MAKE) -C host/oemcrypto_unittests $@ + +$(MAKE) -C host/wtpi_unittests $@ diff --git a/oemcrypto/opk/ports/linux/common/posix_resources.h b/oemcrypto/opk/ports/linux/common/posix_resources.h index 80cee64..841d747 100644 --- a/oemcrypto/opk/ports/linux/common/posix_resources.h +++ b/oemcrypto/opk/ports/linux/common/posix_resources.h @@ -2,8 +2,8 @@ // source code may only be used and distributed under the Widevine // License Agreement. -#ifndef POSIX_RESOURCES__H_ -#define POSIX_RESOURCES__H_ +#ifndef POSIX_RESOURCES_H_ +#define POSIX_RESOURCES_H_ #include "posix_services.h" @@ -16,4 +16,4 @@ typedef posix::SharedMemory<2> SerializationBlock; typedef posix::Semaphore<0> RequestSemaphore; typedef posix::Semaphore<1> ResponseSemaphore; -#endif // POSIX_RESOURCES__H_ +#endif // POSIX_RESOURCES_H_ diff --git a/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile index b32f676..972b630 100644 --- a/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile +++ b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile @@ -20,10 +20,10 @@ include $(srcdir)/oemcrypto/opk/build/ree-sources.mk srcs += \ $(OPK_REPO_TOP)/oemcrypto/opk/oemcrypto_ta/wtpi_test/wtpi_test_main.cpp \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_transport.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_transport.cpp \ $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_secure_buffers.c \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_logging.c \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_logging.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp \ $(wtpi_unittests_sources) \ incs += \ diff --git a/oemcrypto/opk/ports/linux/rules.mk b/oemcrypto/opk/ports/linux/rules.mk index c72afb1..2b1b100 100644 --- a/oemcrypto/opk/ports/linux/rules.mk +++ b/oemcrypto/opk/ports/linux/rules.mk @@ -27,30 +27,47 @@ cmd-echo := echo cmd-echo-silent := true endif -cc := $(CROSS_COMPILE)gcc -cxx := $(CROSS_COMPILE)g++ +cc := $(CROSS_COMPILE)gcc +cxx := $(CROSS_COMPILE)g++ ssrc := $(patsubst %.S, %.o, $(filter %.S, $(srcs))) csrc := $(patsubst %.c, %.o, $(filter %.c, $(srcs))) cppsrc := $(patsubst %.cpp, %.o, $(filter %.cpp, $(srcs))) ccsrc := $(patsubst %.cc, %.o, $(filter %.cc, $(srcs))) -objs = $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) +objs := $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) -includes += $(addprefix -I, $(addprefix $(srcdir)/, $(incs)) $(global-incs)) +includes := $(addprefix $(srcdir), $(incs)) $(global-incs) -cflags += -Wall \ +cflags += \ + -Wall \ -Werror \ -fPIC \ - $(includes) \ + $(addprefix -I, $(includes)) -cflags_c += $(cflags) \ +cflags_c += \ + $(cflags) \ -std=c11 \ -D_POSIX_C_SOURCE=200809L \ -fno-inline -cppflags += $(cflags) \ - $(CPPFLAGS) \ +cppflags += \ + $(cflags) \ + $(CPPFLAGS) +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +clang-tidy-srcs := \ + $(sort $(addprefix $(srcdir),$(call filter_out_third_party,$(srcs)))) + +clang-tidy-incs := $(call filter_out_third_party,$(includes)) + +clang-tidy-flags := \ + --header-filter '$(subst $() $(),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +.PHONY: all all: $(builddir)$(output) $(builddir)$(output): $(objs) @@ -82,3 +99,18 @@ $(builddir)%.o: $(srcdir)%.S ${q}mkdir -p $(shell dirname $@) @$(cmd-echo-silent) ' CC $@' ${q}$(cc) $(cflags_c) -c $< -o $@ + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + ${q}clang-tidy $(clang-tidy-flags) $(1) -- $(cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/linux/ta/common/opk_config.h b/oemcrypto/opk/ports/linux/ta/common/opk_config.h index 2ca0aa8..7e78d44 100644 --- a/oemcrypto/opk/ports/linux/ta/common/opk_config.h +++ b/oemcrypto/opk/ports/linux/ta/common/opk_config.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef OPK_CONFIG_SECURITY_LEVEL # define OPK_CONFIG_SECURITY_LEVEL OEMCrypto_Level3 @@ -15,10 +15,6 @@ # define OPK_CONFIG_RESOURCE_RATING_TIER 3 #endif -#ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT -# define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT 1 * 1024 * 1024 -#endif - #ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO # define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO 500 * 1024 #endif diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c index 0f950ad..536794b 100644 --- a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c @@ -10,6 +10,7 @@ #include "crypto_util.h" #include "layer2_crypto_key_table.h" +#include "odk_util.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_key_types.h" #include "oemcrypto_math.h" @@ -237,7 +238,7 @@ OEMCryptoResult WTPI_C2_HMAC_SHA256_Verify( OEMCryptoResult result = WTPI_C2_HMAC_SHA256( key_handle, message, message_length, computed_signature); if (result != OEMCrypto_SUCCESS) return result; - if (memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { + if (crypto_memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } return OEMCrypto_SUCCESS; diff --git a/oemcrypto/opk/ports/optee/Makefile b/oemcrypto/opk/ports/optee/Makefile index ae19b81..786a9d1 100644 --- a/oemcrypto/opk/ports/optee/Makefile +++ b/oemcrypto/opk/ports/optee/Makefile @@ -36,6 +36,7 @@ TEE_OS := OP-TEE TEE_VERSION := 3.18 DEVICE_FORM_FACTOR := test # overridden later by OP-TEE $(PLATFORM) var. Feel free to replace with own values IMPLEMENTER := your-name-here +OPTEE_PROVISIONING_METHOD := OEMCrypto_Keybox # Default toolchain dir from the optee repositories OPTEE_TOOLCHAIN_DIR ?= $(OPTEE_DIR)/toolchains @@ -119,12 +120,11 @@ oemcrypto_unittests: liboemcrypto wtpi_unittests: +$(MAKE) -C host/wtpi_unittests -.PHONY: clean -clean: - +$(MAKE) -C ta/oemcrypto_ta clean - +$(MAKE) -C ta/wtpi_test_ta clean - +$(MAKE) -C host/liboemcrypto clean - +$(MAKE) -C host/oemcrypto_helloworld clean - +$(MAKE) -C host/oemcrypto_unittests clean - +$(MAKE) -C host/wtpi_unittests clean - +.PHONY: clean clang-tidy +clean clang-tidy: + +$(MAKE) -C ta/oemcrypto_ta $@ + +$(MAKE) -C ta/wtpi_test_ta $@ + +$(MAKE) -C host/liboemcrypto $@ + +$(MAKE) -C host/oemcrypto_helloworld $@ + +$(MAKE) -C host/oemcrypto_unittests $@ + +$(MAKE) -C host/wtpi_unittests $@ diff --git a/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c b/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c index b71801e..57dca9a 100644 --- a/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c +++ b/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c @@ -140,12 +140,19 @@ OPK_TransportStatus TOS_Transport_SendMessage(ODK_Message* request, op.params[0].memref.size = opk_shared_memory_.size; op.params[1].memref.parent = &transport_shared_memory_; op.params[1].memref.offset = 0; - op.params[1].memref.size = ODK_Message_GetSize(request); + op.params[1].memref.size = transport_shared_memory_.size; + + // TEE_Param VALUE types contain two uint32_t fields. We want to store a + // size_t to represent max(request_size, response_size), but we don't ever + // expect it to realistically be larger than the max uint32_t size (4 GB) so + // we intentionally downcast from size_t to uint32_t. + op.params[2].value.a = (uint32_t)(ODK_Message_GetSize(request)); + op.params[2].value.b = 0; op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_WHOLE, /* opk_shared_memory */ TEEC_MEMREF_PARTIAL_INOUT, /* transport_shared_memory */ - TEEC_NONE, TEEC_NONE); + TEEC_VALUE_INPUT, TEEC_NONE); res = TEEC_InvokeCommand(&teec_session_, TA_SEND_REQUEST_CMD, &op, NULL); if (res != TEEC_SUCCESS) { LOGE("SendMessage failed: 0x%08x", res); diff --git a/oemcrypto/opk/ports/optee/host/rules.mk b/oemcrypto/opk/ports/optee/host/rules.mk index 6ae3a69..f6999e4 100644 --- a/oemcrypto/opk/ports/optee/host/rules.mk +++ b/oemcrypto/opk/ports/optee/host/rules.mk @@ -28,29 +28,46 @@ cmd-echo := echo cmd-echo-silent := true endif -cc := $(CROSS_COMPILE)gcc -cxx := $(CROSS_COMPILE)g++ +cc := $(CROSS_COMPILE)gcc +cxx := $(CROSS_COMPILE)g++ ssrc := $(patsubst %.S, %.o, $(filter %.S, $(srcs))) csrc := $(patsubst %.c, %.o, $(filter %.c, $(srcs))) cppsrc := $(patsubst %.cpp, %.o, $(filter %.cpp, $(srcs))) ccsrc := $(patsubst %.cc, %.o, $(filter %.cc, $(srcs))) -objs = $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) +objs := $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) -includes += $(addprefix -I, $(addprefix $(srcdir)/, $(incs)) $(global-incs)) +includes := $(addprefix $(srcdir), $(incs)) $(global-incs) -cflags += -Wall \ +cflags += \ + -Wall \ -Werror \ -fPIC \ - $(includes) \ + $(addprefix -I, $(includes)) -cflags_c += $(cflags) \ +cflags_c += \ + $(cflags) \ -std=c11 \ -D_POSIX_C_SOURCE=200809L -cppflags += $(cflags) \ - $(CPPFLAGS) \ +cppflags += \ + $(cflags) \ + $(CPPFLAGS) +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +clang-tidy-srcs := \ + $(sort $(addprefix $(srcdir),$(call filter_out_third_party,$(srcs)))) + +clang-tidy-incs := $(call filter_out_third_party,$(includes)) + +clang-tidy-flags := \ + --header-filter '$(subst $() $(),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +.PHONY: all all: $(builddir)$(output) $(builddir)$(output): $(objs) @@ -82,3 +99,18 @@ $(builddir)%.o: $(srcdir)%.S ${q}mkdir -p $(shell dirname $@) @$(cmd-echo-silent) ' CC $@' ${q}$(cc) $(cflags_c) -c $< -o $@ + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + ${q}clang-tidy $(clang-tidy-flags) $(1) -- $(cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h index c2bcb87..8987e5a 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _WTPI_OPTEE_ASYMMETRIC_KEY_H_ -#define _WTPI_OPTEE_ASYMMETRIC_KEY_H_ +#ifndef WTPI_OPTEE_ASYMMETRIC_KEY_H_ +#define WTPI_OPTEE_ASYMMETRIC_KEY_H_ #include #include "wtpi_crypto_asymmetric_interface.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h index 926b486..f54c23f 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _WTPI_CRYPTO_COMMON_H_ -#define _WTPI_CRYPTO_COMMON_H_ +#ifndef WTPI_CRYPTO_COMMON_H_ +#define WTPI_CRYPTO_COMMON_H_ #include "wtpi_crypto_and_key_management_interface_layer1.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h index e8e0e5a..1946c9b 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef MAX_NUMBER_OF_SESSIONS # define MAX_NUMBER_OF_SESSIONS 20 diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk index c50d86c..aeb8fc2 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk @@ -39,6 +39,7 @@ wtpi_impl_sources += \ $(wtpi_impl_dir)/util/ta_log.c \ $(wtpi_impl_dir)/util/der_parse.c \ $(wtpi_impl_dir)/util/odk_endian.c \ + $(wtpi_impl_dir)/util/device_info.c \ $(wtpi_ref_dir)/cose_util.c \ $(wtpi_impl_dir)/wtpi_abort.c \ $(wtpi_impl_dir)/wtpi_clock_layer2.c \ diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h index b79aa19..0f42300 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _DER_PARSE_H_ -#define _DER_PARSE_H_ +#ifndef DER_PARSE_H_ +#define DER_PARSE_H_ #include "OEMCryptoCENC.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c new file mode 100644 index 0000000..804e5e5 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c @@ -0,0 +1,55 @@ +#include "device_info.h" + +#include "cose_util.h" + +#include + +#include "dice/cbor_reader.h" +#include "dice/cbor_writer.h" +#include "dice/config.h" +#include "dice/dice.h" +#include "oemcrypto_check_macros.h" +#include "opk_config.h" +#include "wtpi_provisioning_4_interface.h" + +#define MAX_DEVICE_INFO_SIZE 768 + +OEMCryptoResult BuildDeviceInformation(uint8_t* out, size_t* out_length) { + if (out_length == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + size_t max_device_info_size = WTPI_MaxDeviceInfoSize(); + if (out == NULL || *out_length < max_device_info_size) { + *out_length = max_device_info_size; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + *out_length = max_device_info_size; + + // DeviceInfo = { + // "manufacturer" : tstr, + // "model" : tstr, + // "fused": 1 / 0, ; 1 if secure boot is enforced. 0 otherwise. + // } + const char* kMakeLabel = "manufacturer"; + const char* kModelLabel = "model"; + const char* kFusedLabel = "fused"; + bool is_fused = false; + OEMCryptoResult fused_result = WTPI_GetDeviceFusedStatus(&is_fused); + if (fused_result != OEMCrypto_SUCCESS) { + return fused_result; + } + struct CborOut cbor_out; + CborOutInit(out, *out_length, &cbor_out); + CborWriteMap(/*num_pairs=*/3, &cbor_out); + CborWriteTstr(kMakeLabel, &cbor_out); + CborWriteTstr(XSTR(OPK_CONFIG_SOC_VENDOR_NAME), &cbor_out); + CborWriteTstr(kModelLabel, &cbor_out); + CborWriteTstr(XSTR(OPK_CONFIG_SOC_MODEL_NAME), &cbor_out); + CborWriteTstr(kFusedLabel, &cbor_out); + CborWriteInt(is_fused ? 1 : 0, &cbor_out); + if (CborOutOverflowed(&cbor_out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + *out_length = CborOutSize(&cbor_out); + return OEMCrypto_SUCCESS; +} \ No newline at end of file diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h new file mode 100644 index 0000000..efe2b53 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h @@ -0,0 +1,20 @@ +/* Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#ifndef WTPI_UTIL_DEVICE_INFO_H_ +#define WTPI_UTIL_DEVICE_INFO_H_ + +#include "OEMCryptoCENCCommon.h" + +/* + * Builds a basic device information CBOR struct according to requirements in + * wtpi_provisioning_4_interface.h + * + * If possible, it is preferable to use a separate module (eg Trusty has + * "hwbcc") to provide this information. + */ +OEMCryptoResult BuildDeviceInformation(uint8_t* device_info, + size_t* device_info_length); + +#endif diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h index 796a33c..fddf459 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _TA_LOG_H_ -#define _TA_LOG_H_ +#ifndef TA_LOG_H_ +#define TA_LOG_H_ #include #include diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c index 03db811..5087387 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c @@ -4,17 +4,19 @@ * License Agreement. */ +#include "cose_util.h" +#include "device_info.h" +#include "oemcrypto_check_macros.h" #include "wtpi_provisioning_4_interface.h" #define DEVICE_INFO_MAX_LENGTH 256 +#define HWBCC_MAX_RESP_PAYLOAD_SIZE 1024 size_t WTPI_MaxDeviceInfoSize(void) { return DEVICE_INFO_MAX_LENGTH; } OEMCryptoResult WTPI_GetDeviceInformation(uint8_t* device_info, size_t* device_info_length) { - (void)device_info; - (void)device_info_length; - return OEMCrypto_ERROR_NOT_IMPLEMENTED; + return BuildDeviceInformation(device_info, device_info_length); } OEMCryptoResult WTPI_GetSignedCsrPayload(const uint8_t* challenge, @@ -23,11 +25,33 @@ OEMCryptoResult WTPI_GetSignedCsrPayload(const uint8_t* challenge, size_t encoded_device_info_length, uint8_t* signed_csr_payload, size_t* signed_csr_payload_length) { - (void)challenge; - (void)challenge_length; - (void)encoded_device_info; - (void)encoded_device_info_length; - (void)signed_csr_payload; - (void)signed_csr_payload_length; - return OEMCrypto_ERROR_NOT_IMPLEMENTED; + RETURN_INVALID_CONTEXT_IF_NULL(challenge); + RETURN_INVALID_CONTEXT_IF_ZERO(challenge_length); + RETURN_INVALID_CONTEXT_IF_NULL(encoded_device_info); + RETURN_INVALID_CONTEXT_IF_ZERO(encoded_device_info_length); + RETURN_INVALID_CONTEXT_IF_NULL(signed_csr_payload_length); + + if (signed_csr_payload == NULL || + *signed_csr_payload_length < HWBCC_MAX_RESP_PAYLOAD_SIZE) { + *signed_csr_payload_length = HWBCC_MAX_RESP_PAYLOAD_SIZE; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + *signed_csr_payload_length = HWBCC_MAX_RESP_PAYLOAD_SIZE; + + /* Generate Csr payload to be signed. HWBCC_MAX_RESP_PAYLOAD_SIZE is + * guaranteed to be large enough to hold the Csr payload. */ + uint8_t csr_payload_to_sign[HWBCC_MAX_RESP_PAYLOAD_SIZE]; + size_t csr_payload_to_sign_length = sizeof(csr_payload_to_sign); + OEMCryptoResult result = + GenerateCsrPayload(challenge, challenge_length, encoded_device_info, + encoded_device_info_length, csr_payload_to_sign, + &csr_payload_to_sign_length); + if (result != OEMCrypto_SUCCESS) { + return result; + } + + /* Sign Csr payload. */ + result = WTPI_BccKeyCoseSign1(csr_payload_to_sign, csr_payload_to_sign_length, + signed_csr_payload, signed_csr_payload_length); + return result; } diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c index 2e5d8b8..eb56257 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c @@ -674,7 +674,7 @@ OEMCryptoResult WTPI_K1_DeriveKeyFromKeyHandle( } uint8_t buffer[KEY_SIZE_256]; - for (uint8_t i = 0; i < out_key_size; i += KEY_SIZE_128) { + for (int i = 0; i < (int)out_key_size; i += KEY_SIZE_128) { TEE_MACInit(op_handle, NULL, 0); TEE_MACUpdate(op_handle, &counter, sizeof(counter)); counter++; diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c index 4e1fa5b..f5cb900 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c @@ -561,8 +561,6 @@ OEMCryptoResult WTPI_ECCDeriveSessionKey(WTPI_AsymmetricKey_Handle key, key_size_bytes = KEY_SIZE_512; break; default: - alg_type = 0; - key_size_bytes = 0; EMSG("Unsupported curve type %d", key->ecc_curve_type); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c index fd0f62b..b57ca69 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c @@ -74,6 +74,7 @@ static OEMCryptoResult WTPI_DecryptToOutputBuffer_CBC( WTPI_K1_SymmetricKey_Handle key, const uint8_t* initial_iv, const OEMCrypto_CENCEncryptPatternDesc* pattern, const uint8_t* in, size_t size, const OPK_OutputBuffer* out, size_t output_offset) { + if (size == 0) return OEMCrypto_SUCCESS; size_t total_size; if (OPK_AddOverflowUX(output_offset, size, &total_size)) { return OEMCrypto_ERROR_INVALID_CONTEXT; @@ -82,7 +83,6 @@ static OEMCryptoResult WTPI_DecryptToOutputBuffer_CBC( RETURN_INVALID_CONTEXT_IF_NULL(initial_iv); RETURN_INVALID_CONTEXT_IF_NULL(pattern); RETURN_INVALID_CONTEXT_IF_NULL(in); - RETURN_INVALID_CONTEXT_IF_ZERO(size); RETURN_INVALID_CONTEXT_IF_NULL(out); RETURN_INVALID_CONTEXT_IF_NULL(key); if (total_size > out->size) { @@ -252,6 +252,7 @@ OEMCryptoResult WTPI_DecryptSample( subsample->num_bytes_encrypted, &subsample_length)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (subsample_length == 0) continue; size_t current_offset; if (OPK_AddOverflowUX(starting_output_offset, offset, ¤t_offset)) { diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c index 5904403..6507ba3 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c @@ -156,11 +156,7 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( RETURN_INVALID_CONTEXT_IF_NULL(key_type); RETURN_INVALID_CONTEXT_IF_NULL(private_key_handle); - TEE_Attribute attrs[4]; - WTPI_AsymmetricKey_Handle sess = TEE_HANDLE_NULL; - TEE_Result res = TEE_SUCCESS; - OEMCryptoResult result = OEMCrypto_SUCCESS; - // Get device key + // Get device key const uint8_t* device_key = WTPI_GetDeviceKey(); const KeySize device_key_len = WTPI_GetDeviceKeySize(); if (device_key == NULL || device_key_len == 0) { @@ -175,28 +171,33 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - result = DeriveEccKey(device_key, device_key_len, TEE_ECC_CURVE_NIST_P256, - sess_key); + OEMCryptoResult result = DeriveEccKey(device_key, device_key_len, + TEE_ECC_CURVE_NIST_P256, sess_key); if (result != OEMCrypto_SUCCESS) { goto cleanup; } - sess = TEE_Malloc(sizeof(tee_asymmetric_key_handle), TEE_MALLOC_FILL_ZERO); + WTPI_AsymmetricKey_Handle sess = + TEE_Malloc(sizeof(tee_asymmetric_key_handle), TEE_MALLOC_FILL_ZERO); if (sess == NULL) { EMSG("Malloc failed, out of memory"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + goto cleanup; } sess->max_signature_size = sess_key->max_signature_size; sess->ecc_curve_type = sess_key->ecc_curve_type; - res = TEE_AllocateTransientObject( + TEE_Result tee_result = TEE_AllocateTransientObject( TEE_TYPE_ECDSA_KEYPAIR, sess_key->private_val_len * 8, &sess->key_handle); - if (res != TEE_SUCCESS) { - EMSG("TEE_AllocateTransientObject() failed with result 0x%x", res); + if (tee_result != TEE_SUCCESS) { + EMSG("TEE_AllocateTransientObject() failed with result 0x%x", tee_result); + WTPI_FreeAsymmetricKeyHandle(sess); + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; goto cleanup; } + TEE_Attribute attrs[4]; TEE_InitRefAttribute(&attrs[0], TEE_ATTR_ECC_PRIVATE_VALUE, sess_key->private_val, sess_key->private_val_len); TEE_InitRefAttribute(&attrs[1], TEE_ATTR_ECC_PUBLIC_VALUE_X, @@ -206,30 +207,24 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( TEE_InitValueAttribute(&attrs[3], TEE_ATTR_ECC_CURVE, sess_key->ecc_curve_type, 0); - res = TEE_PopulateTransientObject(sess->key_handle, - (const TEE_Attribute*)(&attrs), 4); - if (res != TEE_SUCCESS) { - EMSG("TEE_PopulateTransientObject() failed with result 0x%x", res); + tee_result = TEE_PopulateTransientObject(sess->key_handle, attrs, 4); + if (tee_result != TEE_SUCCESS) { + EMSG("TEE_PopulateTransientObject() failed with result 0x%x", tee_result); + WTPI_FreeAsymmetricKeyHandle(sess); + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; goto cleanup; } *key_type = DRM_ECC_PRIVATE_KEY; + *private_key_handle = sess; cleanup: - if (sess_key != TEE_HANDLE_NULL) { - TEE_Free(sess_key->private_val); - TEE_Free(sess_key->public_x); - TEE_Free(sess_key->public_y); - } + TEE_Free(sess_key->private_val); + TEE_Free(sess_key->public_x); + TEE_Free(sess_key->public_y); TEE_Free(sess_key); - if (res != TEE_SUCCESS) { - WTPI_FreeAsymmetricKeyHandle(sess); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - - *private_key_handle = sess; - return OEMCrypto_SUCCESS; + return result; } OEMCryptoResult WTPI_BccKeyCoseSign1(const uint8_t* message, diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile index 4729e6f..41285c9 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile @@ -36,3 +36,5 @@ endif .PHONY: build_and_copy build_and_copy: all cp $(O)/$(BINARY).ta $(O_BASE)/ + +include ../rules.mk diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c index 1f0818e..8829d65 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c @@ -83,7 +83,7 @@ void TA_CloseSessionEntryPoint(void __maybe_unused* session_context) { static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { uint32_t expected_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INOUT, TEE_PARAM_TYPE_MEMREF_INOUT, - TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE); + TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE); if (param_types != expected_param_types) { DMSG("Bad parameters\n"); @@ -98,7 +98,7 @@ static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { return TEE_ERROR_BAD_PARAMETERS; } - size_t request_size = params[1].memref.size; + size_t request_size = (size_t)(params[2].value.a); if (request_size > OPK_TRANSPORT_MESSAGE_SIZE) { DMSG("Size too large. Input is %zu, limit is %d\n", request_size, OPK_TRANSPORT_MESSAGE_SIZE); diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk index 42c1fac..aacf72b 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk @@ -35,13 +35,13 @@ global-incdirs-y += \ $(wtpi_impl_includes) \ cppflags-y += \ - -DWTPI_BUILD_INFO=\"$(WTPI_BUILD_INFO)\" \ -DOPK_CONFIG_SOC_VENDOR_NAME=$(SOC_VENDOR) \ -DOPK_CONFIG_SOC_MODEL_NAME=$(SOC_MODEL) \ -DOPK_CONFIG_TEE_OS_NAME=$(TEE_OS) \ -DOPK_CONFIG_TEE_OS_VERSION=$(TEE_VERSION) \ -DOPK_CONFIG_DEVICE_FORM_FACTOR=$(DEVICE_FORM_FACTOR) \ -DOPK_CONFIG_IMPLEMENTER_NAME=$(IMPLEMENTER) \ + -DOPK_CONFIG_PROVISIONING_METHOD=$(OPTEE_PROVISIONING_METHOD) \ -Wno-switch-default #-D_DEBUG diff --git a/oemcrypto/opk/ports/optee/ta/rules.mk b/oemcrypto/opk/ports/optee/ta/rules.mk new file mode 100644 index 0000000..b5062c9 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/rules.mk @@ -0,0 +1,50 @@ +# +# Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +# Filter out third-party sources for clang-tidy. +clang-tidy-srcs := \ + $(filter-out user_ta_header.c ta_entry_a32.S,\ + $(call filter_out_third_party,$(srcs))) + +# Generate flags to run clang-tidy with a single source file. + +oname = $(O)/$(patsubst %.c,%.o,$(1)) + +clang-tidy-incs = \ + $(call filter_out_third_party,\ + $(incdirs-$(call oname,$(1))) $(incdirs$(sm))) + +clang-tidy-flags = \ + --header-filter \ + '$(subst $() $(),|,$(strip $(call clang-tidy-incs,$(1))))' \ + --quiet + +clang-tidy-cflags = \ + -m$(ARCH) \ + $(comp-cppflags-$(call oname,$(1))) + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + $(q)clang-tidy \ + $(call clang-tidy-flags,$(1)) \ + $(1) \ + -- \ + $(call clang-tidy-cflags,$(1)) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile index a25f452..e661ae5 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile @@ -36,3 +36,5 @@ endif .PHONY: build_and_copy build_and_copy: all cp $(O)/$(BINARY).ta $(O_BASE)/ + +include ../rules.mk diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk index 5a685d8..30c7979 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk @@ -47,3 +47,6 @@ cppflags-y += \ -DOPK_CONFIG_TEE_OS_VERSION=$(TEE_VERSION) \ -DOPK_CONFIG_DEVICE_FORM_FACTOR=$(DEVICE_FORM_FACTOR) \ -DOPK_CONFIG_IMPLEMENTER_NAME=$(IMPLEMENTER) \ + -DOPK_CONFIG_PROVISIONING_METHOD=$(OPTEE_PROVISIONING_METHOD) \ + -Wno-switch-default \ + diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c index 02cdd8f..af07f79 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c @@ -77,7 +77,7 @@ void TA_CloseSessionEntryPoint(void __maybe_unused* session_context) { static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { uint32_t expected_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INOUT, TEE_PARAM_TYPE_MEMREF_INOUT, - TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE); + TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE); if (param_types != expected_param_types) { DMSG("Bad parameters\n"); @@ -92,7 +92,7 @@ static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { return TEE_ERROR_BAD_PARAMETERS; } - size_t request_size = params[1].memref.size; + size_t request_size = (size_t)(params[2].value.a); if (request_size > OPK_TRANSPORT_MESSAGE_SIZE) { DMSG("Size too large. Input is %zu, limit is %d\n", request_size, OPK_TRANSPORT_MESSAGE_SIZE); diff --git a/oemcrypto/opk/ports/trusty/ta/README.md b/oemcrypto/opk/ports/trusty/ta/README.md index 45b4493..729ed76 100644 --- a/oemcrypto/opk/ports/trusty/ta/README.md +++ b/oemcrypto/opk/ports/trusty/ta/README.md @@ -39,8 +39,8 @@ repo sync -c -j32 # Download an Android NDK prebuilt to compile liboemcrypto.so cd $TRUSTY_DIR/prebuilts -mkdir -p ndk && cd ndk -git clone https://android.googlesource.com/toolchain/prebuilts/ndk/r21 r21 +mkdir ndk && cd ndk +git clone https://android.googlesource.com/toolchain/prebuilts/ndk/r25 # Add the OEMCrypto TA path as a user module. The OEMCRYPTO_TA_DIR must expand # to a path that is relative to the Trusty directory diff --git a/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk b/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk new file mode 100644 index 0000000..b4f22cb --- /dev/null +++ b/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk @@ -0,0 +1,61 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPK_TRUSTY_CLANG_TIDY ?= false +ifeq ($(call TOBOOL,$(OPK_TRUSTY_CLANG_TIDY)),true) + +clang-tidy-srcs := $(MODULE_SRCS) + +clang-tidy-incs := $(MODULE_INCLUDES) + +clang-tidy-flags := \ + --header-filter '$(subst $(SPACE),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +clang-tidy-cflags := \ + $(MODULE_CFLAGS) \ + $(addprefix -D,$(MODULE_DEFINES) TRUSTY_USERSPACE) \ + $(addprefix -I,\ + $(MODULE_INCLUDES) \ + $(addsuffix /include,$(MODULE_LIBRARY_DEPS)) \ + external/open-dice/include/dice/config/boringssl_ed25519 \ + $(BUILDDIR)/sdk/sysroot/usr/include) + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): clang-tidy-flags := $(clang-tidy-flags) +clang-tidy-$(1): clang-tidy-cflags := $(clang-tidy-cflags) +clang-tidy-$(1): + @echo running clang-tidy: $(1) + $(NOECHO)clang-tidy $(clang-tidy-flags) $(1) -- $(clang-tidy-cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) + +EXTRA_BUILDDEPS += clang-tidy + +clang-tidy-srcs := +clang-tidy-incs := +clang-tidy-flags := +clang-tidy-cflags := +clang-tidy-rule := + +endif diff --git a/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h b/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h index cd25c62..4729186 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h +++ b/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h @@ -5,8 +5,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef OPK_CONFIG_RESOURCE_RATING_TIER # define OPK_CONFIG_RESOURCE_RATING_TIER 3 diff --git a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c deleted file mode 100644 index b274cd4..0000000 --- a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wtpi_crypto_asymmetric_interface.h" - -#include -#include -#include - -#include "OEMCryptoCENCCommon.h" -#include "ecc_util.h" -#include "oemcrypto_check_macros.h" -#include "oemcrypto_compiler_attributes.h" -#include "oemcrypto_key_types.h" -#include "openssl/curve25519.h" -#include "openssl/evp.h" -#include "openssl/hkdf.h" -#include "openssl/rsa.h" -#include "openssl/x509.h" -#include "rsa_util.h" -#include "wtpi_abort_interface.h" -#include "wtpi_device_key_access_interface.h" -#include "wtpi_device_key_interface.h" -#include "wtpi_logging_interface.h" - -typedef struct tee_asymmetric_key_handle { - AsymmetricKeyType key_type; - RSA* rsa_key; - EC_KEY* ecc_key; - // Consider to use EVP_KEY instead of serialized key. - uint8_t ed25519_key[ED25519_PRIVATE_KEY_LEN]; -} tee_asymmetric_key_handle; - -// Returns true as long as one byte of ed25519_key is non-zero. -static bool HasED25519Key(WTPI_AsymmetricKey_Handle key_handle) { - for (size_t i = 0; i < ED25519_PRIVATE_KEY_LEN; ++i) { - if (key_handle->ed25519_key[i] != 0) { - return true; - } - } - return false; -} - -static bool IsAsymmetricKeyHandleValid(WTPI_AsymmetricKey_Handle key_handle) { - if (key_handle == NULL) return false; - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: { - if (key_handle->rsa_key == NULL) return false; - if (key_handle->ecc_key != NULL) return false; - if (HasED25519Key(key_handle)) return false; - break; - } - case DRM_ECC_PRIVATE_KEY: { - if (key_handle->ecc_key == NULL) return false; - if (key_handle->rsa_key != NULL) return false; - if (HasED25519Key(key_handle)) return false; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - if (key_handle->ecc_key != NULL) return false; - if (key_handle->rsa_key != NULL) return false; - if (!HasED25519Key(key_handle)) return false; - break; - } - default: - return false; - } - return true; -} - -static bool IsSupportedAsymmetricKeyType(AsymmetricKeyType key_type) { - return (key_type == DRM_RSA_PRIVATE_KEY || key_type == DRM_ECC_PRIVATE_KEY || - key_type == PROV40_ED25519_PRIVATE_KEY); -} - -static bool CreateAsymmetricRSAKeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - if (serialized_bytes == NULL || size == 0 || handle == NULL) { - return false; - } - RSA* rsa = NULL; - if (!DeserializePKCS8PrivateKey(serialized_bytes, size, &rsa)) { - return false; - } - if (!CheckRSAKey(rsa)) { - RSA_free(rsa); - return false; - } - handle->key_type = DRM_RSA_PRIVATE_KEY; - handle->rsa_key = rsa; - return true; -} - -static bool CreateAsymmetricECCKeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - EC_KEY* ecc_key = NULL; - if (!DeserializeECCPrivateKey(serialized_bytes, size, &ecc_key)) { - return false; - } - /* DeserializeECCPrivateKey will check the key after deserializing. */ - handle->key_type = DRM_ECC_PRIVATE_KEY; - handle->ecc_key = ecc_key; - return true; -} - -static bool CreateAsymmetricED25519KeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - if (serialized_bytes == NULL || size != ED25519_PRIVATE_KEY_LEN) { - return false; - } - handle->key_type = PROV40_ED25519_PRIVATE_KEY; - memcpy(handle->ed25519_key, serialized_bytes, size); - return true; -} - -OEMCryptoResult WTPI_CreateAsymmetricKeyHandle( - const uint8_t* serialized_bytes, size_t size, AsymmetricKeyType key_type, - WTPI_AsymmetricKey_Handle* key_handle) { - if (serialized_bytes == NULL || size == 0 || - !IsSupportedAsymmetricKeyType(key_type) || key_handle == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - WTPI_AsymmetricKey_Handle handle = malloc(sizeof(tee_asymmetric_key_handle)); - if (handle == NULL) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - memset(handle, 0, sizeof(*handle)); - switch (key_type) { - case DRM_RSA_PRIVATE_KEY: { - if (!CreateAsymmetricRSAKeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - case DRM_ECC_PRIVATE_KEY: { - if (!CreateAsymmetricECCKeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - if (!CreateAsymmetricED25519KeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - } - *key_handle = handle; - return OEMCrypto_SUCCESS; -cleanup: - if (handle) { - free(handle); - } - // TODO(b/201581141): Renamed to be more applicable to both RSA and ECC - // keys. - return OEMCrypto_ERROR_INVALID_RSA_KEY; -} - -OEMCryptoResult WTPI_FreeAsymmetricKeyHandle( - WTPI_AsymmetricKey_Handle key_handle) { - if (key_handle == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: { - RSA_free(key_handle->rsa_key); - key_handle->rsa_key = NULL; - break; - } - case DRM_ECC_PRIVATE_KEY: { - EC_KEY_free(key_handle->ecc_key); - key_handle->ecc_key = NULL; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - memset(key_handle->ed25519_key, 0, sizeof(key_handle->ed25519_key)); - break; - } - } - free(key_handle); - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_RSASign(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length, - RSA_Padding_Scheme padding_scheme) { - if (key_handle == NULL || message == NULL || message_length == 0 || - signature_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_RSA_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - RSA* rsa = key_handle->rsa_key; - const size_t max_signature_size = (size_t)RSA_size(rsa); - if (signature == NULL || *signature_length < max_signature_size) { - *signature_length = max_signature_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - - /* This is the standard padding scheme used for license requests. */ - if (padding_scheme == kSign_RSASSA_PSS) { - size_t local_signature_length = *signature_length; - if (!RSASignSSAPSSSHA256(rsa, message, message_length, signature, - &local_signature_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - *signature_length = local_signature_length; - /* This is the alternate padding scheme used by cast receivers only. */ - } else if (padding_scheme == kSign_PKCS1_Block1) { - /* Pad the message with PKCS1 padding, and then encrypt. */ - const int encrypt_res = RSA_private_encrypt( - message_length, message, signature, rsa, RSA_PKCS1_PADDING); - if (encrypt_res <= 0) { - dump_ssl_error(); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - *signature_length = (size_t)encrypt_res; - } else { /* Bad RSA_Padding_Scheme */ - return OEMCrypto_ERROR_INVALID_RSA_KEY; - } - - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_RSADecrypt(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* in, size_t in_length, - uint8_t* out, size_t* out_length) { - if (key_handle == NULL || in == NULL || in_length == 0 || out == NULL || - out_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_RSA_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - RSA* rsa = key_handle->rsa_key; - const size_t max_cleartext_size = (size_t)RSA_size(rsa); - if (*out_length < max_cleartext_size) { - *out_length = max_cleartext_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - if (!RSAPrivateDecrypt(rsa, in, in_length, out, out_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_ECCSign(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length) { - if (key_handle == NULL || message == NULL || message_length == 0 || - signature_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_ECC_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - EC_KEY* ecc_key = key_handle->ecc_key; - const size_t max_signature_size = ECDSA_size(ecc_key); - if (signature == NULL || *signature_length < max_signature_size) { - *signature_length = max_signature_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - if (!ECCSignECDSA(ecc_key, message, message_length, signature, - signature_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_ECCDeriveSessionKey(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* key_source, - size_t key_source_length, - uint8_t* session_key, - size_t* session_key_length) { - if (key_handle == NULL || key_source == NULL || key_source_length == 0 || - session_key_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_ECC_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - if (session_key == NULL || *session_key_length < KEY_SIZE_256) { - *session_key_length = KEY_SIZE_256; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - EC_KEY* ecc_key = key_handle->ecc_key; - if (!ECCWidevineECDHSessionKey(ecc_key, key_source, key_source_length, - session_key, session_key_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_GetSignatureSize(WTPI_AsymmetricKey_Handle key_handle, - size_t* key_size) { - if (key_handle == NULL || key_size == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - *key_size = 0; - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: - *key_size = RSA_size(key_handle->rsa_key); - break; - case DRM_ECC_PRIVATE_KEY: - *key_size = ECDSA_size(key_handle->ecc_key); - break; - case PROV40_ED25519_PRIVATE_KEY: - *key_size = ED25519_SIGNATURE_LEN; - break; - } - if (*key_size == 0) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_GetSignatureHashAlgorithm( - WTPI_AsymmetricKey_Handle key, AsymmetricKeyType key_type, - OEMCrypto_SignatureHashAlgorithm* hash_algorithm) { - RETURN_INVALID_CONTEXT_IF_NULL(key); - RETURN_INVALID_CONTEXT_IF_NULL(hash_algorithm); - ABORT_IF(!IsAsymmetricKeyHandleValid(key), "Impossible key handle."); - if (key_type != key->key_type) { - LOGE("Passed-in key's type does not match passed-in key type."); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - switch (key_type) { - case DRM_RSA_PRIVATE_KEY: - *hash_algorithm = OEMCrypto_SHA2_256; - return OEMCrypto_SUCCESS; - - case DRM_ECC_PRIVATE_KEY: - if (GetECCKeyECDSAHashAlgorithm(key->ecc_key, hash_algorithm)) { - return OEMCrypto_SUCCESS; - } else { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - - case PROV40_ED25519_PRIVATE_KEY: - *hash_algorithm = OEMCrypto_SHA2_512; - return OEMCrypto_SUCCESS; - } - return OEMCrypto_ERROR_UNKNOWN_FAILURE; -} - -OEMCryptoResult WTPI_ED25519Sign(WTPI_AsymmetricKey_Handle key, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length) { - return OEMCrypto_ERROR_NOT_IMPLEMENTED; -} diff --git a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c index 122a20c..4e0703e 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c @@ -53,7 +53,7 @@ OEMCryptoResult WTPI_GetBootCertificateChain(uint8_t* out, size_t* out_length) { size_t signature_size_unused = 0; int result = hwbcc_get_protected_data( /*test_mode=*/false, /*cose_algorithm=*/HWBCC_ALGORITHM_ED25519, - /*key=*/key_unused, /*key_size=*/sizeof(key_unused), + /*data=*/key_unused, /*data_size=*/sizeof(key_unused), /*aad=*/NULL, /*aad_size=*/0, /*cose_sign1=*/signature_unused, /*cose_sign1_buf_size=*/sizeof(signature_unused), /*cose_sign1_size=*/&signature_size_unused, /*bcc=*/out, @@ -146,7 +146,7 @@ OEMCryptoResult WTPI_BccKeyCoseSign1(const uint8_t* message, size_t bcc_size_unused = 0; int result = hwbcc_get_protected_data( /*test_mode=*/false, /*cose_algorithm=*/HWBCC_ALGORITHM_ED25519, - /*key=*/message, /*key_size=*/message_length, /*aad=*/NULL, + /*data=*/message, /*data_size=*/message_length, /*aad=*/NULL, /*aad_size=*/0, /*cose_sign1=*/signature, /*cose_sign1_buf_size=*/*signature_length, /*cose_sign1_size=*/signature_length, /*bcc=*/bcc_unused, diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk index 777b2af..8b7f7d6 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk @@ -1,6 +1,8 @@ +APP_BUILD_SCRIPT := Android.mk APP_PLATFORM := android-19 APP_ABI := arm64-v8a APP_STL := c++_static APP_CFLAGS := -Werror -Wall -Wextra -Wno-unused-function -Wno-unused-label -Wvla APP_CONLYFLAGS += -std=c17 APP_CPPFLAGS += -std=c++17 +APP_CLANG_TIDY_FLAGS := --header-filter shared/include --quiet diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh index 882c383..fb9eca7 100755 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh @@ -3,11 +3,18 @@ set -e set -u +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + # Build liboemcrypto.so -if [ ! -v ANDROID_NDK_ROOT ]; -then - ANDROID_NDK_ROOT=$(realpath $(dirname "$0")/../../../../../prebuilts/ndk/r21) +if [ ! -v ANDROID_NDK_ROOT ]; then + ANDROID_NDK_ROOT=$(realpath "$SCRIPT_DIR/../../../../../prebuilts/ndk/r25") fi -$ANDROID_NDK_ROOT/ndk-build -C $(dirname "${BASH_SOURCE[0]}") NDK_PROJECT_PATH=out APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk NDK_DEBUG=1 -j`nproc` +"$ANDROID_NDK_ROOT/ndk-build" \ + -C "$SCRIPT_DIR" \ + NDK_PROJECT_PATH=out \ + NDK_APPLICATION_MK=Application.mk \ + NDK_DEBUG=1 \ + "-j$(nproc)" \ + "$@" diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk index c9e2e6c..0b1f6a3 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk @@ -24,12 +24,18 @@ endif LIBOEMCRYPTO_SO := $(LIBOEMCRYPTO_OUT_DIR)/lib/arm64-v8a/liboemcrypto.so +.PHONY: $(LIBOEMCRYPTO_SO) $(LIBOEMCRYPTO_SO): LOCAL_DIR := $(GET_LOCAL_DIR) $(LIBOEMCRYPTO_SO): LIBOEMCRYPTO_BUILD_DIR := $(LIBOEMCRYPTO_BUILD_DIR) $(LIBOEMCRYPTO_SO): LIBOEMCRYPTO_OUT_DIR := $(LIBOEMCRYPTO_OUT_DIR) -$(LIBOEMCRYPTO_SO): NDK_ROOT := $(TRUSTY_TOP)/prebuilts/ndk/r21 -$(LIBOEMCRYPTO_SO): .PHONY - $(NOECHO)(cd $(LOCAL_DIR) && $(NDK_ROOT)/ndk-build NDK_PROJECT_PATH=$(LIBOEMCRYPTO_BUILD_DIR) NDK_LIBS_OUT=$(LIBOEMCRYPTO_OUT_DIR)/lib APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk -j`nproc`) +$(LIBOEMCRYPTO_SO): NDK_ROOT := $(TRUSTY_TOP)/prebuilts/ndk/r25 +$(LIBOEMCRYPTO_SO): + $(NOECHO)$(NDK_ROOT)/ndk-build \ + -C $(LOCAL_DIR) \ + NDK_PROJECT_PATH=$(LIBOEMCRYPTO_BUILD_DIR) \ + NDK_LIBS_OUT=$(LIBOEMCRYPTO_OUT_DIR)/lib \ + NDK_APPLICATION_MK=Application.mk \ + -j`nproc` # Ensure liboemcrypto.so is built EXTRA_BUILDDEPS += $(LIBOEMCRYPTO_SO) diff --git a/oemcrypto/opk/ports/trusty/ta/reference/rules.mk b/oemcrypto/opk/ports/trusty/ta/reference/rules.mk index eea7380..443873d 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/rules.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/rules.mk @@ -85,6 +85,7 @@ MODULE_SRCS += \ $(APP_DIR)/wtpi_reference/wtpi_clock_and_gn_layer1.c \ $(APP_DIR)/wtpi_reference/wtpi_config.c \ $(APP_DIR)/wtpi_reference/wtpi_crc32.c \ + $(APP_DIR)/wtpi_reference/wtpi_crypto_asymmetric.c \ $(APP_DIR)/wtpi_reference/wtpi_crypto_wrap_asymmetric.c \ $(APP_DIR)/wtpi_reference/wtpi_device_renewal_layer1.c \ $(APP_DIR)/wtpi_reference/wtpi_decrypt_sample.c \ @@ -92,7 +93,6 @@ MODULE_SRCS += \ $(APP_DIR)/wtpi_reference/wtpi_logging.c \ $(APP_DIR)/wtpi_reference/wtpi_root_of_trust_layer1.c \ $(REF_IMPL_DIR)/wtpi_clock_layer2.c \ - $(REF_IMPL_DIR)/wtpi_crypto_asymmetric.c \ $(REF_IMPL_DIR)/wtpi_secure_buffer_access.c \ $(REF_IMPL_DIR)/wtpi_initialize_terminate.c \ $(REF_IMPL_DIR)/wtpi_config.c \ @@ -129,6 +129,8 @@ MODULE_SRCS += \ MODULE_INCLUDES += \ $(opk_base_ta_includes) \ +include $(REF_DIR)/clang-tidy-inc.mk + # Before including trusted_app.mk, this is the root build directory LIBOEMCRYPTO_OUT_DIR := $(BUILDDIR) diff --git a/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c b/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c index 6b80085..c8b805e 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c @@ -123,8 +123,8 @@ void cleanup_secure_buffers(void) { } /* Overly cautious clear */ - secure_buffers[num_secure_buffers] = (struct secure_buffer_info){ - .handle = INVALID_IPC_HANDLE, .size = 0, .addr = NULL}; + secure_buffers[i] = (struct secure_buffer_info){ + .handle = INVALID_IPC_HANDLE, .size = 0, .addr = NULL}; } num_secure_buffers = 0; } diff --git a/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c b/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c index 201b148..f388136 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c @@ -138,12 +138,10 @@ static int receive_tagged(handle_t chan, /* Check we have enough space to read the message. */ if (info.len > WV_HEADER_SIZE + *num_bytes) { TLOGE("Buffer too small %d %zu\n", chan, info.len); - rc = -1; goto on_post_get_error; } if (info.num_handles > *num_handles) { TLOGE("Too many handles %d %u\n", chan, info.num_handles); - rc = -1; goto on_post_get_error; } diff --git a/oemcrypto/opk/serialization/common/GEN_common_serializer.c b/oemcrypto/opk/serialization/common/GEN_common_serializer.c index 5aed9c1..67775bf 100644 --- a/oemcrypto/opk/serialization/common/GEN_common_serializer.c +++ b/oemcrypto/opk/serialization/common/GEN_common_serializer.c @@ -11,7 +11,6 @@ #include -#include "GEN_common_serializer.h" #include "bump_allocator.h" #include "common_special_cases.h" #include "log_macros.h" diff --git a/oemcrypto/opk/serialization/common/include/marshaller_base.h b/oemcrypto/opk/serialization/common/include/marshaller_base.h index dbe9440..b3eb9c0 100644 --- a/oemcrypto/opk/serialization/common/include/marshaller_base.h +++ b/oemcrypto/opk/serialization/common/include/marshaller_base.h @@ -19,8 +19,6 @@ extern "C" { #endif -typedef struct _Message Message; - /* * When packing a pointer to size_t, and the pointer is null, pass * this special value of size_t instead diff --git a/oemcrypto/opk/serialization/common/include/opk_serialization_base.h b/oemcrypto/opk/serialization/common/include/opk_serialization_base.h index 09dd4ca..474618a 100644 --- a/oemcrypto/opk/serialization/common/include/opk_serialization_base.h +++ b/oemcrypto/opk/serialization/common/include/opk_serialization_base.h @@ -144,7 +144,7 @@ void OPK_PackEOM(ODK_Message* message); * parameter type */ void OPK_PackSharedBuffer(ODK_Message* message, const uint8_t* address, - const LengthType length, bool map, bool copy_in, + LengthType length, bool map, bool copy_in, bool is_output); /* diff --git a/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c b/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c index 6af6b1b..324703f 100644 --- a/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c +++ b/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c @@ -772,41 +772,6 @@ cleanup_and_return: return result; } -OEMCRYPTO_API OEMCryptoResult OEMCrypto_LoadCasECMKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key) { - pthread_mutex_lock(&api_lock); - OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_LoadCasECMKeys_Request(session, message, message_length, - even_key, odd_key); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_LoadCasECMKeys_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - result = API_CheckResult(result); - pthread_mutex_unlock(&api_lock); - return result; -} - OEMCRYPTO_API OEMCryptoResult OEMCrypto_GetOEMKeyToken(OEMCrypto_SESSION key_session, uint8_t* key_token, size_t* key_token_length) { @@ -1194,6 +1159,39 @@ cleanup_and_return: return result; } +OEMCRYPTO_API OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature( + const uint8_t* signature, size_t signature_length) { + pthread_mutex_lock(&api_lock); + OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + ODK_Message request = ODK_Message_Create(NULL, 0); + ODK_Message response = ODK_Message_Create(NULL, 0); + + API_Initialize(); + request = + OPK_Pack_FactoryInstallBCCSignature_Request(signature, signature_length); + if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { + if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { + api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; + } else { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + goto cleanup_and_return; + } + response = API_Transact(&request); + OPK_Unpack_FactoryInstallBCCSignature_Response(&response, &result); + + if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } +cleanup_and_return: + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + + result = API_CheckResult(result); + pthread_mutex_unlock(&api_lock); + return result; +} + OEMCRYPTO_API OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(void) { pthread_mutex_lock(&api_lock); diff --git a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c index 5c7a6dd..a927db2 100644 --- a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c +++ b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c @@ -761,43 +761,6 @@ void OPK_Unpack_ReassociateEntitledKeySession_Response( } } -ODK_Message OPK_Pack_LoadCasECMKeys_Request( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key) { - uint32_t api_value = 120; /* from _oecc120 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_Pack_size_t(&msg, &message_length); - OPK_Pack_uint32_t(&msg, &session); - OPK_PackMemory(&msg, (const uint8_t*)message, - OPK_ToLengthType(message_length)); - OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, even_key); - OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, odd_key); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, - OEMCryptoResult* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 120) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_uint32_t(msg, result); - if (!Is_Valid_OEMCryptoResult(*result)) { - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); - } - OPK_UnpackEOM(msg); - - if (SuccessResult(*result)) { - OPK_SharedBuffer_FinalizeUnpacking(); - } -} - ODK_Message OPK_Pack_GetOEMKeyToken_Request(OEMCrypto_SESSION key_session, const uint8_t* key_token, const size_t* key_token_length) { @@ -1259,6 +1222,38 @@ void OPK_Unpack_InstallKeyboxOrOEMCert_Response(ODK_Message* msg, } } +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Request( + const uint8_t* signature, size_t signature_length) { + uint32_t api_value = 142; /* from _oecc142 */ + ODK_Message msg = TOS_Transport_GetRequest(); + OPK_Pack_uint32_t(&msg, &api_value); + uint64_t timestamp = time(0); + OPK_Pack_uint64_t(&msg, ×tamp); + OPK_Pack_size_t(&msg, &signature_length); + OPK_PackMemory(&msg, (const uint8_t*)signature, + OPK_ToLengthType(signature_length)); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + +void OPK_Unpack_FactoryInstallBCCSignature_Response(ODK_Message* msg, + OEMCryptoResult* result) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 142) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + OPK_Unpack_uint32_t(msg, result); + if (!Is_Valid_OEMCryptoResult(*result)) { + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); + } + OPK_UnpackEOM(msg); + + if (SuccessResult(*result)) { + OPK_SharedBuffer_FinalizeUnpacking(); + } +} + ODK_Message OPK_Pack_GetProvisioningMethod_Request(void) { uint32_t api_value = 49; /* from _oecc49 */ ODK_Message msg = TOS_Transport_GetRequest(); diff --git a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h index 2535ed9..e76e432 100644 --- a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h +++ b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h @@ -114,12 +114,6 @@ ODK_Message OPK_Pack_ReassociateEntitledKeySession_Request( OEMCrypto_SESSION key_session, OEMCrypto_SESSION oec_session); void OPK_Unpack_ReassociateEntitledKeySession_Response(ODK_Message* msg, OEMCryptoResult* result); -ODK_Message OPK_Pack_LoadCasECMKeys_Request( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key); -void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, - OEMCryptoResult* result); ODK_Message OPK_Pack_GetOEMKeyToken_Request(OEMCrypto_SESSION key_session, const uint8_t* key_token, const size_t* key_token_length); @@ -192,6 +186,10 @@ ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Request( const uint8_t* keybox_or_cert, size_t keybox_or_cert_length); void OPK_Unpack_InstallKeyboxOrOEMCert_Response(ODK_Message* msg, OEMCryptoResult* result); +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Request( + const uint8_t* signature, size_t signature_length); +void OPK_Unpack_FactoryInstallBCCSignature_Response(ODK_Message* msg, + OEMCryptoResult* result); ODK_Message OPK_Pack_GetProvisioningMethod_Request(void); void OPK_Unpack_GetProvisioningMethod_Response( ODK_Message* msg, OEMCrypto_ProvisioningMethod* result); diff --git a/oemcrypto/opk/serialization/ree/ree_special_cases.c b/oemcrypto/opk/serialization/ree/ree_special_cases.c index fc7d976..be3133b 100644 --- a/oemcrypto/opk/serialization/ree/ree_special_cases.c +++ b/oemcrypto/opk/serialization/ree/ree_special_cases.c @@ -76,3 +76,40 @@ void OPK_Pack_RewrapDeviceRSAKey_Request( } OEMCryptoResult OPK_PreHook_OEMCrypto_Initialize(void) { return 0; } + +ODK_Message OPK_Pack_LoadCasECMKeys_Request( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key) { + uint32_t api_value = 120; /* from _oecc120 */ + ODK_Message msg = TOS_Transport_GetRequest(); + OPK_Pack_uint32_t(&msg, &api_value); + uint64_t timestamp = time(0); + OPK_Pack_uint64_t(&msg, ×tamp); + OPK_Pack_size_t(&msg, &message_length); + OPK_Pack_uint32_t(&msg, &session); + OPK_PackMemory(&msg, (const uint8_t*)message, + OPK_ToLengthType(message_length)); + OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, even_key); + OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, odd_key); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + +void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, + OEMCryptoResult* result) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 120) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + OPK_Unpack_uint32_t(msg, result); + if (!Is_Valid_OEMCryptoResult(*result)) { + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); + } + OPK_UnpackEOM(msg); + + if (SuccessResult(*result)) { + OPK_SharedBuffer_FinalizeUnpacking(); + } +} diff --git a/oemcrypto/opk/serialization/ree/ree_special_cases.h b/oemcrypto/opk/serialization/ree/ree_special_cases.h index b2b22a4..45b3cd4 100644 --- a/oemcrypto/opk/serialization/ree/ree_special_cases.h +++ b/oemcrypto/opk/serialization/ree/ree_special_cases.h @@ -27,6 +27,12 @@ void OPK_Pack_RewrapDeviceRSAKey_Request( const uint32_t* unaligned_nonce, const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, const uint8_t* enc_rsa_key_iv, const uint8_t* wrapped_rsa_key, const size_t* wrapped_rsa_key_length); +ODK_Message OPK_Pack_LoadCasECMKeys_Request( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key); +void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, + OEMCryptoResult* result); /* * Optional function declarations for custom REE-side hooks. See diff --git a/oemcrypto/opk/serialization/ree/special_case_apis.c b/oemcrypto/opk/serialization/ree/special_case_apis.c index 593045d..3a24efa 100644 --- a/oemcrypto/opk/serialization/ree/special_case_apis.c +++ b/oemcrypto/opk/serialization/ree/special_case_apis.c @@ -38,3 +38,37 @@ OEMCrypto_OPK_SerializationVersion(uint32_t* ree_major, uint32_t* ree_minor, pthread_mutex_unlock(&api_lock); return result; } + +OEMCRYPTO_API OEMCryptoResult OEMCrypto_LoadCasECMKeys( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key) { + pthread_mutex_lock(&api_lock); + OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + ODK_Message request = ODK_Message_Create(NULL, 0); + ODK_Message response = ODK_Message_Create(NULL, 0); + API_Initialize(); + request = OPK_Pack_LoadCasECMKeys_Request(session, message, message_length, + even_key, odd_key); + if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { + if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { + api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; + } else { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + goto cleanup_and_return; + } + response = API_Transact(&request); + OPK_Unpack_LoadCasECMKeys_Response(&response, &result); + + if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } +cleanup_and_return: + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + + result = API_CheckResult(result); + pthread_mutex_unlock(&api_lock); + return result; +} diff --git a/oemcrypto/opk/serialization/tee/GEN_dispatcher.c b/oemcrypto/opk/serialization/tee/GEN_dispatcher.c index daa5a31..327d852 100644 --- a/oemcrypto/opk/serialization/tee/GEN_dispatcher.c +++ b/oemcrypto/opk/serialization/tee/GEN_dispatcher.c @@ -20,6 +20,7 @@ #include "oemcrypto_wall_clock.h" #include "opk_dispatcher.h" #include "shared_buffer_allocator.h" +#include "special_case_request_handlers.h" #include "tee_special_cases.h" #include "tos_shared_memory_interface.h" #include "tos_transport_interface.h" @@ -549,31 +550,8 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, } case 120: /* OEMCrypto_LoadCasECMKeys */ { - size_t message_length; - OPK_Init_size_t((size_t*)&message_length); - OEMCrypto_SESSION session; - OPK_Init_uint32_t((uint32_t*)&session); - uint8_t* message; - OPK_InitPointer((uint8_t**)&message); - OEMCrypto_EntitledContentKeyObject* even_key = - (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( - sizeof(OEMCrypto_EntitledContentKeyObject)); - OPK_Init_OEMCrypto_EntitledContentKeyObject( - (OEMCrypto_EntitledContentKeyObject*)even_key); - OEMCrypto_EntitledContentKeyObject* odd_key = - (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( - sizeof(OEMCrypto_EntitledContentKeyObject)); - OPK_Init_OEMCrypto_EntitledContentKeyObject( - (OEMCrypto_EntitledContentKeyObject*)odd_key); - OPK_Unpack_LoadCasECMKeys_Request(request, &session, &message, - &message_length, &even_key, &odd_key); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - OEMCryptoResult result; - OPK_Init_uint32_t((uint32_t*)&result); - LOGD("LoadCasECMKeys"); - result = OEMCrypto_LoadCasECMKeys(session, message, message_length, - even_key, odd_key); - *response = OPK_Pack_LoadCasECMKeys_Response(result); + if (!Handle_OEMCrypto_LoadCasECMKeys(request, response)) + goto handle_invalid_request; break; } case 130: /* OEMCrypto_GetOEMKeyToken */ @@ -841,6 +819,23 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_InstallKeyboxOrOEMCert_Response(result); break; } + case 142: /* OEMCrypto_FactoryInstallBCCSignature */ + { + size_t signature_length; + OPK_Init_size_t((size_t*)&signature_length); + uint8_t* signature; + OPK_InitPointer((uint8_t**)&signature); + OPK_Unpack_FactoryInstallBCCSignature_Request(request, &signature, + &signature_length); + if (!ODK_Message_IsValid(request)) goto handle_invalid_request; + OEMCryptoResult result; + OPK_Init_uint32_t((uint32_t*)&result); + LOGD("FactoryInstallBCCSignature"); + result = + OEMCrypto_FactoryInstallBCCSignature(signature, signature_length); + *response = OPK_Pack_FactoryInstallBCCSignature_Response(result); + break; + } case 49: /* OEMCrypto_GetProvisioningMethod */ { OPK_Unpack_GetProvisioningMethod_Request(request); diff --git a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c index 0310c8e..2ba809c 100644 --- a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c +++ b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c @@ -635,35 +635,6 @@ ODK_Message OPK_Pack_ReassociateEntitledKeySession_Response( return msg; } -void OPK_Unpack_LoadCasECMKeys_Request( - ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, - size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, - OEMCrypto_EntitledContentKeyObject** odd_key) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 120) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_Unpack_size_t(msg, message_length); - OPK_Unpack_uint32_t(msg, session); - OPK_UnpackInPlace(msg, (uint8_t**)message, OPK_FromSizeTPtr(message_length)); - OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, even_key); - OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, odd_key); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result) { - uint32_t api_value = 120; /* from _oecc120 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_uint32_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_GetOEMKeyToken_Request(ODK_Message* msg, OEMCrypto_SESSION* key_session, uint8_t** key_token, @@ -1078,6 +1049,33 @@ ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Response(OEMCryptoResult result) { return msg; } +void OPK_Unpack_FactoryInstallBCCSignature_Request(ODK_Message* msg, + uint8_t** signature, + size_t* signature_length) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 142) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + uint64_t timestamp; + OPK_Unpack_uint64_t(msg, ×tamp); + OPK_Unpack_size_t(msg, signature_length); + OPK_UnpackInPlace(msg, (uint8_t**)signature, + OPK_FromSizeTPtr(signature_length)); + OPK_UnpackEOM(msg); + OPK_SharedBuffer_FinalizeUnpacking(); +} + +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Response( + OEMCryptoResult result) { + uint32_t api_value = 142; /* from _oecc142 */ + ODK_Message msg = TOS_Transport_GetResponse(); + OPK_Pack_uint32_t(&msg, &api_value); + OPK_Pack_uint32_t(&msg, &result); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + void OPK_Unpack_GetProvisioningMethod_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); diff --git a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h index 97316e2..23ad177 100644 --- a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h +++ b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h @@ -112,11 +112,6 @@ void OPK_Unpack_ReassociateEntitledKeySession_Request( OEMCrypto_SESSION* oec_session); ODK_Message OPK_Pack_ReassociateEntitledKeySession_Response( OEMCryptoResult result); -void OPK_Unpack_LoadCasECMKeys_Request( - ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, - size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, - OEMCrypto_EntitledContentKeyObject** odd_key); -ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result); void OPK_Unpack_GetOEMKeyToken_Request(ODK_Message* msg, OEMCrypto_SESSION* key_session, uint8_t** key_token, @@ -189,6 +184,11 @@ void OPK_Unpack_InstallKeyboxOrOEMCert_Request(ODK_Message* msg, uint8_t** keybox_or_cert, size_t* keybox_or_cert_length); ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Response(OEMCryptoResult result); +void OPK_Unpack_FactoryInstallBCCSignature_Request(ODK_Message* msg, + uint8_t** signature, + size_t* signature_length); +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Response( + OEMCryptoResult result); void OPK_Unpack_GetProvisioningMethod_Request(ODK_Message* msg); ODK_Message OPK_Pack_GetProvisioningMethod_Response( OEMCrypto_ProvisioningMethod result); diff --git a/oemcrypto/opk/serialization/tee/special_case_request_handlers.c b/oemcrypto/opk/serialization/tee/special_case_request_handlers.c new file mode 100644 index 0000000..ebbfd05 --- /dev/null +++ b/oemcrypto/opk/serialization/tee/special_case_request_handlers.c @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#include "special_case_request_handlers.h" + +#include + +#include "GEN_tee_serializer.h" +#include "OEMCryptoCENC.h" +#include "log_macros.h" +#include "marshaller_base.h" +#include "tee_special_cases.h" + +void OPK_Init_OEMCrypto_EntitledContentKeyObject( + OEMCrypto_EntitledContentKeyObject* obj); + +bool Handle_OEMCrypto_LoadCasECMKeys(ODK_Message* request, + ODK_Message* response) { + size_t message_length; + OPK_Init_size_t((size_t*)&message_length); + OEMCrypto_SESSION session; + OPK_Init_uint32_t((uint32_t*)&session); + uint8_t* message; + OPK_InitPointer((uint8_t**)&message); + OEMCrypto_EntitledContentKeyObject* even_key = + (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( + sizeof(OEMCrypto_EntitledContentKeyObject)); + OPK_Init_OEMCrypto_EntitledContentKeyObject( + (OEMCrypto_EntitledContentKeyObject*)even_key); + OEMCrypto_EntitledContentKeyObject* odd_key = + (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( + sizeof(OEMCrypto_EntitledContentKeyObject)); + OPK_Init_OEMCrypto_EntitledContentKeyObject( + (OEMCrypto_EntitledContentKeyObject*)odd_key); + OPK_Unpack_LoadCasECMKeys_Request(request, &session, &message, + &message_length, &even_key, &odd_key); + if (!ODK_Message_IsValid(request)) return false; + OEMCryptoResult result; + OPK_Init_uint32_t((uint32_t*)&result); + LOGD("LoadCasECMKeys"); + result = OEMCrypto_LoadCasECMKeys(session, message, message_length, even_key, + odd_key); + *response = OPK_Pack_LoadCasECMKeys_Response(result); + return true; +} diff --git a/oemcrypto/opk/serialization/tee/special_case_request_handlers.h b/oemcrypto/opk/serialization/tee/special_case_request_handlers.h new file mode 100644 index 0000000..4c7273e --- /dev/null +++ b/oemcrypto/opk/serialization/tee/special_case_request_handlers.h @@ -0,0 +1,25 @@ +/* + * Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#ifndef OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ +#define OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include "odk_message.h" + +bool Handle_OEMCrypto_LoadCasECMKeys(ODK_Message* request, + ODK_Message* response); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ diff --git a/oemcrypto/opk/serialization/tee/tee.gyp b/oemcrypto/opk/serialization/tee/tee.gyp index bf07781..9445a58 100644 --- a/oemcrypto/opk/serialization/tee/tee.gyp +++ b/oemcrypto/opk/serialization/tee/tee.gyp @@ -21,6 +21,7 @@ 'sources' : [ 'GEN_dispatcher.c', 'GEN_tee_serializer.c', + 'special_case_request_handlers.c', 'tee_special_cases.c', 'tee_os_type.c', 'tee_version.c', diff --git a/oemcrypto/opk/serialization/tee/tee_special_cases.c b/oemcrypto/opk/serialization/tee/tee_special_cases.c index 0fa1631..3cd6820 100644 --- a/oemcrypto/opk/serialization/tee/tee_special_cases.c +++ b/oemcrypto/opk/serialization/tee/tee_special_cases.c @@ -15,6 +15,7 @@ #include "GEN_tee_serializer.h" #include "OEMCryptoCENC.h" #include "log_macros.h" +#include "oemcrypto_overflow.h" #include "opk_serialization_base.h" #include "shared_buffer_allocator.h" #include "tos_shared_memory_interface.h" @@ -48,7 +49,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t unaligned_nonce_offset = 0; uintptr_t unaligned_nonce_ptr = 0; OPK_Unpack_size_t(msg, &unaligned_nonce_offset); - if (__builtin_add_overflow((uintptr_t)*message, unaligned_nonce_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, unaligned_nonce_offset, &unaligned_nonce_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -58,7 +59,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t enc_rsa_key_offset = 0; uintptr_t enc_rsa_key_ptr = 0; OPK_Unpack_size_t(msg, &enc_rsa_key_offset); - if (__builtin_add_overflow((uintptr_t)*message, enc_rsa_key_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, enc_rsa_key_offset, &enc_rsa_key_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -68,7 +69,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t enc_rsa_key_iv_offset = 0; uintptr_t enc_rsa_key_iv_ptr = 0; OPK_Unpack_size_t(msg, &enc_rsa_key_iv_offset); - if (__builtin_add_overflow((uintptr_t)*message, enc_rsa_key_iv_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, enc_rsa_key_iv_offset, &enc_rsa_key_iv_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -79,3 +80,32 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( OPK_UnpackEOM(msg); OPK_SharedBuffer_FinalizeUnpacking(); } + +void OPK_Unpack_LoadCasECMKeys_Request( + ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, + size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, + OEMCrypto_EntitledContentKeyObject** odd_key) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 120) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + uint64_t timestamp; + OPK_Unpack_uint64_t(msg, ×tamp); + OPK_Unpack_size_t(msg, message_length); + OPK_Unpack_uint32_t(msg, session); + OPK_UnpackInPlace(msg, (uint8_t**)message, OPK_FromSizeTPtr(message_length)); + OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, even_key); + OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, odd_key); + OPK_UnpackEOM(msg); + OPK_SharedBuffer_FinalizeUnpacking(); +} + +ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result) { + uint32_t api_value = 120; /* from _oecc120 */ + ODK_Message msg = TOS_Transport_GetResponse(); + OPK_Pack_uint32_t(&msg, &api_value); + OPK_Pack_uint32_t(&msg, &result); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} diff --git a/oemcrypto/opk/serialization/tee/tee_special_cases.h b/oemcrypto/opk/serialization/tee/tee_special_cases.h index fac7f38..30bec40 100644 --- a/oemcrypto/opk/serialization/tee/tee_special_cases.h +++ b/oemcrypto/opk/serialization/tee/tee_special_cases.h @@ -28,6 +28,11 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( uint32_t** unaligned_nonce, uint8_t** enc_rsa_key, size_t* enc_rsa_key_length, uint8_t** enc_rsa_key_iv, uint8_t** wrapped_rsa_key, size_t** wrapped_rsa_key_length); +void OPK_Unpack_LoadCasECMKeys_Request( + ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, + size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, + OEMCrypto_EntitledContentKeyObject** odd_key); +ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result); #ifdef __cplusplus } // extern "C" diff --git a/oemcrypto/opk/serialization/tee/tee_version.c b/oemcrypto/opk/serialization/tee/tee_version.c index d5c3490..ce8bda6 100644 --- a/oemcrypto/opk/serialization/tee/tee_version.c +++ b/oemcrypto/opk/serialization/tee/tee_version.c @@ -20,24 +20,32 @@ OEMCryptoResult OEMCrypto_OPK_SerializationVersion(uint32_t* ree_major, uint32_t* ree_minor, uint32_t* tee_major, uint32_t* tee_minor) { - // unused variable warning if not debug, since LOG* functions become empty - // expressions - (void)ree_minor; - (void)tee_minor; - if (tee_major) *tee_major = OPK_SERIALIZATION_VERSION_MAJOR; if (tee_minor) *tee_minor = OPK_SERIALIZATION_VERSION_MINOR; if (tee_major && ree_major) { if (*tee_major != *ree_major) { - LOGE("Rejected connection from REE version %" PRIu32 ".%" PRIu32 - ". TEE version is %" PRIu32 ".%" PRIu32, - *ree_major, *ree_minor, *tee_major, *tee_minor); + if (tee_minor && ree_minor) { + LOGE("Rejected connection from REE version %" PRIu32 ".%" PRIu32 + ". TEE version is %" PRIu32 ".%" PRIu32 ".", + *ree_major, *ree_minor, *tee_major, *tee_minor); + } else { + LOGE("Rejected connection from REE version %" PRIu32 + ".x. TEE version is %" PRIu32 ".x.", + *ree_major, *tee_major); + } return OPK_ERROR_INCOMPATIBLE_VERSION; } - LOGI("Accepted connection from REE version %" PRIu32 ".%" PRIu32 - ". TEE version is %" PRIu32 ".%" PRIu32, - *ree_major, *ree_minor, *tee_major, *tee_minor); + + if (tee_minor && ree_minor) { + LOGI("Accepted connection from REE version %" PRIu32 ".%" PRIu32 + ". TEE version is %" PRIu32 ".%" PRIu32 ".", + *ree_major, *ree_minor, *tee_major, *tee_minor); + } else { + LOGI("Accepted connection from REE version %" PRIu32 + ".x. TEE version is %" PRIu32 ".x.", + *ree_major, *tee_major); + } } return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/setup.sh b/oemcrypto/opk/setup.sh index 0f23ad1..0360280 100755 --- a/oemcrypto/opk/setup.sh +++ b/oemcrypto/opk/setup.sh @@ -26,9 +26,8 @@ download_boringssl() { mkdir -p boringssl && cd boringssl mkdir -p kit && cd kit - # Commits after this change some filenames, which is incompatible with - # current OPK makefiles - download https://boringssl.googlesource.com/boringssl src 1e15682f1a4bb64c48b84884976a2b5c4201e878 + # e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 is the latest tested BoringSSL + download https://boringssl.googlesource.com/boringssl src e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 # generate boringssl source file list echo "Generating boringssl source file list" diff --git a/oemcrypto/test/GEN_api_lock_file.c b/oemcrypto/test/GEN_api_lock_file.c index 2a29201..9305120 100644 --- a/oemcrypto/test/GEN_api_lock_file.c +++ b/oemcrypto/test/GEN_api_lock_file.c @@ -366,3 +366,6 @@ OEMCryptoResult _oecc141(const uint8_t* challenge, size_t challenge_length, // OEMCrypto_EnterTestMode defined in v18.1 OEMCryptoResult _oecc140(void); + +// OEMCrypto_FactoryInstallBCCSignature defined in v18.3 +OEMCryptoResult _oecc142(const uint8_t* signature, size_t signature_length); diff --git a/oemcrypto/test/common.mk b/oemcrypto/test/common.mk index ce7a3c8..8624ca0 100644 --- a/oemcrypto/test/common.mk +++ b/oemcrypto/test/common.mk @@ -17,7 +17,9 @@ LOCAL_SRC_FILES:= \ oemcrypto_corpus_generator_helper.cpp \ oemcrypto_session_tests_helper.cpp \ oemcrypto_basic_test.cpp \ + oemcrypto_cast_test.cpp \ oemcrypto_decrypt_test.cpp \ + oemcrypto_generic_crypto_test.cpp \ oemcrypto_license_test.cpp \ oemcrypto_provisioning_test.cpp \ oemcrypto_usage_table_test.cpp \ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 deleted file mode 100644 index cb306f73c28e8a9e2715224ec7efe5ae44e1e41e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmZQzU|@I|3M3eT7zmh8pI7@+&%p3NKw|<(d|APc{!(TJh7VWN!F+?e5c$k??foEm zhZhiWg)>f&PN&1E~Y~2j=d87wU}2@)l5e06dv%#sB~S diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 new file mode 100644 index 0000000000000000000000000000000000000000..71f0701a720a7e0133955674dbab5dce4971da89 GIT binary patch literal 280 zcmZQzU|>)W0}_lt3&&tsC=mpR6ZY~9;TlG%2y~vbq7oy=8lDa)4=Y6i9=~d ebbSRt^JIbkg6RXP1NjH$ZihbtjL7mQpz;7%Qc!dN literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 new file mode 100644 index 0000000000000000000000000000000000000000..0cea3fe57c0bdc838e4239556c79800e0c68163d GIT binary patch literal 280 zcmZQzU|>)W0}_lt3}FI1E~B$KZra`AB=WDb58+O TJ)1A8dYHK|^)UGpP=5dbAkR=} literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 deleted file mode 100644 index b73bdf8caadd309a20b2077b0b71ccde02d15634..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmZQzU|@I|3M3eT7zmipoLBo(&%p3NKw|<-yp)-N;lmYmFyG)VMBaN@dp}6t;RQro z0jkg86hxl&N;6nq;5n*%093y83`D*F%7^KP@l!8AS6L0P=5dbc$aP3 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 new file mode 100644 index 0000000000000000000000000000000000000000..dab87bf9c1b0962ae0be9cf652c673213c2d8757 GIT binary patch literal 280 zcmZQzU|>)WV_^6Xq(OkWfMw0!dIp9IDuOH^@ns)QF_$tkFg$o60OlWPgvf6*n8gf| zH~0e)-vHB>2a#7OL^TH{&j1yNna7aNvIb;6Tpq{=+Runhzbw#wFntUCrh(lB(+8z7 a^c4WjL)HgU2eJ?5ZihbtjL7mQpz;7U22e}@ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 deleted file mode 100644 index 60e15f891034df2f24c259f12fefc9b66833fa15..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmZQzU|@I|%E0g+NP__L>GNuT>KPaw2xv?Ii7zYI(O=5U!0_RUI+$;87b3rHLwi3+ z-r)sAT;U8v+~E|2o&e>;%z?=lK*eF^6#&(P%!kWE^fO}9FAH=ZOy9zD&0u%I^g(G1 aeGh=;G<#MPjp^_1*KsP=vUQJKn#@Wxj{zaRY z@?L-9-(0xP`mSbjNZ*-*JQ@-+c>6bU{nGx=Aiu9~O4i4wOuv2uLy#_X8<^kdy#7}Y I6J=lk06_jE1poj5 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 deleted file mode 100644 index 8132496906224429b5bbed9be7e886ba78fbc64a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB-Hi4Wk5L3@8obM?Vy25}tHgZ_xqe^T%cKq!^*{y76)GHSrId7<=~56jobW Z`}v%u2uKWO3`{@s8=cqx>S3Y`3;^k(6p#P_ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 new file mode 100644 index 0000000000000000000000000000000000000000..68f0ec7ea6ba480cd91decdb66ba37cbf6c6bf2e GIT binary patch literal 368 zcmZQ%fBzn-^$4&GvuM3(N_VZ0RUzF>}`JIdkXDSKrICVRgE1^1-m`{}UZF zU5nd()I^+<%nSN*?Tvx2)kFoq1)*Ibw_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`Su&B7C zw5+_MvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqf5E~dRhmRaRcKpQ2Q>V|IJ$L@X#Y>m3 zT)lSv#?4!|@7%q2|G~pYkDok!_WZ@mSFhi^efR#u$4{TXeEs(Q$IoBC|NQ;;f3W!< T6esBM$lSoP=5IYTQh^iz)}FN` literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 deleted file mode 100644 index 1a8ffc5a3b5fa788a529d412712184aa19b441e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;4)4WlNY3BdS^yE1+m@(SFyQG9obc;NLJx1^|);ZZFj!5oMQK5yM8lYX63J$!H)dxU%yI} z`}-gJ^)kY1?Wf%pA6yRK-}&W*3x|oweoO82@btv5k`uPLOjJ0$@v_+YT{quf*;g-a zrhIqWr{90StTHo*)O!@RC`odcnNmqnd;N;+#LFH863*`1Sn&TLG-9;M%6dNnTY{&gYdO?~kWGkzRgv8p=yhjecd`^2zW zkKU+HKMeUbzy?E>tM45O=Hgy|TJ(>g7c|-tzsYG}9+coHTjL)M?Xa%$zlQ&fIzP z9R!OnZfchB&$qsL)oF1|)9=nsX;Y)HGTql9vf>w_SdJapJ?ltCR`UEdA?+raN6r3K zb?fdZ-w@yu6HnkPjq{0|@$iViuIaf9*{j}HU2l0Ma^d)YAF;pZ#Nv5)f|Q19vO8ESqHa`@QK^1MLn(r&>Yt*7=LY+?J-W;4aW(8$=t z)Xdz%(#qP#*3Q0arI|U)Z>AXmSDs{i54u~k?XKy}AE!^mUOOoHCoX)^ua`3xFZ@z8 z?;FEIU;XzRzRsC(GWgMnskPrf1~Z(TTea20ZDAbao9ih@baHpjxxe;l7bs4k(Z>Lb PPv$o|um9DU+Wb1l?U diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea new file mode 100644 index 0000000000000000000000000000000000000000..8a12877786cac2a6b0006507ff4a3622761d222b GIT binary patch literal 122 zcmZQ%fB;4)%?YKspfrqv@imv9ySZb>=fAAgGWU0O+-rg9(~XadXJBMvW?^Mx=imhK TSfN^BG;;&Xn!oih^B5QaHvSKe literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa deleted file mode 100644 index 79a09521f428a1890fbdd11da182f4bb3a0c23f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQzzz&SigkgM7wGVraHgngvoZtIDTyOb4MyNX7__+8BQ`x6;S#l|_V>K;n&OBRr zFM92d=DKadfdM%L$r`wLF$;`|XR$SF0U#+{*L6MRFjn3i>4CpXzPhwk6Al8F&2uNxm1A8Pb+YW1ZVUv}Hv z*OHYD)U<3~uW?r;I4AZ-R`t~Bt9&op&3IHy{*lSWb0*hXb*2c$1|&aEIDG%@ z9ER8XuU5-tTw8xxZqJca{qSwF>0z5%%MV|Vy&ra=>1fHe_(@mKr1-8dSp6-}z2Ti^ o_2#6G1MDxmrcPTS{!*%iYvDzZn_=FB`H#7QWzFAum?#4S0L%1iV*mgE literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc new file mode 100644 index 0000000000000000000000000000000000000000..92e9167baea6595dd5acae20cfb5ed6559abb95a GIT binary patch literal 162 zcmZQ%fB8 zar5x<@e2qF35$q|iAzXINz2H}$tx%-DXXZescUFzY3u0f=^Ge=b)nhF+`zKtZ#~Rj G1_l6wfD<+V literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 new file mode 100644 index 0000000000000000000000000000000000000000..3b169bf4f6e183ce27e8c20468321466b7bc591a GIT binary patch literal 122 zcmZQzzz(?3gkgM>&EFKO9lyD83as?}+xTxCBUGJkd|W&OBNH>rx6+xv&VhKWP#GA_ M+`zKtZ#}|T07McIVgLXD literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c deleted file mode 100644 index d0fe752c8a43352d5a5e7e679e40f4f7b6637a9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;rB+6c;rQ8510lY5&EPIuk#rtz~-!|lf!j8Fx-@p17o+p5k6T8ak#GB#z& zvHkWwHqLo+=c@g+k)J*aeD9al+x_F&;o0-0Lrmso8#al(y=!0y(uHmV^BbMl|LS3) G3=9D0pD4)y diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 deleted file mode 100644 index 44b4cd768391f2dc1a3abcd19c7ff4dd952b0d39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fB-Hi4Wn@Jy{uQ1=WVc_aK8EAc5eIKxr|T^y76)G42(?7EUawo9GoB?D^vzX PGr!S!{jVNoJ_7>)u!#;f diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 new file mode 100644 index 0000000000000000000000000000000000000000..7d8812f6664a9f89f0a37d94a6bb17c314a6d667 GIT binary patch literal 368 zcmZQ%fB-Hi4W}64EC>V2|Bnj(!IbI7$HgDNV!rT(;$r^J^WHYcmn*X^GhJglv2^An z_hTnI|4M}W{ycKHMIb!vqv+MRKd=3#`>s#W@hz>ecisQ=XxWNaMf!@n*nTY3sGsHS zep$%mpHSFA=2F`iK1(OtMqW1(O);)*+O<<>Pubr)5fcwEu?KHkF3`k$c*=409-~e! zdtdD%-LI<8|44KUT-)=h|pBBWF1#Nix<7t$VAlv`t@U4l=ED%R&tpIKM*=cH><(Gw}Ndxi%mZfJYnVr6Y( zYiIA^=;Z9;I*s$>mCqI3k9RIHal2`KhokQQ_S(m9TaWsmKhrSp>t3lHm+d_5#BW{B zIKI;GdAioABbz@jy`0^tWcp4ka*kQj^|tno&aUpB-oE|`6DLicGIiSY88c_Sdg^h> zbDj3Oe=m2HA5Zg~c;Md7_YbC8{g6C&uXE|VzkhUoyt3Z>%CKB1NLtC|iP)pV$@Ttk z{-%7N`-!WS(ID{N?K^kx-GA`#(c>piK|bYz`q~IeGuE@L`CAX=04bQfH%y3tJQJEc E0H5uSq5uE@ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d new file mode 100644 index 0000000000000000000000000000000000000000..294f86c962566884b4e7d03dfd052595e9f02b08 GIT binary patch literal 288 zcmZQ%fB;rBdIOXXqhS1#dl?oa)l4wEGvmv%6HL-i8KDYv{s#k7FHpx}_uu<(e;sOXs3xcG#`q~w&;wDgS3tn8fJy!?W~ zqT-U$vhs?`s_L5By84F3rskH`w)T$BuI`@RzWxalCrzF*b=ve9GiS}7Gk4zna^ssD gPMH;b*3AF^f@SWZLm)S!`;WPSWzFAum?#4S0DDAUAOHXW literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/00d8703220de64723c9508d6fad24e9caca9b67c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/00d8703220de64723c9508d6fad24e9caca9b67c rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 index 8a927ab742ddabd00fb977fc7befdefdb4c4a014..8150c2fe43ead29b2d3f6c75b22c5c686d0ef7f7 100644 GIT binary patch delta 61 vcmZ3$w17#F0Ub;flov>5IqFk|W6>6g;!y(8|oO@;=XZ z@04D-V^Z@|i`xeN|3lrF)?NrM-PN~y#aHWB=B97+?{MkW9_u?)Te>-4HI{Q~=bJLw z+tz1Z{C%-^Uh$ISZx&3b_V_$An0>z0l@~$ct&g7`jy`i;S+HhZ)5MdnTjK<{gcuBC zMSho?pI!HZVRE5Y?)!f?4}O|-z-#BO-Fx=#+kfETp~FXx9y@;GWe&gn?+js8XyZ_+fqsLF4K70P+<*S$MYj1lrsGAjkIm&QJbN&q1FU5P-yDgnN zMOye^=&kI;P~)=l`ASRKrMx3$(s#`Zej}2wbo*L&{!3C?eEheBq!pXK-oIiwrRcf8 z+^j9<->i0Dc-`%+w|u`v*MbW<>mONs++zBiM`6xhPp#YbZ!5htzW*wB;+1i~ex$9X z%a`GU}sl4w0u_4=I;3Wg~#@$-i>&Eo4aOR+_t*w zd)K5ooY#2}vA$LJak!(=3wnTM=kz~hNhSNe0J!(`7Z3L zAl-Xxm+Iv0fw3i1{wsN(-nwri!>xm>d9FrjKaq-04x7-|HHAH%+tDcJ=0@$_@(+hh z~_8Wt|H<^Rdy(qx^o_lMvH z9bL2j-6spn*iZM literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 deleted file mode 100644 index 766308192affc2ef20069442f7e27b008d8b1034..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQzzz&|F3B&kLwCXM~-Ew|jq~({C(}ga&z&y#qr>&>Bm#(ey?Xj`7vv+WG za&~d`i1@XtUwqpxmrEDr_r9-OTkY2D$@*qq>4utBTiSzae;0kYxA5Ad*0NjYk5#We zA0yHq^eHnyuu4MWcxWx_Z?A1_f9k95Tx{GsNA=FcNt35coi=^O%vm?ui-nH4yYlpw zx)t6OJX_(nt!|FOx}Bm$eOKgN(j9Z^OSv`o9+(sPqWyOKWHYv7YIBx~-oDBx{#R>K ztlAd0#6~`svuf9GztV7w1o@N;>T4q?&G<&=^}l*Vkiq1=VM0)OCMX|Wo(U??3zY`| DRGo(K diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 deleted file mode 100644 index c8c042e12d0d265e6895816ed4c5ab5401769227..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB-Hi4W}64EC>V2|Bnj(!IbI7$Hk|+Z;U)DGi`l|E&F=qbL-u>C2CHpo0+_A zH!}#W`_ucU=~Ub0l$C-;E(h}j&PH+W6nJ7P>&_cO7x(*lqdWV?*#Y z`^#bfroUM~vAH0ku>EuC(jTXcLVrbm@%$mdRDW&FgPQ-pVt;b-#Ai=qH_Cm#O8fow zMD_R%&H6eyT`d!ZTHap|UQGHmmkQu9TzyEEPQjBe9=stcUGb@PJe^!b0hjPDk&4$1P`=%C2R|3>Hazj~M|1_l7wiV%zd diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 new file mode 100644 index 0000000000000000000000000000000000000000..9bf34d9a6b0f44570aa636ebfb459ff6d35acfec GIT binary patch literal 406 zcmZQzzz&|F3B&lBudk$?cC>7Ian+-gpO^a@GgO^!d|W&OBNHNg~ICM_S@Ln**iEo zIlH*dNDuL@Z%DbylUw^<$k0ObkzV6olTO{c8zwDK-!47xWpN+7%ZmLqttsbrdF@X! ziC=HKM<{Lg)Y-Q=#Si(XI~-*YJ9k+t)=;sF)okLV$y26In?7Uati^^Q8~#_b-}!sj z*{4b%`;ywrTM@^WOm_Yfy7a8o(F?EFJip(lWhL2~G3ViC?tO8eq8RUTPrWI<+Q=xW z?dychnEA%4pY5+CDfAcFfPBgY^|cX{W~^sf^S2%mWH5Pem=IK+3Cc&8XM)P}LgfJ_ CZ+!Ux literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 new file mode 100644 index 0000000000000000000000000000000000000000..8e30396c06e6a0c2ae1f3c0e15bd3d4a15ee0683 GIT binary patch literal 128 zcmZQ%fB;4)%?YIipfrqv@fYbb?K-#dvaNw-^w%%DVxPnG>Bh&!`%U%V@af2_w<{K1 YQeyk?ksTz4uAjMqWzFAum?#4S0Lkzd-T(jq literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 deleted file mode 100644 index 823f50c40c89fd39206630f575f325b183b91752..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fB-Hi4WpjH7*HCrjW85o(ESy-m$fvN-GJ^V^@r};wfAxqUgUNftgb2tpp~(XP D)g+E% diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dd14c72951c6ee8245c7e8d77a15eaec5d9839a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dd14c72951c6ee8245c7e8d77a15eaec5d9839a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca index a63d947450d92b580c0057fa9bcf2d54ea74ab3e..1fec89e355eb00d3d7d01d3ab5022ce539004381 100644 GIT binary patch delta 61 zcmZ3$w17#FkpTi=G{Zzed4Z`5WkkO}wOeT4vv%FPvPV1<9WL@Wu&nu84^<4L0GbL9 AAOHXW delta 61 zcmZ3$w17#FkpTi=H0MM?d4azsUl$lRsPr{=Pb~^xlzwrd!$tl#I&C~$GcYnSv#_$Ub8vET z^YHTV3kV7ci-?MeOT4^)BaL5MS)s9H*OQ|a`X@BCv~_g#^bHJ+j7?0<%q=XftZi)V z>>V7PoLyYq+&w(KynTHA`~w1mfX!XqN1qGMv?;u8{+l2cOC(lau%vU76t@(T)! zic3n%$}1|Xs%vWN>KhuHnp;}i+B-VCx_f&2`X@}BGo;uNw0XRJbd){$ zFDWH0BP%Dbps1v*qN=8@L3{tpKA#m~zv{K)LJtj_(<}A-sqO#QZ{EIp|Ka1O&tJZN z`~KtSFS!5z-AJ_DX5T8glIK*;^vK*h;P|J%|8d4YD4j||)9eB$&G<&=^}l*32S^#g Pn6ONNCXcS42~8dVK66eB diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 new file mode 100644 index 0000000000000000000000000000000000000000..7d0336c1af0fdbb9d092caa2cdba2896da319d5b GIT binary patch literal 341 zcmZQ%fB;S?%?PEJLTMO<&WDLJLm9g9aq%!Q(rH%iIs5H?NENKj&0{d?IuT;|@^NDk zd%yfNcD{)@&$Vz_&cHxOqh;@O|JCv<4R1fv+L!ZF1!xe+p^{J+azJUudX_bR>k-a| Q$t%EwaL5}$<(bgr0m2n8;{X5v literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 deleted file mode 100644 index 95784e7605419fafa41bab2dfafb623970fe7d10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB;4)%?YKKLTMO<&WDLJLm9g9aq%!Q(&_8JKmIt?`Dl&W3X@lW3E_}8g32?Y$pZlA;v)tC diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a new file mode 100644 index 0000000000000000000000000000000000000000..7f3f4f9306b8b1ad6a875eb531402064a185bf00 GIT binary patch literal 288 zcmZQ%fB;S?%?PD8Kxr5S;|tC@JMD6N%f5`a($(Bf&lbbf>&C~$Usg|LS#c}h)Y5Fl z{o9K(#djI5h&!<4S-&Sw_4X==Ge5S`ZieWQ!mKnw(N4v4Er+x=pS<34y!%IfLTj*aXuRp-xy)q(366Gk z|3A0J+@HDTYY3mvvdw6d(PZ> l^N-$K&QZZ5Q@&%qw)`nIo1Gvxqx+A!fo09#dYC8!0|3)gV+jBN literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 new file mode 100644 index 0000000000000000000000000000000000000000..401050ba44e7605a57a5c9eda27ff6765ccece15 GIT binary patch literal 512 zcmZQzzz!xbqKd=#Z%l7XOnO|cv6PGZ`?rT{8DPqELc_u%BBP>XV&mcy5|ffsQq$5iGPAOCa`W;F3X6(MO3TVC zDyyn%YU}D78k?G1THD$?I=i}idi(k(Oq?`%%G7DoXUv>6d(PZ>^A{{!w0OzVWy@Er zT(x@5+I8zUY}~YY%hqk%ckJA?d(Yl|`wtvEboj{8W5-XNJazia*>mSFT)cGo%GGPv zZ`{0f`_A2a_a8ib^!UlsXU|`}eD(Ux+js9jeEjtJ%hzw;fBgLQ`_JEh{|B4@!EpkO QMp*nYH?XYvTaSoa06smp4*&oF literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b new file mode 100644 index 0000000000000000000000000000000000000000..17f40dafe7434083917d3372caa952a42368cb58 GIT binary patch literal 128 zcmZQ%fB;rBS^&z2Q84~fwM!eSe)%r?Y$Eac?wOe9j8Fx-@p17Cj7-cdtZeKYoLt;I XynOs%F{nIDKXU`in!oihQyCZlkN^+- literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/53a0b89316eedbd09f44336f493067c223d3afa0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/53a0b89316eedbd09f44336f493067c223d3afa0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e index 8ffedfacf2dbba3b7a72cde9e532737d8c44eaa2..44e1534d09062a7abe1b6a50e56bed69e6a918c4 100644 GIT binary patch delta 41 mcmcc0bd_lX8zW0S%bLHFxfo?23@t_(evn8#0|N&G1ONaU0Sg=e delta 41 mcmcc0bd_lX8zakWo!9>+b1}+57+Q=n{2-Bf1_llW2mk<6rVW?? diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c deleted file mode 100644 index 77f3762b604d2f042010344a16c621316bf92464..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 288 zcmZQ%fB;rBdIOXXqhS2WF?|(}RI+#KtlySy<>*?<2vwjP9~aLlRX_1a&UV%p?euQiYxPQ%iwSlH&x3g*XSO`GyVifgO15i{YO%4XO+P;0Ua@XE`5aecb|1rPOdHt^*Cd$A70IaZLEC2ui diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1262bc5f3f1ecc414e8e21861e9d200c3b775e87 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1262bc5f3f1ecc414e8e21861e9d200c3b775e87 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 index ac50bf8549911e82e2ab813d8e03a6297ab66002..5afd7766178fcea3197386a652c480bfafe8f221 100644 GIT binary patch delta 43 rcmZo*X<(UPAaG`HNT1V&FwT-Vfwsj`c4ZqKHZt-zu&nu8&j1GiPecsN delta 43 scmZo*X<(UPAi(GN=*UgsV2yg8_L7{_b*DBuY-Hqrqx1S-Jp&v70BraUtN;K2 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 new file mode 100644 index 0000000000000000000000000000000000000000..f8fcf3e5fece009e7d923caf62483aebe2658d83 GIT binary patch literal 128 zcmZQ%fB;S?%?PChpfrqv@pC_@ZhTyP>3fU(`-gMhXM{=1 X_|7_|3KB!t&)mSW=5IYrlz{;Nz_1f( literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e new file mode 100644 index 0000000000000000000000000000000000000000..bbd0d2c7a7a67a3e7ba9bba1792761babc6f2968 GIT binary patch literal 122 zcmZQ%fB;S?%?PErpfrqv@xLDB-}ir~&9Os)1&&C~$GcYnSv#_$Ub8v!q TtWd2mnz?~x&EI;Mc?=8y9Lf(A literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 new file mode 100644 index 0000000000000000000000000000000000000000..1d469640e68dbc6d1bd9e763f709419b5cf48caf GIT binary patch literal 122 zcmZQzzz(?3gkk(&1r`c(HfQ}U=wIZxwl%_s5voo%J}#btk%^gwm5rT)6U1YM%D`ym M29`B{>k-BR0Ka(+z5oCK literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 new file mode 100644 index 0000000000000000000000000000000000000000..87889171bb7753838c2fcc69daba99c664c76f3d GIT binary patch literal 512 zcmZQzzz!xbqKd=#XFH>h-TrLs)X}%6bE8^VF-)0md|dq2i94hlr<_bLqeUt6|{OBoN3UTb+ho|rr_%6uEVaD`y6&%mW$dM{d>j5KdsRRf={Kt>YUk` zwaIYNTZRkVysE+%d~WUz%G-bHq3t!xq_eB$m)KYNr#bIjx;s@}@SUs$&((Nm9SJUcO^O8ZCp)eR1w z0o_?6!Y-W9p~KugCOvFXi#g3XiXA1H}m}7Gd$n+`zKt KZ#_(ufdK$bN!gYF literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf deleted file mode 100644 index 77ccd5b4f665d3e7924ecd744ce0e2e68466e8ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB;4)4WpLA7*HCW50hqwGIZnP;$dQ>)0-o#8e0n@&6t;d+W3OSH)n2zG=tj0 z28)X`RwQ50U2TffL_!)b?w_I)xP8IA9=_K~XE!CXFff1|DhV}@14=W#)_MJ}9$^Vg QUI8YAL*57~&x9rq00;FmoB#j- diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 deleted file mode 100644 index 2e0c3f529e77913ecd7a3a4e808c4a498688f2ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB;4)4Wk5L3@8obS7bJ)00w{eEQ`!pW}U{k-EAJlho74Ym=5I zOiI4-|Ht#NO~NTSO(djo3j2BcKD`qvWt01gj|3$gU|;|_R1#_)2b5-ft@HX{J;D;0 QyaG%JhrAI~o(WAJ0KqLc&;S4c diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bf813f09576ef5dc365d4fae65be63a3c14c2de0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bf813f09576ef5dc365d4fae65be63a3c14c2de0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab index 4f1359ced4aab2466837824990c26fc7d864a326..88d5f37409d4ee6f946d599ff7960e488726a23b 100644 GIT binary patch delta 23 Xcmeys^nqzZA|ro2%bLIS3~&GdU_=G6 delta 23 Xcmeys^nqzZA|wABo!9^B8Q=f_Y!(KF diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/638c5864a20d1ca04ad06d3a77181479f477ee91 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/638c5864a20d1ca04ad06d3a77181479f477ee91 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 index 434048c57babd17f305dd6535eefb2d33521ce43..a0f1c959c36f3260a91b3249d3e7b65604d52ccf 100644 GIT binary patch delta 80 zcmcb@c7;ulkpTjjp)~tML3x4YXYSqh=+ACRdBIufT6;ciqr*`qmU@;oe(wMSdnm+7xss3CKsP~5h&Z}aFmJVjn3VJkiH(a-NK8sjNli=7$jr*l$<50zC@d;2DJ?6n zsI024sjaJTXl!b3X>Duo=Fw*EFmcl4DO0CSpD}aR>^XDi&0nx^(c&dbmn~nh za@FcJYuBycuyNDoEnBy3-?4Mo?mc_=?LTnv(BUITj~zd8^3>@wXV0C#aPiXRD_5^w zzj5={?K^kx-GA`#(c>pipFMx^^404%Z{NND@bS~~S4{fC4BJOsfE M<_4BEf9nxq0A_WJBLDyZ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d deleted file mode 100644 index 45a9b93d19e5012f142004f893eb8d5c2ad0caf4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB-Hi4Wo=;3@8ob&zZ=4ar=b#dXDpJD!d(5>|un;>&C~$GcYnSv#_$Ub8vET z^YHTV3kV7ci-?MeOGrvd%gD;fD<~={tEj4}YiMd|>*(s~8yJFhq1nLvM(6dvdW7`= DZRZoI diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bcf58b9cf74875a7b938460b19e703876c2b3067 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bcf58b9cf74875a7b938460b19e703876c2b3067 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 index cb20ada5d2a0cfb969f55bdfc1be5b3546cabde7..c03096db618b9bb5dce886ca7fbb8697ccb2ba94 100644 GIT binary patch delta 80 zcmbQnJdIh9kpTi&Ve~{nd4WmG`>G}1?-Y%>ve+&q>hzV34(yC9^(<@tPWEP$fiSWe NW%xlN^-z643IGiU6wd$v delta 80 zcmbQnJdIh9kpTiYp)}(}L3x4czpV-#TP9A5Pd`v@7pG~s(SejeabghfQf#3dx9q-A8~B*-FiUKECc1mw#RJD?tK&T*KS_;LPCC}Y|N5ZukJp$BlyO^(8$=t)Xdz%(#qP# z*3RC+(aG7x)y>_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`S zu&B7Cw5+_MvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqe|uNn zjPfp#<>eidYr1Th&t$z6N&odqO)PnFU_a0LnL8u2WzR|WYMU?~ylGi?D7F5=#Y>m3 zT)lSv#?4!|@7%q2|G~pYkDok!_WZ@mSFhi^efR#u$4{TXeEs(Q$IoBC|NQ;;pMjBy znT3^&or9B$n}?T=UqDbuSVUAzTtZSxT1Hk*UO`bwSw&S%T|-k#TSr$)LdRI%WHU+3iq>V;dK;B~#9SC)H8Gu2r9N?xVeQv0LoF$FdTC4~GBiW68Y R!s3(pjn3muoI7E9TLL3gUN=52UU(ftT)^of{}|Df zWnv{O{kmOO8^8QH)$3c(tuKEP*vi+PZ~WuUpd+jG!&W=+=oBRbLy#_*MKBwf-{`#l KR}T|qU;qFn4k&{F diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 deleted file mode 100644 index 964189c1db2442835469ad6a935eb637b4b7a659..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;4)%?YI^zy#3vyQ}TOEbYp3(wwJV+VkD_CQO-bd|W&OBNHqPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mx|6ub! TC{EDhk@=0z>wopoNCi>=#>cmt diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a5bc3e146138236be11224681b998194ec1ff9a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a5bc3e146138236be11224681b998194ec1ff9a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 index af793db886133cffc163a1431c3d878709e59f75..03fbf779ee780fda761d22addab04de44461873b 100644 GIT binary patch delta 62 zcmeys^npo`kpTi=H0MM?d4XNA*MlD~J7SYCbxqa(mjB;2Iw&&oH?XYvTMtzYqyX~z B5d8oE delta 62 zcmeys^npo`kpTi&Ve~{nc>w{A|B=V$EIWMq-P!#y9SdJ>bWmjEf1~sIUp-V6kOBbj CdJ$p( diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e deleted file mode 100644 index 33b4d532df416d2d6835d1228462ce026d05a1b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB;4)%?YIipfrqv@sDM^s4-jiZxK&>aLHF;FKw7U-T1h821X`k7FITP4o)s^ X9$r3vuo#+o%x`pF|Eq_Y%D?~s3vdpv diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca new file mode 100644 index 0000000000000000000000000000000000000000..eb47250cd172a092de27de8312eb01711f1a6642 GIT binary patch literal 368 zcmZQ%fB;rBnt>520HdJ%|ES;}Oqp(cT>PY%keP;$Z22<|bT5y#jIns8k;7lbS}JX^ zm+`eglv(fTNb_?$zIpDv_4~c#df7-vHz&KyCeK>S$cJk=9$b@4X6OHBCS~%R?~CP~ z?<@CAR163V3JwVk3y+A5ijIkmi%&>QN=`{lOV7y6%FfBn%P%M_DlRE4E3c@ms;;T6 zt8Zv*YHn$5Ywzgn>h9_7>z^=j(&Q;qr%j(RbJpxRbLY($-?U*t7h5~ax%m^8eu?Q; zDcpH=j&xS}{@9{bdN+#iITUU-Slg`oJm9Ueq3PM@Vlr>0hpX)pIb^+Ck@va5!;}SL z@5RCj-W0t0cjq1BY;nH7A3lEi{N?Mn?>~P2`u*qczyF{xfCU#U{Fv)m*8Hu9i!uNJ DCw-OU literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff deleted file mode 100644 index 5db4a6d696522da7df9311ce40f796efc8f1b72d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fBQ5m7O52}vnw8Cf}b1w|!g6;(BL4NWa=9bG+r14AQY6H_yD3rj0&8(TYj z2S+Do7gslT4^J;|A74NJfWV;OkkGL3h{&kunAo`Zgv6xel+?8JjLfX;oZP(pg2JNW zlG3vBipr|$n%cVhhQ_Amme#iRj?S*`p5DIx2@@wxo-%dX^cgc}&7L!N-uwj%7cE}0 zblLJ1D_5;vvv%G34I4LY-m-Pu_8mKS?cTF@-~Iy!4;?;o^w{weCr_O|bN1Z%3l}e4 zzH;^2^&2;D-M(}8-u(v;A3c8Z^x5+lFJHZW^Y-2Q4a!-~Ykp Te^8vD$0PF_o!9^B5pfFuM`pNj diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc deleted file mode 100644 index 6d191a5e414638d0c54449a9b7de388cc7fb2510..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fB;rB`WciDqhS1k=&)z!KCYj?F>=zXw;g{an4t=ElfUPUm9>qn zoxOvjle3HKjKH61R|>9stlnRnC@Jb{*1x{YL7yu#>wZn*Y@v733*|bmJl^QlsXecA zRz!wSk3>k<|DVcPD_+^Gyqpu=H}PUydq-zicTaC$|AdK?CQq3J&y;8i`I^K+TKw6C!*cVi$J(+P5}9 zFV#)#=bJN=%onwF=(Y3OSKQ!@^vE{UVz^}gIF=OHbe`V8cn*>h?_X#DiJKIjLn!O~FX{PsL_nONs zTD;qe4n`l_GwJY!u*F>}9&*dq-MP**o#DBw)I{Nr@jIN9Kw$t2K3MoMztMU9uO2SS F0023hj*tKV diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/236647fd79907186bba5d42ebcc90e62ea632872 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/236647fd79907186bba5d42ebcc90e62ea632872 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 index 639397d15845c39802d065510300766fcb2ea724..f1b831e4e69b11016599df82f801af6d540a58d7 100644 GIT binary patch delta 62 wcmZo*XD*_><{*nq&V1&L4jUQy8(7x-tw*Q^0FIIl82|tP delta 62 zcmZo*X6wcw1Vq=c{Ko=e#wT81K2!VIw2|8=cqx>Y=KD6ab}d B548XQ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cd9a833ced641a1716ca14082589ce7ce2cbbb0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cd9a833ced641a1716ca14082589ce7ce2cbbb0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d index 2de08c616d69871a514375588d13771422c170c3..41a05087db7c495408642401c0fe9798fde39bfd 100644 GIT binary patch delta 79 zcmbQnJdIh9kpTjjp)~tMK?VL57lk}#9#JbeT=RDtr!(V52X;o5dX_bRCwnu>Kp5GK NGW;NsdZ;!a1pvaF6D|M% delta 79 zcmbQnJdIh9kpTi=G{Zze1^(&>X|u{F<=IW1{6x8U&xMT+?2IgLbYB0P?9C_xVPrGP M@PkC^q1u5I05LHZ`v3p{ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 deleted file mode 100644 index 9f060a69020e0b57269ccfcf4368926cab82e935..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fB;S?%?PErpfrqv@h5J18Qynk+TBKf#o7ap)JtIMb>rjW85o(ESyB6 delta 80 zcmcb@c7;ulkpTi=H0MM?c>#+_?6dcJ@6?>DY0g%X6uN4o!%-%dH#)EXP3B~lfiN_g NW%xlN^-%pl3IGzT6}JEY diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee deleted file mode 100644 index a51590a6fa2848e45553ccb5dd523b8ba7981ee8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmZQzzz&u$p^C%!wqdzX${$>15svl$u~=`GDKk`=ZhTxk10xeN3o9Et2PYRd4=*3T zfS{1Dh^UyjM94oe+dW4kRNZu3e}n~ydkWU7O-j(Z9lrGVO$p9^e#gejZQ+J1dg|;i zq=nSJ)~JY+@y)#`B=U0d8Ez{Bj;OfKFPwRW-Ycvoy?L5jwk~G=#7Aep`YgDg8eF?L zWGypu-hZh8wlB#!`FpE-zxFyWWW z-R0AdJuq}Md&%je%)kI)t^(B`P3b# z4DvkTSHE%U-B*@B57>Qr)U(jh<5TZHZ)uG(5sTL~?+$-|{pRhv_a8of`uyeVx9>lG z{`&pr@4x?``1k+UaP5`6;FlY13y<;5aW(wCTKTp{)W@ERuKT{G3YE>;n(tYSbHDzK zx^!&^+jS354$C}wgPlj-Hg?@ju27%5!|>~;PYFv4Qom}+mgWhp$ZK+I;1T5LTzv7n zM6_m|%X_ab?yKrEWaiv4XHehcetNRbQ;lPPo442|zS)1v{{4HK!|X!5zc0&e68Mt- zpWiA*GJo!j;sTuoRsRz>^G(zLwSm&9Bs9$~fYOX_bYB0fhjM_F5sb+QWuVEU>t{lf F2LM>scR2t6 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe new file mode 100644 index 0000000000000000000000000000000000000000..c82175e0f4d89f564ac5ef9545e73ec3d96f07d7 GIT binary patch literal 341 zcmZQ%fB;rBdMT6-qtN*-J&-=z+ YeaXQNBnC4Erl0wZ&g*~mFi{2u00^KI)6b^lzHVL_sMgn}xkzG3@Bu9_NeGL_!){H?aQb@SC>2Gum?JWVWl57#Khfm4uqd0i_x1S=RimM_2-r QSAYrOkT-(LGoi@?0JU{AQvd(} literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 deleted file mode 100644 index 01a1100ab8a2da59e530ff9302bfbf29824ba0b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fB;4)4WqbV3@8ob+ZynnV4vpOzvI~Dg`(@5nqc~LXzj}nR0Ff*W+W-In diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 deleted file mode 100644 index 2a433e7a82248742e662bf35ba9370a8a54078e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQzzyTQ1#G(8Ho4sw{NprR5wI3I__C5PGOqp(cTs#9K6Eh1d8#@Ol7dHqnoxOvjle3Gf zo4bdnm$#3vpMOALP;f|SSa?KaRCG*iTzo=eQgTXaT6#uiR(4KqUVcGgQE^FWS$Rce zRdr2mU427iQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_iknLBU(f`y9~FIl>5`HGdR zRKIRx^4T8ox67L*}HH5frEz*A31vL_=%IJPM`HPpYUcY(!?)`_4pFV&2`tAFVpTBwonKF#y&EjvfF2 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db new file mode 100644 index 0000000000000000000000000000000000000000..c28600210b8985691f647562c6c25360abe21c4f GIT binary patch literal 341 zcmZQ%fB{t$dlG^1AVH@eGVi%q*;I>>Qk2 z+&sK|`~reP!Xlz#;u7LT6FS@fF5$gA&HeM5&qrKb_HoM<&kYQ_v+}b_|JpY{zHfWJ z%>U`LvtPMIJ$7I4%J6^g!g5DA`0159*LX8+`4;E?4EFF<59V6V(6ec+TgsQlWwEw5 z>eb>SKN(kiac}Y})7|aZd`ZN9b@!~`BS%#yE^E7`*?Iol4!Kt=r>?r|vU+M@@Qc9E zORFF0{K-ly)0?_-)#^2C*R9{Mant54TeofBv2)k%J$v`A<*BIQ$$@kuS zc*!kCgR0)+!i=J!hPUVD{9P{n!+4|pqwB@`X&>X2YZ&gPE}6Hb^6TYf@zt+VeQ)2? zK73}CglpeLmOWPsP0X`@PmTzWtg+u2tsTpAu)3zUuD+qMskx=Kt-YhOi|?bNc+Q49 z{tUa`Jq)V5{5zOuYtu)=S&R`Z?YaW@`@YvNxF((WbOST03zP6Wg83 zi@)%#^5@%k^@wmAL!Fqf0=GFwjzWNMxkpQ!9qUT3`z zS2OHf%}#C7iQkyu#ru`BKvLZCvxb|NUzYCEhGyov?F_7jM>fxC$ZzE>;cflUmvp;H z|9H}ze;gjSj{N_)a{Hl89*Yj#^RUzF>}`JIdkXDU$Ah|Vo*Ajgr?aAP@3_L&g*~mP!5nXf-zy4 M0ZkrVKNFff02Y#awg3PC diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b deleted file mode 100644 index 60c23475c9a9800871cc1a9df00224ed648c4518..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB;rBS^&z2Q80erhpX|g3@T5G-%JdC@Nd~OMyLYa__+9*6CJAm1baU&Sa#5U XPu;bnATf0P%x`pF|Eq_IGB5xDG@Kd- diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e new file mode 100644 index 0000000000000000000000000000000000000000..62c38203ad9f2e1cdfa3eff59f612c6edcaa8345 GIT binary patch literal 341 zcmZQ%fB-Hi4WpLA7*HCW50hqwGIZnP;$dQ>(?8upeCk`|)feC9_1Rr1$jxK?r>!r; z>9q26HnpVuTqc|*64I#d9s7x)Sz2({IjjB^ciyaIU;sH(5^5d?lxD1FS@X9ZVF^rL P0Vae)-UuqsgeDIF18gkd literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a index bb8ba9d349a7c0ad7350de592a8691cc12d887d8..09ef7f54218eb756cd7ab98cd26e6684587e4b14 100644 GIT binary patch delta 23 Xcmeys^nqzZA|ro2%bLIS3~&GdU_=G6 delta 23 Xcmeys^nqzZA|wABo!9^B8Q=f_Y!(KF diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d new file mode 100644 index 0000000000000000000000000000000000000000..8a882cd39498e5104d2b85d5257aadc9b0af95aa GIT binary patch literal 368 zcmZQ%fB;4)4X4lrp#1-+;2%txZhTz)Hx>1oj8u=@kNZ@enT}p=+JE8e`R4*E;;*Mw zy07C&J(=^kVbkXNY)yUx%cIuwH+yK_6kv~CXp|oln5N_Q*kj9)Cr950yGKj5EC0M$ zb@oE7bddV4d+%iJIM^QQ+Xh^*{Ac8}u|4nY4lfCV%Vz>#@ur+ue=2kp>+!vk($7VO z9j0WkboH=bi%sCa^rZOAA?IhkRqqxim@Ax&m#TR&Z&BFA%lY@7m~Xo+l~(RIrSG7k z;(DH0A0JOEIetImmv4RRstbS5Tg`crZ5|O4&#$EZpgMH_hpllj|C^iMHl#jSbbRC0 z{$-3+k2mbt`s4mhv#9;X%{Q7S*)LmkX|-h;Yg49ePXH(k(8G_po@LG7dblV90M6c* AkpKVy literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 new file mode 100644 index 0000000000000000000000000000000000000000..8a57ebaf2f10fcaf4ad5fd3e2f3e67e8c34288e1 GIT binary patch literal 341 zcmZQ%fB>T(L6MRFjn3;m zcmvgvwIvGXAD<#CUcT9X-`xHg4ieuPZoGWf<+9OrX>3T`t*uJN%3jvD+;*xZbF@Fc z=f@K;cWsvI`8{V|+pMj#U$d+7>eGn(?L~cd(zRK%xE}4w#;RO5dCxreb^cz@%BP>tUu)BSHA8!Jm+1V&ZMeQn#J Pm>XEu{H=$HGB5xDK&{cL literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 deleted file mode 100644 index 237097b4c623e67259606ca049102313c60b6c33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQzzz!xbqKd=#S?W$auh$nnnrVA%^R2LwH85qm@p17Cj7-cdtZeKYoLt;IynOru zfkx|hxv2pPUiAl*RscGpMnOWI6xq0~og+;|BrDf$6 zl~vU>wRQCkjZMuht!?ccon75My?y-?CQh0>W$Lu)GiJ`3J!kH``3n{J9h5cy=U*f{Ra*nI(+2lvEwIBo;rQz?78z7E?&BP<+v*#~fzIy%U?Ys9MK7RWAPsoi{A(%eh__%lmMkZz!RyKAHP7se3 QsuM;tztMU9uO4A60MTd;l>h($ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 new file mode 100644 index 0000000000000000000000000000000000000000..41f3e792585e37731caecef3d3d2d221cb92f635 GIT binary patch literal 162 zcmZQ%fBAwroP-+PGdC3S>pc@|-zq*=ddb-S zn0MVi)GOAIvMf!%SNJgk?Pam++mpMn6hIfm)92=q2(C{h9F(&HZV7^tod6H I6J=lk0RQhIRsaA1 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 deleted file mode 100644 index 3169e31d9cdfb58040c7970d132daf5025cf4e23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB;4)4X4lrp!_XgZ|GKEP)e)#x=1VJjS>$`nQnYsJOd*WGYcylI|nBhHxDl# zzkr~Su!yLbxP+vXw2Z8ryn>>VvWlvjx`w8fwvMizzJZ~Uv5BdfxrL>bwT-Qvy@R8Z zvx}>nyN9Qjw~w!%e?VYRa7buactm7WbWChqd_rPUa!P7idPZhec1~_yenDYTaY<=e zc|~PabxmzueM4hYb4zPmdq-zicTaC$|AdK?CQq3EN z?fQ+Iw{G9Ld++{(hmRgVdHU@6iDb diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 new file mode 100644 index 0000000000000000000000000000000000000000..5c2b1d545daf9e32a1512d49f08daa7188833fca GIT binary patch literal 288 zcmZQ%fBYfsAJTT$;*3=EBoO-#+qEiA39 zZEWrA9UPsUU0mJVJv_aQ&Q8?GcvQXb8_?Y z3kr*hOG?YiD=Mq1YijH28ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGmk& ik80U@|4^LEH@n+kWiBa#+>Gu&<_4BEf9qkQ3=9CQYhRWC literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1094990c3689bc731ba000f7c144920750d254e3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1094990c3689bc731ba000f7c144920750d254e3 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d index 5572991a8d06966801f84e1125885c0600ad8c6a..b34e5b903e76388242e5bfa13b31ab1c760438eb 100644 GIT binary patch delta 62 zcmZo*XJ$|e6p>1m1LuXZm{ebKnlVIw2|8=cqx>Y=KE6abby B4@v+4 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 deleted file mode 100644 index dcd345a622df86325557c55f23be6c3a99261b98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fBCGrL&xT3u9=y-X~+4%ny_RqHFQ(c1lD#|P%Hq?7;ro*Z1LZ)I&` zYiIA^=;Z9;%DQ@G^r0y)&K`>SFSTz2R|lWin`0`j&Y4mThwN5t5i@@`TXDnt=LSX1 z7iaz5wAtuJS$RceRdr2mU427iQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_6HSl%Rm zJm~OiYRkx|hxv2pPUiAl*RscGpMnOWI6xq0~og+;|B zrDf$6l~vU>wRQCkjZMuht!?ccon75My?y-?CQh0>W$Lu)GiJ`3J!kH``3n{J9h5cy=U*f{Ra*nI(+2lvEwIBo;rQz?78z7E?&BP z<+v*#~fzIy%U?Ys9MK7RWAik7|9w$yr63R9*V9~aNS$i&RT%Er#Y$;HjX z%f~MuC?qT*Dkd%=DJ3ltEX>ZXk=_+YG!U>X=QC=YiIA^ z=;Z9;>gMj@>E-R?>*pU37!({58WtWA85JE98yBCDn3SB7nwFlCnU$TBo0nfuSX5k6 zT2@|BSyf$ATUX!E*woz8+ScCD+11_C+t)u~;-tw_rcRqaW9F>cbLP&QzhL2_#Y>hh zTfSoDs?}@Ou3NuhHH#)EX)g#0Jf3}ST diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 index 425bc4a3d2a07d0a2cd4fd411ec60e2464f59a46..9a9b2b614ae52fa2a948a80819e6bf204f35349f 100644 GIT binary patch delta 62 zcmZo*XdS delta 62 zcmZo*Xhpa#&Zm&1Gf(~2?Da5xy76)G42(?7EUawo9GoB? TD^x3tW`3jd`d>ZFJO%~;dSMN0 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a deleted file mode 100644 index 21e51bd71a280fc93cc6d8e7e1fba97e6fb89c85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQzzz(?3gkk(+kJhRGTh#Ksrr?lO{_d9Zj8JvD@p17Cj7-cdtZeKYoFE=6R0c*f MztMU9uO4A607Fg?UjP6A diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 new file mode 100644 index 0000000000000000000000000000000000000000..4012771a0bf9244c40ce82cc0fab3c66fbec935a GIT binary patch literal 406 zcmZQ%fBd+FxM7sjTa zjcLp=aGzOLUQt<9T~k|E-_Y39+|t_C-qG3B-P7CGKVjme$y26In?7UatcxH2Je{|g zJ3+~D;jD~hzoVa5hvm9{+%Nt8h?mcty8i|4!sn|0cr1E$qKxOtlAt%Sr_Y={cmBe~ zOP8-)y>|V^&0Dwc+`V`I!NW(7pF9QmlnWXxMo^luo@LG7dRSO7Fu>%!VL}Atnb70` D5TA&$ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 deleted file mode 100644 index 67f7fa39770f2316a85cdefd93185ab758cd7e08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;4)4WlNY3BdU4%{t$dv#&Bb>$dgTT9&gWFlD;&aq$d{Ow25-Z0sDIT--do zeEb4}Lc$`VV&W2#QqnTAa`Fm_O3Es#YU&!ATG~3gdin;2M#d(lX66=_R@OGQcJ>aA zPR=f_ZtfnQUfw>we*OW0LBS!RVc`*xQPDB6aq$U>Ny#axY3Ui6S=l+cdHDr}Ma3nh zW#tu>Rn;}Mb@dI6P0cN>ZS5VMUEMvsef<+APMSPr>a^)IX3m;DXYRcD3l=U~ykzOJ z$dGXcJA7}XYaoK2M!)OeB|h{<0np@I(_Esx$_q;Ub=kc z>b2`PZr-|m=kC4x4<0^x{N(Ag=PzEqdj00@yZ0YHe)|07>$mSee*XIX=kLG&gU$b- VIDy3*EMA%4=)C?{592W~007AJx0nC` diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 deleted file mode 100644 index 5e7065be2a6b25fbab33cac4477103bbbf9a8c56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmZQ%fB;4)4WpJY!B`L)#=n;Jc+JGf*ewE|ILg!4DScyxD$|XRi)UbDVrF4wW9Q)H z;^yJy;};MV5*85^6PHLUc;qPGd*J(|X;KUOZaUA?Jht}8sKhZU#XoW1ph0b$vL;P;+o5mGL;Z9nQwCdq5|EUn+de<^J7 zP9bK6h!utGH$xkhjU8hiZ^@cveb3?3?3+~vkKPFVFh6yD@85Yx@)F+!zLycO40o)5 zZM@|}hKX$h$J)}Q$u6r-Pw6}Eu7CU5?zb~MW}UhA*vlk2goRT~ut@Cw``dEoT6dJq zJI$bHY+0mu^r(yPsol$$=WB~)y;$Q~vunEmv$xYEf94HI)3>~6pU2^T{LI1f2XptA zA4oAyJeQLa8EJ9q*Oe)`y2mdU?5ef@dEwBZ%JN334f6TTEhTkUGOypfefR#u$4{TX zeEs(Q$IoBC|NQ;;9~A#L+3a^#oZT$-Z|8~rjnluJ4!U~1Md|d`u=-o#H_zEIIV&tZ zWZ2#D(E6T^Orh@G=yp@NZ@$b?sV0)olYVtpzgv7pchj0%yJ~~D%G7Q$SLsY#(x*L{ zX%n+kcxs{(--3hvj0bYRommlLX7zF1`xL{_<4phe&8?|6*G>z5`r|^3c$Ly0^Be0b zTjDm!z3`O(Vx7go>gs>uMC&>|{!O)aHvYK=N~e<0G`j#wGrrMz{jVO%0a8XVCM;8+ L$)oFMLX!soz*}@Q diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d0abf7562348a077076a31f67dab240996227e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d0abf7562348a077076a31f67dab240996227e6 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 index 9afe3b60e3201e67213b54c3b35534d2ac02d30b..f6db7363ee4071b9c9bafdc82bfdb83cca63080d 100644 GIT binary patch delta 43 scmZo*X<(UPAW$Otp<+=apKf%d{wony^B5QayuJ=q diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 deleted file mode 100644 index d40c3a274b74791fa0c10de90d06181171d96e71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB-Hi4WpLA7*HCW50hqwGIZnP;$dQ>(~mxE?&ICS?I1kI!EyHbaGkUE?k8fk zRa)mo=w@4+iyGlHk&woe+p)*Em&WOpXHBR&ttaEkzyNZnB-A_(D9!j<=k>pOge5R} O1(*;Hd6>JH(BuKjZ7)dx diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 deleted file mode 100644 index 9fab967f0d0483ff3d8cb426a1d5c60d80f62827..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 288 zcmZQ%fB)=I1a%73jvt#fPk}-FU-i>Z^L$ zT<@&;2OaB585W)>PCN1_J4#pXoQf;Ad+#-4J*KY{%T6@7Mu?m;Ff=kYF*P%{u(Yza zv9+^zaCCBZadmU|@bvQb@%8f$2n-4i2@MO6h>VJkiH(a-NK8sjNli=7$jr*l$<50z zC@d;2DJ?6nsI024sjaJTXl!b3X>Duo=Fw*EFmcl4DO0CSpD}aR>^XDi&2Ra0 h{&uL<;>E2U*4v#Ux)VTdM)x1{8=cqx>S3Y`3;?YyU1k6P diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d new file mode 100644 index 0000000000000000000000000000000000000000..69a3bb89dcbd046c9142934ebe6eb1703059240a GIT binary patch literal 406 zcmZQ%fB;4)%?YKSL1`ETjo5`ZoXZ$htS>u-mrZ=pEF~=?D<`j@sHCi-s-~`?sim!>tEX>ZXk=_+YG!U>X=QC= zYiIA^=;Z9;YOAnL^28qF1yhxy#cr5=)(H!bh>VJkiH(a-NK8sjNli=7$jr*l$<50z zC@d;2DJ?6nsI024sjaJTXl!b3X>Duo=Fw*EFmcl4DO0CSpD}aRKg%6U?93cg z)h~peV|~x}di9#M>(+1BxM}m2t=qQm*tu)>p1u3_A2@jE@R6g(j-NPr>hzhj=gwca zcsi+Pt%rpb0|QLn8zw|Ro(WAJ E01>E#R{#J2 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 new file mode 100644 index 0000000000000000000000000000000000000000..19c2474b497d5f51e74273f75dd781a4111a6ae8 GIT binary patch literal 512 zcmZQ%fB;rBdIBR<07}95TOK8D_^Y`_R$o;#Sy*~*I82#td|W&OBNHqPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mx|6ub! SI8M;wkGX+m&EI-N+yVd#(zQJR literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1e148e9501ed59f5274e01ae905b2bf5db81ef79 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1e148e9501ed59f5274e01ae905b2bf5db81ef79 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c index e636810f6ecfbc948a7938a3d4e1fab099f0bca2..f0af3576e4ef20f8984dadb7c8c6b5c1af4f95b3 100644 GIT binary patch delta 61 zcmbQnJdJsRfq-3G=law0cqOK7_%vnJ`>TB$9oQLJ>RHzOo$Sph17Tz{%J73k>KWhw E01QqQegFUf delta 61 zcmbQnJdJsRfdEhLwq@M&!`JmnX{(k?UlZTxz|P3>M(6dv$=-}I5Jonm3_nPuo&gR3 Dw8s>s diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f new file mode 100644 index 0000000000000000000000000000000000000000..294915bf23cdbee38a130f05ac8afbb061987fcd GIT binary patch literal 122 zcmZQ%fB;4)4WqbV3@8obZ{Z5LaoELssnh0-cMaAW3BvU0#>d4oFfuW-u(GjpaDsTO QP@OQExq)TP-+F|x0F$E)6aWAK literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa deleted file mode 100644 index 549b3ff678dd2b9e4b43617be7c669fda6f594e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQzzz&w838V92(#%kXZhTxkObmlQ^WdF8`?JZbFeG3CtR@CF=etfS=>AGne(QQx zyn^Xx$evW5`I|GjR$3NbOoyq%pp!osIawE`&X~FW*YY2ZP3_e|XPeKh+0CdGzSvEd zyXFg%=VkXjLd8o==B|hc5nrD9JsaduNvJs-P@3_z&g*~m2*Y9W3NRt4JWM@I-Uuqs HgeDIFgoZjz diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f new file mode 100644 index 0000000000000000000000000000000000000000..17a1a5fd3bfba4ea68cb20df4aee43469ec5acb9 GIT binary patch literal 162 zcmZQzzz&Sigkk)il|{X)UYJGDj7`}`(ylNtfE+3bHID;IGrrb&{jVNj2~1uA OCWJ%Y2rAEnCJz9)-Y~-e diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 new file mode 100644 index 0000000000000000000000000000000000000000..6f90cceaed4022e60c2aad33706ef85a7997d254 GIT binary patch literal 122 zcmZQ%fB>QjR U9xGG^Ml(0Ctod6HGmn7*0Bqz8rT_o{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 deleted file mode 100644 index eec9883c502a94856d42d76d06ddc73e55c67cda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 288 zcmZQ%fB;S?%?PD8Kxr5SB lZ~g=wyPEeGJPezaN?J@)_X>jCjP5_?H#)EX)x$&?7yy1 delta 42 rcmZ3$w18=Xfxwx)GqMWfOSJ#pX3;U&vX5t?!$tl#IKp5GK NGW;NsdZ>ON1poo46rTV9 delta 80 zcmbQnJdIh9kpTi&Ve~{nd4UUZK_zaFx;T$)tyI%y`c<>hft``%jn3#+^1?#+Vf(~XadXJBMvW?^Mx=imhK USfN^BH1ivs*Z=Ba<}ok;0LDcQo&W#< diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 deleted file mode 100644 index 820d1884ecc78d62376570f0cb33afada9bf15eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;4)4Wo=;3@8obZ=b&-!)k+R`lf^PCS`71GY_UuH$ErjW85o(ESy_}RaDi~H8i!fb#(Rg4Gh7$&}?LWqx1S-JMy?%+n&ET*LamzmP-&vI($ zcrW~sKQZ@3hjZFdd4oFfuW-u(Gjpa8C8? zs{0x(WU9S0(yQ&!y6u@+*^}-6{k6AHu}>V7PoLyXVrYWt6p7#3pszCMjs5tG&l5cCR74{s@GUnW=WV-y0mbKTtnFSs-ZM##| zv|n$!Qp>VoUCGriPP1>kR~5Mvd?UE6y`!_MyQjCWf5OB`lc!9bHhsp-S!@&H8!kYJywbH=RY{+t)ero$#G4q8&Andm@uz;mig9YXl?nPdG~aJSMg4=g~xAgN`TO zD|XdfZ;-X+y?y8Iz55RyK6?D*DafZ>P+uECX~ue%HGk`2Va31zllO)R5s+s>lLr9) CLxI}> literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c deleted file mode 100644 index dfe1b8ff68ade9fb947dc9fd40c06f3087bbb8a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB;rBnt>520HdJ%|ES;}Oqp(cTztLs$AaE|##P1gBH`Y*L|R{Qd{S!5TUXdA zdN7Ldv*=+V5$8F2*Rx9YbMajqustwGH)!Pl8Pr%{a9zsK5Ag z75j2M_JF{k;E>R;@QBE$=$P2J_=LoyYCcR z`i91)=9bpB_Kwc3?w;Ph{s|K&O`bA!+VmMSXU(27ciw#e=rzWIS8millT`Y?HgX$J zgvPPoyQ`k=(Rf(2Q0~(T#mm{ZHc#&ponhh8UQ~F|v$W^%QJI4WrflfmIXQmLEM3vF zM~}|4`eoq2WZ|Fi>7^axhmW5=fBE|D`;VW$e*gLV?>{IEV8I0oKjt?&um9DU#{JCYxTbApEz$%_FuAl>W0mia(-`es6W+J zd~dU_ilx2l)9Z^iczSvJ`1<(=1O^3%gocGjL`Fr&#Ky%ZBqk-Nq^6~3WM*aOYz*tlu)maW^i@7TF(_ny7`_8&NS=VC-V3(|NevG zf1XA`z^9CqH{$Kq_pa~j2{B0c^>qt_v*^+|HvZ7sc`^Z86ASouPdXd1?a?1Ab%SX% o@;}b_2c=Ud6qYyBe67U*Z(sJgl{ zWqzVb-|3>#J^j)`CGG(}>%3F`9XS`k;B?-fdyfuB)Z-~upQf-~*{aalaA^I%#?9LX%?IRfDe@O|J$mA^)A)YAwT zJA_wVn(=Qn$xT&wJ^P2 m=+KT-&MEnwwdad$e^0fT19CIWn=t<|ztMU9uO24KzyJV1DrUX_ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 deleted file mode 100644 index 7feed1617cdc574793c9df1fe67aea115c864296..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;S?%?PE9pfrqv@t56SYml1|eb>y$!(5TovJR$RH$E=jd4rDWRaZY9F{6m2 zEYaXUNzZ?NV)_w3h1dJ??;jiN<02T<+-tCsXf4`RQ{oCA|jGffk%kTZ_^#0E;R-tn9kZAD5H{8xQy{>oo z{l3EN{;uxP=0l1;!4*sAhvjbLn#;|*@=M$EW}TynhgKhzUoNxx_o7929{8Dw3UBQ? zwRM8eP02|oLp1N3E?(E?q18WYcTEYu+J3|6HJ{Yq9hw$mvG+O4x>p6YN!x#H*!IN! zw9MD;mnpGx-=9CF?Xg_%+P_Diw2rmdaEZ1QooMB!l*TB?tedw%qZFI)2K z>Sc;%{P4`XALzQZitPl`D~`yF&1>J9s%?;SfAm89>+QKdZ)e1BxP0JL%)8c-`WCaD z3%}SF%w78AXXkRR_Wpc^o6G@={q_XU2ozlterm0PulEKon+;9H#KPvcoooWNoc R7JtldbYB0fhlw&U002dJ*^2-G diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 new file mode 100644 index 0000000000000000000000000000000000000000..50f265e8f43d9f9bd42f28087371dd6fb326534f GIT binary patch literal 122 zcmZQ%fB;S?%?PErpfrqv@dYc~?|0WJvfMkm=(vPc=zN%Z-T1h821X`k7FITP4o(n{ T6{;0RGdHlT`CAV&kAVRIe1r_h literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a deleted file mode 100644 index ed02f5b73dec472f632250a07658ba2b951cd9ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB;rBS^&z2Q80c+!w36c;sqZ}SN-`KeOJAj5vo8pJ}#btk%^gwm5rT)lZ%^& XmyaJT29<~DXMUse`d>ZFR0akBV5ATH diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 deleted file mode 100644 index c36fbc54f16f99e91aa9cbb51814c92b36d5cf8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQzzzzh^gkgL)A>)gu3(xd<^rh-aEHXRI2vw&W9~Upy#^Wg6*41^3<8{Y#$GxjS UVlZQ1`kCM8y#7}Y6J=lk0PyY<-v9sr diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 new file mode 100644 index 0000000000000000000000000000000000000000..df36b8b9f6be9fd32b1b33a7528857ae16f98c62 GIT binary patch literal 852 zcmZQ%fB-Hi4WpJY!B`L)#&-{6zqTl0n^p57&-14W>(4SnmFdRE#WOH6F|)9;v2$>8 zar5x<@e2qF35$q|iA!)lO1_@D$aK>7h%K-6ZoZkba^^+G{@xe$<(sNBa>A@{$o$V< z8-L>F8Qs;Vf9|lX&wKDRnc3z1yu|&6O3x0hK2YhHWmm98|AU8dR;4LkY`xx_`|$FD@4Tr$f1i-py7|V98{CO60-CnkaPQeKYv+E)bgr`T zTI=@{KN$N8IEl1wf4%E$5Z_|Ihzhj z=gwcac|p1*kc>dNvrg+cd!S{;~DXp$cpEH^NIlX@B2mViCY3_~{`G+^gMKn3Q zGPCY$kGucS+SaWr#rD-75259s-BvGN%~S4{RhSW(kczFB599QUumPqSJ_zhOk-*ls)!Y8IrW91%lOj*H-!!( z!&&OQsp~5o%l4cz{&6Vr?IAypSO&)428Fxnjdp#(ha{U=e7)Pw#NLyh`dFL0`%a|m z#2djXhu0s-Use{$*`V-g#`f@};N18bhgiRyOkBI5eSr!0t4UfJ64z{5SUcbKe(Vmi zyCo5IL2C1Z!;!|xCHq$Lc&rzm-M(<=vAh&eI+cW`*#%IVv7Tkk-+CwqNEyMHj8F!e KJi2}+Gk9J literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/74395b056ddfc22160234e4a4616bf87e2159eda b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/74395b056ddfc22160234e4a4616bf87e2159eda rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d index 85d1c760cae500ca9a7198d2c535737cd1648fc4..6c4b98b094c223880bbe1bf351e81882923e3056 100644 GIT binary patch delta 23 Xcmeys^nqzZA|ro2%bLIS3~&GdU_=G6 delta 23 Xcmeys^nqzZA|wABo!9^B8Q=f_Y!(KF diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece deleted file mode 100644 index cbb8c60bb59492b811243baf0e74d0bb500cd1cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB-Hi4WpLA7*HCW50hqwGIZnP;$dQ>(`|%9I~kFW$L QuK*LmA#VhgXF`()0Itq8m;e9( diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 deleted file mode 100644 index f34be3e9cef78f130dcb6fe5acc5462712086d9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB;S?%?PEJLTMO<&WDLJLm9g9aq%!Q(rHV+V}6V`Z{1!e`j7LT?!!gFE^D)T z8KZAD%&zAQ)XVP1X(Azw%)eAzfAasBUDp2c+qLVHjxjKR94ZMlj{{0GzSepDuO49u ROkM#dghSp4D$j%_4*-y6HiiHI diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 new file mode 100644 index 0000000000000000000000000000000000000000..e23426d93fe6cd0675bad41639b42c88fa4a055f GIT binary patch literal 128 zcmZQzzzzh^gkk(O*;hHb*I!W9N&CF?^52#@j8JvD@p188Kd#SuccJ@Deej`e-`{^b V4ibYI1Jlpkz_R9VJxr8=0RU078p8kp literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f deleted file mode 100644 index fc7d9a4bc5b50e01c6899bc4843de5f9e7bfd804..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fB;rBnhVN@Q84~`*UA6F#owOeTlU3n=ll$IMyLYa__%lmMkZz!RyKAHP7n{> QMCLa-um9D<%wu2x0Nfc4$N&HU diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a new file mode 100644 index 0000000000000000000000000000000000000000..b8d9ae102d435d15bebc0460898d873f66be0ee6 GIT binary patch literal 368 zcmZQzzyTQ1#G(A-&)STRhALRPv{^YHSr|44rc5_JE}nsriJ66!jh%y&i<^g+k6%Dg zNLWNvOk6@zN?Jx%PF_J#Nm)fzObje8tLD ztJkbuw|>LMO`ErD-L`$l&Rx6r?A^Ejz`;X@j~qRA{KUyqr_Y={cmBe~OP8-)y>|V^ z&0Dwc+`V`I!NW(7pFDl`{Kd;xuiw0V_x{7jPoKYh{r3IG&tJd){QdVI5(cQ@#@xWN J=5IYh3;>Apj647U literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 new file mode 100644 index 0000000000000000000000000000000000000000..9f35bef4015e2cf5aa2088760baa383d5cb5b090 GIT binary patch literal 368 zcmZQ%fBx7;u#p3m|0la*f}`4 zxOsT__yq)oghfQf#3dx9q-A8~>V7PoLyYq+&w(KynTHA`~w1mfX!XqN1qGMv?;u8{+l2cOC(lau%vU76t@(T)! zic3n%$}1|Xs%vWN>KhuHnp;}i+B-VCx_f&2`X@}BGo;uNw0XRJbd){$~I}^!dxzZ{L6X{Pp|K-+%uh QVSpNL%ndAS{?;SJ05Oq_!vFvP literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 new file mode 100644 index 0000000000000000000000000000000000000000..97054f4d63337e4de52e17d548086383878653df GIT binary patch literal 122 zcmZQ%fB;rBnhVN@Q80eRE^+G_LS^=)>la_U@4K^x5vo8pJ}#btk%^gwm5rT)6U0L| Pk-33o&EI;Mc?=8yrPvL6 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 deleted file mode 100644 index 980fd4f90a17b32f195e1eab0b7bebf9729af1c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;rBdIBR<07}951}6V6vM;>7-XZ1Y#Jx;=4PeT2VJkiH(a-NK8sjNli=7$jr*l$<50z zC@d;2DJ?6nsI024sjaJTXl!b3X>Duo=Fw*EFmcl4DO0CSpD}aR>^XDi%|FPL zF_+{2{!@2(<11AAdu|+csXM5WR4IS>-2Jo^?a6Hk>yKX$R{W~`xWAZT;d-X)=NIqh z-eA4|wP?e+_+M=Me#e}jw_}EqRBM&tC9cZc3q~J4e)|07>$mSee*XIX=kLG&42(?7 zEUawo9GqO-JiL7T0)j%qBBEmA5|UEVGO}{=3W`d~DynMg8k$<#I=XuL28Kq)CZ=ZQ z7M51lHnw*5DIdiu4+$#WdBajBd;cI~%7V@FuiX3Dw>pP;Lb=Tzk^4t37#2NcxAZai zry{p2=i=(^;>9YgisIjYyZ_t}_9}E|Pu!_S&49piD#$jghtn-MCn8y^?Xz{teR!pg?Z!O6wV z!^_7nASfg(A}S^>At@y-BP%Dbps1v*qN=8@p{b>p$T*H+Q4Nm%2YrUu~}O=`cd&b>rjW6?clNF}B`3s^WdG zv@-SE19#bVC4DLz6Vr7(O_blf$<+3ox#jv?(>YJ;epapEzTaqI2+{?!2xbFw1IwDf J^)OKe1^^2CCE)-7 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa deleted file mode 100644 index 01d7ba601c0caf75cf994fb5a22f53e127d13793..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmZQ%fB;rBdI=L$07}95NgazV3l$<_r%IOd_%#>wF+=5bEI`O4L6*Kgdsb^FfUd-oqaeDwIq(`V0LynHpY_`t&Qy3L?sGDc|Bys<(RAyerr9d{3pYtQ30xYpV*n|6jj(`|kaRkDoq& z`TFhqkDtGO|M~mxKPdkHq@C325?Y&Z=l+>^=2P9WJKujhJA3)UM~C-qydkQ@{<_L= zFY5%x-UmM=wJ)>s{S&VjI8y4f-K9h)DkM?l1Z8Cw3^nD>3^K@ k4@#$!&@{UMN;AIEdHt^*$^lYFFeW3EfhLcxp9xJK0QmlK=l}o! diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 new file mode 100644 index 0000000000000000000000000000000000000000..bc99f9e1888b596a8e9267b027d320268c4730ed GIT binary patch literal 512 zcmZQ%fBJ-vPX6DCfYJZ0*%=`&`|nmuRky!i_jE?T@~ z>9XZ3R<2sTX6?H58#Zp*yk+aQ?K^hv+P!D*zWoOd9y)yF=&|D`PM$h_=Ipui7cO49 zeC6u3>o;!Rx_#&Fz55RyK6?D*>9glAUcP$$=Iy)pA3lEi{N?Mn?>~P2`u*qczyE{H T|DZTQk4NSPmNkFt5pfFuBQ>`H literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/596a7741bc1da115af7b9a5d9a38fdf109b7fcfc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/596a7741bc1da115af7b9a5d9a38fdf109b7fcfc rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d index 14b60cbb1472c38fe0ba8d075a877ba44c88324d..bdb8151d2f10d73657ea72092f982a7ed98e9af0 100644 GIT binary patch delta 60 xcmZo*X<(UPAh7q`lHKeH6IN=dcqlnK`p9o|Siq<-fsp|PFgLKQ`CE?=0ssLR4EO*5 delta 60 zcmZo*X<(UPAn@i&aObv=MC%7z9Tq*3*W10(VF9B80~AbPgfN)j=)C?{4-;iz003|_ B5JCU| diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f deleted file mode 100644 index 0790556127087856335e04b5e81d5862795677ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;rB+6c;rQ85028KHaJSw1M)YOU1Nd_BjM5vo8pJ}#btk%^gwm5rT)lZ%^& zmycgSP)JxrR7_k#Qc7AzR!&|)QAt@vRZU$(Q%hS%S5M!-5UdMo0?Y>HH#)EX)x+#% GU;qH=AQEK& diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/17cf1e48c441638a2874088ac78b42e8c4cca286 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/17cf1e48c441638a2874088ac78b42e8c4cca286 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 index 5762de6f633063728d17b0ff41d9ab99fe50068e..cd9b42c460f7c09f136f30422be4ca9f483db5b3 100644 GIT binary patch delta 84 zcmbQnJdIh90Ub;flo!x_R(S6IqnSowZzs%}7PH{QMhA9AmU@;oe*cKMhA9AmNz=D|4sI0l;Hp| Q>Ve89=QB$1!#Ggw0BOY*_y7O^ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 new file mode 100644 index 0000000000000000000000000000000000000000..02d61fb615549898b8450f3432e2954fda9f1cb5 GIT binary patch literal 512 zcmZQ%fB;4)%?YI^zy#3vdIuj#GP$zIe)e6o;M*l`A(%4V__%lmMkZz!RyKAHPA+a9 zUOs*SK_OugQ894|NhxU=Svh$HMI~hwRW)@DO)YI5T|IpRLnC7oQ!{f5ODk&|TRVFP zM<-_&S2uSLPcLsDUqAnVz@Xre(6I1`$f)R;*tqzF#H8eu)U@=B%&hF3+`RmP!lL4m z(z5c3%Bt#`+PeCN#-`?$*0%PJ&aUpB-oE|`6DLicGIiSY88c_io-=pe`~?daEnc#8 z+42=DSFK*NcHR078#isK_CSHTxGR# literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 deleted file mode 100644 index cf62735fcd69f13d1975568c6b6cb72571aec52c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQzzz!xbqKd=#sgtXj{rlhg`O5GGiliP}3R9*V9~aNS$i&RT%Er#Y$;HjX%f~Mu zC?qT*Dkd%=DJ3ltEX>ZXk=_+YG!U>X=QC=YiIA^=;Z9; z>gMj@>E-R?>*pU37!({58WtWA85JE98yBCDn3SB7nwFlCnU$TBo0nfuSX5k6T2@|B zSyf$ATUX!E*woz8+ScCD+11_C+t)u~;-tw_rcRqaW9F>cbLP&QzhL2_#Y>hhTfSoD zs?}@Ou3NuhaiW6A8 R!D5s7jn3lU diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 new file mode 100644 index 0000000000000000000000000000000000000000..29cb89e5258ee8eaf9460b7bb6d5e32108150aea GIT binary patch literal 162 zcmZQ%fB;S?%?PE9pfrqv@&7JKSo&xl&m?ZnzOosd=HW2)y76)G-S;}LOy4JF9O1EK z_WP;6{KxNq>Dkcqf7XGo%Is4kCii|dxmECM*_2=9R=qoY=EiO_Fa+sBw}H8VWzFAu Im?#4S0Kmd1ETL(c>FK2tVajylBM{9uZMQ7(!aoe zZj;O86*I4Y)AMp^(+kRLkzO2m?dp?5#ZuMDvmgI{C%SmT#7UE`o>=ggfq z-{9*N-8YBkOMi;{YnG+Jf6w8@S1xh6Uwbe8f3EY|_H5F{h|K%1AKBi!)EeMw{G4^- zy}j>pTG!oYYh=;aK72>8sPv#kX~DwpFY0=N1k@fsvHW^K{>1JIL(4}_5f}PSU+0n9 zo0VvsD!1rR=Cvc+EpFeo_g!@Mto*v&>JuHaUS6u{_-(tmZ%4ECzR5SwNHl+5amB#U z$k@cx%-q7#%G$=(&R$zOZuz}}ra8=E9ipM1mO65X$s{j+@nK3q&C~$KfJRrozuzhM=hJ% Zfl5~AyC5-`F);ni4J>Q^*26>@7yzq!7JUE! literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 new file mode 100644 index 0000000000000000000000000000000000000000..4f1e36898f99fd45c72f4bea659637cfbac19e7e GIT binary patch literal 512 zcmZQ%fB;4)4WlNY3BdTN`%4T@JPu-wh=DQOv5Ie7&|C1n*=HFXV5Eo~iLJ$(a1BV!X&Gjj_|D{C8DJ9`I5 zCubK|H+K(DFK-`TKmUNhpx}_uu<(e;sOXs3xcG#`q~w&;wDgS3tn8fJy!?W~qT-U$ zvhs?`s_L5By84F3rskH`w)T$BuI`@RzWxalCrzF*b=ve9GiS}7Gk4zn1q&A~Ub1xA z@)avrtzNTs-TDn1H*Masb=&qGJ9q8gvv=SA0|yTsK63Qf@e?Ocoj!B+-1!R^FI~QJ z_1g6tH*ej(bNAl;2M-@Te)9C$^A|5)y?*od-TMz8KYjl4_1pI!KY#uH^Y`EX!RCKZ UoWSA@7O%_=ENlMO!*~n~06;{w?f?J) literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 new file mode 100644 index 0000000000000000000000000000000000000000..54c722662ef7d17010157de45aa957dfd90534a9 GIT binary patch literal 122 zcmZQ%fB_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`Su&B7Cw5+_M zvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqf5E~dRhmRaRcKpQ2Q>V|IJ$L@X#Y>m3T)lSv z#?4!|@7%q2|G~pYkDok!_WZ@mSFhi^efR#u$4{TXeEs(Q$IoBC|NQ;;f3W!<6eqBF RgT*Fu1IwDf^)Ma-0|3QFw#xtj literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead new file mode 100644 index 0000000000000000000000000000000000000000..cc4c2059d370968ebc1c4f5b24b9c2e38f3f8fb8 GIT binary patch literal 406 zcmZQ%fB;S?%?PERL1`ET<6m)M?x=Dz%V0Wf#Jc=rDkn2kfo^6Zr>W($oY^<`f zwz0LdcW`uac5!t&Xg$&9vdWUeC2j5$FXr?3A<%PWS-u!H9@96C6?&T4q?%~;Q}=5IYLtQZ(z^4>5Z0`g2~ F@&MR!h9Up} literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd new file mode 100644 index 0000000000000000000000000000000000000000..91390080274f0b9c0385f6edad61927d0cb72172 GIT binary patch literal 128 zcmZQzzzzh^gkgMcM~hRH%g?EuXn1q#=cSLij8JvD@p17Cj7-cdtZeKYoLt;IynOs% RF{nIDKXU`in!oi3!vS064|D(k literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad new file mode 100644 index 0000000000000000000000000000000000000000..37f6080072182691fc57eebba670e144db310745 GIT binary patch literal 341 zcmZQ%fB;4)4WpLA7*HCW50hqwGIZnP;$dQ>(_7BoGYITC(^O zn{b$STKY}D->BuMg?Ml8 zar5x<@e2qF35$q|iAzXINz2H}$tx%-DXXZescUFzY3u0f=^Gdt8Jn1znOj&|S=-p! z**iEoIlH*JxqEnedHeYK`3D3B1&4%&g-1k2MaRU(#U~^tC8wmOrDtSjW#{DPGGAU*RJ2VdF%F_yZ7!tc=+h?lc&#~zj*oT^_#cv-hcS`>GPMb-@gC&`Rn(ezyJP2 R!T>egnBVBU{#TC>0{~Btj(z|D diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a deleted file mode 100644 index 7f1cd0a15954ee344910cecc9bc939797cb88210..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmZQ%fBu>#c_Fgc$F^i|mgD7!Z0+ZH&Px;z+svQz zxcK>@y5|?`??eZAdU^Z!`uPV01_g(NhJ{B&Mn%WO#>FQjCMBn&rln_OW@YE(=H(X@ z78RG2mX%jjR#n&3*3~yOHZ`}jwzYS3c6Imk_VrJgIBD{fsne#maka3YW146>(+1BxM}m2t=qQm*tu)>p1u3_A2@jE@R6g(j-NPr>hzhj=gwca zc|p1*kc>PUCmVg{uRrH#IIW+v;TKd9_+B&*=`UZwZ z#wMm_<`$M#);6|w_709t&MvNQ?jDr;e`R{2;j|rl|M~oA*_Ro#)5wYQ@2At<)~8l& zO5Nl;$$93@utP`Eg}&D(eHKYaZ3`ODXD-+%o4_507?fB!-8 zpZiy(>1+2#cflgT_XY0$@)BGV_pv-y+8Ois_z{Nw>pQMjZSUo`;`zHPPI_NK!H3H< o@;}b_2c=URn~oYg&*xn)7GCA_6qEi-@Q!7Xp> zv9PlIjhbt%P5hStmLKl9Pc9st@)hJzNvLiPD9u>UvgU6+!V;Lg0!#=h4^t15H-gGD Hp~(XP>u@*) literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b new file mode 100644 index 0000000000000000000000000000000000000000..361978518bba33466ca90835589244656aef1605 GIT binary patch literal 128 zcmZQ%fB-Hi4Wk5L3@8obe^Fr7y)}h7QLaGhL(d{nFGi@mZhTxk10xeN3o9Et2PYRd U4=*1-SPV@+a|6qozx4>i0e`m)GXMYp literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce deleted file mode 100644 index 469a399135c71a90a7350b27be9ea1967fd47393..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 288 zcmZQ%fB;4)%?YJ9Kxr5S<5x(eM}_BwBuObT?mn{fKr>9AZhTyP*|HezgMUnQx&j&U zMSK?J2?z=ai-?MeOGrvd%gD;fD<~={tEj4}YiMd|>*(s~8yFfHo0yuJTUc6I+t}LK zJ2*NyySTc!dw6Xzj~M`0|Nj=Fii;n diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e new file mode 100644 index 0000000000000000000000000000000000000000..d6f29cf04e1dd134a7dd3d6d7f1d810ad878a16d GIT binary patch literal 512 zcmZQ%fB;rBdIBR<07}95O^0p$M19R;=T7Nox!|Ul4O6BY9~aNS$i&RT%Er#Y$;HjX z%f~MuC?qT*Dkd%=DJ3ltEX>ZXk=_+YG!U>X=QC=YiIA^ z=;Z9;>gMj@>E-R?>*pU37!({58WtWA85JE98yBCDn3SB7nwFlCnU$TBo0nfuSX5k6 zT2@|BSyf$ATUX!E*woz8+ScCD+11_C+t)u~;-tw_rcRqaW9F>cbLP&QzhL2_#Y>hh zTfSoDs?}@Ou3Nuha ViW6A8!D5rSfo09#dKiy^0RU*twB-N* literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f new file mode 100644 index 0000000000000000000000000000000000000000..149b87e5c22c1e7f82f6c7cf73ccf43c0c8464bf GIT binary patch literal 368 zcmZQzzyTQ1#G!lv>CTnSrE?csyDvbje8tLD ztJkbuw|>LMO`ErD-L`$l&Rx6r?A^Ejz`;X@j~qRA{KUyqr_Y={cmBe~OP8-)y>|V^ z&0Dwc+`V`I!NW(7pFDl`{Kd;xuiw0V_x{7jPoKYh{r3IG&tJd){QdVI5(cQ@#@xWN J=5IYh3;^lci@yK> literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe new file mode 100644 index 0000000000000000000000000000000000000000..bb0ecfe3f9b09080977289ef42c68440a054ecb0 GIT binary patch literal 368 zcmZQ%fB;S?%?PC#;0#oW|ES;}Oqp(cT)fbvWnZqos}TJC=0sZ0_8_?pk0dwVe-y@g z;7nA`*M^&MxA;6DL=Od=CRp7_OnXxcUT=$7W)F#^BM!*(@= zm22Md_nW?Lwz|`^nBNRWJgbxuUspmQ>waeQ;ggXN?IHCrzF*b=ve9GiS}7Gk4y6kq>==SQ1=CtH3II~aKB`x=u~#fdZiEDQLOJ2lhm z_&oPxXQdK!7XR{?mwV>Y`{tBKrB!TGf3JCav{Hx5PgLUYeHKs{z=97Je$4eOYyQ^5 GMHv9(_nG4W literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c new file mode 100644 index 0000000000000000000000000000000000000000..1430671a22c5bb511398b23710f263e1f1e30c98 GIT binary patch literal 368 zcmZQ%fB;S?%?PC#;0#oWGWV}n9`c7g-D@qPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mxKO_ub Q0SKX)8(7x-tw)Ff07lJ>(f|Me literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 new file mode 100644 index 0000000000000000000000000000000000000000..b43d6f33cd11de1edef2d2a2d25d453e6beae760 GIT binary patch literal 512 zcmZQ%fB z!O_Xt#nsK-!_&*#$Jft4ATTI6Bs45MA~GsECN?fUAu%aAB{eNQBQq;ICpRy@ps=X8 zq_nKOqOz*GrnauWp|PpCrM0cSqqD2Kr?;$2pIz1KE1RsK`mDwMA*^6CuZ zhnwv&;gZ+NB5e&cw;63^K48rJPT1JLt-YhOtGlPSuYbbCNt35coi=^O%vrBH`n_+b za_uNtvp=n!Z`lv$xw$XqIV-!CiKlK1sT19>ZA!pPZLbwwoSn5Z0`g2~@&FUW Bg){&F diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 deleted file mode 100644 index f78544f7ab321e72b99a7d2fbe58480548a3ca3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB;4)4X4lrp#1-+;2%txZhTz)nY_KZ35BP>J$!KO)Yi%OYHPE%eVJRXGEcnj z^i~$JjyW9rc}l~R)^yjXWxriz^js+OpJ{AmD_`WJ%bSJ&C2>6Mx#b|LZyD-3ZSilz z5(^GNDKF;R6FpDv{jGdqO|nhT8u6AXV!Ub$G6!_7T>LtXPq?=>bQ2JSGP6}rIKVa5j;H|FeK^)s7m zCrpv12E5VdGZ(yJV-1tz;8#m!C*~8BCvUd|W&OBNHqn zoxOvjle3Gfo4bdnm$#3vpMOALP;f|SSa?KaRCG*iTzo=eQgTXaT6#uiR(4KqUVcGg zQE^FWS$RceRdr2mU427iQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_iknLBU(R=q`y gx>r_(uXN_F_Ir9)802Pj|1mePtod6H6J=lk0L<)DbN~PV literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 deleted file mode 100644 index d521dadedcb65039eda8d23329dfda0e672219dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;rBdIBR<07}95{c<}urtd4&_N)kdHf!6)TQFt1@p17Cj7-cdtZeKYoLt;I zynOrufkx|hxv2pPUiAl*RscGpMnOWI6xq0~og+;|B zrDf$6l~vU>wRQCkjZMuht!?ccon75My?y-?CQh0>W$Lu)GiJ`3J!kH``3n{J9h5cy=U*f{Ra*nI(+2lvEwIBo;rQz?78z7E?&BP z<+v*#~fzIy%U?Ys9MK7RWAU%^2bhR+|%Wr zeDTiyzjrH}4)wChD8;RQyztr^_c`C%rnnc~pSj)YzrJ?+vJ0R1He`I+%-qHuY^I;Hk#e^c_4}&#P-v!V zmdCy)2ja>n6;{5iPv>7wnOFTuSsV0FM?I_Kk#^8>gxJfcJ2LSnXccT3inNX{+mz4uD$C)!?%rh z(^>PJcHdlYf9T`-a;dtX0n0BKq0FU*zB4b^b-Y z{9oBia{nY8FK9lS;rp^+#{Hc02UNpjo@|?$vSy{pEALfVGgno42Bm(J4@_a~U68+F zQ_{Z&nK2$6wLunQ&281k*PP`)85Aa+$+P`-PU+G0C$|fj*$V_28ujhzN}PN*@j}VG h=eHlYJG_4RLg(6gkegxNg!zy8jn3(|Lc`I(8;;p+I+Vee@slsHU!$tlEmNkFtp^AVM0GyEy A+W-In delta 61 zcmZ3$w17#FkpTiYp)}(}L3x2z9}&KyLyRxZWf)COZsy>e=x~w$jn3GK Tg=&S-%x`pF|Eq_Y$G`vpCA16- diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 new file mode 100644 index 0000000000000000000000000000000000000000..694a425678958f5dfe1ec0243466112028d44847 GIT binary patch literal 368 zcmZQ%fB;!jX!msqa*&f=ReWxDZk@eGVi%q*;I>>Qk2 z+&sK|`~reP!Xlz#;u4Zl(lWAg@(PMd$||aA>Kd9_+B&*=`UZwZ#wMm_<`$M#);6|w z_709t&MvNQ?jD|A-afv5{sDnO!6Bhx;SrHh(J`@c@d=4Z$tkI6=^2?>**Up+`2~eV z#U-U>ECr+L^edg@B^A|2& zx_ss8wd*%--nxC~?!EgD9zJ^flG{`&pr@4x?$ QFhC7A<_4BEf9nxq0NZPfg8%>k literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d deleted file mode 100644 index 3a6abd378100f5f780ee3ec67a09c56a4bcd6203..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB;4)%?YIipfrqv@nU+WD?t^& diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 new file mode 100644 index 0000000000000000000000000000000000000000..5bff421399ce82018b10a99b0f299afdc7df4d30 GIT binary patch literal 341 zcmZQ%fB;rBdMT6-qtN*ogo_dEZXwLIpwPY#;5^N}t8o}M}9BUC4cnwVE`7{)hxRNd5Bd|Yht1PKitwhQXt zO*Sf;EZu1`!PNTEOjUp8zk4nnY&DqnTrFvqyIWq;YTo1V5({1yT*&QP{@?fNZsFY~ n|6V25UEI>#?HhaNd+8?CZErwshItd_Kjt?&um9DU+Wgapq&j{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/22e370faf486d5e245dcc33671bbf15910a5e91e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/22e370faf486d5e245dcc33671bbf15910a5e91e rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c index 6d6f1680c3fb2c577cf548f989c848dde672f70e..7bc1890c7b3d89129ab7c264a7ed505e325f59cc 100644 GIT binary patch delta 72 zcmcb@c7=_TkpTi2CvvI_+|bi!x!v=ste5C&0dxNv>+fr@^gX#&)%0C9gZ@wywQ36Z!#yd41}S{EW-~H KsfX!fU;qF;=obF~ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 new file mode 100644 index 0000000000000000000000000000000000000000..7bac769c53ec517b529ad91835e388139e5b58e3 GIT binary patch literal 852 zcmZQ%fB;4)4WpJY!B`L)#*d!1cUASIvy;vW9(a)2wp^1Ls!TUNE}nsriJ66!jh%y& zi<^g+k6%DgNLWNvOk84D@GDJ@=bIdRyZ@X&W3cGpYtuPGL9>qMtm%^1yWqL7^LzNY zcAHy=C*_^^rP$lznZbP z4y&9)i|kT7gdO)g9nHSHrt0SZ%B}9o+m#MZ-??k|p1u3_A2@jE@R6g(j-NPr>hzhj z=gwcac|p1*kc>gB@=X+BD?45}i}>7JXKth}~; zy{db0x9EC}U(Q=Z)*k$y&wkCwdeY?o7XM?pwfX%$ww|={x`2SGi7&) zuG;ai0)f)i1;J>Bh&!GcYnSv#_$Ub8vET z^YHTV3kV7ci-?MeOGrvd%gD;fD<~={tEj4}YiMd|>*(s~8yJFhq1njXz_R9VJ8 zar5x<@e2qF35$q|iAzXINz2H}$tx%-DXXZescUFzY3u0f=^Gdt8Jn1znOj&|S=-p! z**iEoIlH*JxqEnedHeYK`3D3B1&4%&g-1k2MaRU(#U~^tC8wmOrDtSjW#{DPGGAU*RJ2VdF%F_yZ7!tc=+h?lcyk`azTA<1f?14S=RimhlLdb15DlY<8&6abk= B4~PH& diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 new file mode 100644 index 0000000000000000000000000000000000000000..003ee32e0bf2090c0054a29e5479d0378dcf5790 GIT binary patch literal 288 zcmZQ%fB>Qk2 z+&sK|`~reP!Xlz#;u4Zl(lWAg@(PMd$||aA>Kd9_+B&*=`UZwZ#wMm_<`$M#);6|w z_709t&MvNQ?jD|A-afv5{sDnO!6Bhx;SrHh(J`@c@d=4Z$tkI6=^2?>**Up+`2~eV z#U-U>%@-FdLW~Sl0Zl Jhlw&U000wVCAZ5Z~(pa4XywH diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 deleted file mode 100644 index ff7e49325b9b2eba0a9a7734ca658526a9044c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 852 zcmZQ%fB;4)4WpJY!B`L)#^2wv?yuCh`#y5d4{qbW`MZ=Es!TUNE}nsriJ66!jh%y& zi<^g+k6%DgNLWNvOk6@zN?Jx%PF_J#Nm)fzObje8tLDtJkbuw|>LMO`ErD-L`$l&Rx6r?A^Ejz`;X@j~qRA{KUyqr_Y={cmBe~ zOP8-)y>|V^&0Dwc+`V`I!NW(7pFDl`{Kd;xuiw0V_x{7jPoKYh{r3IG&tJd){QdWT o)c=D&{z2(f5}IZgKxxJ|IGgq7tg@R#LU9V#?HaX#m&RZ z$1fl#BrGB-CN3cC$FHWq^zQrLCi@r*B|rWNcz;W^Q3=Wo=_?XYb(X z(^b diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef new file mode 100644 index 0000000000000000000000000000000000000000..8658752c580c015853abdfa24cbdc317d30b4771 GIT binary patch literal 128 zcmZQ%fB;4)4Wk5L3@8ob$9G!HKQ^^=dQsu3vmbZd*M#ZQjgN~@c+T>uT!(qbgDb_K ZGg;++g2Z6P!1OaWu&nu84-;iz005%w7SI3y literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db deleted file mode 100644 index 5d84edef8c81be93d05d179c3ce7fdf8845263e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;4)4Wo=;3@8obpUZvqpL^YN55{l#?>I81h{N>h#>d4oFfuW-u(GjpaB^|; z@bd8s2nq>{h>D3zNJ>e|$jZqpC@LwdsH&-JXliNe=<4Yk7=m@7*}(ip=k>pOg!KTE C6BF|Q diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 deleted file mode 100644 index 48b792180a57e44fd7b1d0052e26472737615b0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQzzz!xbqKd=#rB|*+@O)$9l5OseoEO3J1*S|lJ}#btk%^gwm5rT)lZ%^&mycgS zP)JxrR7_k#Qc7AzR!&|)QAt@vRZU$(Q%hS%S5M!-(8$=t)Xdz%(#qP#*3RC+(aG7x z)y>_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`Su&B7Cw5+_M zvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqf5E~dRhmRaRcKpQ2Q>V|IJ$L@X#Y>m3T)lSv z#?4!|@7%q2|G~pYkDok!_WZ@mSFhi^efR#u$4{TXeEs(Q$IoBC|NQ;;f3W!<94F9d QgvB588=cqx>Jf1Z0L72Cc>n+a diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 new file mode 100644 index 0000000000000000000000000000000000000000..9c364121d414d4fc7effe28bd8a549a57e22197d GIT binary patch literal 162 zcmZQzzz&Sigkk(?la3k~<~FSnv$|_DQKdnF5voo%J}#btk%^gwm5rT)lZ%^&mycgS zP)JxrR7_k#Qc7AzR!&|)QAt@vRZU$(Q%hS%S5M!-5UdMo0?Y>H29`B{>k-xi0Ka7s ANdN!< literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc deleted file mode 100644 index 0479bf70d452b815dc8cbbe5d66e9c414c7910eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB>Qk2 z+&sK|`~reP!Xlz#;u4Zl(lWAg@(PMd$||aA>Kd9_+B&*=`UZwzU1&BkztMU9uO4PE G0|NkY9}}bi diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 deleted file mode 100644 index fa86f79e5be8091c680537725e6b7b3f71ceaa38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQ%fB;4)%?YKApfrqv@!R?n1vIWFZCiiIEB95xho3Ngy76)G<|*;Xg1;7BYJG7> z_xU^@beFH;~E_551-{`#lR}T|q GU;qFdOB_A` diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 deleted file mode 100644 index b504855404dc609af279f2de155646e7a5cbc858..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB-Hi4Wk5L3@8obd+$465}j*sZ1(d_haC=oRbYh5>&C~$GcYnSv#_$Ub8vET V^YHTVgT>JFGr!S!{jVNjH~?5N590s; diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 new file mode 100644 index 0000000000000000000000000000000000000000..efbcc4d5e23ab248bdb71ddeb78ccbf3d43d7ce4 GIT binary patch literal 512 zcmZQ%fBdtM>bv*UpSd@K59W?{Cdi{AiJZp^>qPshPQjrIodf zt)0Dtqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&t zVNr2OX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{?GW@ zL}A&e=k9en>gj_2GUluds7v8aJW+SiO<+v*#~fzIy%U?Ys9MK7RWA>Qk2+&sK|`~reP!Xlz#;u4Zl(lWAg@(PMd$||aA>Kd9_+B&*=`sn_TQR$R= zFUYtvt$XSDAKU*c3M6>>o~&8D|4!}U3l@hT6zl!DvSB03!wccB+AjP5XP-^T|DZU5 T#Ud;|nHyNv{H=$HGB5xD^|#5| literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 new file mode 100644 index 0000000000000000000000000000000000000000..6ddfeac3d5c419eef66ebd0bbd4d1fe028ec11ff GIT binary patch literal 162 zcmZQ%fB;rB+6c;rQ84})k+&ezUW0DM}JD0L1IwDf^)OKe F1^@_KA~^s6 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 new file mode 100644 index 0000000000000000000000000000000000000000..5e31df51289964b7e1d5b975ea076abecc49f600 GIT binary patch literal 122 zcmZQ%fB;4)%?YKspfrqv@mDkU=ziFrBlz*#Qm+2pcIGgBy76)G42(?7EUawo9GoB? TD^x3tW^Q0v^S2&m9s>gauOJP7 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f new file mode 100644 index 0000000000000000000000000000000000000000..f706ae5da86230af4c5deb5891b8661e835a3a2d GIT binary patch literal 341 zcmZQ%fB;4)4WpLA7*HCW50hqwGIZnP;$dQ>(+d(Mwrnn0YrEutrRniC8TaQ)xUT5Z z4`)hU^U_drSA-Bw6A5WNeLMHgmDcw?%N=(_$5yP1Wncg~R1#_)2b5;4XIb;N9$^Vg QUI8YAL*57~&x9rq0M`pMSpWb4 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c new file mode 100644 index 0000000000000000000000000000000000000000..0d7a293233bdd7195baaeaba941e899efc784b2d GIT binary patch literal 341 zcmZQ%fB;4)%?YKKLTMO<&WDLJLm9g9aq%!Q(&Zn?Slo hkV7S*=5s)4#(I`Df9nyJ!sHcTLOA4&pz=&;@&MLa9J&Ai literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e deleted file mode 100644 index 543669bec6015aa74f81e3a4f692be8c044ff720..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB;4)%?YKKLTMO<&WDLJLm9g9aq%!Q(rLE-ob^!_E{(61q-_dryiz9G1kyEv h94ZMlp94xWzSepDuO4A3OkM#dghSp4D$j%_4*+gk9FPD2 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 deleted file mode 100644 index 511f39637a9e341b9bd4b579eda72abfdb39cbfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fBvg#xV7b>>+n5omKsP=vo`I2xnT3^&or4p^ UV};7VXy!LMum9D<%wu2x06)JBX8-^I diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 new file mode 100644 index 0000000000000000000000000000000000000000..6527a67a2449682f2e575355f9acbbf2d1193856 GIT binary patch literal 128 zcmZQ%fBCho;O+x&YIs8y^?Xz{teR!pg?Z!3pBA RLUqDu<_4BEf9ny(0ssaF4%q+z literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 new file mode 100644 index 0000000000000000000000000000000000000000..dd9e5370a38c6d89d42a85ab382ca48442fe25c7 GIT binary patch literal 162 zcmZQ%fB;S?%?PE9pfrqv@go&KX$q~qqqTa?n%RuAUZ%m+>&C~$GcYnSv#_$Ub8vET z^YHTV3kV7ci-?MeOGrvd%gD;fD<~={tEj4}YiMd|>*(s~8yJFhq1njXz_R9VJ>Qk2 Y+&sK|{9rLO^Ozf0*8Hu9naaQb01eU(GXMYp literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e deleted file mode 100644 index 4a2e690a5afbd5005b927641b2c1838299550527..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fB;4)%?YKSL1`ETqn zoxOvjle3F!S=R0EFDEFLI0e3*xrWtRBrH54GAcSIHZDFPF)2AEH7z|OGb=kMH!r`S zu&B7Cw5+_MvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`pGNd{d_TUHbv zRI2z;)LwOX^_sQo)^FIjY4et?+qUo6xoh{Hz5DhbIC$vrk)y|spE!By^qI5g&R@8A z>GGAU*RJ2VdF%F_yZ7!tc=+h?lcyk`azTA<1f?0@=)C?{4+|>>2AI4zOo)Iy6Pi2# D4%UU; diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf new file mode 100644 index 0000000000000000000000000000000000000000..07b87a094655f6fcc769cf600051d0a283aee185 GIT binary patch literal 368 zcmZQ%fB;rBnt>520HdIM;qCm3&$S$=c_><5ZdJK32&POoJ}#btk%^gwm5rT)lZ%^& zmycgSP)JxrR7_k#Qc7AzR!&|)QAt@vRZU$(Q%hS%S5M!-(8$=t)Xdz%(#qP#*3RC+ z(aG7x)y>_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`Su&B7C zw5+_MvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqf5E~dRhmRaRcKpQ2Q>V|IJ$L@X#Y>m3 zT)lSv#?4!|@7%q2|G~pYkDok!_WZ@mSFhi^efR#u$4{TXeEs(Q$IoBC|NQ;;9})(z P0E5uX4J>Q^)+59Kx*&{Y literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b new file mode 100644 index 0000000000000000000000000000000000000000..6fdeda88fe16b77810851e52a736c6a568e863f3 GIT binary patch literal 288 zcmZQ%fB;4)4Wl-|7*HCcSZEwqfI_Rn~IQba!N^ov~&KE1!9wIX$)Q)0uK%>Eh^ zi@pZ7-JZ@Yj<&Pqcpsi#=d-|Of_Zw-*TP9^6)RpQvgNJ~*z(X|X8gv0b4gR!wnR!) l%+!jJ`CTK}BmGKv`*QnskegxNg!zxTfo09#dYC8!0|14-V8s9c literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 deleted file mode 100644 index 6aa20f3a13a3681336a72bee5552cbb6f2c1fe4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB;4)4X4lrp!{UN3o_+*7A~EU+LROZ>|QfWnQnYsJOd*WGYcylI|nBhHxDl# zzkr~Su!yLbxP+vXw2Z8ryn>>VvWlvjx`w8fwvMizzJZ~Uv5BdfxrL>bwT-Qvy@R8Z zvx}>nyN9Qjw~w!%e?VYRa7buactm7WbWChqd_rPUa!P7idPZhec1~_yenDYTaY<=e zc|~PabxmzueM4hYb4zPmdq-zicTaC$|AdK?CQq3EN z?fQ+Iw{G9Ld++{(hmRgVdHU@6iXzj}nR0C@co_W%F@ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa new file mode 100644 index 0000000000000000000000000000000000000000..7bd771d6934adaa717ff0d4a60ca25797208110b GIT binary patch literal 852 zcmZQ%fB;S?%?PEJFhLn;{JVByJfacn_HBCpVeaQ!%0w|8lNa9?YWuT<<==5;Mt!eov;XgAKk(+9y7$(#0SoFvJ_>HGE0|=f z!g9cve^O=bQ&Hy${^m2a)@F-aL&x^VoZVPyK@*0<2 z?ezn5d6_NN%CB6tdd=E(>o;uNw0XRJbd){$-APG zeX>#S*O|>1E5k2;+HABXZ@&%KlJ;z6smbewMfd02%z7A*U^1z8&Dk?zI;pIw6IMhl z*%kFLx^t@8`qRo`NB@0i&foIoz5}c4&B!lWH$Ej?{Z^(NtN(!IYlh#xq~dG|v-2)N zzHBa{mXdYyx2`^RfB$pA+lSW{&Rna-5VOp$x~8_SzM-+HxuvzOy`!`1!Qa1g*yr31 z{P|5cYsZUCuL`}hwSpp~cKx|^f1c=G-NuHv-~i5wU%~>+GjdKJSURVe`TJF|y6rE1 z@a9dbbeW(p$KiP1nyK+Y*6Qf34`1$?xbEuJ-G^5vH2p}aemtj9%aq_n*K2{)6J*{d(Jz4391I&gA)==8A7zy!7xySBuGZT&^sRYG#wBcUoN3 zn8#ncC%^5+;eyA_{geB9H%@ra$0BiT3-982>ugl~eyxrvzOv!ohNc-ZoMlb#7ZjcP zQgErs$*iY8;%=$J6CLMHu4}KC?6})BYuov@Tc6d(PZ>^A{{!v>235C823{0hDH}XIb;N9?AhyMldEU NGoZ<%>t{lf2LKb0cJ2TG literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/06703ef82d4a6446b3f0008ab5240a8007769563 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/06703ef82d4a6446b3f0008ab5240a8007769563 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 index 615bf5659cf2687223152f6da9f7aa36a3a442fd..8f86ed90164aec9a9b90739240cb03c4d77a7d27 100644 GIT binary patch delta 43 scmeys^nq!Dfxz9LX)JU4-t#^SpOrmN%kt|+2SrBy29`B{>lxqx0H6mCApigX delta 43 scmeys^nq!Dfk53J_lSbf@|Nd?ZAB9~mOt6(pvcJoM(6dvdImTE0F@gLWB>pF diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 deleted file mode 100644 index 095cb69d33caaef7e13193433e02ebce694fa276..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmZQ%fB;S?%?PEJLTMO<&WDLJLm9g9aq%!Q(&<*#^fM(Msn>T1i)`TONO!%-BC|i# zvM#~nvUKgQzem(@nn+0FLXp!Vb&>+x)kQQ}#EjaPFff1|DhV}@14=W#)_MJ}9$^Vg QUI8YAL*57~&x9rq0F4zeR{#J2 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 new file mode 100644 index 0000000000000000000000000000000000000000..06c9e0d6546e26f68b0980935caccf96d563e957 GIT binary patch literal 368 zcmZQ%fB;4)%?YI$U;=3T?M6uvISX?aGtD}^CdyyyButrZd|W&OBNHqPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mxKO_ub Q0S2L&8(7x-tw)Ff0E<72KmY&$ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d new file mode 100644 index 0000000000000000000000000000000000000000..81e2526e0dbc025be0c90047ca8d40d49a6ee13d GIT binary patch literal 852 zcmZQ%fB;4)%?YKKFhLn;{Jq}{Pd;>f%6X-%^A}gP;%sK9yl#A4JOd*WGYcylI|nBh zHxDl#zkr~Su!yLbxCHOs4NIq8y<2zhpvSLeNB#b2YH91}>ggL88X23InweWzT3OrJ z+SxleIyt+zy19FJdU^Z!`uPV01_g(NhJ{B&Mn%WO#>FQjCMBn&rln_OW@YE(=H(X@ z78RG2mX%jjR#n&3*3~yOHZ`}jwzYS3c6Imk_VrJgIBD{fsne#maka3YW146>(+1BxM}m2t=qQm*tu)>p1u3_A2@jE@R6g(j-NPr>hzhj=gwca zc|p1*kc>SO7&Oi7!TmZWPxa`S@~e*gaS_uqe< z{+E=JmXVc{S5Q<^R#8<`*Py-sm#}%8TvxR)?{kz`*wT|JM{WPVe)IO-`wt&Keg5+G z+xH(of5H79u;gfL`=dP*MKmHa*Lxke0mnc6{f{&LLFrTynr0V3X~ue%HGk`&93W)` PW5O~8nmoFGCNy~fN(N50 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e new file mode 100644 index 0000000000000000000000000000000000000000..1d311d20f56fb0db63e8e851451d801cb3ee97d2 GIT binary patch literal 512 zcmZQ%fB;S?%?PC@z!+%!rI}Ayc20f!?Cc7ij>D%K!ePpELc_u%BBP>XV&mcy5|ffsQq$5iGPAOCa`W;F3X6(M zO3TVCDyyn%YU}D78k?G1THD$?I=i}idi(k(Oq?`%%G7DoXUv>6d(PZ>^A{{!w0OzV zWy@ErT(x@5+I8zUY}~YY%hqk%ckJA?d(Yl|`wtvEboj{8W5-XNJazia*>mSFT)cGo z%GGPvZ`{0f`_A2a_a8ib^!UlsXU|`}eD(Ux+js9jeEjtJ%hzw;fBgLQ`_JEh{|B4@ UL2-f}kIW4$YyQ?lBNa#i0GO7zT>t<8 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d deleted file mode 100644 index c48ef8152c8e0104bd396ea7e1f5cc37e8692e9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ%fB diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd new file mode 100644 index 0000000000000000000000000000000000000000..831373f4ece6607bb06e767f3a4f14ec562ac5c2 GIT binary patch literal 288 zcmZQ%fB;4)%?YJ9Kxr5SJ-vPX6DCfYJZ0*%=`&`|nmuRky!i_jE?T@~ f>9XZ3R<2sTX6?H5U^k=rm$`vu&EI;MuNfEsdnQYZ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f deleted file mode 100644 index 8552bf1701b04f2a56f9b4fcf5815528e5bddbc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB z!O_Xt#nsK-!_&*#$Jft4ATTI6Bs45MA~GsECN?fUAu%aAB{eNQBQq;ICpRy@ps=X8 zq_nKOqOz*GrnauWp|PpCrM0cSqqD2Kr?;uW@yGl|=k>pOMBD-Z(*w7j diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d new file mode 100644 index 0000000000000000000000000000000000000000..2e284a54c0f6aeebd6e7a059e301f168ac63dd83 GIT binary patch literal 128 zcmZQ%fB;4)4Wk5L3@8obTgAQV7n*-T1ip?z-z1&a?LXITTrJ X#oTqWA0&pZpZSf>>wonyQ3eJ8WsDYT diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 deleted file mode 100644 index 4c749b85d6990dff95926fa6943f62fc0691530c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQ%fB_}RaDi~H8i!fb#(Rg4GfKpO-#+qEiA39ZEWrA9UPsUU0mJVJv_a< zeSH1=0|JABLqfyCBO;@sV`Agt6B3h>Q&Q8?GcvQXb8_?Y3kr*hOG?YiD=Mq1YijH2 z8ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGi-6T(o$}(q+q6tX#Ev&DwSA zH*DOrdCS&q+js2TwR_Lreftj_JaqWT(PPI?oIG{<%-M72FI>EI`O4L6*Kgdsb^FfU zd-oqaeDwIq(`V0LynOZg&D(eHKYaZ3`ODXD-+%o4_507?fB(T@01Gx~z%akjdHt^* ICdj}50Qnb{lmGw# diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 deleted file mode 100644 index 3a243d399af691a91bbd5253d282bdea49d4ad0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fB;4)%?YKSL1`ET<6G^$wku73jvt#WOH6F|)9;v2$>8 zar5x<@e2qF35$q|iAzXINz2H}$tx%-DXXZescUFzY3u0f=^Gdt8Jn1znOj&|S=-p! z**iEoIlH*JxqEnedHeYK`3D3B1&4%&g-1k2MaRU(#U~^tC8wmOrDtSjW#{DPGGAU*RJ2VdF%F_yZ7!tc=+h?lcyk`azTA<1f?0@=)C?{4+|>>2AI4zOo)Iy6Pi2# DW>J3p diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 deleted file mode 100644 index c6ef4a6d81ff3d91cb17ed505a62aed2b036f67a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZQzzz&Sigkk(FK}X+`sWWxwE<4ZgzHjz#MyNX7__%lmMkZz!RyKAHPA+a9UOs*S zK_OugQ894|NhxU=Svh$HMI~hwRW)@DO)YI5T|IpRL$EHW2{0R&-{`#lSC6nB07%ml Aa{vGU diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 deleted file mode 100644 index 15c9a7e9c96529fc88b6bf0c6bf14546fe4f751a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmZQzzyTQ1#G(BEsNf$=nQnYsyn}IZR>(ukvdqWb`7-6pr}J}gRTyNQJS=_lhWFdT z6+3Ky>TjLAmF=rX+>NW%{|!H#NPbwr{~>SHvs5j{291cupX$Og=@)YR#38Bd2Yt`aWgA3>t61-dSrn}184&tk!}Vcq=Zcw2 zF5F}aPoCgo!L^+-Lxkx|hxv2pPUiAl*RscGpMnOWI6xq0~og+;|BrDf$6l~vU> zwRQCkjZMuht!?ccon75My?y-?CQh0>W$Lu)GiJ`3J!kH``ECa8Z(NE(=V$MhJ=m8} z5VG0WRzCLX&L5Q=kKSze_VYQhfM4RBM^zh3-0M$~c`E)FE?&BP<+v*#~fzIy%U?Ys9MK7RWAqPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mxKO_ub Q0SKX)-{`#lSC0?_0A$9Ey8r+H diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 deleted file mode 100644 index af2be3f993632df5c820b6ebcf23e2e61e5a3b99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;S?%?PC@z!+%!7jt>Lc_u%BBP>XV&mcy5|ffsQq$5iGPAOCa`W;F3X6(M zO3TVCDyyn%YU}D78k?G1THD$?I=i}idi(k(Oq?`%%G7DoXUv>6d(PZ>^A{{!w0OzV zWy@ErT(x@5+I8zUY}~YY%hqk%ckJA?d(Yl|`wtvEboj{8W5-XNJazia*>mSFT)cGo z%GGPvZ`{0f`_A2a_a8ib^!UlsXU|`}eD(Ux+js9jeEjtJ%hzw;fBgLQ`_JEh{|B4@ T!Eu5Xf6Q-mUjM6y3IZtrU_Q8g diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 new file mode 100644 index 0000000000000000000000000000000000000000..4b796145f2108b1d24c5dd45e5adccc5386bad11 GIT binary patch literal 368 zcmZQ%fB-Hi4W}64EC>V2|Bnj(!IbI7$Hg-+GBLBTvaxe;a&hzU^6?7@3JHsdiit}| zN=eJe%E>DzDk-a|s;O&eYH91}>ggL88X23InweWzT3OrJ+SxleIyt+zy19FJdU^Z! z`uPV01_g(NhJ{B&Mn%WO#>FQjCMBn&rln_OW@YE(=H(X@78RG2mX%jjR#n&3*3~yO zHZ`}jwzYS3c6Imk_VrJgIBD{fsne#maka3YW146>(+1B zxM}m2t=qQm*tu)>p1u3_A2@jE@R6g(j-NPr>hzhj=gwcac|p1*kc>h+tq@7{m-`04YPuiw7^`1$MipTGb9gTnw8Y|wyVu4h^Ew;m?Q GzyJX4eU!fd literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 deleted file mode 100644 index b502858e21a3120d24b29955374936fa7b414452..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQzzz&|F3B&k4M_)zjwn+-_R6DRGq>ROw8LCb_*)63h(*Uvv7Feo@AG%P$KGAcSIHZDFPF)2AEH7z|OGb=kMH!r`Su&B7Cw5+_M zvZ}hKwywURv8lPGwXMCQv#YzOx37P~#7UE`o>=ggfqf5E~dRhmRaRcKpQ2Q>V|IJ$L@X#Y>m3T)lSv z#?4!|@7%q2|G~pYkDojR`IHOlYa=Ml_(tdTzj{QF!Q{PRLQr`oC?8#(2`bMEl?MR! C4ShlY diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c new file mode 100644 index 0000000000000000000000000000000000000000..82a41d45c9ba50389ce4d7bec0128eb46ae1d1c7 GIT binary patch literal 852 zcmZQ%fB;4)%?YKKFhLn;{BQM7SN{J${}NwiUivvVhd0bndENN9cm_r$W)@a9b`DN1 zZXRAfegQ!tVG&U=aS2H&X&G5Lc?Cr!WffI5bq!4|Z5>@beFH-yV-r&|a|=r=Ya3fT zdk04+XBSsDcMnf5Zy#Sj|A4@t;E>R;@QBE$=$P2J_=LoyYCcR`i91)=9bpB_Kwc3?w;Ph{s|K&O`bA!+VmMSXU(27ci#L33l}Y3 zvUJ(<6)RV*UbA-H`VAX5ZQinV+x8thckSM@ci;X42M--Sa`f2o6DLodK6Ccm`3n~> zUA}Vl+VvYZZ{5Cg_ul;n4<9{#^7PsB7cXDEe)IO-`wt&Keg5+G+xH(ofBpXR_uv0f n{}2B72c=UqPshPQjrIodft)0Dt zqm#3XtDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2O zX<2ziWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4 zZ25|nt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mx|6ub! TC{EDhk-33o&EI-xqyi}bDR8#~ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 index 986208e97f8721f8984d51eb2ed4c51be1a0b0cf..4ae7c11b4f777b9889ee7c2f64a1e839ae6d6359 100644 GIT binary patch delta 60 zcmZo*X<(UPAdr#&edik9Kd##=IploACQEE|Siq>j00k2mAq?gQmNkFtVWJES02rjW85o(ESyd4oFfuW-u(GjpaB^|; z@bd8s2nq>{h>D3zNJ>e|$jZqpC@LwdsH&-JXliNe=<4Yk7#bOyn3|beSXx=z*xK1U zI667IxVpJ}czSvJ`1<(=1O^3%gocGjL`Fr&#Ky%ZBqk-Nq^6~3WM*aOY{-Hhfx<~KU8|J5Tr4*=EkOu7I7 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b new file mode 100644 index 0000000000000000000000000000000000000000..8ce143644a561469a8a80eec4eb31f3a5debc867 GIT binary patch literal 406 zcmZQ%fB;4)%?YKSL1`ET>VvWlvjx`w8fwvMizzJZ~Uv5BdfxrL>bwT-Qv zy@R8Zvx}>nyN9Qjw~w!%e?VYRa7buactm7WbWChqd_rPUa!P7idPZhec1~_yenDYT zaY<=ec|~PabxmzueM4hYb4zPmdq-zicTaC$|AdK?CQq3EN?fQ+Iw{G9Ld++{(hmRgVc?$9=7u45AP@1uxWzFAuSXePIz~sGQLImWQ(BuIL CZhI5} literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a deleted file mode 100644 index 0cd2c5c82c1a60b47153c84964eab3bf06fc4b69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmZQ%fB;S?%?PERL1`ET<46BosxGTuZ6dg8+t-!L^PQNX3UuS+;u#p3m|0la*f}`W z158|wPS1SSBKWau$Gp%Jjlw$S+gy_*wLad7-QMw>(=C0C;rgrB?FIKYX8#m5ceS#% zv9+^zaCCBZaox@zBA{0{v#ZK4q4m_`8*6!+BV6>DewT&w#%cUb+3z}a-i`Y^&Uw8# zv0&BO_Na)xdk-AkvTOCKm3i~c9oF3V{J*WeqqD2Kr?;xVso(BC zdnCQ>ft=sTga+Q*ckbT1|KQ=H$4{Pue98s&wGotNe53RFUp*|W7#Lvk-Y_8o@=R#* E06bWO(*OVf diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 deleted file mode 100644 index 3ffb03b1b75ef97190dd1dbafba1f07bbe3daa8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQ%fB;4)%?YI^zy#3vGp;O%d&=q`=KNpC{cKWmB21ZXd|Z4)?%qq0IAt@y-BP%Dbps1v*qN=8@p{b>IRvK4a#r*>mR3n_pz~N`Err z>V;7+j~ciiDoWn4ant54TeofBv2)k%J$v`eOC(!6)fW;^C8=cqx>S3Y` F3;;06zVrY9 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 deleted file mode 100644 index d635eecd722c2ee6434401cef85acc08771d748d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZQ%fBdMQlYB;~0^Rtycm_r$W)@a9b`DMu Uj}e7jKgbZ1DLd7$S+lZ`5vo8pJ}zFme8IhhK>e*9A?5*s WuROCsV(9vr8(7x-t%r#+FaQ8A0~B2V literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 deleted file mode 100644 index face2bac20479cc517f063a7d3850ddc85726103..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 288 zcmZQzzz#N`3B&jv@#|Oo+i9!UoX`I8X~aDsTvho_gfkFTG9KwwaCNN8AiL}XNSOl(|yLSj;KN@`kqMrKxaPHtX)L19sG zNoiSmMP*fWO>JF$Lt|5OOKV$uM`u@ePj6rUgo%?TPnkMx`iz;gX3v>BZ~lUXixw|g zx@`H1m8({-S-WoihK-vxZ`rzS`;MKvcJJA{Z~uXVhYlY(dhGa#lc!FfIeYH>g^QOi zU%7hi`i+~nZr{0k@BV{_j~+jH`t13Om#<#GdHe4DhmW5=fBE|D`;VW$e*gLV@Bd)) TKR8a%;*Yt3WzFAuMBD-ZtvL|v+{#;`tfUdxS}AK&?4eO;FMo77vmyr3V`grD8XnSF!p$i}O6@!?-Z8jqi-w^Q9;wdLC{ jwa=VlXAbJ{JvUdn(FJld%$qR(F*mTR`CAVYWncgR@Udv{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 new file mode 100644 index 0000000000000000000000000000000000000000..27e29c75f6a90bdd4f050b852cd38ec6e8fd0615 GIT binary patch literal 368 zcmZQ%fB;4)4X4lrp#1-+;2%txZhTxk10xeN3o9Et2PYRd4=*3TfS{1Dh^UyjgrtsTvho_gfkFTG9 zKwwaCNN8AiL}XNSOl(|yLSj;KN@`kqMrKxaPHtX)L19sGNoiSmMP*fWO>JF$Lt|5O zOKV$uM`u@ePj6rUgo%?TPnkMx`iz;gX3v>BZ~lUXixw|gx@`H1m8({-S-WoihK-vx zZ`rzS`;MKvcJJA{Z~uXVhYlY(dhGa#lc!FfIeYH>g^QOiU%7hi`i+~nZr{0k@BV{_ zj~+jH`t13Om#<#GdHe4DhmW5=fBE|D`;VW$e*gLV?>{&UU;zjX80LDGHGk`2f(#4* D;MJ72 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adab987e21e9838b02e500658ea0818a18ac0403 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adab987e21e9838b02e500658ea0818a18ac0403 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e index 77d070f792ab439fe3380ab001ead6cd4ddaa340..e90b66278346eab175a19e0e6e6229a8d02ee4e4 100644 GIT binary patch delta 61 zcmcb@c7<(%fxw*hq9b0e?^tr>L_bIFo^fZR!%-%ddX_bRCv!5(Kp2|LGW;NsdImTE E0RKu9;s5{u delta 61 zcmcb@c7<(%fxyihx~rdkx46P8?_F=HE$6h+;V2W!8=cqxCUY{&Kp2|LGW;NsdImTE E03`PokN^Mx diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e deleted file mode 100644 index 48e5f6338032477b325a5b29bc91a20e4ef6006f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmZQzzz!xbqKd=#vuignghdE%u{bU9Avi&Ws{nQB)+(E*TN+etRj|wo4IpkvU_gB>X!89CmYIs zx~&l4z8h?y6;^PS&tp>DH7NsmW?5m|3oM(OO3sKzu9R6BwP)Mwp6TbAgWtKFk!Fh6 zuD128z1*LU1Md7!Vt-#xod2@%S&UVs@uaGwer#F1y+!Rg%irz#Jw5!Shlup=kS)a* zDvGx(_&fKT?$jH6?7iiZioGTA=S7#zDoCpI|GfXrA-Bgre@~P?42lz2EW+ZC`Hjx& KfAug?1_l6rB-Zf& diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c new file mode 100644 index 0000000000000000000000000000000000000000..94594c4ad4126d39e3510df026235b4a13715850 GIT binary patch literal 178 zcmV;j08Re@00000000000RjUA1qKHQ2?`4g4Gs@2UtV7z_3}gw_h(Ppeuk0&Kf+@4 zlbw0ey-r0xRhewIheQk4^KG+5LLy0G6hm3r{aiNmQv{JdgDw^}L`i_9y70Qq}bo79)Z?3T<3rf5n69V}LU9EP=8 qIR)tG_`iWwyDw!NymCQ`T3y1@g71D_rdQ1p6g#@B*7^1cH*s$~&ry~D diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a deleted file mode 100644 index dd245f4a4ddc00b1cca222904933b0b2db4fccf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b deleted file mode 100644 index ff53f68f159d0258d8fe2bba37ed9ba2913cb573..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc new file mode 100644 index 0000000000000000000000000000000000000000..7d7969daa4bf7d6435fcbe06caddd2e84da9c27d GIT binary patch literal 188 zcmZQzfC5G)W)@a9b`DN1ZXRAfe%<)E_zB@v#lmZZE9)b+t8Sg-UqAVEi3|JB-JHk1 zWaONfSbN+>Y0I}0W)ro_xvCe5FW##Eu~akCr1_zqZB1ey6Y~k4w#4uDxeFIqD8C8b zUHowSZr+W_<)X=bHH)PaJpGhPkG)n~);wKk4cE0j>@)tY3)1_T)gt7P<8)TQSpRa< oTYHA0mPl>uW$b2bvm4sna@BU-Vc#s~yX*N|7MG7sU+a1+0cqGu{r~^~ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa new file mode 100644 index 0000000000000000000000000000000000000000..19506468005d8f2f7ba438edb64e26138d3934b0 GIT binary patch literal 188 zcmV;t07L%(00001000000RjUA1qKHQ2?`4g4Gs@2UtV7yaeJ$5d2>(jU}^9K`V-olhXfgC*>9C;%`#)xU^oWv|&S6lf`Y?X8U q6=G|0;HgUfVZR9&3(@6qbjpec$uWh!=LslXmZaD0suKs+2U)GxsZqoL literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 new file mode 100644 index 0000000000000000000000000000000000000000..e12eb9dbfd3947be265bd1f8305d1b229d61d40d GIT binary patch literal 188 zcmV;t07L%(00000000000RjUA1qKHQ2?`4g4Gs@2UtVA2WRR)VIJ-ihfT*ecl8nW( zLA!fvAgd6DGC9RBDV}F>d+rgsg%KW$D_wlt<1;+?Dsvn~?0cmKE#|}h$SGIr0l@b zeFH-yV-r&|a|=r=Ya3fTdk04+XBSsDcMnf5Zy#Sj|A4@t;E>R;@QBE$=$P2J_=Loy zYCcR`i91)=9bpB_Kwc3?w;Ph{s|K&O`bA! Q+VmMSXU(27ci#L30G=K)Q2+n{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/d1ef093f11c8e8c42da35501230bb7030067602e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 similarity index 71% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/d1ef093f11c8e8c42da35501230bb7030067602e rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 index 6bdca2df06eeac059300cc2189b724e959d209f9..083b686ecf2936c5adae8b030c8e6475a185c271 100644 GIT binary patch delta 39 xcmV+?0NDS`0n7oAtRQ$zty;qlh$>~x#Pf%c(N9V19=FvM)9C9yrCgN!Ob>!S6e$1z delta 39 xcmV+?0NDS`0n7oAtROWP@hyJh%8!~O1$4erEp(ZcuQYh>DauiBSBEo-`Xpbv5#;~? diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae new file mode 100644 index 0000000000000000000000000000000000000000..94d5aa73cc9877cf254275eb46cbe6aaa92ada0d GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq-`4UM-d@3*3||{55ULUk<+cheWCa*;Axh8b4)3-Eipu E0OJipSO5S3 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b new file mode 100644 index 0000000000000000000000000000000000000000..d2484b28e9d70f34a72737544639de88831bf43d GIT binary patch literal 205 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 zGIiSY88c_io-=pe`~|x4aq;Q-LGLBKU+XIdepuFUTQBZkE>BQ|P|#xW9a(a@9}lH4 F000l1LLvYF literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f new file mode 100644 index 0000000000000000000000000000000000000000..1cb22732517a84dd1ae6256f61cb2b562274e9fb GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq*G@ejB5vd;82O74%$W`*7yjIrS6Lw4&73bYGo%e#+$S E0KF|j@b zeFH-yV-r&|a|=r=Ya3fTdk04+XBSsDcMnf5Zy#Sj|A4@t;E>R;@QBE$=$P2J_=Loy zYCcR`i91)=9bpB_Kwc3?w;Ph{s|K&O`bA! z+VmMSXU(27ci#L3y76)G>G?tLCB0wkD+Yd8)^J-d?q4oXP=rv>V(}eWa=9N5r2qiT Cqe3A7 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b new file mode 100644 index 0000000000000000000000000000000000000000..231f7f817c636932fa2cf740ad5ea2aa13067f10 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq)$%mXq8nH&6Oe-t}ktQGMoZF5dH-v(yTYJl?sgBIlkj E0Pb5vWB>pF literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a94b2e9c5f7896643f5405d040cddacb15f8866a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 similarity index 71% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a94b2e9c5f7896643f5405d040cddacb15f8866a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 index 9775e6c152bbbfd918bb0821b5cb483599e6092a..ee4a672fae0ca5676cc57bb2309c064afc0f2d42 100644 GIT binary patch delta 38 wcmV+>0NMY`0m}i9tRJ{Qqi_US#@fdDeFXr5P~P0pe@h-(#13$a*)wekKwp{>YXATM delta 38 ucmX@jc$#s-8hIT9i*q}4QlF=K7APx;%dWPGagh&=zrXk4ri!H=Cqw`z;Sc8k diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e new file mode 100644 index 0000000000000000000000000000000000000000..a92d163234246450f6e0d490dc7d71f6810e99df GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq+(SLGLBKU+XIdepuFUTQBZkE>BQ|P|#xW9a(a@9}lGf E0Lm*u2mk;8 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 new file mode 100644 index 0000000000000000000000000000000000000000..112ab0f1581880dad36528e3dc3eb464b4f799bf GIT binary patch literal 205 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 zGIiSY88c_io-=pe`~|x4aq&AG78kHY9=mnyXDus3Q^37D7wf&{qK@ztbl)`2<#e!S F001W+LQMbw literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 new file mode 100644 index 0000000000000000000000000000000000000000..4d62d872c9cf19d89b5cbf9606dbcaddfe6fef68 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq*KJ78kHY9=mnyXDus3Q^37D7wf&{qK@ztbl)`2<#ezH E0N?{cCjbBd literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab new file mode 100644 index 0000000000000000000000000000000000000000..131cd7aa3926d0632f9273c4923a4797f2568923 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq%1r{o^9$=rX*FVRt$DmF+;kr;2#w)jbofr!L|DpK^UE E0JMuj5&!@I literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d new file mode 100644 index 0000000000000000000000000000000000000000..2701f83f9cb45dd27148e74682847f718971d757 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq$m#2>rBqW;#9na@beF{oXQDUtV@=3G%&?zDT_Hj*Pzv E0Q&hup8x;= literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd new file mode 100644 index 0000000000000000000000000000000000000000..4ceea01ece0550f3e5722e2a7a9e68fba657b6ee GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq;OZH@!O;A#pYAkc-Jmr;jGeE4yno=E!Wla{5&2{rTM- E0P`M1IRF3v literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 new file mode 100644 index 0000000000000000000000000000000000000000..c3c516abc5362c3280551e8a5b8d629678fb19a8 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq+$G$xD(y?_B=l6rCbu5>*SazNg61n#?nxETPWd(UPxw(? E0O;&P$N&HU literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f new file mode 100644 index 0000000000000000000000000000000000000000..8bda288a23a8c5c9f379a02a1de3765c7073e26c GIT binary patch literal 203 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 zGIiSY88c_io-=pe`~|x4aq;Q-LGLBKU+XIdepuFUTQBZkE>BQ|P|#xW9a(a@9}fWl Di%CJg literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d new file mode 100644 index 0000000000000000000000000000000000000000..fc9409f19d6e82f58b26534a85950f0778f060f6 GIT binary patch literal 204 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 zGIiSY88c_io-=pe`~|x4aq+Kpc=grJPLI&s9HJ|`W$X4PZix?@Ov-M*sx!0QbYjUT E0K*_dApigX literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 new file mode 100644 index 0000000000000000000000000000000000000000..e637ca1b8d84771e60f4069393bd2d702e61bc6a GIT binary patch literal 204 zcmZQzfB;4&W)@a9b`DN1ZXRAfegQ!tVG&U=aS2H&X&G5Lc?Cr!WffI5bq!4|Z5>@b zeFH-yV-r&|a|=r=Ya3fTdk04+XBSsDcMnf5Zy#Sj|A4@t;E>R;@QBE$=$P2J_=Loy zYCcR`i91)=9bpB_Kwc3?w;Ph{s|K&O`bA! z+VmMSXU(27ci#L3y76)GI~*1lutXlab?j#?D??Mjy*n4{z2%~g@D+65G|uI8um%9* C`$9|r literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 new file mode 100644 index 0000000000000000000000000000000000000000..2f4df33cbf5772e10734913f32ed34977d8b2525 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6ZbyUw9Rjw*aqvA>{&YN1U`IAJAQmA|GbOO8s@Y(7XPz-xOmax zZ;wLlms+p9zlE_Z17yj=99k?gO2(^d_4ZzGhj0Rxh>!a39+bi*`T5ZLuzrBxF z^{!*OQgc6&=co3D{D2MLbLFMsOh?RapO&-GC54T<#=tqeVyj+}fd(5!pw`}J~f|HboJijuD^+wH{+wMRET zE*=(!Fta3}0x-S-8b1Jy57UoM!y*S}P6L|08EE_+XnZIagSvpG?gbj30UB8_dlk_5 X7zRQGEYQ>ipz$-%_#J3`T;>7*t!|>3 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c new file mode 100644 index 0000000000000000000000000000000000000000..7d11b56851609e543bff92c02da903d3d31858de GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}d0#Ax!+?8s4{MDpDPpov$nNuX;Q`R=6|z&-!iM z;=5;L{n=H$COPM6EaXB z8UD?a4}PmQ?pm-VP43adwg1v(->24Ld4GPfpf-@qJLmY)1}Lugc8^7F4VB))UWJb1G>Z{`0tt8W|2%2)4EJ|Y&U zDeckL5zY*?M>jq$9u|f$vm~GbFunmAKLCvn(~nMPps8y>u(C1C8H-#>ZtY01U{N0{{R3 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 new file mode 100644 index 0000000000000000000000000000000000000000..af5021de64012ff3781882323548ce4da4bc2746 GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}d0#5lno^=Ba-ioMjXC|B>1C_hUza5-$XgPHZqc#|X8E2@Sx^JB$Wk;>XsP z*G%60to)d-@4X4B#mk!$AKh8*@iitQV?*?oMK@7M?T+lZ2m^VI?1C@8Oi+86 z(E!Z6BWM67KKCYL%Zz{LqLjP#NGRIgHLZAgXlgN!M}x{g2fK%#uKvmmKU;HBV;RGi z#ZfXQDKib3q4wy;$Hl|K5N4JHQ~<^|K;s9X@h@IEmi8jbvo|ZxcimQ=;#pT;XtXmt zZcENUQ`dmTpMl2TfyTdo>HL-z*R2*#xpn^5j9wL%-uFW59XJ2maRE);3p73hG_qjs zS3u*hOX4~rtdqI#-;^?joJ$E@`n=V7675G_EYQ>ipz$-%_#J5cZ|hiuYlO1fR?7ZQ R)R-o{&L*eES!}h~LICOI$b|p^ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d new file mode 100644 index 0000000000000000000000000000000000000000..613b52f6a255027e4bd130c3748e885123c3f757 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6Zb#r!1KHF@|Rn)!`w8&m40Qp>KyFo`M7BAO4pKD1+ELnLh63* zU0};MJ&`SQk6Cdk%ydRH05k6p8i0x0?$K|X$P#>D-}SXE%b(>)tXkT4$6I=>oJ{l5 zn|D64TzX@3uVZzC-T|HjQBL+;>5Ys~i>WO|f@7EYOZ#j7MmBR5y=Tz6FGehmsjgO0m zg(1u=38(;!Z-B-RK;y&oqth8^>Kf4aGtl@u(D+a;26X{V-3v5612nQ=?pHwLV;Be( Tus~B6fX2^2<9DF(ahVGMP2rdR literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 new file mode 100644 index 0000000000000000000000000000000000000000..e80b5766fab03f81d9b5ec0dcaf5967420f949ec GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}d0#5llS2is=FWMlGZ2m>2usvgv3X-sgRC)%BbA z|D3B0u8jy@baj>II{(*~rq9^NxY4V~7mB)OI@U^Dh+_CP7cHz%?sc&Tcz-?c+K334T_4T&r#xU2)!Z zyFBnv#|n=)W~e>7@p196Foc;U0TqDp4bb=jXndG{bUFh~T>~0_1{!|{8XwBVpe~@P idx6GhfJPR~{R(J&3{0=leE^`5#DVocArHiiw%*?4HGRSV=|VoTceoFAE{#g$4b|l; zxWrm&@V2z>>nCXmY0A}7HGyoH4dXiab&NXpDv0o#r;#4i`JDeMio{_)zWo_=K zKrNU3e&Q+5`>cBNPi!f=<*Km8p@|`zl9=uX&e6q^$@b=K?{K^e2FCs^5Mc!f2_Wqd1_W`^3M8y^=B z3qzP$5>Npc-vEstfX0XEN2fE;)HR^-XQ1(Spz)zx4C(@!x)*4C254l#+^>Mf$1o5o TV1cGC0F9r4#_vGm<1!ZjNRF5+ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc new file mode 100644 index 0000000000000000000000000000000000000000..900a20192d10034ee2e0b1c2c753356cfe05d331 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6Mvid_kiBr8QQ`hrXHF8U+PJY=}y+TZ{ksD+cdWe-r?Q%+0?IT zXQ6l8=1%1@Y0rb(V5T#o0hoD*&;U&Qa8XUU!@T0%F=;n8NhkANEj-jNuPgd?b3@_0 zOQ|RN?2ht2n7Bma{^a~j<+HnOV~QD}7BQg#xOs8zw9Ft4vUPn9%^tyd!7;Ca(N@&gCHa zwe1q^aw67=`_JEt<)6%TobkWKf4aGtl@u(D+a;26X{V-3v5612nQ=?pHwLV;Be( Tus~B6fX2^2<9DF(ahVGMZ_Ss? literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a new file mode 100644 index 0000000000000000000000000000000000000000..41affc3841664604495ec1f6444c17de0d69d40e GIT binary patch literal 772 zcmZQzKm`I&?m;vF6Hk!Nnl8Py%q-H||9shzEepQs=@iXg)wO-);hi}(B_Esu@9l}< zea3C)lUu_2Z=%KrnCXmY0A}7HGyoHC@48#{!TZ|j`?EWJHio_rb?WurR;%SgIuq0$W;6gZ?+6-ziMv0&V;oh# z^X%nidc|MZH;G)`BqsZz+NLUN@up5k)z7UrR_!V&zRj;A@L0$&^oY?VW~e>7@p196 zFoc;U0TqDp4bb=jXndG{bUFh~T>~0_1{!|{8XwBVpe~@Pdx6GhfJPR~{R(J&3{0=leE^`6SmzU)L literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 new file mode 100644 index 0000000000000000000000000000000000000000..8ac3bac6821f1bb1a7058c3ee296d3a27ce93296 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6K@ui{qb!1o0|*g|ElxK)V~rZc-LOz&zC^$*X9+vi`AcO$+4ZzGhga%;Z^$O)ok1ia$uz7=n!k3i2MrUgc?=AUmHO0py zY0kd(W%!nE=A=}IJ+KV3(b~%hwTKA~z|1?024Lc`(=C@AC}KOiKtkl=@^*8N zBfiyfnQ!Oc`c?a~Mb>DA%>2i-0k5CE^joJ;pUNb@&X@^m4>KBonRf&Yz{Dp8>%2=p zH%Zv-(wl9b&)$39)wR0Nygv4gxq+sXEbN*6Aipz$-%_#J5ckd!%|Y^P*)o4-t0&Sc%fbi+yC;?CAW832>Z B$VdPH literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe new file mode 100644 index 0000000000000000000000000000000000000000..2864ac963e8a73f9c3f43bef75367a76cadcf43b GIT binary patch literal 772 zcmZQzKm`I&?m;vF6JKQ@JWIqVMeK3Fhuog^p>|AB`<7=-m7evhEpW{`RsMV2GtYppy_ z7_5^zGecrp>N`)_-ARI0O7Hp_gBYO}F`)sNd56&eOg!kVb;J9=CQ90KR(i}@`D&f- zvbcLa-3KJE3X0V3`WyAV;$SwfgUMI!ORbHUbSknKnV|MCqXC$CN6-LF+}Hg|*h@Pj zrM2usvgv3X-sgRC)%BbA z|D3B0u8jy@baj>II{(*~rq9^NxY4V~7mB)OI@U^Dh+_CP7cHz%?sc&Tcz-?c+K334T_4T&r#xU2)!Z zyFBnv#|n=)W~e>7@p196Foc;U0TqDp4bb=jXndG{bUFh~T>~0_1{!|{8XwBVpe~@P idx6GhfJPR~{R(J&3{0=leE^`5yOr2Q( literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a new file mode 100644 index 0000000000000000000000000000000000000000..1c6aea4e2455ddfc8ee293c3280690745ab20fb9 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6R+OGJ2`>#%M793I?D~co2y-QB36CAP(4r2Gbj1;#$_j$KJ(81 z=EmWkSrAvl#eX6SW;!DpfSGp)4Zy?~Rn%n9^zX|1zG`!*!RK9@7BVxwUNhlwaVh7P zh(lj&c3b;RQILNxoOa2F)zI|e#+i&ziKf4aGtl@u(D+a;26X{V-3v5612nQ=?pHwLV;Be( Tus~B6fX2^2<9DF(ahVGMB2Ja9 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 new file mode 100644 index 0000000000000000000000000000000000000000..43950c9e6d843748e383adf96dbe37036790619a GIT binary patch literal 772 zcmZQzKm`I&?m;vF6BoMvX4(_MyOnComup7UG(Ir@- zUw8P9H>;d&Ojx(~_4=tXxtG$emxf7@p196 zFoc;U0TqDp4bb=jXndG{bUFh~T>~0_1{!|{8XwBVpe~@Pdx6GhfJPR~{R(J&3{0=leE^`4jtd`aQ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 new file mode 100644 index 0000000000000000000000000000000000000000..2f0ec24cd8bd234f92cf36f77d07954662df47be GIT binary patch literal 772 zcmZQzKm`I&?m;vF6Sr8ACb@Aqwuk+fS*QG3vpLsp&MfL6l zJoEDp?F)(N=v^#-1!g)U8i1L12o1o*4Oup1M_xFiTyahPsA1C7sUd5(3jBWVCi=eq zPu?XVn|;?WpNf5|IQiYj=L!izi_Qx%LM>uK12FRrqXC$>L*L?ngC-lFcW(OTq9~pJ zscB_`@01mSzgENv>M*HCMtys{>v}_IuIu`VfyXBnG96-q+QW||mIPD)#y3FY2cYp``qAkOG<6MV{26Hc9cX+g7lXQhrtSqAp8*rCpo5;lLt&;fq5+tBhtL2_{6a&cWjCI{jbmQaVVPOa}O9CnY;~Svy1JL*|{pfTCnz{xw{tPt!4m3WLi$PsLQ}+Um g&j5`qnEMsb_!tI41uW3i1)%XW(D)r_d|c)N0DNwcFaQ7m literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf new file mode 100644 index 0000000000000000000000000000000000000000..72c00efa0a45affacc5a2e68216a3dec118c0fca GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}d0#5lozUl5|jL>xX*Znu{6-LnFH`8^u`~*;gi< z6v_8{Aj0;N;eaP+(uTylExvO4%lv9j!%SyH12FRrp#hk9*{VBzo45B*oZ`OxMd}yJ z->FCKzJ-N4-T2oiY1IA3Q^KcDFx}pNg^*H(>g_r&e{V*pMNDV_X5L{m024pwlz)h0 zN>!7i+RXrV%Y>`)UVm)E_wL>%rr9a-^>6q7g&I3*Be-WrE%6W!x}bU3kqK%KGa7)I zcLWW<#BX`|9lgrD*Gl3^pk-%1_wDk4sdtZ87QFuV-C1JiBHO59<+8W@hR;3))|yq` zJ#_UHGt?g4__%mj7{bhwfC|9)259^MH2%cTe{UB%v2s0~c)wQ4A{28b1S#-+{(|9DOqKF#AL)t1GV_`hLgJv zL&)_xqH-cnH}BiB*4(Bm`DvDdRo>iMetv}_?t-7nn-!)k@XV;N*4-A%47Eo$J}w>> zhA^`vpaL+y0UAF5jSth0PG_L0Ye3`AK;!Q~<3qU^)CDwkFVOf5(8z+hUjdDeVIWk% S0!>{28b1S#-+{)*Wi9~lzmos} literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 new file mode 100644 index 0000000000000000000000000000000000000000..b0ee50d333cd657c5bee204676d609a2e33dc936 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6F>g&bNRnQPQQ)14Sp}xB>ZwUybmmm6w8#4dhqnxV>=#T_j+I{8q`J*;>EaEVY9(CB0TO2-UM-f|;>85DhZzmP%sYYxVB!;87j?M5 z=nj)u$$v%cqGytoZ}7GAi^}eG1uJLqGThlGX8Y0SWt+y6jH+##hm#loWro_L8y^=B z3qzP$5>Npc-vEstfX0XEN2fE;)HR^-XQ1(Spz)zx4C(@!x)*4C254l#+^>Mf$1o5o TV1cGC0F9r4#_vGm<1!Zj@}QX2 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 deleted file mode 100644 index baf0a05cde5b5839115e7a5081da7ae855f1d16d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e new file mode 100644 index 0000000000000000000000000000000000000000..ac50b91522dfc917d3c142d55578a1b66a9c6afd GIT binary patch literal 772 zcmd1HkIzo6WPk%UDC-~^5P*u$%sXa!-2LaotuDed-^om56_HuAVluB(;q<*po60`j zHT-et(nG!#k-iHZo}8E|c+L!FFe4g(nRf^cz{CTD(%WiWOnl82C3uD2tkv-RVypL0 zVcuefV`Xn^mA(fmpD8-Bd%{|a$1JaU-{jaPFhVV2LIW`K4x<5>c-g6;@d|zdEQ+~s(tZz{i@3oJeDv+ z?a_^oi-(0FEN&#A0x+`;(D(spe3*W8Is;8z0~&t@8h-~GAIim`E}*GAJu}0nV_ja#``<8nwW%+vRT|zs|bVf7)v*!>RfQj=dZ}UE$@ZZYsM(EYc z|IQs<^}qF>!dvSn|6Cqdzdczt^Tx7&s}7btx_hl&?zwzo`Y%SPMNDV_X5L{m028;( zGj}liz!5JNyy$8Bei8d>qZ~@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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 deleted file mode 100644 index 16a14bc7a02dc9ac8c8949f97ee1cca59b5fab1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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%smQdd>24Lcc9L%qX=-D6G=jkupb$WWn-w#jupZ`6_aN=)KOv2Q(jUmBj*RFZ|PS>&O zTu5bd;d5rFJ-YF6@vtz2nI!=gfW?Ucln;{+K;y&oqth8^>Kf4aGtl@u(D+a;26X{V j-3v5612nQ=?o~kJV;Be(us~B6fX2^2<9DF(ahVGM?kAD% literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 new file mode 100644 index 0000000000000000000000000000000000000000..4b8218a7c74e6606b98c2165e0488e41c60349dd GIT binary patch literal 772 zcmZQzKm`I&?m;vF6F>Vy@%e$%DM~Kl&z<}Zhqc&ydWp;bXH>{{S#VuwZ*9rOXr-wv zo~1`Wsj<{tt-84jW;!DpfSGp)4Zy@VTc}6>e7dvrsi(%~*&7;fewxOs(Vk>^Xl|70 z^!1x6KQB4CxbFBBjg#pgik+Kud6O z!VqSb1XKXVH$dYDpz&e)(di5{bq#3z8EE_+XnZIagSvpG?gbj30UB8__bZ_BF${zX TSfHs3K;vhi@jKA?xXc9rX-<{= literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 new file mode 100644 index 0000000000000000000000000000000000000000..651de5da656a4a4e5e5226fc491f8b9b96e11659 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6W3oY&2-XVL%m1U#yT#gh=;jX$ez9Q*}?;6JWM8b@$J4Ro_zn6 zKK;PLn;#?QC$i0fna+p?VCEe{12A!;2^-c(95`&b;IVn4(TRdwXXi8%_5iWXCp^RW z99Udlnn^e=s+5`f#lSXd;cflRvW!rRn9u;syu)Y!CjRt{YgR${Th<(TxlL6^KRl}T z(8&#ti+R4?s=D%D<52-+-}3DpEiX>(@vBRC8r)#d1ht154ZzGhf(BsXReR1&11wK+_(6U3C6q4wy;$Hl|K z5N4JHQ~<^|K;s9X@nQPW=?pY=4QTusX#5>$d?*)#x`3wc1sb0L8d)&+E1>Z)41@|; Sps5Q$<7c4pJJ9&J%mn~toRdoc literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc new file mode 100644 index 0000000000000000000000000000000000000000..93314a09df993466cbbe89daad452f43ecf0f32b GIT binary patch literal 772 zcmZQzKm`I&?m;vF6F;oiv9hV_%9&@8&$szFscz2iT{~q$gwEfDABL)Y`i_6@Oghu` zJ~VQfzh>-oe*uflFw+^)0L;8YXaFXDL_y`v%B^SXf-B{&9lYLiG%~;9TiNFRZ;T#S zwokP=Gw<KBonRf&Yz{F=o@E_^i zm%q*T!iQA}C2^h><&T%@Uk~&YdvQ_b=9}kjxx)LeF}$!hZVtI1b;;E^mKkb~ZhTxk zEDT|0Nk9c)d;>Io02&{rADzxXQ`dmTpMl2TfyRe&F{le@>RzDn8K98`bH4%_AHzVX TfCZYm05pCE8ovXLkIP&D+^?OH literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 new file mode 100644 index 0000000000000000000000000000000000000000..950e043e4d4f9027b569539f7e9c51ecf29928ab GIT binary patch literal 772 zcmZQzKm`I&?m;vF6aTfsHSUGuDwkDlyi-$OoLW)p=#%xL+I2;L)vNkdY1v2fj?PZC z$*|%&Vftcc+}xv0Fw+^)0L;8YXaFXD-sbRS%_{aI`JXaBGG8_{5wTD3-jH%qZfjr1 z-oANzdm|NlKN>yGSaY*^X6!Au1~W#eMNDV_X5L{m0280cUFjrjdgtcZ+nyr*7kCcV zuWjnBefq;I*!1O+?H_o~zX@AcQlGMKf4aGtl@u(D+a;26X{V-3v5612nQ=?pHwLV;Be( Tus~B6fX2^2<9DF(ahVGM7EGNt literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 new file mode 100644 index 0000000000000000000000000000000000000000..cbaf7cc7d0cab3b391dd7147118c9bdc615c9503 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6SwpK%~M=-WbT8?yxhXO-_A__|Ff3&e-4X^*`9yppU*S!nrtbU zC#iEH?bf5}z&7V{nCXmY0A}7HGyoI7zv+f9=hM~3k@{C+3g^uXoN@f1^^?q1e~Q$$ zJW!qZV4~Rmwar(GoEq$JW=!~!c-f2*Y7r9}fSGp~4Zy_tcKQdONjr2~vR7@2HP?#b z4DJ(6s+DWw%2uAevVcdX)9c>RGcqg!iCp`x_wHA1oy-KahZzmP%sYYxVB)(b)J`&$ zdG%%f$%jt@nRFaK*Bs+A-K3Mj?mv6A_+*1yW_LH@$H@eR=U0cd=fesnqmO4>zd<+Aj T0v2fM0?_ywX#5T|J}z?s6{4DB literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 new file mode 100644 index 0000000000000000000000000000000000000000..a820254e2dae3827bda374d1b0c4909d06353d19 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6aQ8JtK)9Nkt10;O5*44K6$c`wMLd(VB*5{yT!K55AN~O+aI>+ zAROzGp;8nvc=gYFszMWB>wEJbBvv(8I6B#C`J)R5^R z8~M`wti?9Q@YSnBs%swfDH*9<_gCH9c4qMg*Bd5kyk{;+Du2Gh#N)^Gj~Qx@ZhTxk zEDT|0Nk9c)d;>Io02&{rADzxXQ`dmTpMl2TfyRe&F{le@>RzDn8K98`bH4%_AHzVX TfCZYm05pCE8ovXLkIP&Dr#YCw literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 new file mode 100644 index 0000000000000000000000000000000000000000..d99206f0a810a82513369a0c1cc056348cc10377 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6OZekc_{kJ^(*Sz=FIOhvAf4~Y08)Fg}n~WJ-WpjwLYO)#3En-3gF!K(h0hst|#yz**ZF^L{d(Xr2LqF8) zYZ|g*UL^`Yh)7sA}^Vs_AsLXn0ZIg08IS)f)8I> zn+%`qJ-#i<J-YF6 z@vtz2nI!=gfbk8`_yK5qn0|CR15I568h-{Fe+L>L%Eh2Aps9O-#%F*=7R>z$XnYI< Up#m0Y>H^UC8EE_tG(IkK0f|+hL;wH) literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 new file mode 100644 index 0000000000000000000000000000000000000000..55d7039d7f26d9d361eab7bef83b1dc766d187b2 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6YqQK!FN;nNx;FY96SCT{;H&CapejBZJi?SDVq5`mot8{KGZU4 z^uKLdEioxMbnp4|Fw+^)0L;8YXaFYO&y_Zv>HOW4?T=S5O#Se8O>?>F@uw4~rpI&E zSIqnV%BO4E!nL>VoDOy3|7o_zXB!VA)FLJ{05k6}8i0u}Y%vJga#BS6)?A&9T>0v9 zeYu)0W({UC%^rqxZs}Jt*DOqxi>+PjK^S&}c?O{d(F!PR}0hsu!nnTSm zRsg3@0TW@&x$cT7F$1-xiLfS(T$Ib zhlL@`ED5LpjBkL(4?yF?^rO=mXzCi!_%qP>JJ9%0E(Uc0P2CGLJ_9teVD48y<6{^I U6|g{47l6jkK;w6y@o||80OoL-r2qf` literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 new file mode 100644 index 0000000000000000000000000000000000000000..7b17d352ba8e70ace9e75130382e12885ff6d9e5 GIT binary patch literal 772 zcmZQzKm`I&?m;vF6Hhu+aNV}Qn`2FwYewt$c_Ou0d;R1@u3R>&aWR%ydRH05k6p8i0xaw+ykq&zE|o`up8wa^HS4aZJ1A@kN;B(2I+PrpEE7GhvAU-%v81Ap9~qH7BQg#n0bfM08G5uXKL$-`i4(Ol7iJ=e{opH zsl9T-VqwkfE%%}~u8NBM$W=7+uS|91q>Myk^=TKKRTU(rmg{vKLd@w1C0;mVo(>*)V)CCGe9E?=6(e?d@Y8XD7 zub9IWe<8E<)`8qv=e#yVcRn#+6Yb9kwTKA~z|1?024Lb7W=*(zRX6Q|NNbtbpVqcH zD)Sc}6Zzbwp!{w5(wM_G(Lpm#sr;#7Gt&{zU{k0)`JV}D4>KBonRf&Yz{DjD@$H@eR=U0cd=fesnqmO4>zd<+Aj T0v2fM0?_ywX#5T|J}z?sj>DRo literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 new file mode 100644 index 0000000000000000000000000000000000000000..3f785b092661536701b19a4b9344df87f3c9024b GIT binary patch literal 772 zcmZQzKm`I&?m;vF6TfYBVg}b#f$yo0Q{EOU^G=&?`C_d0>%h%WW zy)Wc`*UC-&Dzs)g6U=l*GypU25E_7q3k3i9(2!@h_IW`3T(DM}(XVZcP>Yz*0L;9@XaFX@t<3uSR@-wfk4h@GN=O7f z3O>8l`X+nXPWxM;AJ*UAn$iNtGSnHlOI-T1h8 zSQx_0l7I@p_y%bF05twVje@DA+`pPW4>z{GIikbN5UY^Dnot z-gQWKvA2CzzBwoN1sMx8bpdGn3^aZR8o&GgWZ~-hj8!2rEYPA!c1pG12FRrp#hkt3~H2@UCuiw+BK{%mvO>))cd_%<`Asp5%usuDipz$-%_#J3`T;>7*YR#6c literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 new file mode 100644 index 0000000000000000000000000000000000000000..bf169c2f718ea0ea933391e846590edea412a505 GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}d0#5nMbl(qASh^lj7ri&7gSRC67UeK7gMmH#6A z+AeX~o6+y{Ka|M4D4QNSulI1-`omTmV5T#o0hoD*&;U$)`cs~7XFZy_bmL!Y+C0fV z9&|Z)zS;Jc1q}b2bW=}gxOw%|YRul6?w0=9r6Y;yxH}`%A|^BdGw(1OfQi@F@LiAy z>MC7(>Fe2@DI(2R_!M0{oY=n{scse3NjPSj%Of*q#^dDIZ%k+HZrM724-?cLW;6gZ z?+6-ziGR0zxtXbF)8=|1`C0ihOFEZbKPb(yQZA-`$-h$jshg@_HPlq(ZVWGVeE4JU zm(@IHnW6UR#>d6O!VqSb1XKXVH$dYDpz&e)(di5{bq#3z8EE_+XnZIagSvpG?gbj3 f0UB8__bZ_BF${zXSfHs3K;vhi@jKA?xXc9rBlDFG literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 new file mode 100644 index 0000000000000000000000000000000000000000..a414e8193424bb61a52109fa6304d4125513e8ca GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}hkQgM3hNvn_}BKX0BPbNCA5M020n)!(~6h#$7h z&2{CkzJEW+qS7&H!2+XQYm^L6-~AcT5jYEGIwKl@*>eaDz{KzUaY(sZ6}{M{c_#0# zqKVr(uDiEtzjB&3uUVCE#i&FXqLhdrIk5A%OKbe&P=%mmNy_tVRLnV|MC zqXC$CN6-LFT#7f|dmiKUyY`QtaW8jsvNN2}C!NvoGt>6=`OvrfT@Ls2)Y*A<-#WrJ zXQq47+tvbRs6D#zaq+M)gqbA)6@bNw0hAAu4?yF?^rO=mXzCi!_%qP>JJ9%0E(Uc0 kP2CGLJ_9teVD42w<6{^I6|g{47l6jkK;w6y@o||80EvN=;{X5v literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 new file mode 100644 index 0000000000000000000000000000000000000000..ffe0dc548929372941f90fc5ceb89c8f0c83f099 GIT binary patch literal 772 zcmd1HkIzo6WPk%UDC-~^5P*tb^0GhqIB!35$A-_9hgQhV zXxseraD|r6cd?z?a@lTIqHOoLZG3-<@2QX1rOd=YyOr}Z{T!H?p!P7M0hoD5&;U$4 zfb~_#AuCD07r%DODk;Qit?cfKfyUo~#)on-s0(Q7UZC+AppgZ0 azXBQ`!$7Ej1)915G=2sezXOer%Ul40(VYnZ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 new file mode 100644 index 0000000000000000000000000000000000000000..8766c31dba1fd42a0e61c295e78c555911f8e20d GIT binary patch literal 772 zcmZQzKm`I&ZgPHJNorn6e0FMOd}hkQgM3i&Lo;WpSSxe|cdbofZIo2uRb5*Ci{sJu zd;N8eS(`;;_5X96yFCA!>-q8{1&e(TY1F_>XG8-qdk&!in0TJvaf|grCc>trs*A3c zseW0d;5VarVdIkfouAlOo%rv6dCNM<`5*oldwbQ03Y@mu#|X8E2@Sx^JB$Wk;_uG; z3H=Cp-=FaLWTN7%ud^O!e!8dkyS-7j>bZI1^v^pprtQ67v_Uz`YU(txibDaG zT5VeLr#4?^hT5YW9~Tb`Lzr0-Pytw+7(n?j`2aLNOg}oEfu^njjXwj8zXOdAMC7(>Fe2@DI(2R_!M0{oY=n{scse3NjPSj%Of*q#^dDIZ%k+HZrM724-?cLW;6gZ z?+6-ziGR0zxtXbF)8=|1`C0ihOFEZbKPb(yQZA-`$-h$jshg@_HPlq(ZVWGVeE4JU zm(@IHnW6UR#>d6O!VqSb1XKXVH$dYDpz&e)(di5{bq#3z8EE_+XnZIagSvpG?gbj3 f0UB8__bZ_BF${zXSfHs3K;vhi@jKA?xXc9rAr_Sl literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 deleted file mode 100644 index 08541f451a59718d1d93d66fc4d91dfbf49e11ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6648 zcmWgOV*mpI2*qFkV_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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/06ae1005d93d4a19b67d090a020ae37db54e6e3e similarity index 53% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/06ae1005d93d4a19b67d090a020ae37db54e6e3e index dc58149e75a4f5b54425503583a6528c6d09e194..d2cfb477e6648b9eac4d052714cf8796ddec9b5d 100644 GIT binary patch delta 334 zcmexid_ZwR!Q=ys3Oq~<5U}A@KI241k%JgtzRT)p#qUj}xjyo?*Eu4xlMO9E zN+Xp-qbEP%Qi<>>?leEBt0F#QPyN>mk2rIkuikOroaz#-*(zgs;bfQ`%;3Ein^rWw zSwH>pu_NBA=e==Qap;IddaAsY-dpJQ_%k2w#}Hy;xYUU>KAv{L`2 zE BgD3z1 literal 6648 zcmWgOV*mpI2*qFk={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^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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb deleted file mode 100644 index cab8c50243d8f18c07a90e2ab4c2f07144a0755d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec deleted file mode 100644 index 7aac2f96f5e80b8cb9ddfdefb6aed64c5ab82c0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 deleted file mode 100644 index 57edbd78644324a1c06120bebafd52c513b89e6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 deleted file mode 100644 index 0a09fb4f2db749e74f6dfa473dccc96b3335f4e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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#kRHIA1ioruZX!@yqvL+LEm12k5)0m%cC9qITrJ xgy8j-v<7tZM){Bsfc0w~paBBoOQ7+gTsW10CSQTZ-+{)TfX0V%;nWQ@c>qn9cmMzZ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe new file mode 100644 index 0000000000000000000000000000000000000000..72a258eebebb576343cc4ab0e218a44cef4c30a0 GIT binary patch literal 4288 zcmWgOV*mpI2*qFk4ibd*9D(g zpT1FURlI%34wjoCZO6{PhN-Jhn)k8#fYhSfb9b9X`RH35dsE)uWiKC~uDW~cqu%pg z*~x|$AS<2ra~%Xy98l{S7|{UCy!#Up9vc<-{G2>h-uhYXp`7MeJML3z_oGbHCvCG} zu6+(u_i$I&!@mbJKfd1m`tz@UJ1;*hiEX>Z75AwoA=1N^m-R3%dtvsE(xV|T8Umvs zFd71*Aut*OqaiRF0;3@?8UmvsFw#T7U16{8@5wJkZ(H?EdAMUy5PEnViH}^S7?%I1 zV20qa=uGSFUR-a&r*Z7_``&y^xcv8CM?tRZN9WA@t8z-Jtn~8xwg;bI@pr7gAt5cE yBjvGHBw;POd82$t2*CQa4$uIB@g>msP%fNGK$EXP={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&C)R)a;zho@c^&Hc`8z8y zJK4|zWaawc+!;WM18O}3BN~92C%*XkJ-O!k^?!f$&Aj5wVf>+5BL6ARf@3?c zAAbZ>SDIwZv!`84;_lMcX$>#s95?*EG4tsQzf}U;+LC|R`7`3O7iRw`JsJX|Aut*O zqaiRF0;3@?8UmvsFd71*Aut*OBRvH6U%wtd`OljleXGr_UkP*sp@)af0?|FkXD#AT zlvwuf4bNMSaN{|Q%XwZ*wKe^9X*E*;`>`!f+Ifc_If=d3`1rH!y~lpv3B`wazC07= yU@eh|Z`DONZiB0}r>Lr)Vf~nJsHC4SaUm%`E5`ckRJB z*~x|$AS)+Y=6(fI98l{S7|{UCJjQ@7liN467S|f6?f%}7Q@SR+c&f(2dZx2%CDK)4 z_VO@wHbH-znl+S`B_H0dSUh`)f&W$RC95k=PA<%`w|`KTb{LnvF#AX8(GVC7fzc2c z4S~@R7!85Z5Eu=C(GVC7fzc2c=^;@6FYwY=&ASWv8}Gbu^@}@?9v%WKMfl?kweQT{ zINhWtZ-Uyak9=9Ntl|fMGF&npSD^8Cpz$Z5@u6HebpuTv03On8`~Uy| literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 deleted file mode 100644 index bd4f8760d571328f8ad4c3524cd7c4599e08be98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6648 zcmWgOV*mpI2*qFk={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&jkw5={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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/81d43836885e32dc8c2b187cb9545bd5c01dfef5 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/81d43836885e32dc8c2b187cb9545bd5c01dfef5 index 70ed9c599bbb1493946e95834b6261daecb9429d..9fc97a34e11847fe25f5f9350e5abf8ce6a77d0e 100644 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkHA;HXx#T=^D}|S zt@gK0dcB-}^`k~^WG>IStuS?w8;?k&ruck0T-SfX)X4QR{y{Hifr2?LIDb zFFV=L0%T=Y>zm_1iUVpr10x!Mnb&s1*z1qZ?&XnOM|>XsyCd8rCgCe>@~S}ATO^6o z`0X5+x_MtDYA-G?_j@C}^w^ep(!G;BC$4HXO4FWI9QelIq1aYj_QLERrAI?xGz3ON zU^E0qLtr!nMnhmU1V%$(Gz3ONV5EnD@#G2fOeS7@urs&3{Cvx1HuUgltzzk0Gd1Mx zB6Xo7&L-|Zjjqdy>a9O&@lDf+y*+XJ!3*(B3a%T|XRuwEYxK1s@ljEn#?2doY;Tzv w7CGCgaATN4S~@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% diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 deleted file mode 100644 index 352ae2edaeffd68ef558f7d4ca6237ac87ec8753..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 new file mode 100644 index 0000000000000000000000000000000000000000..24fd910f77f03ec543372d71588555ae6a476977 GIT binary patch literal 4288 zcmWgOV*mpI2*qFk*|tAI)CnOnrW8W5V|4GYF}_tOU`SZHQ|dg3IhDJYxgb4QEJKh wdg|!pHgxkw`H&ER^=loV0RrPopz)zxIF*1VUxCKofySSJ#)op@)D1Lw07*7)9smFU literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 new file mode 100644 index 0000000000000000000000000000000000000000..96f694c031091a683a1544c6d920e7c7e487e6f2 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkVa|~< zYqGu3%Jg#eVZW9jnLuwjn7X$D;re@(?(_S#ESby9q;Y2TX2whJ-#VW5RS;bGD=6z! zcCw)b$V$$+A`gHR2Z#**MuuligM?u{U;Z6$>XgNWPQREN#eBuYB{$_mXHX@7CKZ v0(l*H(9Ij=LqY)7uXTV12#ha*#)op@R05iO1sZ<`8h-*BAIgPOH_+q(M($_R literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 deleted file mode 100644 index 02ccf56269424b74fef7466c30b53a8afac1a8ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 new file mode 100644 index 0000000000000000000000000000000000000000..70c6fdcd104461eeccb5cf2e4c3c60615ddb7ba1 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkqI8F#AX8(GVC7fzc2c z4S~@R7!85Z5Eu=C(GVC7fzc2c=^>!Zt9~neq3pt3<<(C`-esAfhex~bvIRa348NCt ztKasArQN~6{U4K^fk)sKt@Zt;dN!L}`dr#GbklRb|C@PrwO&ZEsdBTX#;3QJrY&=4 wbhz996WzQ~J|qNS{aOcTfWY_?XnZIaP9>npSD^8Cpz$Z5@u6HebpuTv03q&f82|tP literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 new file mode 100644 index 0000000000000000000000000000000000000000..f026287a032da8a67d69f40c5399446888c657fb GIT binary patch literal 4288 zcmWgOV*mpI2*qFk6Ic0HXD zVKv|LhcD+lX){vB+INf$c3LW9NKL-`!!&`|jO)ZPU9a?eT-e z>|{d=kd=>%z4ihr4yg4EjA#I6UO{H9@xJSp8(Ldpr@QvqnCf0S8dGvpy5bb)*QcK~ z(%NC__WzzWeR6SL#96nmNK$d8LgX=+9Bt3+vSx&kMFz-f9CvneunLG`gOw< u0SayQm(h(Ip8~AL!rU3Jpp}>|na+}5n_nq>Av@HT zN&29GmA&@QU!n7)S4~+3Q#VOx<68d|b@7z}mp|0Le6#Vwas89_3mlqQ*bdy>vc*I& zJK4|zWM$UgU~eGB0kxii5e>l1lihmO+C6)n>xCS%(pc%vhiQGAo|S$*e%njdfysUL zz8aXiol_Sq+*B*G>hiS{_KQRO**ctG>vj1=Oq219{<7icMt@xP!t5WVM?+vV1V%$( zGz3ONU^E0qLtr!nMnhmU1V%$(q=$eu2T$~q74lP#JL%oBJwIVKdU&i9`Q8|H?QJx7 z>hpWMXE2}LWMPuGuSU`!Z&g=~=*hj>Z7uw4y2k}N&MnMy>uleruyjVuecOju4L`GY xBuf5O_CYsqln)63SijZ*8Xz#f1R5X8g;NP=@)c1JL*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_ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff new file mode 100644 index 0000000000000000000000000000000000000000..ae1d6cd28632ef997849bfc035e85cf24d8cb2a4 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkXDZORcFnucZrEUdx3WwzRgrci*z(JlB_m z>|{d=kd^;h_MZb%98l{S7|{UCJh|#+yI+<2tPHN7)FLIujBY`8=hp9oiUHCQX(d-l6vIiq1_h3aWo|+P!5;9F#AX8(GVC7fzc2c z4S~@R7!85Z5Eu=C(GVC7fzc2c=^@bcd}YnOV#AbO6TQ`++iliH4-YT)=QhtQ&6|tA zy4J7%ACX>Ibt`M`&+RuWlULmLzOvjQe9jKeSIeSH_PM<~-N0#ksGl>o@PUqUYU)=@ wP7Vd-YIO5P`H&ER^=loV0RrPopz)zxIF*1VUxCKofySSJ#)op@)D1Lw0ArnTFaQ7m literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 deleted file mode 100644 index 8f98344fbcc9ade5a8048127d7760a48599a1042..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d new file mode 100644 index 0000000000000000000000000000000000000000..5f3c553c3fde5d25ec74b354c0b5fb43d415cca5 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkiE>|mj=6YXB-JM{#7N+j;-6t9Q*k*8xZvM+#6Jqd(DPm#g3F{is{okG~G_tl?Tija**x5R_NU>^$Lr!3u%22t zVPer9n7X3FVyBpY9r$MdWJP(x)U-B5%`Rruk2>DlgPQ(M`?^98m%T9iN9oZJ7!85Z z5Eu=C(GVC7fzc2c4S~@R7!85Z5E$tp@IG8Y{rs9!k`^YlO)Dm`B%_DNDd*puLF!V8 zfA}Icm{hpjtOmikll9Ry0=L4cFnr{rnEgb y=1BQYeO88U-Y6du0tw}JZ} z$7hRx<4fK%oluP1c~9i;S(v)-A@yWYO&mGc|-2`kq> z%uY7609jf8T{H?vaX_tSU_=8j^R_)WAMxP9uDzu>{<0NGORU<@-K|PJ!|-;dK9j{i zxBF{h>M}mhJ9J2!fz5>RM0I86U#7r|FMfG&pYOO)cH4yg#QV9p?1kAsN{@!XXb6mk zz-S1JhQMeDjE2By2#kinXb6mkz(@}P^&)P!1>5#Hb1M4fE_^k=4m~{d=jR%)+34eP zHq>P4fyxK`m93|~TsmjT*%nQ7^G5lQ5Pd7yj;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}- diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5 index d8911528a17ea420d0ec1a6c3155484faea6a355..2ed91aa5eae4a60192b2602507d85ff5706d200d 100644 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkF zykB$t-&qbmS@U$ArQO;aVd`RBk9H+_oeSOYPwie;{MsWf4!0JXtokYUY2Pwo+hT{p z>|{d=kd;?6ee;172h@57Ml=93uk7Qz5BuYJ3XJ&G5|{67x)N0ox@zMKxz7>o3G?`T zCe4GX%L{oIa4n$!@GX&meX|*Dwp2@H`hQ&VGrC^9Sfo7gkN_@wVfK&GqaiRF0;3@? z8UmvsFd71*Aut*OqaiRF0;3@?(nBDBchAhuV7fvOh$ycE9ccAenpz)zxICTR}9srQDcL4wZ 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 deleted file mode 100644 index 5442bebbed3e79e4092a3bd863b445894417f5de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 new file mode 100644 index 0000000000000000000000000000000000000000..259383082ece7c038fbcedaf019bc3bd3b6f0623 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkJst<+oZ{`ADo?HBIfwUnP{y=P|D|%8+v$5RW8b{epC0j zw>d4~lvATK!;cbiM@5EX)vhH*Pag;bhkQG6wkMpC>z8QCR({53JI)=iF#B{|>}0)T xniHexn``Lijq)KO0PEK}Km!EEmq6n~xo|20O}+w+zXOdw0gVsk!l@f*@&H@!cDVom literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 new file mode 100644 index 0000000000000000000000000000000000000000..c4692d018e7bb3728aef808ef3421c2daa42946f GIT binary patch literal 4288 zcmWgOV*mpI2*qFkWgbgaE8x>i`W97+(U759PwC1T^^yH2w}W{sc5WlnbYBpveOO2NQYg literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 deleted file mode 100644 index 58dc14ffc1690766e9314712a4d8bfe1c6f2cf17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d0a0d8d0c842875b97e89957095af3c71f7e9744 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d0a0d8d0c842875b97e89957095af3c71f7e9744 index 1a0f23cf40106786464045a4a169cdfadf12c930..2e0d879ef1d9388adadbd3fdf59c77e4c793452b 100644 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkp8~AL!rYml)^+lE!v5!OTf9_)ziVWF zQBFInm-Hd(rO$CCm0u4kVd}1_JDOjy-EAiFbW!h(Zm!@*p=xzuE8FK!i3#;Ew4r6G_40jBjb7aInRI^Xymc|tjBl%?_WRCQ#V_;M;bBhoycxgNbxSzg xcle~Kr=puT%7=sitY7N@4G0B9 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+;} diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 new file mode 100644 index 0000000000000000000000000000000000000000..f6752016b00935b4933dd2fc33da271643f72893 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkjmMPW?N*xV=GC z+}*gSaf{da^TCy~M2=Mo!qm;ujfq*=y{o~t`S`^dCRXd1_wKy7;g{Df(O1(YgZW?l z&rUY909m;~EAtAF;(%Juz=#H5=4q7|ABoKp3)S=UdH3kg* zsnKFsUJ%-IZfQ+c#Sb%~ulIJ(no@Lb*RrNZB3buB4!v(+)@;o>`eE_wSxHNBPGlZ< yaEO(g!L}UTyiqKs8pvhOD@pqu{C!q16TsUc76_Fm+LS|2!x6a)wW4mDqaveq>s-qm|#r*;Cw%I}$$2Ogn!) zJK4|zWaYu|S*L*%2h@57Ml=93&rG~FMXEyKr$EeaWBp5k>D~+FE^J_*QNb;5QNE(6 zdjd?IkEzz&f-8mvQ!h`Fj(C4T@RrrJDn3lVj4+#NSzt#a7ATYiJ8XwAqQweDD6=?h&X#5Fid?*)A-9VEE07DvTk^lez literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 deleted file mode 100644 index b54027c58647dbe9d102ecf7cfa0ec1c503d79bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6648 zcmWgOV*mpI2*qFk~_4RvT>JEw? z|EH33<%F@By2KuyhNE3iORkFQaqeYLb+CCGe2OJI+0YCW7}Z5O;=ra82P|M1(E!Z6 zNjsSrx}J(Z($n)kz(YBrxA(`nM9s@`m@4S}g^oa1V4_IlwojR}(%{7YJ7 zBg&at{i?$t^JUeC!d<$xF1YMvLIW`K{y(04{~~{3!kNcs>xJ$MX)@PZ#;$(vzhJWD z+>NFzfB0eQ%rt(bUOn*P|El|@oNYBfe=9KVi1^%kp+L_hPBJB@!v>eV%xC~+-aj#; z-@oS{Ze;6U$He#L@7#s*0^6QT#hkKId3vcLWr7GyU9IC}_L8KY=hng34XZwvP(wS;%8r%Lo(67GAhHl;-;QsHGlW^o{M)j;k-?RlaHAvKMCmC_NeiqaiRF z0;3@?8UmvsFd71*Aut*OqaiRF0wX;HEPBI(zv^H7w8%)j?YWgbgaE8x>i`W97+(U759PwC1T^^yH2w}W{sc5WlnbYBpveOOKqh+) literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 new file mode 100644 index 0000000000000000000000000000000000000000..fa031685dfb0272d103abbed669e450bb71ae277 GIT binary patch literal 4288 zcmWgOV*mpI2*qFkv0|*o!rZwgWKZy>L-LY0WfoXTwsAaP zeKBP2^~GO=Jzg}tnPjxz52jB2XOz4`!<2JwR$@n;8ofVku3QmyDaQGw+~c|HqmCTC zl$~s70kTrSx=4h| z|5VxnQzx|Y%G#G(xuti$pLyiP?OA)fc3g0GJf@cLS&{L)u}}UwT=qh2A0LqY)7uXTV12#ha*#)op@R05iO1sZ<`8h-*BAIgPOH_+q(bP9XG literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 new file mode 100644 index 0000000000000000000000000000000000000000..afa4721fe18fa1a22de33d8275a1d3f347e28f0a GIT binary patch literal 4288 zcmWgOV*mpI2*qFk}2=eFy_B<=Kw;~SpG1T;?YyMOv6E_-42kJ6(dFd71* zAut*OqaiRF0;3@?8UmvsFd71*Au!TIfbB=yE(N2?*?f2PB4Vf9e2yL-McU8bCzX`h zA3LeJ?}LwA?H0e5ISW1-_OEB$dqu~^xBJekjxaX#5>${0V4$C>KuMK$8am=eBuX literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 new file mode 100644 index 0000000000000000000000000000000000000000..a1bbac3b4132350f4c1fe46cfc32d364fa6c5d5e GIT binary patch literal 4288 zcmWgOV*mpI2*qFkCDBuJ30hU`I%}w?O0;HH0i>kEA#vJhq&b|ohp3V zI6K+U0%T?F0gs(PiUVpr10x!MnYVrNx(7e^JQm}T7Ypq>^C|KZb4UK#wf~+UIUlYX zS@2pErta=G^XuHqkF9Q0rL+GREio_L6}4Gx>b~G2k>!Q~+pey_WiQPBQF=54MnhmU z1V%$(Gz3ONU^E0qLtr!nMnhmU1V(xY=qmYYw`)#`>{j_CKOt?l4|;frOP#&SCjH#u z{yOn8QM1agQ`Snto*!9ao>$$@2Y}#6{_yUv})^nlg7& ybBDUc<*jY#=8f_pApq;wIzR&i#+N|jL%DD&0ZqOFjlTnpKLL#o<-(~OXz~C(4RlQa literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc index b9a1ce8..0c4d76d 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc @@ -7,31 +7,39 @@ #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + return 0; +} 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_DestBufferDesc and a buffer from which data needs to be copied // are expected as inputs to copy buffer API. // Input fuzzed data is interpreted as: // (OEMCrypto_DestBufferDesc | subsample_flags | input_buffer) - OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, - &fuzzed_structure.dest_buffer_desc.type); - fuzzed_structure.dest_buffer_desc.buffer_config %= MAX_FUZZ_OUTPUT_LENGTH + 1; + wvoec::ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, + fuzzed_structure.dest_buffer_desc.type); + fuzzed_structure.dest_buffer_desc.buffer_config %= + wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; const std::vector input_buffer = fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - const uint32_t session_id = license_api_fuzz.session()->session_id(); + const uint32_t session_id = license_api_fuzz.session().session_id(); // Initialize output buffer. OEMCrypto_DestBufferDesc dest_buffer_desc; @@ -79,5 +87,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc index 952946e..07c0bd4 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc @@ -2,33 +2,31 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "FuzzedDataProvider.h" #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(); - if (size < sizeof(ODK_ParsedLicense) + sizeof(MessageData)) { - return 0; + wvoec::RedirectStdoutToFile(); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + uint32_t key_session; + uint32_t* const key_session_ptr = + fuzzed_data.ConsumeBool() ? &key_session : nullptr; + + OEMCrypto_CreateEntitledKeySession(session_fuzz.session().session_id(), + key_session_ptr); + + if (key_session_ptr == nullptr || fuzzed_data.ConsumeBool()) { + key_session = fuzzed_data.ConsumeIntegral(); } - OEMCryptoLicenseAPIFuzz license_api_fuzz; - license_api_fuzz.license_messages().set_license_type( - OEMCrypto_EntitlementLicense); - license_api_fuzz.license_messages().SignAndVerifyRequest(); - // Interpreting input fuzz data as unencrypted (core_response + license - // message data) from license server. - license_api_fuzz.license_messages().InjectFuzzedResponseData(data, size); - license_api_fuzz.license_messages().EncryptAndSignResponse(); - license_api_fuzz.license_messages().LoadResponse(); - uint32_t key_session_id; - OEMCrypto_CreateEntitledKeySession(license_api_fuzz.session_id(), - &key_session_id); - - OEMCrypto_RemoveEntitledKeySession(key_session_id); + OEMCrypto_RemoveEntitledKeySession(key_session); + session_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc index 0c96b6b..9644106 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc @@ -2,29 +2,24 @@ // source code may only be used and distributed under the Widevine Master // 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(); + wvoec::RedirectStdoutToFile(); - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->CreateNewUsageEntry(); - session->GenerateNonce(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // LoadLicense sets the pst for usage entry. entry.LoadLicense(); + OEMCrypto_DeactivateUsageEntry(entry.session().session_id(), data, size); + entry.Terminate(); - OEMCrypto_DeactivateUsageEntry(session->session_id(), data, size); - session->close(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc index 8ddef79..7519959 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc @@ -2,42 +2,55 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { +namespace { // Limit output buffer size to 5 MB as 4 MB is maximum size specified by // resource rating tier documentation. -const size_t MAX_FUZZ_SAMPLE_SIZE = 5 * MB; +constexpr size_t MAX_FUZZ_SAMPLE_SIZE = 5 * wvoec::MB; + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} 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. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 3) { return 0; } // Read cipher mode and pattern from fuzzed data. - OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); // Allocate sample descriptions. std::vector sample_descriptions( - fuzzed_data.remaining_bytes() / sizeof(OEMCrypto_SampleDescription_Fuzz)); + fuzzed_data.remaining_bytes() / + sizeof(wvoec::OEMCrypto_SampleDescription_Fuzz)); // Allocate input buffers for each sample description. std::vector> input_buffers( @@ -50,8 +63,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { std::vector> subsamples( sample_descriptions.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - const uint32_t session_id = license_api_fuzz.session()->session_id(); + const uint32_t session_id = license_api_fuzz.session().session_id(); // Free first given number of output buffers. const auto FreeOutputBuffers = [&sample_descriptions, session_id, @@ -81,14 +93,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { FuzzedDataProvider subsample_data(inputs[2].data, inputs[2].size); for (size_t i = 0; i < sample_descriptions.size(); i++) { // Read and normalize sample description fuzzed properties. - OEMCrypto_SampleDescription_Fuzz fuzzed_sample_description; + wvoec::OEMCrypto_SampleDescription_Fuzz fuzzed_sample_description; sample_description_data.ConsumeData(&fuzzed_sample_description, sizeof(fuzzed_sample_description)); fuzzed_sample_description.buffers.input_data_length %= MAX_FUZZ_SAMPLE_SIZE + 1; - ConvertDataToValidEnum( + wvoec::ConvertDataToValidEnum( OEMCrypto_BufferType_MaxValue, - &fuzzed_sample_description.buffers.output_descriptor.type); + fuzzed_sample_description.buffers.output_descriptor.type); fuzzed_sample_description.buffers.output_descriptor.buffer_config %= MAX_FUZZ_SAMPLE_SIZE + 1; @@ -126,7 +138,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Initialize output buffer. OEMCrypto_DestBufferDesc& output_descriptor = sample_descriptions[i].buffers.output_descriptor; - const OEMCrypto_DestBufferDesc_Fuzz& fuzzed_output_descriptor = + const wvoec::OEMCrypto_DestBufferDesc_Fuzz& fuzzed_output_descriptor = fuzzed_sample_description.buffers.output_descriptor; output_descriptor.type = fuzzed_output_descriptor.type; switch (output_descriptor.type) { @@ -154,11 +166,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { } // Load license and call decrypt_cenc API. - license_api_fuzz.LoadLicense(); - const MessageKeyData& key = license_api_fuzz.session()->license().keys[0]; - vector key_handle; - GetKeyHandleIntoVector(session_id, key.key_id, key.key_id_length, - fuzzed_structure.cipher_mode, key_handle); + const wvoec::MessageKeyData& key = + license_api_fuzz.session().license().keys[0]; + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session_id, key.key_id, key.key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_DecryptCENC(key_handle.data(), key_handle.size(), sample_descriptions.data(), sample_descriptions.size(), &fuzzed_structure.pattern); @@ -168,5 +180,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc new file mode 100644 index 0000000..e894884 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc @@ -0,0 +1,73 @@ +// Copyright 2023 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 "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + if (fuzzed_data.ConsumeBool()) { + license_api_fuzz.license_messages().set_control( + license_api_fuzz.license_messages().control() | + wvoec::kControlAllowHashVerification); + } + + const uint32_t session_id = license_api_fuzz.session().session_id(); + const std::array content_key_id{}; + const uint32_t frame_number = fuzzed_data.ConsumeIntegral(); + std::array sample_buffer{}; + + OEMCrypto_SubSampleDescription subsample; + subsample.num_bytes_clear = 0; + subsample.num_bytes_encrypted = sample_buffer.size(); + subsample.subsample_flags = + OEMCrypto_FirstSubsample | OEMCrypto_LastSubsample; + subsample.block_offset = 0; + + OEMCrypto_SampleDescription sample; + sample.buffers.input_data = sample_buffer.data(); + sample.buffers.input_data_length = sample_buffer.size(); + sample.buffers.output_descriptor.type = OEMCrypto_BufferType_Clear; + sample.buffers.output_descriptor.buffer.clear.clear_buffer = + sample_buffer.data(); + sample.buffers.output_descriptor.buffer.clear.clear_buffer_length = + sample_buffer.size(); + memset(sample.iv, 0, sizeof(sample.iv)); + sample.subsamples = &subsample; + sample.subsamples_length = 1; + + OEMCrypto_CENCEncryptPatternDesc pattern; + pattern.encrypt = 0; + pattern.skip = 0; + + uint32_t failed_frame_number_data; + uint32_t* const failed_frame_number = + fuzzed_data.ConsumeBool() ? &failed_frame_number_data : nullptr; + + const std::vector hash = + fuzzed_data.ConsumeRemainingBytes(); + + license_api_fuzz.LoadLicense(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session_id, content_key_id.data(), + content_key_id.size(), + OEMCrypto_CipherMode_CENC, key_handle); + OEMCrypto_SetDecryptHash(session_id, frame_number, hash.data(), hash.size()); + OEMCrypto_DecryptCENC(key_handle.data(), key_handle.size(), &sample, 1, + &pattern); + OEMCrypto_GetHashErrorCode(session_id, failed_frame_number); + + license_api_fuzz.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc index eb6a351..50929b1 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc @@ -1,9 +1,12 @@ // 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 { + void RedirectStdoutToFile() { freopen("log.txt", "a", stdout); } std::vector SplitFuzzedData(const uint8_t* data, size_t size) { @@ -22,14 +25,58 @@ std::vector SplitFuzzedData(const uint8_t* data, size_t size) { return result; } -void OEMCryptoLicenseAPIFuzz::LoadLicense() { +void InitializeFuzz(SessionUtil& session_util) { + wvoec::global_features.Initialize(); + OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); + OEMCrypto_Initialize(); + OEMCrypto_EnterTestMode(); + session_util.EnsureTestROT(); +} + +void SessionFuzz::Initialize() { + InitializeFuzz(session_util_); + session_.open(); +} + +void SessionFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::Initialize() { + session_fuzz_.Initialize(); + session_fuzz_.InstallTestDrmKey(); + session_fuzz_.session().GenerateNonce(); +} + +void OEMCryptoLicenseAPIFuzz::Terminate() { + session_fuzz_.Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::LoadLicense(bool generic_crypto_keys) { license_messages_.SignAndVerifyRequest(); - license_messages_.CreateDefaultResponse(); + if (generic_crypto_keys) { + license_messages_.CreateResponseWithGenericCryptoKeys(); + } else { + license_messages_.CreateDefaultResponse(); + } license_messages_.EncryptAndSignResponse(); OEMCryptoResult sts = license_messages_.LoadResponse(); CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); } +void OEMCryptoProvisioningAPIFuzz::Initialize() { + InitializeFuzz(session_util_); + + // Opens a session and Generates Nonce. + provisioning_messages_.PrepareSession(session_util_.keybox_); +} + +void OEMCryptoProvisioningAPIFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + void OEMCryptoProvisioningAPIFuzz::LoadProvisioning() { provisioning_messages_.SignAndVerifyRequest(); provisioning_messages_.CreateDefaultResponse(); @@ -62,4 +109,5 @@ void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, abort(); } } + } // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h index 15b7363..a322ebc 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h @@ -1,28 +1,31 @@ // Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. + #ifndef OEMCRYPTO_FUZZ_HELPER_H_ #define OEMCRYPTO_FUZZ_HELPER_H_ +#include +#include #include #include "FuzzedDataProvider.h" -#include "OEMCryptoCENC.h" #include "oec_device_features.h" #include "oemcrypto_corpus_generator_helper.h" #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; +namespace wvoec { + +constexpr size_t KB = 1024; // Default maximum length of fuzzing output parameters. -const size_t MAX_FUZZ_OUTPUT_LENGTH = 5 * KB; +constexpr size_t MAX_FUZZ_OUTPUT_LENGTH = 5 * KB; // Fuzzed data region. struct FuzzedData { @@ -33,106 +36,165 @@ struct FuzzedData { // 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. -class InitializeFuzz : public SessionUtil { +void InitializeFuzz(SessionUtil& session_util); + +class SessionFuzz { public: - InitializeFuzz() { - wvoec::global_features.Initialize(); - OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); - OEMCrypto_Initialize(); - OEMCrypto_EnterTestMode(); - EnsureTestROT(); + void Initialize(); + + void Terminate(); + + void InstallTestDrmKey() { + session_util_.InstallTestDrmKey(&session_); } - ~InitializeFuzz() { OEMCrypto_Terminate(); } + Session& session() { return session_; } + + const Session& session() const { return session_; } + + private: + SessionUtil session_util_; + Session session_; }; -class OEMCryptoLicenseAPIFuzz : public InitializeFuzz { +class OEMCryptoLicenseAPIFuzz { public: - OEMCryptoLicenseAPIFuzz() : license_messages_(&session_) { - session_.open(); - InstallTestDrmKey(&session_); - session_.GenerateNonce(); - } + OEMCryptoLicenseAPIFuzz() : license_messages_(&session_fuzz_.session()) {} - ~OEMCryptoLicenseAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); + + void LoadLicense() { LoadLicense(false); } + + void LoadLicenseWithGenericCryptoKeys() { LoadLicense(true); } LicenseRoundTrip& license_messages() { return license_messages_; } - Session* session() { return &session_; } + const LicenseRoundTrip& license_messages() const { return license_messages_; } - uint32_t session_id() { return session_.session_id(); } + Session& session() { return session_fuzz_.session(); } - void LoadLicense(); + const Session& session() const { return session_fuzz_.session(); } private: - Session session_; + void LoadLicense(bool generic_crypto_keys); + + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; }; -class OEMCryptoProvisioningAPIFuzz : public InitializeFuzz { +class OEMCryptoProvisioningAPIFuzz { public: OEMCryptoProvisioningAPIFuzz() - : provisioning_messages_(&session_, encoded_rsa_key_) { - // Opens a session and Generates Nonce. - provisioning_messages_.PrepareSession(keybox_); - } + : provisioning_messages_(&session_, session_util_.encoded_rsa_key_) {} - ~OEMCryptoProvisioningAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); void LoadProvisioning(); + ProvisioningRoundTrip& provisioning_messages() { return provisioning_messages_; } - Session* session() { return &session_; } + + const ProvisioningRoundTrip& provisioning_messages() const { + return provisioning_messages_; + } + + Session& session() { return session_; } + + const Session& session() const { return session_; } private: + SessionUtil session_util_; Session session_; ProvisioningRoundTrip provisioning_messages_; }; // Initial setup to create a valid state such as creating session, installing // golden key box etc. in order to fuzz Load Renewal API. -class OEMCryptoRenewalAPIFuzz : public OEMCryptoLicenseAPIFuzz { +class OEMCryptoRenewalAPIFuzz { public: - OEMCryptoRenewalAPIFuzz() : renewal_messages_(&license_messages()) {} + OEMCryptoRenewalAPIFuzz() + : renewal_messages_(&license_api_fuzz_.license_messages()) {} + + void Initialize() { license_api_fuzz_.Initialize(); } + + void Terminate() { license_api_fuzz_.Terminate(); } + + LicenseRoundTrip& license_messages() { + return license_api_fuzz_.license_messages(); + } + + const LicenseRoundTrip& license_messages() const { + return license_api_fuzz_.license_messages(); + } RenewalRoundTrip& renewal_messages() { return renewal_messages_; } + const RenewalRoundTrip& renewal_messages() const { return renewal_messages_; } + private: + OEMCryptoLicenseAPIFuzz license_api_fuzz_; RenewalRoundTrip renewal_messages_; }; -class LicenseWithUsageEntryFuzz : public InitializeFuzz { +class LicenseWithUsageEntryFuzz { public: - LicenseWithUsageEntryFuzz() : license_messages_(&session_) { + LicenseWithUsageEntryFuzz() : license_messages_(&session_fuzz_.session()) { license_messages_.set_pst("my_pst"); } + void Initialize() { session_fuzz_.Initialize(); } + + void Terminate() { session_fuzz_.Terminate(); } + void CreateUsageTableHeader(); - LicenseRoundTrip& license_messages() { return license_messages_; } - const vector& encrypted_usage_header() { - return encrypted_usage_header_; - } + + void InstallTestDrmKey() { session_fuzz_.InstallTestDrmKey(); } + void LoadLicense(); + LicenseRoundTrip& license_messages() { return license_messages_; } + + const LicenseRoundTrip& license_messages() const { return license_messages_; } + + const std::vector& encrypted_usage_header() const { + return encrypted_usage_header_; + } + + Session& session() { return session_fuzz_.session(); } + + const Session& session() const { return session_fuzz_.session(); } + private: - vector encrypted_usage_header_; + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; - Session session_; + std::vector encrypted_usage_header_; }; // Convert data from FuzzedDataProvider to valid enum value. template T ConvertDataToValidEnum(FuzzedDataProvider& fuzzed_data, T max_enum_value) { - return static_cast(fuzzed_data.ConsumeIntegralInRange( - 0, static_cast(max_enum_value))); + using UnsignedT = + typename std::make_unsigned::type>::type; + return static_cast(fuzzed_data.ConsumeIntegralInRange( + 0, static_cast(max_enum_value))); } // Convert data to valid enum value in place. template -void ConvertDataToValidEnum(T max_enum_value, T* t) { - FuzzedDataProvider fuzzed_enum_data(reinterpret_cast(t), sizeof(T)); - *t = ConvertDataToValidEnum(fuzzed_enum_data, max_enum_value); +void ConvertDataToValidEnum(T max_enum_value, T& enum_data) { + using UnsignedT = + typename std::make_unsigned::type>::type; + UnsignedT data; + std::memcpy(&data, &enum_data, sizeof(T)); + const auto max_value = static_cast(max_enum_value); + if (data > max_value) { + enum_data = static_cast(data % (max_value + 1)); + } } // Redirect printf and log statements from oemcrypto functions to a file to @@ -146,6 +208,7 @@ std::vector SplitFuzzedData(const uint8_t* data, size_t size); // 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/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi index f8abdec..d4db950 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi @@ -63,7 +63,7 @@ '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', ], 'ldflags': [ '-fPIC', diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc new file mode 100644 index 0000000..f66353a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc @@ -0,0 +1,95 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoProvisioningAPIFuzz& provisioning_api_fuzz = + *new wvoec::OEMCryptoProvisioningAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + provisioning_api_fuzz.Initialize(); + +#ifdef SECOND_STAGE + + const uint32_t session_id = provisioning_api_fuzz.session().session_id(); + + size_t public_key_length = 0; + size_t public_key_signature_length = 0; + size_t wrapped_private_key_length = 0; + OEMCrypto_PrivateKeyType key_type = OEMCrypto_RSA_Private_Key; + OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( + session_id, nullptr, &public_key_length, nullptr, + &public_key_signature_length, nullptr, &wrapped_private_key_length, + &key_type); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, + OEMCrypto_ERROR_SHORT_BUFFER); + + std::vector public_key(public_key_length); + std::vector public_key_signature(public_key_signature_length); + std::vector wrapped_private_key(wrapped_private_key_length); + result = OEMCrypto_GenerateCertificateKeyPair( + session_id, public_key.data(), &public_key_length, + public_key_signature.data(), &public_key_signature_length, + wrapped_private_key.data(), &wrapped_private_key_length, &key_type); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + + result = OEMCrypto_InstallOemPrivateKey(session_id, key_type, + wrapped_private_key.data(), + wrapped_private_key_length); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + +#endif + + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // public_key and public_key_length parameters + size_t public_key_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key(public_key_length_data); + size_t* const public_key_length = + fuzzed_data.ConsumeBool() ? &public_key_length_data : nullptr; + + // public_key_signature and public_key_signature_length parameters + size_t public_key_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key_signature(public_key_signature_length_data); + size_t* const public_key_signature_length = + fuzzed_data.ConsumeBool() ? &public_key_signature_length_data : nullptr; + + // wrapped_private_key and wrapped_private_key_length parameters + size_t wrapped_private_key_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector wrapped_private_key(wrapped_private_key_length_data); + size_t* const wrapped_private_key_length = + fuzzed_data.ConsumeBool() ? &wrapped_private_key_length_data : nullptr; + + // key_type parameter + OEMCrypto_PrivateKeyType key_type_data; + OEMCrypto_PrivateKeyType* const key_type = + fuzzed_data.ConsumeBool() ? &key_type_data : nullptr; + + OEMCrypto_GenerateCertificateKeyPair( + provisioning_api_fuzz.session().session_id(), public_key.data(), + public_key_length, public_key_signature.data(), + public_key_signature_length, wrapped_private_key.data(), + wrapped_private_key_length, key_type); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc index 39aa72c..f30eed8 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc @@ -2,36 +2,35 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" - -namespace wvoec { +#include "oemcrypto_fuzz_structs.h" 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(); + wvoec::RedirectStdoutToFile(); - OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + fuzzed_structure.signature_length %= wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; const std::vector message = fuzzed_data.ConsumeRemainingBytes(); - - // 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. - fuzzed_structure.signature_length %= MAX_FUZZ_OUTPUT_LENGTH + 1; std::vector signature(fuzzed_structure.signature_length); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + session_fuzz.InstallTestDrmKey(); OEMCrypto_GenerateRSASignature( - license_api_fuzz.session()->session_id(), message.data(), message.size(), + session_fuzz.session().session_id(), message.data(), message.size(), signature.data(), &fuzzed_structure.signature_length, fuzzed_structure.padding_scheme); + session_fuzz.Terminate(); + return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc deleted file mode 100644 index 6531457..0000000 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc +++ /dev/null @@ -1,37 +0,0 @@ -#include "properties.h" -#include "oemcrypto_session_tests_helper.h" - -using namespace wvoec; - -static bool is_init = false; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - SessionUtil session_helper; - if (!is_init) { - wvoec::global_features.Initialize(); - wvoec::global_features.RestrictFilter("*"); - wvutil::Properties::Init(); - is_init = true; - } - - OEMCrypto_Initialize(); - OEMCrypto_EnterTestMode(); - session_helper.EnsureTestROT(); - - Session s; - s.open(); - s.GenerateDerivedKeysFromKeybox(session_helper.keybox_); - - static const uint32_t SignatureBufferMaxLength = size; - vector signature(SignatureBufferMaxLength); - size_t signature_length = signature.size(); - - OEMCryptoResult sts; - sts = OEMCrypto_GenerateSignature(s.session_id(), data, size, - &signature[0], &signature_length); - - s.close(); - OEMCrypto_Terminate(); - - return 0; -} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc index 1bf5570..a38cf8b 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc @@ -2,58 +2,67 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + 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. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - const std::vector iv = fuzzed_data.ConsumeRemainingBytes(); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); // Initialize encrypted and clear buffers. const std::vector encrypted_buffer(inputs[1].data, inputs[1].data + inputs[1].size); std::vector clear_buffer(encrypted_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_decrypt API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and decrypt. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[1].key_id, + session.license().keys[1].key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), encrypted_buffer.data(), encrypted_buffer.size(), iv.data(), fuzzed_structure.algorithm, clear_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc index 0c9c8fa..e40c2bb 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc @@ -2,58 +2,67 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + 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. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - const std::vector iv = fuzzed_data.ConsumeRemainingBytes(); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); // Initialize clear and encrypted buffers. const std::vector clear_buffer(inputs[1].data, inputs[1].data + inputs[1].size); std::vector encrypted_buffer(clear_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_encrypt API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and encrypt. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[0].key_id, + session.license().keys[0].key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_Generic_Encrypt(key_handle.data(), key_handle.size(), clear_buffer.data(), clear_buffer.size(), iv.data(), fuzzed_structure.algorithm, encrypted_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc index 103668e..a01b3bb 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc @@ -2,44 +2,51 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + 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; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy clear buffer from input data. const std::vector clear_buffer = fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_sign API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and sign. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[2].key_id, + session.license().keys[2].key_id_length, + fuzzed_structure.cipher_mode, key_handle); size_t signature_length = 0; OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), clear_buffer.data(), clear_buffer.size(), @@ -52,4 +59,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { &signature_length); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc index 23f598d..a7698fc 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc @@ -2,135 +2,62 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { -// Properties deserialized from fuzzed data. -struct FuzzedProperties { - OEMCrypto_Generic_Api_Fuzz structure; - std::vector buffer; - std::vector signature; -}; +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; -// Contains value only if has_value is true. -struct OptionalFuzzedProperties { - FuzzedProperties value; - bool has_value; -}; - -OEMCryptoLicenseAPIFuzz license_api_fuzz; - -OptionalFuzzedProperties DeserializeFuzzedData(const uint8_t* data, - size_t size) { - OptionalFuzzedProperties fuzzed_properties; - const std::vector inputs = SplitFuzzedData(data, size); - if (inputs.size() < 2 || - inputs[0].size < sizeof(fuzzed_properties.value.structure)) { - fuzzed_properties.has_value = false; - return fuzzed_properties; - } - FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); - fuzzed_data.ConsumeData(&fuzzed_properties.value.structure, - sizeof(fuzzed_properties.value.structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_properties.value.structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_properties.value.structure.algorithm); - fuzzed_properties.value.buffer = fuzzed_data.ConsumeRemainingBytes(); - fuzzed_properties.value.signature.assign(inputs[1].data, - inputs[1].data + inputs[1].size); - fuzzed_properties.has_value = true; - return fuzzed_properties; -} +} // namespace extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { - RedirectStdoutToFile(); - license_api_fuzz.LoadLicense(); + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); return 0; } -extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, - size_t max_size, unsigned int seed) { - // Deserialize fuzzed data. - OptionalFuzzedProperties fuzzed_properties = - DeserializeFuzzedData(data, size); - if (!fuzzed_properties.has_value) { - return 0; - } - - // Get key handle for signing and verifying. - Session* const session = license_api_fuzz.session(); - vector key_handle; - OEMCryptoResult result = GetKeyHandleIntoVector( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_properties.value.structure.cipher_mode, key_handle); - if (result == OEMCrypto_SUCCESS) { - // Generate a new signature if verification fails. - result = - OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - fuzzed_properties.value.signature.size()); - if (result != OEMCrypto_SUCCESS) { - size_t signature_length = 0; - OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - nullptr, &signature_length); - fuzzed_properties.value.signature.resize(signature_length); - OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - &signature_length); - const size_t signature_offset = - sizeof(fuzzed_properties.value.structure) + - fuzzed_properties.value.buffer.size() + sizeof(kFuzzDataSeparator); - size = signature_offset + signature_length; - if (size > max_size) { - return 0; - } - memcpy(data + signature_offset, fuzzed_properties.value.signature.data(), - signature_length); - } - } - - return LLVMFuzzerMutate(data, size, max_size); -} - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Deserialize fuzzed data. - const OptionalFuzzedProperties fuzzed_properties = - DeserializeFuzzedData(data, size); - if (!fuzzed_properties.has_value) { + // Split data using separator. + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 2) { return 0; } - // Select key and perform verification. - Session* const session = license_api_fuzz.session(); - vector key_handle; - GetKeyHandleIntoVector( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_properties.value.structure.cipher_mode, key_handle); - OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - fuzzed_properties.value.signature.size()); + // Deserialize fuzzed data. + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); + const std::vector buffer = + fuzzed_data.ConsumeRemainingBytes(); + const std::vector signature(inputs[1].data, + inputs[1].data + inputs[1].size); + + // Select key and verify. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[3].key_id, + session.license().keys[3].key_id_length, + fuzzed_structure.cipher_mode, key_handle); + OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), fuzzed_structure.algorithm, + signature.data(), signature.size()); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc new file mode 100644 index 0000000..ea71f8a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // bcc and bcc_length parameters + size_t bcc_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector bcc(bcc_length_data); + size_t* const bcc_length = + fuzzed_data.ConsumeBool() ? &bcc_length_data : nullptr; + + // additional_signature and additional_signature_length parameters + size_t additional_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector additional_signature(additional_signature_length_data); + size_t* const additional_signature_length = + fuzzed_data.ConsumeBool() ? &additional_signature_length_data : nullptr; + + OEMCrypto_GetBootCertificateChain(bcc.data(), bcc_length, + additional_signature.data(), + additional_signature_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc new file mode 100644 index 0000000..191fe38 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc @@ -0,0 +1,31 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // device_info and device_info_length parameters + size_t device_info_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector device_info(device_info_length_data); + size_t* const device_info_length = + fuzzed_data.ConsumeBool() ? &device_info_length_data : nullptr; + + OEMCrypto_GetDeviceInformation(device_info.data(), device_info_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc new file mode 100644 index 0000000..b30fa60 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Split data using separator. + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 3) { + return 0; + } + + const std::vector challenge(inputs[0].data, + inputs[0].data + inputs[0].size); + + const std::vector encoded_device_info( + inputs[1].data, inputs[1].data + inputs[1].size); + + // signed_csr_payload and signed_csr_payload_length parameters + FuzzedDataProvider signed_csr_payload_fuzzed_data(inputs[2].data, + inputs[2].size); + size_t signed_csr_payload_length_data = + signed_csr_payload_fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector signed_csr_payload(signed_csr_payload_length_data); + size_t* const signed_csr_payload_length = + signed_csr_payload_fuzzed_data.ConsumeBool() + ? &signed_csr_payload_length_data + : nullptr; + + OEMCrypto_GetDeviceSignedCsrPayload( + challenge.data(), challenge.size(), encoded_device_info.data(), + encoded_device_info.size(), signed_csr_payload.data(), + signed_csr_payload_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc new file mode 100644 index 0000000..9d70470 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc @@ -0,0 +1,47 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + const OEMCryptoCipherMode cipher_mode = + wvoec::ConvertDataToValidEnum(fuzzed_data, OEMCrypto_CipherMode_MaxValue); + + // key_handle and key_handle_length parameters + size_t key_handle_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector key_handle(key_handle_length_data); + size_t* const key_handle_length = + fuzzed_data.ConsumeBool() ? &key_handle_length_data : nullptr; + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_GetKeyHandle(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + cipher_mode, key_handle.data(), key_handle_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc new file mode 100644 index 0000000..e81f956 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc @@ -0,0 +1,24 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::vector random_data( + FuzzedDataProvider(data, size) + .ConsumeIntegralInRange(0, wvoec::MAX_FUZZ_OUTPUT_LENGTH)); + OEMCrypto_GetRandom(random_data.data(), random_data.size()); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc index dcd3c05..310999c 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc @@ -6,36 +6,20 @@ #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(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(OEMCrypto_PrivateKeyType)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; - entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->GenerateNonce(); - session->CreateNewUsageEntry(); - std::vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); FuzzedDataProvider fuzzed_data(data, size); - const OEMCrypto_PrivateKeyType key_type = - ConvertDataToValidEnum(fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); + const OEMCrypto_PrivateKeyType key_type = wvoec::ConvertDataToValidEnum( + fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); const std::vector wrapped_private_key = fuzzed_data.ConsumeRemainingBytes(); - OEMCrypto_InstallOemPrivateKey(session->session_id(), key_type, + OEMCrypto_InstallOemPrivateKey(session_fuzz.session().session_id(), key_type, wrapped_private_key.data(), wrapped_private_key.size()); - session->close(); + session_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc index 52d3493..a0e5342 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.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(); + wvoec::RedirectStdoutToFile(); + // Reject the input if it is less than fuzz data structure size. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for license request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - license_api_fuzz.license_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + license_api_fuzz.license_messages().InjectFuzzedRequestData(input.data(), + input.size()); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc index fcc53a0..f0a9b45 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc @@ -2,20 +2,20 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + +#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(); + wvoec::RedirectStdoutToFile(); // Corpus format is as below, let | be separator. // message buffer with key data | entitled content key object array with // offsets and lengths to read key data from message buffer. // Split data using separator. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } @@ -29,19 +29,28 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { sizeof(OEMCrypto_EntitledContentKeyObject)); } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + // Setting up state. Load default entitlement license to load entitlement // keys into sessions key table. license_api_fuzz.license_messages().set_license_type( OEMCrypto_EntitlementLicense); license_api_fuzz.LoadLicense(); + + // Create entitled key session. + OEMCrypto_SESSION key_session; + const OEMCryptoResult result = OEMCrypto_CreateEntitledKeySession( + license_api_fuzz.session().session_id(), &key_session); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + // Call OEMCrypto_LoadEntitledContentKeys with fuzzed buffers. const std::vector message(inputs[0].data, inputs[0].data + inputs[0].size); - OEMCrypto_LoadEntitledContentKeys( - license_api_fuzz.session()->session_id(), message.data(), message.size(), - entitled_content_keys.size(), entitled_content_keys.data()); + OEMCrypto_LoadEntitledContentKeys(key_session, message.data(), message.size(), + entitled_content_keys.size(), + entitled_content_keys.data()); + + license_api_fuzz.Terminate(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc index 64f5f4b..3dc3b07 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc @@ -4,27 +4,26 @@ #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(); - if (size < sizeof(ODK_ParsedLicense) + sizeof(MessageData)) { + wvoec::RedirectStdoutToFile(); + + if (size < sizeof(ODK_Packing_ParsedLicense) + sizeof(wvoec::MessageData)) { return 0; } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); license_api_fuzz.license_messages().SignAndVerifyRequest(); - // Interpreting input fuzz data as unencrypted (core_response + license - // message data) from license server. + // Interpreting input fuzz data as unencrypted core_response + response_data + + // key_array from license server. license_api_fuzz.license_messages().InjectFuzzedResponseData(data, size); // Convert OEMCrypto_LicenseType in core_response to a valid enum value. - ConvertDataToValidEnum( + wvoec::ConvertDataToValidEnum( OEMCrypto_LicenseType_MaxValue, - &license_api_fuzz.license_messages().core_response().license_type); + license_api_fuzz.license_messages().core_response().license_type); license_api_fuzz.license_messages().EncryptAndSignResponse(); license_api_fuzz.license_messages().LoadResponse(); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc index 757ab24..bda7ce3 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc @@ -4,17 +4,16 @@ #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(); - if (size < sizeof(ODK_ParsedProvisioning) + sizeof(RSAPrivateKeyMessage)) { + wvoec::RedirectStdoutToFile(); + + if (size < + sizeof(ODK_ParsedProvisioning) + sizeof(wvoec::RSAPrivateKeyMessage)) { return 0; } - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); provisioning_api_fuzz.provisioning_messages().SignAndVerifyRequest(); // Interpreting input fuzz data as unencrypted(core_response + provisioning // message data) from provisioning server. @@ -22,6 +21,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { size); provisioning_api_fuzz.provisioning_messages().EncryptAndSignResponse(); provisioning_api_fuzz.provisioning_messages().LoadResponse(); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc index 1b6ecfc..8957ee0 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc @@ -2,41 +2,41 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.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(); - if (size < sizeof(OEMCrypto_Renewal_Response_Fuzz)) { - return 0; - } + wvoec::RedirectStdoutToFile(); + // Copy input data to OEMCrypto_Renewal_Response_Fuzz and rest of message // into encrypted license_renewal_response. - OEMCrypto_Renewal_Response_Fuzz fuzzed_data; - memcpy(&fuzzed_data, data, sizeof(fuzzed_data)); - const uint8_t* renewal_response = - data + sizeof(OEMCrypto_Renewal_Response_Fuzz); - const size_t renewal_response_size = - size - sizeof(OEMCrypto_Renewal_Response_Fuzz); + wvoec::OEMCrypto_Renewal_Response_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + const std::vector renewal_response = + fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + wvoec::OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + renewal_response_fuzz.Initialize(); renewal_response_fuzz.license_messages().SignAndVerifyRequest(); renewal_response_fuzz.license_messages().CreateDefaultResponse(); + // Inject timer limits from fuzzed input to timer_limits field from // core license response. - renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits(fuzzed_data); + renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits( + fuzzed_structure); renewal_response_fuzz.license_messages().EncryptAndSignResponse(); renewal_response_fuzz.license_messages().LoadResponse(); // Call renewal response API using fuzzed data. renewal_response_fuzz.renewal_messages().SignAndVerifyRequest(); renewal_response_fuzz.renewal_messages().InjectFuzzedResponseData( - fuzzed_data, renewal_response, renewal_response_size); + fuzzed_structure, renewal_response.data(), renewal_response.size()); renewal_response_fuzz.renewal_messages().LoadResponse(); + renewal_response_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc index 17c5150..d39ef00 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc @@ -2,42 +2,49 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. -#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::LicenseWithUsageEntryFuzz& entry = *new wvoec::LicenseWithUsageEntryFuzz; OEMCryptoResult LoadUsageEntryWithFuzzedData(OEMCrypto_SESSION session, const uint8_t* data, size_t size) { - if (size < sizeof(uint32_t)) { + uint32_t usage_entry_number; + if (size < sizeof(usage_entry_number)) { return OEMCrypto_ERROR_SHORT_BUFFER; } - - FuzzedDataProvider fuzzed_data(data, size); - const uint32_t usage_entry_number = fuzzed_data.ConsumeIntegral(); - const std::vector buffer = - fuzzed_data.ConsumeRemainingBytes(); + memcpy(&usage_entry_number, data, sizeof(usage_entry_number)); + const std::vector buffer(data + sizeof(usage_entry_number), + data + size); return OEMCrypto_LoadUsageEntry(session, usage_entry_number, buffer.data(), buffer.size()); } +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + entry.Initialize(); + return 0; +} + // 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) { - LicenseWithUsageEntryFuzz entry; entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - if (LoadUsageEntryWithFuzzedData(s->session_id(), data, size) != + entry.session().open(); + entry.InstallTestDrmKey(); + if (LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size) != OEMCrypto_SUCCESS) { - s->CreateNewUsageEntry(); + entry.session().CreateNewUsageEntry(); std::vector encrypted_usage_header; - s->UpdateUsageEntry(&encrypted_usage_header); - const uint32_t usage_entry_number = s->usage_entry_number(); + entry.session().UpdateUsageEntry(&encrypted_usage_header); + const uint32_t usage_entry_number = entry.session().usage_entry_number(); const std::vector& encrypted_usage_entry = - s->encrypted_usage_entry(); + entry.session().encrypted_usage_entry(); size = sizeof(usage_entry_number) + encrypted_usage_entry.size(); if (size > max_size) { return 0; @@ -47,20 +54,13 @@ extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, memcpy(data + sizeof(usage_entry_number), encrypted_usage_entry.data(), encrypted_usage_entry.size()); } - s->close(); + entry.session().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(); - - Session s; - s.open(); - LoadUsageEntryWithFuzzedData(s.session_id(), data, size); - s.close(); + entry.session().open(); + LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size); + entry.session().close(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc index 19c699a..ebf92fa 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc @@ -5,12 +5,11 @@ #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; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); if (OEMCrypto_LoadUsageTableHeader(data, size) != OEMCrypto_SUCCESS) { entry.CreateUsageTableHeader(); size = entry.encrypted_usage_header().size(); @@ -21,17 +20,17 @@ extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, memcpy(data, entry.encrypted_usage_header().data(), entry.encrypted_usage_header().size()); } + entry.Terminate(); 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(); + wvoec::RedirectStdoutToFile(); + // Initialize OEMCrypto and call API. - InitializeFuzz initialize_fuzz; + wvoec::SessionUtil session_util; + InitializeFuzz(session_util); OEMCrypto_LoadUsageTableHeader(data, size); + OEMCrypto_Terminate(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc index 10c2d30..0c65ed0 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc @@ -2,32 +2,28 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -LicenseWithUsageEntryFuzz entry; 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; - } + wvoec::RedirectStdoutToFile(); + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - memcpy(&usage_entry_number, data, sizeof(uint32_t)); - s->CreateNewUsageEntry(); - vector encrypted_usage_header; - s->UpdateUsageEntry(&encrypted_usage_header); - OEMCrypto_MoveEntry(s->session_id(), usage_entry_number); - s ->close(); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); + entry.session().close(); + entry.session().open(); + entry.session().ReloadUsageEntry(); + OEMCrypto_MoveEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc index 537e90e..231cf40 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc @@ -3,7 +3,7 @@ #include "opk_dispatcher.h" #include "opk_init.h" -namespace wvoec { +namespace { void OpenOEMCryptoTASession() { uint8_t request_body[] = { @@ -35,6 +35,8 @@ void InitializeOEMCryptoTA() { OPK_DispatchMessage(&request, &response); } +} // namespace + extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { OPK_Initialize(); InitializeOEMCryptoTA(); @@ -51,5 +53,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { OPK_DispatchMessage(&request, &response); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp index b5a73a1..f5ac011 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp @@ -16,114 +16,36 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_opk_load_license_fuzz', - 'sources': [ - 'oemcrypto_load_license_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', - 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_deactivate_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_report_usage_fuzz', - 'sources': [ - 'oemcrypto_report_usage_fuzz.cc', - ], - }, - { 'target_name': 'oemcrypto_opk_copy_buffer_fuzz', 'sources': [ 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_opk_create_and_remove_entitled_key_session_fuzz', + 'sources': [ + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_deactivate_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_opk_dispatcher_fuzz', 'include_dirs': [ '<(oemcrypto_dir)/opk/serialization/common', @@ -144,5 +66,170 @@ '<(oemcrypto_dir)/opk/ports/trusty/serialization_adapter/shared_memory.c', ], }, + { + 'target_name': 'oemcrypto_opk_generate_certificate_key_pair_first_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generate_certificate_key_pair_second_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + 'defines': [ + 'SECOND_STAGE', + ], + }, + { + 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_device_information_fuzz', + 'sources': [ + 'oemcrypto_get_device_information_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_device_signed_csr_payload_fuzz', + 'sources': [ + 'oemcrypto_get_device_signed_csr_payload_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_key_handle_fuzz', + 'sources': [ + 'oemcrypto_get_key_handle_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_report_usage_fuzz', + 'sources': [ + 'oemcrypto_report_usage_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi index 5c99ee4..4e7efc7 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi @@ -27,12 +27,12 @@ '-g3', ], 'cflags_c': [ - '-std=c99', + '-std=c11', '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc' : [ '-frtti', - '-std=c++11', + '-std=c++14', ], 'ldflags': [ '-fPIC', @@ -53,6 +53,7 @@ 'OPK_CONFIG_TEE_OS_VERSION=0.0.0', 'OPK_CONFIG_DEVICE_FORM_FACTOR=oemcrypto_opk_fuzztests', 'OPK_CONFIG_IMPLEMENTER_NAME=Widevine', + 'FACTORY_BUILD_ONLY', ], 'conditions': [ ['generate_code_coverage_report=="true"', { diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc index b66aab6..7e709f6 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.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(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure size, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for provisioning request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; - provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData(input, - size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); + provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData( + input.data(), input.size()); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc new file mode 100644 index 0000000..fb97187 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc @@ -0,0 +1,43 @@ +// Copyright 2023 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 "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // key_control_block and key_control_block_length parameters + size_t key_control_block_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector key_control_block(key_control_block_length_data); + size_t* const key_control_block_length = + fuzzed_data.ConsumeBool() ? &key_control_block_length_data : nullptr; + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_QueryKeyControl(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + key_control_block.data(), key_control_block_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc index 8b7fd79..658bdc1 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc @@ -2,26 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.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(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for renewal request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoRenewalAPIFuzz renewal_api_fuzz; - renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoRenewalAPIFuzz renewal_api_fuzz; + renewal_api_fuzz.Initialize(); + renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input.data(), + input.size()); + renewal_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc index d4df351..8b63654 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc @@ -2,42 +2,46 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -const size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * MB; +namespace { + +constexpr size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * wvoec::MB; + +} // namespace + 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(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(size_t)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->CreateNewUsageEntry(); - session->GenerateNonce(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // Sets pst for usage entry. entry.LoadLicense(); FuzzedDataProvider fuzzed_data(data, size); - size_t pst_report_buffer_length = fuzzed_data.ConsumeIntegralInRange( - 0, MAX_FUZZ_PST_REPORT_BUFFER_LENGTH); + + // pst_report_buffer and pst_report_buffer_length parameters + size_t pst_report_buffer_length_data = + fuzzed_data.ConsumeIntegralInRange( + 0, MAX_FUZZ_PST_REPORT_BUFFER_LENGTH); + std::vector pst_report_buffer(pst_report_buffer_length_data); + size_t* const pst_report_buffer_length = + fuzzed_data.ConsumeBool() ? &pst_report_buffer_length_data : nullptr; + const std::vector pst = fuzzed_data.ConsumeRemainingBytes(); - std::vector pst_report_buffer(pst_report_buffer_length); - // Call API with fuzzed pst_buffer_length, pst. - OEMCrypto_ReportUsage(session->session_id(), pst.data(), pst.size(), - pst_report_buffer.data(), &pst_report_buffer_length); - session->close(); + + OEMCrypto_ReportUsage(entry.session().session_id(), pst.data(), pst.size(), + pst_report_buffer.data(), pst_report_buffer_length); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc index c825498..700e67b 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc @@ -2,32 +2,25 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -LicenseWithUsageEntryFuzz entry; 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; - } + wvoec::RedirectStdoutToFile(); + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - s->CreateNewUsageEntry(); - s->close(); - s->open(); - memcpy(&usage_entry_number, data, sizeof(uint32_t)); - OEMCrypto_ReuseUsageEntry(s->session_id(), usage_entry_number); - s->close(); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().close(); + entry.session().open(); + OEMCrypto_ReuseUsageEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc index 625b0f0..4806ed5 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc @@ -2,30 +2,33 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #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(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(uint32_t) + sizeof(size_t)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - FuzzedDataProvider fuzzed_data(data, size); - const uint32_t new_entry_count = fuzzed_data.ConsumeIntegral(); - size_t header_buffer_length = - fuzzed_data.ConsumeIntegralInRange(0, MAX_FUZZ_OUTPUT_LENGTH); - std::vector header_buffer(header_buffer_length); - OEMCrypto_ShrinkUsageTableHeader(new_entry_count, header_buffer.data(), - &header_buffer_length); + FuzzedDataProvider fuzzed_data(data, size); + + const uint32_t new_entry_count = fuzzed_data.ConsumeIntegral(); + + // header_buffer and header_buffer_length parameters + size_t header_buffer_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector header_buffer(header_buffer_length_data); + size_t* const header_buffer_length = + fuzzed_data.ConsumeBool() ? &header_buffer_length_data : nullptr; + + OEMCrypto_ShrinkUsageTableHeader(new_entry_count, header_buffer.data(), + header_buffer_length); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp index bd72a5c..c970e50 100644 --- a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp @@ -14,106 +14,199 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_load_license_fuzz', + 'target_name': 'oemcrypto_copy_buffer_fuzz', 'sources': [ - 'oemcrypto_load_license_fuzz.cc', + 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_provisioning_fuzz', + }, + { + 'target_name': 'oemcrypto_create_and_remove_entitled_key_session_fuzz', 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { + }, + { 'target_name': 'oemcrypto_deactivate_usage_entry_fuzz', 'sources': [ 'oemcrypto_deactivate_usage_entry_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_certificate_key_pair_first_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_certificate_key_pair_second_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + 'defines': [ + 'SECOND_STAGE', + ], + }, + { + 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_device_information_fuzz', + 'sources': [ + 'oemcrypto_get_device_information_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_device_signed_csr_payload_fuzz', + 'sources': [ + 'oemcrypto_get_device_signed_csr_payload_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_key_handle_fuzz', + 'sources': [ + 'oemcrypto_get_key_handle_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_report_usage_fuzz', 'sources': [ 'oemcrypto_report_usage_fuzz.cc', ], - }, + }, + { + 'target_name': 'oemcrypto_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi index ddf927d..0a9e92f 100644 --- a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi @@ -69,7 +69,7 @@ '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', '-frtti', ], 'ldflags': [ diff --git a/oemcrypto/test/oec_device_features.cpp b/oemcrypto/test/oec_device_features.cpp index 9c91f5a..2264053 100644 --- a/oemcrypto/test/oec_device_features.cpp +++ b/oemcrypto/test/oec_device_features.cpp @@ -60,17 +60,12 @@ void DeviceFeatures::Initialize() { printf("--- ERROR: Could not open session: %d ----\n", result); } // If the device uses a keybox, check to see if loading a certificate is - // installed. - if (provisioning_method == OEMCrypto_Keybox || - provisioning_method == OEMCrypto_OEMCertificate || - provisioning_method == OEMCrypto_BootCertificateChain) { - // Devices with a keybox or OEM Certificate are required to support loading - // a DRM certificate. - loads_certificate = true; - } else { - // Other devices are either broken, or they have a baked in certificate. - loads_certificate = false; - } + // installed. Devices with a keybox or OEM Certificate are required to support + // loading a DRM certificate. Other devices are either broken, or they have a + // baked in certificate. + loads_certificate = provisioning_method == OEMCrypto_Keybox || + provisioning_method == OEMCrypto_OEMCertificate || + provisioning_method == OEMCrypto_BootCertificateChain; printf("loads_certificate = %s.\n", loads_certificate ? "true" : "false"); generic_crypto = (OEMCrypto_ERROR_NOT_IMPLEMENTED != @@ -160,13 +155,7 @@ std::string DeviceFeatures::RestrictFilter(const std::string& initial_filter) { provisioning_method == OEMCrypto_BootCertificateChain) FilterOut(&filter, "OEMCryptoLoadsCert*"); if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*"); - if (!supports_cas) FilterOut(&filter, "*CasOnly*"); if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*"); - if (provisioning_method - != OEMCrypto_OEMCertificate) FilterOut(&filter, "*Prov30*"); - if (provisioning_method != OEMCrypto_BootCertificateChain) - FilterOut(&filter, "*Prov40*"); - if (!supports_rsa_3072) FilterOut(&filter, "*RSAKey3072*"); if (api_version < 17) FilterOut(&filter, "*API17*"); if (api_version < 18) FilterOut(&filter, "*API18*"); // clang-format on diff --git a/oemcrypto/test/oec_session_util.cpp b/oemcrypto/test/oec_session_util.cpp index efed598..9e442fb 100644 --- a/oemcrypto/test/oec_session_util.cpp +++ b/oemcrypto/test/oec_session_util.cpp @@ -603,6 +603,161 @@ OEMCryptoResult Provisioning40RoundTrip::LoadDRMCertResponse() { wrapped_drm_key_.size()); } +void Provisioning40CastRoundTrip::PrepareSession() { + const size_t buffer_size = 5000; // Make sure it is large enough. + std::vector public_key(buffer_size); + size_t public_key_size = buffer_size; + std::vector public_key_signature(buffer_size); + size_t public_key_signature_size = buffer_size; + std::vector wrapped_private_key(buffer_size); + size_t wrapped_private_key_size = buffer_size; + OEMCrypto_PrivateKeyType key_type; + ASSERT_EQ( + OEMCrypto_SUCCESS, + OEMCrypto_GenerateCertificateKeyPair( + session()->session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type)); + wrapped_private_key.resize(wrapped_private_key_size); + public_key.resize(public_key_size); + + wrapped_drm_key_ = wrapped_private_key; + drm_public_key_ = public_key; + drm_key_type_ = key_type; +} + +void Provisioning40CastRoundTrip::LoadDRMPrivateKey() { + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_LoadDRMPrivateKey(session()->session_id(), drm_key_type_, + wrapped_drm_key_.data(), + wrapped_drm_key_.size())); +} + +void Provisioning40CastRoundTrip::FillAndVerifyCoreRequest( + const std::string& core_message_string) { + EXPECT_TRUE( + oemcrypto_core_message::deserialize::CoreProvisioning40RequestFromMessage( + core_message_string, &core_request_)); + EXPECT_EQ(global_features.api_version, core_request_.api_major_version); + EXPECT_EQ(session()->nonce(), core_request_.nonce); + EXPECT_EQ(session()->session_id(), core_request_.session_id); +} + +void Provisioning40CastRoundTrip::VerifyRequestSignature( + const vector& data, const vector& generated_signature, + size_t /* core_message_length */) { + ASSERT_NO_FATAL_FAILURE( + session()->VerifySignature(data, generated_signature.data(), + generated_signature.size(), kSign_RSASSA_PSS)); +} + +// Creates a prov2 response +void Provisioning40CastRoundTrip::CreateDefaultResponse() { + uint32_t algorithm_n = htonl(allowed_schemes_); + memcpy(response_data_.rsa_key, "SIGN", 4); + memcpy(response_data_.rsa_key + 4, &algorithm_n, 4); + memcpy(response_data_.rsa_key + 8, encoded_rsa_key_.data(), + encoded_rsa_key_.size()); + response_data_.rsa_key_length = 8 + encoded_rsa_key_.size(); + response_data_.nonce = session_->nonce(); + response_data_.enc_message_key_length = 0; + core_response_.key_type = OEMCrypto_RSA_Private_Key; + core_response_.enc_private_key = + FindSubstring(response_data_.rsa_key, response_data_.rsa_key_length); + core_response_.enc_private_key_iv = FindSubstring( + response_data_.rsa_key_iv, sizeof(response_data_.rsa_key_iv)); + core_response_.encrypted_message_key = FindSubstring( + response_data_.enc_message_key, response_data_.enc_message_key_length); +} + +void Provisioning40CastRoundTrip::EncryptAndSignResponse() { + session()->key_deriver().PadAndEncryptProvisioningMessage( + &response_data_, &encrypted_response_data_); + core_response_.enc_private_key.length = + encrypted_response_data_.rsa_key_length; + SignResponse(); +} + +void Provisioning40CastRoundTrip::SignResponse() { + CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + + // Create prov 2 request struct from prov 4 request + oemcrypto_core_message::ODK_ProvisioningRequest core_request_prov2; + core_request_prov2.api_minor_version = core_request_.api_minor_version; + core_request_prov2.api_major_version = core_request_.api_major_version; + core_request_prov2.nonce = core_request_.nonce; + core_request_prov2.session_id = core_request_.session_id; + memcpy(&core_request_prov2.counter_info, &core_request_.counter_info, + sizeof(core_request_.counter_info)); + + ASSERT_TRUE(oemcrypto_core_message::serialize::CreateCoreProvisioningResponse( + features, core_response_, core_request_prov2, &serialized_core_message_)); + // Resizing for huge core message length unit tests. + serialized_core_message_.resize( + std::max(required_core_message_size_, serialized_core_message_.size())); + // Make the message buffer a just big enough, or the + // required size, whichever is larger. + const size_t message_size = + std::max(required_message_size_, serialized_core_message_.size() + + sizeof(encrypted_response_data_)); + // Stripe the encrypted message. + encrypted_response_.resize(message_size); + for (size_t i = 0; i < encrypted_response_.size(); i++) { + encrypted_response_[i] = i & 0xFF; + } + ASSERT_GE(encrypted_response_.size(), serialized_core_message_.size()); + memcpy(encrypted_response_.data(), serialized_core_message_.data(), + serialized_core_message_.size()); + ASSERT_GE(encrypted_response_.size(), + serialized_core_message_.size() + sizeof(encrypted_response_data_)); + memcpy(encrypted_response_.data() + serialized_core_message_.size(), + reinterpret_cast(&encrypted_response_data_), + sizeof(encrypted_response_data_)); + session()->key_deriver().ServerSignBuffer(encrypted_response_.data(), + encrypted_response_.size(), + &response_signature_); + SetEncryptAndSignResponseLengths(); +} + +OEMCryptoResult Provisioning40CastRoundTrip::LoadResponse(Session* session) { + EXPECT_NE(session, nullptr); + // Write corpus for oemcrypto_load_provisioning_fuzz. Fuzz script expects + // unencrypted response from provisioning server as input corpus data. + // Data will be encrypted and signed again explicitly by fuzzer script after + // mutations. + if (ShouldGenerateCorpus()) { + const std::string file_name = + GetFileName("oemcrypto_load_provisioning_fuzz_seed_corpus"); + // Corpus for license response fuzzer should be in the format: + // unencrypted (core_response + response_data). + AppendToFile(file_name, reinterpret_cast(&core_response_), + sizeof(ODK_ParsedProvisioning)); + AppendToFile(file_name, reinterpret_cast(&response_data_), + sizeof(response_data_)); + } + size_t wrapped_key_length = 0; + OEMCryptoResult sts = LoadResponseNoRetry(session, &wrapped_key_length); + if (sts != OEMCrypto_ERROR_SHORT_BUFFER) return sts; + wrapped_rsa_key_.assign(wrapped_key_length, 0); + sts = LoadResponseNoRetry(session, &wrapped_key_length); + if (sts == OEMCrypto_SUCCESS) { + wrapped_rsa_key_.resize(wrapped_key_length); + } + return sts; +} + +OEMCryptoResult Provisioning40CastRoundTrip::LoadResponseNoRetry( + Session* session, size_t* wrapped_key_length) { + EXPECT_NE(session, nullptr); + VerifyEncryptAndSignResponseLengths(); + return OEMCrypto_LoadProvisioning( + session->session_id(), encrypted_response_.data(), + encrypted_response_.size(), serialized_core_message_.size(), + response_signature_.data(), response_signature_.size(), + wrapped_rsa_key_.data(), wrapped_key_length); +} + void LicenseRoundTrip::VerifyRequestSignature( const vector& data, const vector& generated_signature, size_t core_message_length) { @@ -685,16 +840,14 @@ void LicenseRoundTrip::CreateDefaultResponse() { // Fill in the default core_response_ fields, except the substrings, which are // filled in the next function. core_response_.nonce_required = - ((wvoec::kControlNonceEnabled | wvoec::kControlNonceOrEntry | - wvoec::kControlNonceRequired) & - control_) - ? 1 - : 0; + (wvoec::kControlNonceEnabled | wvoec::kControlNonceOrEntry | + wvoec::kControlNonceRequired) & + control_; core_response_.license_type = license_type_; FillCoreResponseSubstrings(); } -void LicenseRoundTrip::ConvertDataToValidBools(ODK_ParsedLicense* t) { +void LicenseRoundTrip::ConvertDataToValidBools(ODK_Packing_ParsedLicense* t) { t->nonce_required = ConvertByteToValidBoolean(&t->nonce_required); t->timer_limits.soft_enforce_playback_duration = ConvertByteToValidBoolean( &t->timer_limits.soft_enforce_playback_duration); @@ -713,19 +866,19 @@ void LicenseRoundTrip::InjectFuzzedTimerLimits( void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, size_t size) { - // Interpreting fuzz data as unencrypted core_response + message_data + // Interpreting fuzz data as unencrypted core_response + response_data + + // key_array FuzzedData fuzzed_data(data, size); // Copy core_response from data. fuzzed_data.Fill(&core_response_, sizeof(core_response_)); - // Maximum number of keys could be kMaxNumKeys(30). key_array_length can be - // any random value as it is read from fuzz data. - // Key data array(MessageKeyData keys[kMaxNumKeys]) will be looped over - // key_array_length number of times during LoadLicense. If key_array_length is - // more than kMaxNumKeys, setting it to max value of kMaxNumKeys as we should - // not go out of bounds of this array length. For corpus, this value is - // already hard coded to 4. + // Copy response_data from data. + fuzzed_data.Fill(&response_data_, sizeof(response_data_)); + + // If key_array_length is more than kMaxNumKeys, we set it to kMaxNumKeys to + // prevent it from going out of bounds. For corpus, this value is already hard + // coded to 4. if (core_response_.key_array_length > kMaxNumKeys) { core_response_.key_array_length = kMaxNumKeys; } @@ -733,6 +886,13 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, // For corpus data, this value gets set to 4, but we need to test other // scenarios too, hence reading key_array_length value. set_num_keys(core_response_.key_array_length); + + // Copy key_array from data. + key_array_.resize(num_keys_); + core_response_.key_array = key_array_.data(); + fuzzed_data.Fill(core_response_.key_array, + num_keys_ * sizeof(*core_response_.key_array)); + ConvertDataToValidBools(&core_response_); // TODO(b/157520981): Once assertion bug is fixed, for loop can be removed. @@ -753,11 +913,9 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, } } - // Copy response_data from data and set nonce to match one in request to pass - // nonce validations. - fuzzed_data.Fill(&response_data_, sizeof(response_data_)); + // Set nonce to match one in request to pass nonce validations. for (uint32_t i = 0; i < num_keys_; ++i) { - response_data_.keys[i].control.nonce = session()->nonce(); + response_data_.keys[i].control.nonce = htonl(session()->nonce()); } } @@ -802,27 +960,30 @@ void LicenseRoundTrip::FillCoreResponseSubstrings() { sizeof(response_data_.srm_restriction_data)); } core_response_.key_array_length = num_keys_; + key_array_.clear(); for (unsigned int i = 0; i < num_keys_; i++) { - core_response_.key_array[i].key_id = FindSubstring( - response_data_.keys[i].key_id, response_data_.keys[i].key_id_length); - core_response_.key_array[i].key_data_iv = FindSubstring( - response_data_.keys[i].key_iv, sizeof(response_data_.keys[i].key_iv)); - core_response_.key_array[i].key_data = - FindSubstring(response_data_.keys[i].key_data, - response_data_.keys[i].key_data_length); + OEMCrypto_KeyObject obj; + obj.key_id = FindSubstring(response_data_.keys[i].key_id, + response_data_.keys[i].key_id_length); + obj.key_data_iv = FindSubstring(response_data_.keys[i].key_iv, + sizeof(response_data_.keys[i].key_iv)); + obj.key_data = FindSubstring(response_data_.keys[i].key_data, + response_data_.keys[i].key_data_length); if (core_request().api_major_version < kClearControlBlockAPIMajor || (core_request().api_major_version == kClearControlBlockAPIMajor && core_request().api_minor_version < kClearControlBlockAPIMinor)) { - core_response_.key_array[i].key_control_iv = + obj.key_control_iv = FindSubstring(response_data_.keys[i].control_iv, sizeof(response_data_.keys[i].control_iv)); } else { - core_response_.key_array[i].key_control_iv = FindSubstring(nullptr, 0); + obj.key_control_iv = FindSubstring(nullptr, 0); } - core_response_.key_array[i].key_control = - FindSubstring(&response_data_.keys[i].control, - sizeof(response_data_.keys[i].control)); + obj.key_control = FindSubstring(&response_data_.keys[i].control, + sizeof(response_data_.keys[i].control)); + key_array_.push_back(obj); } + core_response_.key_array = key_array_.data(); + core_response_.key_array_length = static_cast(key_array_.size()); } void LicenseRoundTrip::EncryptResponse(bool force_clear_kcb) { @@ -947,11 +1108,14 @@ OEMCryptoResult LicenseRoundTrip::LoadResponse(Session* session, const std::string file_name = GetFileName("oemcrypto_load_license_fuzz_seed_corpus"); // Corpus for license response fuzzer should be in the format: - // core_response + response_data. + // core_response + response_data + key_array. AppendToFile(file_name, reinterpret_cast(&core_response_), - sizeof(ODK_ParsedLicense)); + sizeof(core_response_)); AppendToFile(file_name, reinterpret_cast(&response_data_), sizeof(response_data_)); + AppendToFile( + file_name, reinterpret_cast(core_response_.key_array), + core_response_.key_array_length * sizeof(*core_response_.key_array)); } // Some tests adjust the offset to be beyond the length of the message. Here, @@ -1855,10 +2019,7 @@ bool Session::GenerateRsaSessionKey(vector* session_key, } *session_key = wvutil::a2b_hex("6fa479c731d2770b6a61a5d1420bb9d1"); *enc_session_key = public_rsa_->EncryptSessionKey(*session_key); - if (enc_session_key->empty()) { - return false; - } - return true; + return !enc_session_key->empty(); } bool Session::GenerateEccSessionKey(vector* session_key, diff --git a/oemcrypto/test/oec_session_util.h b/oemcrypto/test/oec_session_util.h index cdf7642..e13bb51 100644 --- a/oemcrypto/test/oec_session_util.h +++ b/oemcrypto/test/oec_session_util.h @@ -27,8 +27,6 @@ #include "oemcrypto_types.h" #include "pst_report.h" -using namespace std; - // GTest requires PrintTo to be in the same namespace as the thing it prints, // which is std::vector in this case. namespace std { @@ -38,13 +36,15 @@ void PrintTo(const vector& value, ostream* os); } // namespace std namespace wvoec { + +using namespace std; + // OEMCrypto Fuzzing: Set max signture length to 1mb. const size_t MB = 1024 * 1024; // Make sure this is larger than kMaxKeysPerSession. constexpr size_t kMaxNumKeys = 30; -namespace { #if defined(TEST_SPEED_MULTIPLIER) // Can slow test time limits when // debugging is slowing everything. constexpr int kSpeedMultiplier = TEST_SPEED_MULTIPLIER; @@ -57,7 +57,6 @@ constexpr uint32_t kDuration = 2 * kSpeedMultiplier; constexpr uint32_t kLongDuration = 5 * kSpeedMultiplier; constexpr int32_t kTimeTolerance = 3 * kSpeedMultiplier; constexpr int64_t kUsageTableTimeTolerance = 10 * kSpeedMultiplier; -} // namespace // Note: The API does not specify a maximum key id length. We specify a // maximum just for these tests, so that we have a fixed message size. @@ -158,7 +157,7 @@ class RoundTrip { required_request_signature_size_(0), encrypted_response_length_(0), response_signature_length_(0) {} - virtual ~RoundTrip() {} + virtual ~RoundTrip() = default; // Have OEMCrypto sign a request message and then verify the signature and the // core message. @@ -369,18 +368,69 @@ class Provisioning40RoundTrip OEMCrypto_PrivateKeyType drm_key_type_; }; +class Provisioning40CastRoundTrip + : public RoundTrip< + /* CoreRequest */ oemcrypto_core_message::ODK_Provisioning40Request, + OEMCrypto_PrepAndSignProvisioningRequest, + /* CoreResponse */ ODK_ParsedProvisioning, + /* ResponseData */ RSAPrivateKeyMessage> { + public: + Provisioning40CastRoundTrip(Session* session, + const std::vector& encoded_rsa_key) + : RoundTrip(session), encryptor_(), + encoded_rsa_key_(encoded_rsa_key) {} + + void PrepareSession(); + void LoadDRMPrivateKey(); + void CreateDefaultResponse() override; + void SignResponse(); + void EncryptAndSignResponse() override; + OEMCryptoResult LoadResponse() override { return LoadResponse(session_); } + OEMCryptoResult LoadResponse(Session* session) override; + OEMCryptoResult LoadResponseNoRetry(Session* session, size_t* wrapped_key_length) ; + + // Returned + const std::vector& wrapped_drm_key() { return wrapped_drm_key_; } + const std::vector& wrapped_rsa_key() { return wrapped_rsa_key_; } + const std::vector& drm_public_key() { return drm_public_key_; } + OEMCrypto_PrivateKeyType drm_key_type() { return drm_key_type_; } + void set_allowed_schemes(uint32_t allowed_schemes) { + allowed_schemes_ = allowed_schemes; + } + + protected: + bool RequestHasNonce() override { return true; } + void VerifyRequestSignature(const vector& data, + const vector& generated_signature, + size_t core_message_length) override; + // Verify the values of the core response. + virtual void FillAndVerifyCoreRequest( + const std::string& core_message_string) override; + + uint32_t allowed_schemes_; + Encryptor encryptor_; + std::vector wrapped_oem_key_; + std::vector oem_public_key_; + OEMCrypto_PrivateKeyType oem_key_type_; + std::vector wrapped_drm_key_; + std::vector drm_public_key_; + OEMCrypto_PrivateKeyType drm_key_type_; + std::vector encoded_rsa_key_; + std::vector wrapped_rsa_key_; +}; + class LicenseRoundTrip : public RoundTrip< /* CoreRequest */ oemcrypto_core_message::ODK_LicenseRequest, OEMCrypto_PrepAndSignLicenseRequest, - /* CoreResponse */ ODK_ParsedLicense, + /* CoreResponse */ ODK_Packing_ParsedLicense, /* ResponseData */ MessageData> { public: LicenseRoundTrip(Session* session) : RoundTrip(session), control_(wvoec::kControlNonceEnabled), num_keys_(4), - pst_(""), + pst_(), minimum_srm_version_(0), update_mac_keys_(true), api_version_(kCurrentAPI), @@ -399,7 +449,7 @@ class LicenseRoundTrip void InjectFuzzedResponseData(const uint8_t* data, size_t size); // Used for OEMCrypto Fuzzing: Convert boolean flags in parsed_license to // valid bytes to avoid errors from msan. - void ConvertDataToValidBools(ODK_ParsedLicense* t); + void ConvertDataToValidBools(ODK_Packing_ParsedLicense* t); // Create a license with four keys. Each key is responsible for one of generic // encrypt (key 0), decrypt (key 1), sign (key 2) and verify (key 3). Each key // is allowed only one type of operation. @@ -494,6 +544,9 @@ class LicenseRoundTrip // CreateDefaultResponse. OEMCrypto_LicenseType license_type_; uint8_t request_hash_[ODK_SHA256_HASH_SIZE]; + // Used to hold and add/update key information to be transferred into the core + // response later on. + std::vector key_array_; }; class RenewalRoundTrip @@ -516,7 +569,7 @@ class RenewalRoundTrip void EncryptAndSignResponse() override; void InjectFuzzedResponseData(OEMCrypto_Renewal_Response_Fuzz& fuzzed_data, const uint8_t* renewal_response, - const size_t renewal_response_size); + size_t renewal_response_size); OEMCryptoResult LoadResponse() override { return LoadResponse(session_); } OEMCryptoResult LoadResponse(Session* session) override; uint64_t renewal_duration_seconds() const { @@ -849,6 +902,7 @@ OEMCryptoResult GetKeyHandleIntoVector(OEMCrypto_SESSION session, size_t key_id_length, OEMCryptoCipherMode cipher_mode, vector& key_handle); + } // namespace wvoec #endif // CDM_OEC_SESSION_UTIL_H_ diff --git a/oemcrypto/test/oemcrypto_basic_test.cpp b/oemcrypto/test/oemcrypto_basic_test.cpp index 719af19..7b07053 100644 --- a/oemcrypto/test/oemcrypto_basic_test.cpp +++ b/oemcrypto/test/oemcrypto_basic_test.cpp @@ -156,7 +156,7 @@ TEST_F(OEMCryptoClientTest, FreeUnallocatedSecureBufferNoFailure) { */ TEST_F(OEMCryptoClientTest, VersionNumber) { const std::string log_message = - "OEMCrypto unit tests for API 18.1. Tests last updated 2023-03-08"; + "OEMCrypto unit tests for API 18.3. Tests last updated 2023-07-07"; cout << " " << log_message << "\n"; cout << " " << "These tests are part of Android U." @@ -165,7 +165,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { // If any of the following fail, then it is time to update the log message // above. EXPECT_EQ(ODK_MAJOR_VERSION, 18); - EXPECT_EQ(ODK_MINOR_VERSION, 1); + EXPECT_EQ(ODK_MINOR_VERSION, 3); EXPECT_EQ(kCurrentAPI, static_cast(ODK_MAJOR_VERSION)); OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); EXPECT_GT(level, OEMCrypto_Level_Unknown); @@ -189,7 +189,6 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { if (sts != OEMCrypto_SUCCESS) { LOGW("Device is not production ready, returns %d", sts); } - sts = OEMCrypto_SUCCESS; std::string build_info; size_t buf_length = 0; sts = OEMCrypto_BuildInformation(&build_info[0], &buf_length); diff --git a/oemcrypto/test/oemcrypto_cast_test.cpp b/oemcrypto/test/oemcrypto_cast_test.cpp new file mode 100644 index 0000000..6dc2552 --- /dev/null +++ b/oemcrypto/test/oemcrypto_cast_test.cpp @@ -0,0 +1,977 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +#include "oemcrypto_cast_test.h" + +#include "oemcrypto_usage_table_test.h" + +using ::testing::Range; + +namespace wvoec { + +// The alternate padding is only required for cast receivers, but all devices +// should forbid the alternate padding for regular certificates. +TEST_F(OEMCryptoLoadsCertificateAlternates, DisallowForbiddenPaddingAPI09) { + LoadWithAllowedSchemes(kSign_RSASSA_PSS, + true); // Use default padding scheme + DisallowForbiddenPadding(kSign_PKCS1_Block1, 50); +} + +// The alternate padding is only required for cast receivers, but if a device +// does load an alternate certificate, it should NOT use it for generating +// a license request signature. +TEST_F(OEMCryptoLoadsCertificateAlternates, TestSignaturePKCS1) { + // Try to load an RSA key with alternative padding schemes. This signing + // scheme is used by cast receivers. + LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); + // If the device is a cast receiver, then this scheme is required. + if (global_features.cast_receiver) { + ASSERT_TRUE(key_loaded_); + } + // If the key loaded with no error, then we will verify that it is not used + // for forbidden padding schemes. + if (key_loaded_) { + // The other padding scheme should fail. + DisallowForbiddenPadding(kSign_RSASSA_PSS, 83); + DisallowDeriveKeys(); + if (global_features.cast_receiver) { + // A signature with a valid size should succeed. + TestSignature(kSign_PKCS1_Block1, 83); + TestSignature(kSign_PKCS1_Block1, 50); + } + // A signature with padding that is too big should fail. + DisallowForbiddenPadding(kSign_PKCS1_Block1, 84); // too big. + } +} + +// This test verifies RSA signing with the alternate padding scheme used by +// Android cast receivers, PKCS1 Block 1. These tests are not required for +// other devices, and should be filtered out by DeviceFeatures::Initialize for +// those devices. +class OEMCryptoCastReceiverTest : public OEMCryptoLoadsCertificateAlternates { + protected: + void SetUp() override { + OEMCryptoLoadsCertificateAlternates::SetUp(); + if (!global_features.cast_receiver) { + GTEST_SKIP() << "OEMCrypto does not support CAST Receiver functionality"; + } + } + + vector encode(uint8_t type, const vector& substring) { + vector result; + result.push_back(type); + if (substring.size() < 0x80) { + uint8_t length = substring.size(); + result.push_back(length); + } else if (substring.size() < 0x100) { + result.push_back(0x81); + uint8_t length = substring.size(); + result.push_back(length); + } else { + result.push_back(0x82); + uint16_t length = substring.size(); + result.push_back(length >> 8); + result.push_back(length & 0xFF); + } + result.insert(result.end(), substring.begin(), substring.end()); + return result; + } + vector concat(const vector& a, const vector& b) { + vector result = a; + result.insert(result.end(), b.begin(), b.end()); + return result; + } + + // This encodes the RSA key used in the PKCS#1 signing tests below. + void BuildRSAKey() { + vector field_n = + encode(0x02, wvutil::a2b_hex("00" + "df271fd25f8644496b0c81be4bd50297" + "ef099b002a6fd67727eb449cea566ed6" + "a3981a71312a141cabc9815c1209e320" + "a25b32464e9999f18ca13a9fd3892558" + "f9e0adefdd3650dd23a3f036d60fe398" + "843706a40b0b8462c8bee3bce12f1f28" + "60c2444cdc6a44476a75ff4aa24273cc" + "be3bf80248465f8ff8c3a7f3367dfc0d" + "f5b6509a4f82811cedd81cdaaa73c491" + "da412170d544d4ba96b97f0afc806549" + "8d3a49fd910992a1f0725be24f465cfe" + "7e0eabf678996c50bc5e7524abf73f15" + "e5bef7d518394e3138ce4944506aaaaf" + "3f9b236dcab8fc00f87af596fdc3d9d6" + "c75cd508362fae2cbeddcc4c7450b17b" + "776c079ecca1f256351a43b97dbe2153")); + vector field_e = encode(0x02, wvutil::a2b_hex("010001")); + vector field_d = + encode(0x02, wvutil::a2b_hex("5bd910257830dce17520b03441a51a8c" + "ab94020ac6ecc252c808f3743c95b7c8" + "3b8c8af1a5014346ebc4242cdfb5d718" + "e30a733e71f291e4d473b61bfba6daca" + "ed0a77bd1f0950ae3c91a8f901118825" + "89e1d62765ee671e7baeea309f64d447" + "bbcfa9ea12dce05e9ea8939bc5fe6108" + "581279c982b308794b3448e7f7b95229" + "2df88c80cb40142c4b5cf5f8ddaa0891" + "678d610e582fcb880f0d707caf47d09a" + "84e14ca65841e5a3abc5e9dba94075a9" + "084341f0edad9b68e3b8e082b80b6e6e" + "8a0547b44fb5061b6a9131603a5537dd" + "abd01d8e863d8922e9aa3e4bfaea0b39" + "d79283ad2cbc8a59cce7a6ecf4e4c81e" + "d4c6591c807defd71ab06866bb5e7745")); + vector field_p = + encode(0x02, wvutil::a2b_hex("00" + "f44f5e4246391f482b2f5296e3602eb3" + "4aa136427710f7c0416d403fd69d4b29" + "130cfebef34e885abdb1a8a0a5f0e9b5" + "c33e1fc3bfc285b1ae17e40cc67a1913" + "dd563719815ebaf8514c2a7aa0018e63" + "b6c631dc315a46235716423d11ff5803" + "4e610645703606919f5c7ce2660cd148" + "bd9efc123d9c54b6705590d006cfcf3f")); + vector field_q = + encode(0x02, wvutil::a2b_hex("00" + "e9d49841e0e0a6ad0d517857133e36dc" + "72c1bdd90f9174b52e26570f373640f1" + "c185e7ea8e2ed7f1e4ebb951f70a5802" + "3633b0097aec67c6dcb800fc1a67f9bb" + "0563610f08ebc8746ad129772136eb1d" + "daf46436450d318332a84982fe5d28db" + "e5b3e912407c3e0e03100d87d436ee40" + "9eec1cf85e80aba079b2e6106b97bced")); + vector field_exp1 = + encode(0x02, wvutil::a2b_hex("00" + "ed102acdb26871534d1c414ecad9a4d7" + "32fe95b10eea370da62f05de2c393b1a" + "633303ea741b6b3269c97f704b352702" + "c9ae79922f7be8d10db67f026a8145de" + "41b30c0a42bf923bac5f7504c248604b" + "9faa57ed6b3246c6ba158e36c644f8b9" + "548fcf4f07e054a56f768674054440bc" + "0dcbbc9b528f64a01706e05b0b91106f")); + vector field_exp2 = + encode(0x02, wvutil::a2b_hex("6827924a85e88b55ba00f8219128bd37" + "24c6b7d1dfe5629ef197925fecaff5ed" + "b9cdf3a7befd8ea2e8dd3707138b3ff8" + "7c3c39c57f439e562e2aa805a39d7cd7" + "9966d2ece7845f1dbc16bee99999e4d0" + "bf9eeca45fcda8a8500035fe6b5f03bc" + "2f6d1bfc4d4d0a3723961af0cdce4a01" + "eec82d7f5458ec19e71b90eeef7dff61")); + vector field_invq = + encode(0x02, wvutil::a2b_hex("57b73888d183a99a6307422277551a3d" + "9e18adf06a91e8b55ceffef9077c8496" + "948ecb3b16b78155cb2a3a57c119d379" + "951c010aa635edcf62d84c5a122a8d67" + "ab5fa9e5a4a8772a1e943bafc70ae3a4" + "c1f0f3a4ddffaefd1892c8cb33bb0d0b" + "9590e963a69110fb34db7b906fc4ba28" + "36995aac7e527490ac952a02268a4f18")); + + // Header of rsa key is constant. + encoded_rsa_key_ = wvutil::a2b_hex( + // 0x02 0x01 0x00 == integer, size 1 byte, value = 0 + // (field=version) + "020100" + // 0x30, sequence, size = d = 13 (field=pkeyalg) + // AlgorithmIdentifier + "300d" + // 0x06 = object identifier. length = 9 + // (this should be 1.2.840.113549.1.1.1) (field=algorithm) + "0609" + "2a" // 1*0x40 + 2 = 42 = 0x2a. + "8648" // 840 = 0x348, 0x03 *2 + 0x80 + (0x48>>15) = 0x86. + // 0x48 -> 0x48 + "86f70d" // 113549 = 0x1668d -> (110 , 1110111, 0001101) + // -> (0x80+0x06, 0x80+0x77, 0x0d) + "01" // 1 + "01" // 1 + "01" // 1 + "05" // null object. (field=parameter?) + "00" // size of null object + ); + + vector pkey = wvutil::a2b_hex("020100"); // integer, version = 0. + pkey = concat(pkey, field_n); + pkey = concat(pkey, field_e); + pkey = concat(pkey, field_d); + pkey = concat(pkey, field_p); + pkey = concat(pkey, field_q); + pkey = concat(pkey, field_exp1); + pkey = concat(pkey, field_exp2); + pkey = concat(pkey, field_invq); + pkey = encode(0x30, pkey); + pkey = encode(0x04, pkey); + + encoded_rsa_key_ = concat(encoded_rsa_key_, pkey); + encoded_rsa_key_ = encode(0x30, encoded_rsa_key_); // 0x30=sequence + } + + // This is used to test a signature from the file pkcs1v15sign-vectors.txt. + void TestSignature(RSA_Padding_Scheme scheme, const vector& message, + const vector& correct_signature) { + OEMCryptoResult sts; + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + // The application will compute the SHA-1 Hash of the message, so this + // test must do that also. + uint8_t hash[SHA_DIGEST_LENGTH]; + if (!SHA1(message.data(), message.size(), hash)) { + dump_boringssl_error(); + FAIL() << "boringssl error creating SHA1 hash."; + } + + // The application will prepend the digest info to the hash. + // SHA-1 digest info prefix = 0x30 0x21 0x30 ... + vector digest = wvutil::a2b_hex("3021300906052b0e03021a05000414"); + digest.insert(digest.end(), hash, hash + SHA_DIGEST_LENGTH); + + // OEMCrypto will apply the padding, and encrypt to generate the + // signature. + size_t signature_length = 0; + sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), + digest.size(), nullptr, + &signature_length, scheme); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + vector signature(signature_length); + sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), + digest.size(), signature.data(), + &signature_length, scheme); + + ASSERT_EQ(OEMCrypto_SUCCESS, sts) + << "Failed to sign with padding scheme=" << (int)scheme + << ", size=" << message.size(); + signature.resize(signature_length); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + + // Verify that the signature matches the official test vector. + ASSERT_EQ(correct_signature.size(), signature_length); + signature.resize(signature_length); + ASSERT_EQ(correct_signature, signature); + + // Also verify that our verification algorithm agrees. This is not + // needed to test OEMCrypto, but it does verify that this test is valid. + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature(digest, signature.data(), + signature_length, scheme)); + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( + digest, correct_signature.data(), correct_signature.size(), scheme)); + } +}; + +// CAST Receivers should report that they support cast certificates. +TEST_F(OEMCryptoCastReceiverTest, SupportsCertificatesAPI13) { + ASSERT_NE(0u, + OEMCrypto_Supports_RSA_CAST & OEMCrypto_SupportedCertificates()); +} + +// # PKCS#1 v1.5 Signature Example 15.1 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_1) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "f45d55f35551e975d6a8dc7ea9f48859" + "3940cc75694a278f27e578a163d839b3" + "4040841808cf9c58c9b8728bf5f9ce8e" + "e811ea91714f47bab92d0f6d5a26fcfe" + "ea6cd93b910c0a2c963e64eb1823f102" + "753d41f0335910ad3a977104f1aaf6c3" + "742716a9755d11b8eed690477f445c5d" + "27208b2e284330fa3d301423fa7f2d08" + "6e0ad0b892b9db544e456d3f0dab85d9" + "53c12d340aa873eda727c8a649db7fa6" + "3740e25e9af1533b307e61329993110e" + "95194e039399c3824d24c51f22b26bde" + "1024cd395958a2dfeb4816a6e8adedb5" + "0b1f6b56d0b3060ff0f1c4cb0d0e001d" + "d59d73be12"); + vector signature = wvutil::a2b_hex( + "b75a5466b65d0f300ef53833f2175c8a" + "347a3804fc63451dc902f0b71f908345" + "9ed37a5179a3b723a53f1051642d7737" + "4c4c6c8dbb1ca20525f5c9f32db77695" + "3556da31290e22197482ceb69906c46a" + "758fb0e7409ba801077d2a0a20eae7d1" + "d6d392ab4957e86b76f0652d68b83988" + "a78f26e11172ea609bf849fbbd78ad7e" + "dce21de662a081368c040607cee29db0" + "627227f44963ad171d2293b633a392e3" + "31dca54fe3082752f43f63c161b447a4" + "c65a6875670d5f6600fcc860a1caeb0a" + "88f8fdec4e564398a5c46c87f68ce070" + "01f6213abe0ab5625f87d19025f08d81" + "dac7bd4586bc9382191f6d2880f6227e" + "5df3eed21e7792d249480487f3655261"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} +// # PKCS#1 v1.5 Signature Example 15.2 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_2) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c14b4c6075b2f9aad661def4ecfd3cb9" + "33c623f4e63bf53410d2f016d1ab98e2" + "729eccf8006cd8e08050737d95fdbf29" + "6b66f5b9792a902936c4f7ac69f51453" + "ce4369452dc22d96f037748114662000" + "dd9cd3a5e179f4e0f81fa6a0311ca1ae" + "e6519a0f63cec78d27bb726393fb7f1f" + "88cde7c97f8a66cd66301281dac3f3a4" + "33248c75d6c2dcd708b6a97b0a3f325e" + "0b2964f8a5819e479b"); + vector signature = wvutil::a2b_hex( + "afa7343462bea122cc149fca70abdae7" + "9446677db5373666af7dc313015f4de7" + "86e6e394946fad3cc0e2b02bedba5047" + "fe9e2d7d099705e4a39f28683279cf0a" + "c85c1530412242c0e918953be000e939" + "cf3bf182525e199370fa7907eba69d5d" + "b4631017c0e36df70379b5db8d4c695a" + "979a8e6173224065d7dc15132ef28cd8" + "22795163063b54c651141be86d36e367" + "35bc61f31fca574e5309f3a3bbdf91ef" + "f12b99e9cc1744f1ee9a1bd22c5bad96" + "ad481929251f0343fd36bcf0acde7f11" + "e5ad60977721202796fe061f9ada1fc4" + "c8e00d6022a8357585ffe9fdd59331a2" + "8c4aa3121588fb6cf68396d8ac054659" + "9500c9708500a5972bd54f72cf8db0c8"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.3 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_3) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "d02371ad7ee48bbfdb2763de7a843b94" + "08ce5eb5abf847ca3d735986df84e906" + "0bdbcdd3a55ba55dde20d4761e1a21d2" + "25c1a186f4ac4b3019d3adf78fe63346" + "67f56f70c901a0a2700c6f0d56add719" + "592dc88f6d2306c7009f6e7a635b4cb3" + "a502dfe68ddc58d03be10a1170004fe7" + "4dd3e46b82591ff75414f0c4a03e605e" + "20524f2416f12eca589f111b75d639c6" + "1baa80cafd05cf3500244a219ed9ced9" + "f0b10297182b653b526f400f2953ba21" + "4d5bcd47884132872ae90d4d6b1f4215" + "39f9f34662a56dc0e7b4b923b6231e30" + "d2676797817f7c337b5ac824ba93143b" + "3381fa3dce0e6aebd38e67735187b1eb" + "d95c02"); + vector signature = wvutil::a2b_hex( + "3bac63f86e3b70271203106b9c79aabd" + "9f477c56e4ee58a4fce5baf2cab4960f" + "88391c9c23698be75c99aedf9e1abf17" + "05be1dac33140adb48eb31f450bb9efe" + "83b7b90db7f1576d33f40c1cba4b8d6b" + "1d3323564b0f1774114fa7c08e6d1e20" + "dd8fbba9b6ac7ad41e26b4568f4a8aac" + "bfd178a8f8d2c9d5f5b88112935a8bc9" + "ae32cda40b8d20375510735096536818" + "ce2b2db71a9772c9b0dda09ae10152fa" + "11466218d091b53d92543061b7294a55" + "be82ff35d5c32fa233f05aaac7585030" + "7ecf81383c111674397b1a1b9d3bf761" + "2ccbe5bacd2b38f0a98397b24c83658f" + "b6c0b4140ef11970c4630d44344e76ea" + "ed74dcbee811dbf6575941f08a6523b8"); + TestSignature(kSign_PKCS1_Block1, message, signature); +}; + +// # PKCS#1 v1.5 Signature Example 15.4 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_4) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "29035584ab7e0226a9ec4b02e8dcf127" + "2dc9a41d73e2820007b0f6e21feccd5b" + "d9dbb9ef88cd6758769ee1f956da7ad1" + "8441de6fab8386dbc693"); + vector signature = wvutil::a2b_hex( + "28d8e3fcd5dddb21ffbd8df1630d7377" + "aa2651e14cad1c0e43ccc52f907f946d" + "66de7254e27a6c190eb022ee89ecf622" + "4b097b71068cd60728a1aed64b80e545" + "7bd3106dd91706c937c9795f2b36367f" + "f153dc2519a8db9bdf2c807430c451de" + "17bbcd0ce782b3e8f1024d90624dea7f" + "1eedc7420b7e7caa6577cef43141a726" + "4206580e44a167df5e41eea0e69a8054" + "54c40eefc13f48e423d7a32d02ed42c0" + "ab03d0a7cf70c5860ac92e03ee005b60" + "ff3503424b98cc894568c7c56a023355" + "1cebe588cf8b0167b7df13adcad82867" + "6810499c704da7ae23414d69e3c0d2db" + "5dcbc2613bc120421f9e3653c5a87672" + "97643c7e0740de016355453d6c95ae72"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.5 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_5) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex("bda3a1c79059eae598308d3df609"); + vector signature = wvutil::a2b_hex( + "a156176cb96777c7fb96105dbd913bc4" + "f74054f6807c6008a1a956ea92c1f81c" + "b897dc4b92ef9f4e40668dc7c556901a" + "cb6cf269fe615b0fb72b30a513386923" + "14b0e5878a88c2c7774bd16939b5abd8" + "2b4429d67bd7ac8e5ea7fe924e20a6ec" + "662291f2548d734f6634868b039aa5f9" + "d4d906b2d0cb8585bf428547afc91c6e" + "2052ddcd001c3ef8c8eefc3b6b2a82b6" + "f9c88c56f2e2c3cb0be4b80da95eba37" + "1d8b5f60f92538743ddbb5da2972c71f" + "e7b9f1b790268a0e770fc5eb4d5dd852" + "47d48ae2ec3f26255a3985520206a1f2" + "68e483e9dbb1d5cab190917606de31e7" + "c5182d8f151bf41dfeccaed7cde690b2" + "1647106b490c729d54a8fe2802a6d126"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.6 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_6) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c187915e4e87da81c08ed4356a0cceac" + "1c4fb5c046b45281b387ec28f1abfd56" + "7e546b236b37d01ae71d3b2834365d3d" + "f380b75061b736b0130b070be58ae8a4" + "6d12166361b613dbc47dfaeb4ca74645" + "6c2e888385525cca9dd1c3c7a9ada76d" + "6c"); + vector signature = wvutil::a2b_hex( + "9cab74163608669f7555a333cf196fe3" + "a0e9e5eb1a32d34bb5c85ff689aaab0e" + "3e65668ed3b1153f94eb3d8be379b8ee" + "f007c4a02c7071ce30d8bb341e58c620" + "f73d37b4ecbf48be294f6c9e0ecb5e63" + "fec41f120e5553dfa0ebebbb72640a95" + "37badcb451330229d9f710f62e3ed8ec" + "784e50ee1d9262b42671340011d7d098" + "c6f2557b2131fa9bd0254636597e88ec" + "b35a240ef0fd85957124df8080fee1e1" + "49af939989e86b26c85a5881fae8673d" + "9fd40800dd134eb9bdb6410f420b0aa9" + "7b20efcf2eb0c807faeb83a3ccd9b51d" + "4553e41dfc0df6ca80a1e81dc234bb83" + "89dd195a38b42de4edc49d346478b9f1" + "1f0557205f5b0bd7ffe9c850f396d7c4"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.7 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_7) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "abfa2ecb7d29bd5bcb9931ce2bad2f74" + "383e95683cee11022f08e8e7d0b8fa05" + "8bf9eb7eb5f98868b5bb1fb5c31ceda3" + "a64f1a12cdf20fcd0e5a246d7a1773d8" + "dba0e3b277545babe58f2b96e3f4edc1" + "8eabf5cd2a560fca75fe96e07d859def" + "b2564f3a34f16f11e91b3a717b41af53" + "f6605323001aa406c6"); + vector signature = wvutil::a2b_hex( + "c4b437bcf703f352e1faf74eb9622039" + "426b5672caf2a7b381c6c4f0191e7e4a" + "98f0eebcd6f41784c2537ff0f99e7498" + "2c87201bfbc65eae832db71d16dacadb" + "0977e5c504679e40be0f9db06ffd848d" + "d2e5c38a7ec021e7f68c47dfd38cc354" + "493d5339b4595a5bf31e3f8f13816807" + "373df6ad0dc7e731e51ad19eb4754b13" + "4485842fe709d378444d8e36b1724a4f" + "da21cafee653ab80747f7952ee804dea" + "b1039d84139945bbf4be82008753f3c5" + "4c7821a1d241f42179c794ef7042bbf9" + "955656222e45c34369a384697b6ae742" + "e18fa5ca7abad27d9fe71052e3310d0f" + "52c8d12ea33bf053a300f4afc4f098df" + "4e6d886779d64594d369158fdbc1f694"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.8 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_8) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "df4044a89a83e9fcbf1262540ae3038b" + "bc90f2b2628bf2a4467ac67722d8546b" + "3a71cb0ea41669d5b4d61859c1b4e47c" + "ecc5933f757ec86db0644e311812d00f" + "b802f03400639c0e364dae5aebc5791b" + "c655762361bc43c53d3c7886768f7968" + "c1c544c6f79f7be820c7e2bd2f9d73e6" + "2ded6d2e937e6a6daef90ee37a1a52a5" + "4f00e31addd64894cf4c02e16099e29f" + "9eb7f1a7bb7f84c47a2b594813be02a1" + "7b7fc43b34c22c91925264126c89f86b" + "b4d87f3ef131296c53a308e0331dac8b" + "af3b63422266ecef2b90781535dbda41" + "cbd0cf22a8cbfb532ec68fc6afb2ac06"); + vector signature = wvutil::a2b_hex( + "1414b38567ae6d973ede4a06842dcc0e" + "0559b19e65a4889bdbabd0fd02806829" + "13bacd5dc2f01b30bb19eb810b7d9ded" + "32b284f147bbe771c930c6052aa73413" + "90a849f81da9cd11e5eccf246dbae95f" + "a95828e9ae0ca3550325326deef9f495" + "30ba441bed4ac29c029c9a2736b1a419" + "0b85084ad150426b46d7f85bd702f48d" + "ac5f71330bc423a766c65cc1dcab20d3" + "d3bba72b63b3ef8244d42f157cb7e3a8" + "ba5c05272c64cc1ad21a13493c3911f6" + "0b4e9f4ecc9900eb056ee59d6fe4b8ff" + "6e8048ccc0f38f2836fd3dfe91bf4a38" + "6e1ecc2c32839f0ca4d1b27a568fa940" + "dd64ad16bd0125d0348e383085f08894" + "861ca18987227d37b42b584a8357cb04"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.9 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_9) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "ea941ff06f86c226927fcf0e3b11b087" + "2676170c1bfc33bda8e265c77771f9d0" + "850164a5eecbcc5ce827fbfa07c85214" + "796d8127e8caa81894ea61ceb1449e72" + "fea0a4c943b2da6d9b105fe053b9039a" + "9cc53d420b7539fab2239c6b51d17e69" + "4c957d4b0f0984461879a0759c4401be" + "ecd4c606a0afbd7a076f50a2dfc2807f" + "24f1919baa7746d3a64e268ed3f5f8e6" + "da83a2a5c9152f837cb07812bd5ba7d3" + "a07985de88113c1796e9b466ec299c5a" + "c1059e27f09415"); + vector signature = wvutil::a2b_hex( + "ceeb84ccb4e9099265650721eea0e8ec" + "89ca25bd354d4f64564967be9d4b08b3" + "f1c018539c9d371cf8961f2291fbe0dc" + "2f2f95fea47b639f1e12f4bc381cef0c" + "2b7a7b95c3adf27605b7f63998c3cbad" + "542808c3822e064d4ad14093679e6e01" + "418a6d5c059684cd56e34ed65ab605b8" + "de4fcfa640474a54a8251bbb7326a42d" + "08585cfcfc956769b15b6d7fdf7da84f" + "81976eaa41d692380ff10eaecfe0a579" + "682909b5521fade854d797b8a0345b9a" + "864e0588f6caddbf65f177998e180d1f" + "102443e6dca53a94823caa9c3b35f322" + "583c703af67476159ec7ec93d1769b30" + "0af0e7157dc298c6cd2dee2262f8cddc" + "10f11e01741471bbfd6518a175734575"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.10 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_10) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "d8b81645c13cd7ecf5d00ed2c91b9acd" + "46c15568e5303c4a9775ede76b48403d" + "6be56c05b6b1cf77c6e75de096c5cb35" + "51cb6fa964f3c879cf589d28e1da2f9d" + "ec"); + vector signature = wvutil::a2b_hex( + "2745074ca97175d992e2b44791c323c5" + "7167165cdd8da579cdef4686b9bb404b" + "d36a56504eb1fd770f60bfa188a7b24b" + "0c91e881c24e35b04dc4dd4ce38566bc" + "c9ce54f49a175fc9d0b22522d9579047" + "f9ed42eca83f764a10163997947e7d2b" + "52ff08980e7e7c2257937b23f3d279d4" + "cd17d6f495546373d983d536efd7d1b6" + "7181ca2cb50ac616c5c7abfbb9260b91" + "b1a38e47242001ff452f8de10ca6eaea" + "dcaf9edc28956f28a711291fc9a80878" + "b8ba4cfe25b8281cb80bc9cd6d2bd182" + "5246eebe252d9957ef93707352084e6d" + "36d423551bf266a85340fb4a6af37088" + "0aab07153d01f48d086df0bfbec05e7b" + "443b97e71718970e2f4bf62023e95b67"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.11 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_11) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "e5739b6c14c92d510d95b826933337ff" + "0d24ef721ac4ef64c2bad264be8b44ef" + "a1516e08a27eb6b611d3301df0062dae" + "fc73a8c0d92e2c521facbc7b26473876" + "7ea6fc97d588a0baf6ce50adf79e600b" + "d29e345fcb1dba71ac5c0289023fe4a8" + "2b46a5407719197d2e958e3531fd54ae" + "f903aabb4355f88318994ed3c3dd62f4" + "20a7"); + vector signature = wvutil::a2b_hex( + "be40a5fb94f113e1b3eff6b6a33986f2" + "02e363f07483b792e68dfa5554df0466" + "cc32150950783b4d968b639a04fd2fb9" + "7f6eb967021f5adccb9fca95acc8f2cd" + "885a380b0a4e82bc760764dbab88c1e6" + "c0255caa94f232199d6f597cc9145b00" + "e3d4ba346b559a8833ad1516ad5163f0" + "16af6a59831c82ea13c8224d84d0765a" + "9d12384da460a8531b4c407e04f4f350" + "709eb9f08f5b220ffb45abf6b75d1579" + "fd3f1eb55fc75b00af8ba3b087827fe9" + "ae9fb4f6c5fa63031fe582852fe2834f" + "9c89bff53e2552216bc7c1d4a3d5dc2b" + "a6955cd9b17d1363e7fee8ed7629753f" + "f3125edd48521ae3b9b03217f4496d0d" + "8ede57acbc5bd4deae74a56f86671de2"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.12 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_12) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "7af42835917a88d6b3c6716ba2f5b0d5" + "b20bd4e2e6e574e06af1eef7c81131be" + "22bf8128b9cbc6ec00275ba80294a5d1" + "172d0824a79e8fdd830183e4c00b9678" + "2867b1227fea249aad32ffc5fe007bc5" + "1f21792f728deda8b5708aa99cabab20" + "a4aa783ed86f0f27b5d563f42e07158c" + "ea72d097aa6887ec411dd012912a5e03" + "2bbfa678507144bcc95f39b58be7bfd1" + "759adb9a91fa1d6d8226a8343a8b849d" + "ae76f7b98224d59e28f781f13ece605f" + "84f6c90bae5f8cf378816f4020a7dda1" + "bed90c92a23634d203fac3fcd86d68d3" + "182a7d9ccabe7b0795f5c655e9acc4e3" + "ec185140d10cef053464ab175c83bd83" + "935e3dabaf3462eebe63d15f573d269a"); + vector signature = wvutil::a2b_hex( + "4e78c5902b807914d12fa537ae6871c8" + "6db8021e55d1adb8eb0ccf1b8f36ab7d" + "ad1f682e947a627072f03e627371781d" + "33221d174abe460dbd88560c22f69011" + "6e2fbbe6e964363a3e5283bb5d946ef1" + "c0047eba038c756c40be7923055809b0" + "e9f34a03a58815ebdde767931f018f6f" + "1878f2ef4f47dd374051dd48685ded6e" + "fb3ea8021f44be1d7d149398f98ea9c0" + "8d62888ebb56192d17747b6b8e170954" + "31f125a8a8e9962aa31c285264e08fb2" + "1aac336ce6c38aa375e42bc92ab0ab91" + "038431e1f92c39d2af5ded7e43bc151e" + "6ebea4c3e2583af3437e82c43c5e3b5b" + "07cf0359683d2298e35948ed806c063c" + "606ea178150b1efc15856934c7255cfe"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.13 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_13) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "ebaef3f9f23bdfe5fa6b8af4c208c189" + "f2251bf32f5f137b9de4406378686b3f" + "0721f62d24cb8688d6fc41a27cbae21d" + "30e429feacc7111941c277"); + vector signature = wvutil::a2b_hex( + "c48dbef507114f03c95fafbeb4df1bfa" + "88e0184a33cc4f8a9a1035ff7f822a5e" + "38cda18723915ff078244429e0f6081c" + "14fd83331fa65c6ba7bb9a12dbf66223" + "74cd0ca57de3774e2bd7ae823677d061" + "d53ae9c4040d2da7ef7014f3bbdc95a3" + "61a43855c8ce9b97ecabce174d926285" + "142b534a3087f9f4ef74511ec742b0d5" + "685603faf403b5072b985df46adf2d25" + "29a02d40711e2190917052371b79b749" + "b83abf0ae29486c3f2f62477b2bd362b" + "039c013c0c5076ef520dbb405f42cee9" + "5425c373a975e1cdd032c49622c85079" + "b09e88dab2b13969ef7a723973781040" + "459f57d5013638483de2d91cb3c490da" + "81c46de6cd76ea8a0c8f6fe331712d24"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.14 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_14) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c5a2711278761dfcdd4f0c99e6f5619d" + "6c48b5d4c1a80982faa6b4cf1cf7a60f" + "f327abef93c801429efde08640858146" + "1056acc33f3d04f5ada21216cacd5fd1" + "f9ed83203e0e2fe6138e3eae8424e591" + "5a083f3f7ab76052c8be55ae882d6ec1" + "482b1e45c5dae9f41015405327022ec3" + "2f0ea2429763b255043b1958ee3cf6d6" + "3983596eb385844f8528cc9a9865835d" + "c5113c02b80d0fca68aa25e72bcaaeb3" + "cf9d79d84f984fd417"); + vector signature = wvutil::a2b_hex( + "6bd5257aa06611fb4660087cb4bc4a9e" + "449159d31652bd980844daf3b1c7b353" + "f8e56142f7ea9857433b18573b4deede" + "818a93b0290297783f1a2f23cbc72797" + "a672537f01f62484cd4162c3214b9ac6" + "28224c5de01f32bb9b76b27354f2b151" + "d0e8c4213e4615ad0bc71f515e300d6a" + "64c6743411fffde8e5ff190e54923043" + "126ecfc4c4539022668fb675f25c07e2" + "0099ee315b98d6afec4b1a9a93dc3349" + "6a15bd6fde1663a7d49b9f1e639d3866" + "4b37a010b1f35e658682d9cd63e57de0" + "f15e8bdd096558f07ec0caa218a8c06f" + "4788453940287c9d34b6d40a3f09bf77" + "99fe98ae4eb49f3ff41c5040a50cefc9" + "bdf2394b749cf164480df1ab6880273b"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.15 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_15) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "9bf8aa253b872ea77a7e23476be26b23" + "29578cf6ac9ea2805b357f6fc3ad130d" + "baeb3d869a13cce7a808bbbbc969857e" + "03945c7bb61df1b5c2589b8e046c2a5d" + "7e4057b1a74f24c711216364288529ec" + "9570f25197213be1f5c2e596f8bf8b2c" + "f3cb38aa56ffe5e31df7395820e94ecf" + "3b1189a965dcf9a9cb4298d3c88b2923" + "c19fc6bc34aacecad4e0931a7c4e5d73" + "dc86dfa798a8476d82463eefaa90a8a9" + "192ab08b23088dd58e1280f7d72e4548" + "396baac112252dd5c5346adb2004a2f7" + "101ccc899cc7fafae8bbe295738896a5" + "b2012285014ef6"); + vector signature = wvutil::a2b_hex( + "27f7f4da9bd610106ef57d32383a448a" + "8a6245c83dc1309c6d770d357ba89e73" + "f2ad0832062eb0fe0ac915575bcd6b8b" + "cadb4e2ba6fa9da73a59175152b2d4fe" + "72b070c9b7379e50000e55e6c269f665" + "8c937972797d3add69f130e34b85bdec" + "9f3a9b392202d6f3e430d09caca82277" + "59ab825f7012d2ff4b5b62c8504dbad8" + "55c05edd5cab5a4cccdc67f01dd6517c" + "7d41c43e2a4957aff19db6f18b17859a" + "f0bc84ab67146ec1a4a60a17d7e05f8b" + "4f9ced6ad10908d8d78f7fc88b76adc8" + "290f87daf2a7be10ae408521395d54ed" + "2556fb7661854a730ce3d82c71a8d493" + "ec49a378ac8a3c74439f7cc555ba13f8" + "59070890ee18ff658fa4d741969d70a5"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.16 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_16) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "32474830e2203754c8bf0681dc4f842a" + "fe360930378616c108e833656e5640c8" + "6856885bb05d1eb9438efede679263de" + "07cb39553f6a25e006b0a52311a063ca" + "088266d2564ff6490c46b5609818548f" + "88764dad34a25e3a85d575023f0b9e66" + "5048a03c350579a9d32446c7bb96cc92" + "e065ab94d3c8952e8df68ef0d9fa456b" + "3a06bb80e3bbc4b28e6a94b6d0ff7696" + "a64efe05e735fea025d7bdbc4139f3a3" + "b546075cba7efa947374d3f0ac80a68d" + "765f5df6210bca069a2d88647af7ea04" + "2dac690cb57378ec0777614fb8b65ff4" + "53ca6b7dce6098451a2f8c0da9bfecf1" + "fdf391bbaa4e2a91ca18a1121a7523a2" + "abd42514f489e8"); + vector signature = wvutil::a2b_hex( + "6917437257c22ccb5403290c3dee82d9" + "cf7550b31bd31c51bd57bfd35d452ab4" + "db7c4be6b2e25ac9a59a1d2a7feb627f" + "0afd4976b3003cc9cffd8896505ec382" + "f265104d4cf8c932fa9fe86e00870795" + "9912389da4b2d6b369b36a5e72e29d24" + "c9a98c9d31a3ab44e643e6941266a47a" + "45e3446ce8776abe241a8f5fc6423b24" + "b1ff250dc2c3a8172353561077e850a7" + "69b25f0325dac88965a3b9b472c494e9" + "5f719b4eac332caa7a65c7dfe46d9aa7" + "e6e00f525f303dd63ab7919218901868" + "f9337f8cd26aafe6f33b7fb2c98810af" + "19f7fcb282ba1577912c1d368975fd5d" + "440b86e10c199715fa0b6f4250b53373" + "2d0befe1545150fc47b876de09b00a94"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.17 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_17) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "008e59505eafb550aae5e845584cebb0" + "0b6de1733e9f95d42c882a5bbeb5ce1c" + "57e119e7c0d4daca9f1ff7870217f7cf" + "d8a6b373977cac9cab8e71e420"); + vector signature = wvutil::a2b_hex( + "922503b673ee5f3e691e1ca85e9ff417" + "3cf72b05ac2c131da5603593e3bc259c" + "94c1f7d3a06a5b9891bf113fa39e59ff" + "7c1ed6465e908049cb89e4e125cd37d2" + "ffd9227a41b4a0a19c0a44fbbf3de55b" + "ab802087a3bb8d4ff668ee6bbb8ad89e" + "6857a79a9c72781990dfcf92cd519404" + "c950f13d1143c3184f1d250c90e17ac6" + "ce36163b9895627ad6ffec1422441f55" + "e4499dba9be89546ae8bc63cca01dd08" + "463ae7f1fce3d893996938778c1812e6" + "74ad9c309c5acca3fde44e7dd8695993" + "e9c1fa87acda99ece5c8499e468957ad" + "66359bf12a51adbe78d3a213b449bf0b" + "5f8d4d496acf03d3033b7ccd196bc22f" + "68fb7bef4f697c5ea2b35062f48a36dd"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.18 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_18) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "6abc54cf8d1dff1f53b17d8160368878" + "a8788cc6d22fa5c2258c88e660b09a89" + "33f9f2c0504ddadc21f6e75e0b833beb" + "555229dee656b9047b92f62e76b8ffcc" + "60dab06b80"); + vector signature = wvutil::a2b_hex( + "0b6daf42f7a862147e417493c2c401ef" + "ae32636ab4cbd44192bbf5f195b50ae0" + "96a475a1614f0a9fa8f7a026cb46c650" + "6e518e33d83e56477a875aca8c7e714c" + "e1bdbd61ef5d535239b33f2bfdd61771" + "bab62776d78171a1423cea8731f82e60" + "766d6454265620b15f5c5a584f55f95b" + "802fe78c574ed5dacfc831f3cf2b0502" + "c0b298f25ccf11f973b31f85e4744219" + "85f3cff702df3946ef0a6605682111b2" + "f55b1f8ab0d2ea3a683c69985ead93ed" + "449ea48f0358ddf70802cb41de2fd83f" + "3c808082d84936948e0c84a131b49278" + "27460527bb5cd24bfab7b48e071b2417" + "1930f99763272f9797bcb76f1d248157" + "5558fcf260b1f0e554ebb3df3cfcb958"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.19 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_19) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "af2d78152cf10efe01d274f217b177f6" + "b01b5e749f1567715da324859cd3dd88" + "db848ec79f48dbba7b6f1d33111ef31b" + "64899e7391c2bffd69f49025cf201fc5" + "85dbd1542c1c778a2ce7a7ee108a309f" + "eca26d133a5ffedc4e869dcd7656596a" + "c8427ea3ef6e3fd78fe99d8ddc71d839" + "f6786e0da6e786bd62b3a4f19b891a56" + "157a554ec2a2b39e25a1d7c7d37321c7" + "a1d946cf4fbe758d9276f08563449d67" + "414a2c030f4251cfe2213d04a5410637" + "87"); + vector signature = wvutil::a2b_hex( + "209c61157857387b71e24bf3dd564145" + "50503bec180ff53bdd9bac062a2d4995" + "09bf991281b79527df9136615b7a6d9d" + "b3a103b535e0202a2caca197a7b74e53" + "56f3dd595b49acfd9d30049a98ca88f6" + "25bca1d5f22a392d8a749efb6eed9b78" + "21d3110ac0d244199ecb4aa3d735a83a" + "2e8893c6bf8581383ccaee834635b7fa" + "1faffa45b13d15c1da33af71e89303d6" + "8090ff62ee615fdf5a84d120711da53c" + "2889198ab38317a9734ab27d67924cea" + "74156ff99bef9876bb5c339e93745283" + "e1b34e072226b88045e017e9f05b2a8c" + "416740258e223b2690027491732273f3" + "229d9ef2b1b3807e321018920ad3e53d" + "ae47e6d9395c184b93a374c671faa2ce"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.20 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_20) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "40ee992458d6f61486d25676a96dd2cb" + "93a37f04b178482f2b186cf88215270d" + "ba29d786d774b0c5e78c7f6e56a956e7" + "f73950a2b0c0c10a08dbcd67e5b210bb" + "21c58e2767d44f7dd4014e3966143bf7" + "e3d66ff0c09be4c55f93b39994b8518d" + "9c1d76d5b47374dea08f157d57d70634" + "978f3856e0e5b481afbbdb5a3ac48d48" + "4be92c93de229178354c2de526e9c65a" + "31ede1ef68cb6398d7911684fec0babc" + "3a781a66660783506974d0e14825101c" + "3bfaea"); + vector signature = wvutil::a2b_hex( + "927502b824afc42513ca6570de338b8a" + "64c3a85eb828d3193624f27e8b1029c5" + "5c119c9733b18f5849b3500918bcc005" + "51d9a8fdf53a97749fa8dc480d6fe974" + "2a5871f973926528972a1af49e3925b0" + "adf14a842719b4a5a2d89fa9c0b6605d" + "212bed1e6723b93406ad30e86829a5c7" + "19b890b389306dc5506486ee2f36a8df" + "e0a96af678c9cbd6aff397ca200e3edc" + "1e36bd2f08b31d540c0cb282a9559e4a" + "dd4fc9e6492eed0ccbd3a6982e5faa2d" + "dd17be47417c80b4e5452d31f72401a0" + "42325109544d954c01939079d409a5c3" + "78d7512dfc2d2a71efcc3432a765d1c6" + "a52cfce899cd79b15b4fc3723641ef6b" + "d00acc10407e5df58dd1c3c5c559a506"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +TEST_P(OEMCryptoSessionTestLoadCasKeysWithHDCP, CasOnlyLoadCasKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } + // Test parameterized by HDCP version. + LoadCasKeysWithHDCP(static_cast(GetParam())); +} +INSTANTIATE_TEST_SUITE_P(TestHDCP, OEMCryptoSessionTestLoadCasKeysWithHDCP, + Range(1, 6)); +} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_cast_test.h b/oemcrypto/test/oemcrypto_cast_test.h new file mode 100644 index 0000000..b6e2116 --- /dev/null +++ b/oemcrypto/test/oemcrypto_cast_test.h @@ -0,0 +1,228 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// +// Test data for OEMCrypto unit tests. +// +#ifndef CDM_OEMCRYPTO_CAST_TEST_ +#define CDM_OEMCRYPTO_CAST_TEST_ + +#include + +#include + +#include "OEMCryptoCENC.h" +#include "oemcrypto_provisioning_test.h" +#include "oemcrypto_session_tests_helper.h" + +namespace wvoec { + +const char* HDCPCapabilityAsString(OEMCrypto_HDCP_Capability value); + +std::string MaybeHex(const uint8_t* data, size_t length); +std::string MaybeHex(const std::vector& data); + +// This test attempts to use alternate algorithms for loaded device certs. +class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate { + protected: + void DisallowForbiddenPadding(RSA_Padding_Scheme scheme, size_t size) { + OEMCryptoResult sts; + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + // Sign a Message + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 256; + vector signature(signature_length); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + // Allow OEMCrypto to request a full buffer. + if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { + ASSERT_NE(static_cast(0), signature_length); + signature.assign(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + } + + EXPECT_NE(OEMCrypto_SUCCESS, sts) + << "Signed with forbidden padding scheme=" << (int)scheme + << ", size=" << (int)size; + const vector zero(signature.size(), 0); + ASSERT_EQ(zero, signature); // signature should not be computed. + } + + void TestSignature(RSA_Padding_Scheme scheme, size_t size) { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 0; + OEMCryptoResult sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), nullptr, + &signature_length, scheme); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + std::vector signature(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + + ASSERT_EQ(OEMCrypto_SUCCESS, sts) + << "Failed to sign with padding scheme=" << (int)scheme + << ", size=" << size; + signature.resize(signature_length); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( + licenseRequest, signature.data(), signature_length, scheme)); + } + + void DisallowDeriveKeys() { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + s.GenerateNonce(); + vector session_key; + vector enc_session_key; + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); + vector mac_context; + vector enc_context; + s.FillDefaultContext(&mac_context, &enc_context); + ASSERT_NE(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + s.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), + mac_context.size(), enc_context.data(), enc_context.size())); + } + + // If force is true, we assert that the key loads successfully. + void LoadWithAllowedSchemes(uint32_t schemes, bool force) { + // prov 2 or prov 3 + if (global_features.provisioning_method == OEMCrypto_Keybox || + global_features.provisioning_method == OEMCrypto_OEMCertificate) { + Session s; + ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); + provisioning_messages.set_allowed_schemes(schemes); + provisioning_messages.PrepareSession(keybox_); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); + OEMCryptoResult sts = provisioning_messages.LoadResponse(); + key_loaded_ = (OEMCrypto_SUCCESS == sts); + if (key_loaded_) { + uint8_t* ptr = provisioning_messages.response_data().rsa_key; + size_t len = provisioning_messages.response_data().rsa_key_length; + encoded_rsa_key_ = std::vector(ptr, ptr + len); + wrapped_drm_key_ = provisioning_messages.wrapped_rsa_key(); + drm_key_type_ = OEMCrypto_RSA_Private_Key; + EXPECT_GT(wrapped_drm_key_.size(), 0u); + EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); + } + if (force) { + EXPECT_EQ(OEMCrypto_SUCCESS, sts); + } + } else if (global_features.provisioning_method == + OEMCrypto_BootCertificateChain) { + Session s1; + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_NO_FATAL_FAILURE(CreateProv4OEMKey(&s1)); + + Session s2; + ASSERT_NO_FATAL_FAILURE(s2.open()); + ASSERT_EQ(OEMCrypto_InstallOemPrivateKey(s2.session_id(), oem_key_type_, + wrapped_oem_key_.data(), + wrapped_oem_key_.size()), + OEMCrypto_SUCCESS); + Provisioning40CastRoundTrip prov_cast(&s2, encoded_rsa_key_); + prov_cast.set_allowed_schemes(schemes); + ASSERT_NO_FATAL_FAILURE(prov_cast.PrepareSession()); + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + + ASSERT_NO_FATAL_FAILURE(s2.SetPublicKeyFromSubjectPublicKey( + prov_cast.drm_key_type(), prov_cast.drm_public_key().data(), + prov_cast.drm_public_key().size())); + ASSERT_NO_FATAL_FAILURE(prov_cast.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(s2.GenerateDerivedKeysFromSessionKey()); + ASSERT_NO_FATAL_FAILURE(prov_cast.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(prov_cast.EncryptAndSignResponse()); + OEMCryptoResult sts = prov_cast.LoadResponse(); + key_loaded_ = (OEMCrypto_SUCCESS == sts); + if (key_loaded_) { + uint8_t* ptr = prov_cast.response_data().rsa_key; + size_t len = prov_cast.response_data().rsa_key_length; + encoded_rsa_key_ = std::vector(ptr, ptr + len); + wrapped_drm_key_ = prov_cast.wrapped_rsa_key(); + drm_key_type_ = OEMCrypto_RSA_Private_Key; + EXPECT_GT(wrapped_drm_key_.size(), 0u); + EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); + } + if (force) { + EXPECT_EQ(OEMCrypto_SUCCESS, sts); + } + } else { + FAIL() << "Unsupported provisioning method"; + } + } + + bool key_loaded_ = false; +}; + +// Used to test the different HDCP versions. This test is parameterized by the +// required HDCP version in the key control block. +class OEMCryptoSessionTestLoadCasKeysWithHDCP : public OEMCryptoSessionTests, + public WithParamInterface { + protected: + void LoadCasKeysWithHDCP(OEMCrypto_HDCP_Capability version) { + OEMCryptoResult sts; + OEMCrypto_HDCP_Capability current, maximum; + sts = OEMCrypto_GetHDCPCapability(¤t, &maximum); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&s)); + LicenseRoundTrip license_messages(&s); + license_messages.set_control((version << wvoec::kControlHDCPVersionShift) | + wvoec::kControlObserveHDCP | + wvoec::kControlHDCPRequired); + license_messages.set_license_type(OEMCrypto_EntitlementLicense); + ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); + + uint32_t key_session_id; + sts = OEMCrypto_CreateEntitledKeySession(s.session_id(), &key_session_id); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + EntitledMessage entitled_message_1(&license_messages); + entitled_message_1.FillKeyArray(); + entitled_message_1.SetEntitledKeySession(key_session_id); + + if (((version <= HDCP_V2_3 || current >= HDCP_V1_0) && version > current) || + (current == HDCP_V1 && version >= HDCP_V1_0)) { + ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( + /*load_even=*/true, /*load_odd=*/true, + OEMCrypto_ERROR_INSUFFICIENT_HDCP)) + << "Failed when current HDCP = " << HDCPCapabilityAsString(current) + << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) + << ", license HDCP = " << HDCPCapabilityAsString(version); + } else { + ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( + /*load_even=*/true, /*load_odd=*/true, OEMCrypto_SUCCESS)) + << "Failed when current HDCP = " << HDCPCapabilityAsString(current) + << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) + << ", license HDCP = " << HDCPCapabilityAsString(version); + } + } +}; +} // namespace wvoec + +#endif // CDM_OEMCRYPTO_CAST_TEST_ diff --git a/oemcrypto/test/oemcrypto_corpus_generator_helper.h b/oemcrypto/test/oemcrypto_corpus_generator_helper.h index 7b7b399..e3a73b4 100644 --- a/oemcrypto/test/oemcrypto_corpus_generator_helper.h +++ b/oemcrypto/test/oemcrypto_corpus_generator_helper.h @@ -14,7 +14,7 @@ namespace wvoec { const uint8_t kFuzzDataSeparator[] = {'-', '_', '^', '_'}; void AppendToFile(const std::string& file_name, const char* message, - const size_t message_size); + size_t message_size); // Function to append separator "-_^_" between contents of corpus file. void AppendSeparator(const std::string& file_name); diff --git a/oemcrypto/test/oemcrypto_generic_crypto_test.cpp b/oemcrypto/test/oemcrypto_generic_crypto_test.cpp new file mode 100644 index 0000000..867b4f8 --- /dev/null +++ b/oemcrypto/test/oemcrypto_generic_crypto_test.cpp @@ -0,0 +1,577 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +#include + +#include "oemcrypto_usage_table_test.h" + +using ::testing::Range; + +namespace wvoec { + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyLoad) { EncryptAndLoadKeys(); } + +// Test that the Generic_Encrypt function works correctly. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncrypt) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector encrypted(clear_buffer_.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); +} + +// Test that the Generic_Encrypt function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadEncrypt) { + EncryptAndLoadKeys(); + BadEncrypt(0, OEMCrypto_HMAC_SHA256, buffer_size_); + // The buffer size must be a multiple of 16, so subtracting 10 is bad. + BadEncrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); + BadEncrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadEncrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadEncrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); +} + +// Test that the Generic_Encrypt works if the input and output buffers are the +// same. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptSameBufferAPI12) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + // Input and output are same buffer: + vector buffer = clear_buffer_; + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + buffer.data())); + ASSERT_EQ(expected_encrypted, buffer); +} + +TEST_P( + OEMCryptoGenericCryptoTest, + OEMCryptoMemoryGenericKeyEncryptForHugeBufferWithBufferLengthNotMultipleOf16) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector buffer(17); + ASSERT_NO_FATAL_FAILURE(OEMCrypto_Generic_Encrypt( + key_handle.data(), key_handle.size(), buffer.data(), buffer.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, buffer.data())); +} + +// Test Generic_Decrypt works correctly. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecrypt) { + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); +} + +// Test that Generic_Decrypt works correctly when the input and output buffers +// are the same. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptSameBufferAPI12) { + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector buffer = encrypted; + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + buffer.data())); + ASSERT_EQ(clear_buffer_, buffer); +} + +// Test that Generic_Decrypt fails to decrypt to an insecure buffer if the key +// requires a secure data path. +TEST_P(OEMCryptoGenericCryptoTest, GenericSecureToClear) { + license_messages_.set_control(wvoec::kControlObserveDataPath | + wvoec::kControlDataPathSecure); + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_NE(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_NE(clear_buffer_, resultant); +} + +// Test that the Generic_Decrypt function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadDecrypt) { + EncryptAndLoadKeys(); + BadDecrypt(1, OEMCrypto_HMAC_SHA256, buffer_size_); + // The buffer size must be a multiple of 16, so subtracting 10 is bad. + BadDecrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); + BadDecrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadDecrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadDecrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); +} + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeySign) { + EncryptAndLoadKeys(); + unsigned int key_index = 2; + vector expected_signature; + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + size_t gen_signature_length = 0; + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, + GenericSign(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), + OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); + ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); + vector signature(SHA256_DIGEST_LENGTH); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &gen_signature_length)); + ASSERT_EQ(expected_signature, signature); +} + +// Test that the Generic_Sign function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadSign) { + EncryptAndLoadKeys(); + BadSign(0, OEMCrypto_HMAC_SHA256); // Can't sign with encrypt key. + BadSign(1, OEMCrypto_HMAC_SHA256); // Can't sign with decrypt key. + BadSign(3, OEMCrypto_HMAC_SHA256); // Can't sign with verify key. + BadSign(2, OEMCrypto_AES_CBC_128_NO_PADDING); // Bad signing algorithm. +} + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerify) { + EncryptAndLoadKeys(); + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); +} + +// Test that the Generic_Verify function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadVerify) { + EncryptAndLoadKeys(); + BadVerify(0, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(1, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(2, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, true); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH - 1, false); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH + 1, false); + BadVerify(3, OEMCrypto_AES_CBC_128_NO_PADDING, SHA256_DIGEST_LENGTH, false); +} + +// Test Generic_Encrypt with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector encrypted(clear_buffer_.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); +} + +// Test Generic_Decrypt with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptLargeBuffer) { + // Some applications are known to pass in a block that is almost 400k. + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); +} + +// Test Generic_Sign with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeySignLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 2; + vector expected_signature; + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + size_t gen_signature_length = 0; + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, + GenericSign(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), + OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); + ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); + vector signature(SHA256_DIGEST_LENGTH); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &gen_signature_length)); + ASSERT_EQ(expected_signature, signature); +} + +// Test Generic_Verify with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerifyLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); +} + +// Test Generic_Encrypt when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationEncrypt) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + vector expected_encrypted; + EncryptBuffer(0, clear_buffer_, &expected_encrypted); + unsigned int key_index = 0; + vector encrypted(clear_buffer_.size()); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + encrypted.assign(clear_buffer_.size(), 0); + OEMCryptoResult status = OEMCrypto_Generic_Encrypt( + key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + encrypted.data()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(encrypted, expected_encrypted); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Decrypt when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationDecrypt) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + // Should be valid key at the start. + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + resultant.assign(encrypted.size(), 0); + OEMCryptoResult status = GenericDecrypt( + key_handle.data(), key_handle.size(), encrypted.data(), encrypted.size(), + iv_, OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(clear_buffer_, resultant); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Sign when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationSign) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + unsigned int key_index = 2; + vector expected_signature; + vector signature(SHA256_DIGEST_LENGTH); + size_t signature_length = signature.size(); + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &signature_length)); + ASSERT_EQ(expected_signature, signature); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + signature.assign(SHA256_DIGEST_LENGTH, 0); + OEMCryptoResult status = + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &signature_length); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(expected_signature, signature); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Verify when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationVerify) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + OEMCryptoResult status = OEMCrypto_Generic_Verify( + key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + signature.size()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +const unsigned int kLongKeyId = 2; + +// Test that short key ids are allowed. +class OEMCryptoGenericCryptoKeyIdLengthTest + : public OEMCryptoGenericCryptoTest { + protected: + void SetUp() override { + OEMCryptoGenericCryptoTest::SetUp(); + license_messages_.set_num_keys(5); + license_messages_.set_control(wvoec::kControlAllowDecrypt); + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + SetUniformKeyIdLength(16); // Start with all key ids being 16 bytes. + // But, we are testing that the key ids do not have to have the same + // length. + // 12 bytes (common key id length). + license_messages_.SetKeyId(0, "123456789012"); + license_messages_.SetKeyId(1, "12345"); // short key id. + // 16 byte key id. (default) + license_messages_.SetKeyId(2, "1234567890123456"); + license_messages_.SetKeyId(3, "12345678901234"); // 14 byte. (uncommon) + license_messages_.SetKeyId(4, "1"); // very short key id. + ASSERT_EQ(2u, kLongKeyId); + ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); + } + + // Make all four keys have the same length. + void SetUniformKeyIdLength(size_t key_id_length) { + for (size_t i = 0; i < license_messages_.num_keys(); i++) { + string key_id; + key_id.resize(key_id_length, i + 'a'); + license_messages_.SetKeyId(i, key_id); + } + ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); + } + + void TestWithKey(unsigned int key_index) { + ASSERT_LT(key_index, license_messages_.num_keys()); + EncryptAndLoadKeys(); + vector encrypted; + // To make sure OEMCrypto is not expecting the key_id to be zero padded, + // we will create a buffer that is padded with 'Z'. Then, we use fill + // the buffer with the longer of the three keys. If OEMCrypto is paying + // attention to the key id length, it should pick out the correct key. + vector key_id_buffer( + session_.license().keys[kLongKeyId].key_id_length + 5, + 'Z'); // Fill a bigger buffer with letter 'Z'. + memcpy(key_id_buffer.data(), session_.license().keys[kLongKeyId].key_id, + session_.license().keys[kLongKeyId].key_id_length); + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), key_id_buffer.data(), + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, + resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); + } +}; + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, MediumKeyId) { TestWithKey(0); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, ShortKeyId) { TestWithKey(1); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, LongKeyId) { TestWithKey(2); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, FourteenByteKeyId) { + TestWithKey(3); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, VeryShortKeyId) { + TestWithKey(4); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformShortKeyId) { + SetUniformKeyIdLength(5); + TestWithKey(2); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformLongKeyId) { + SetUniformKeyIdLength(kTestKeyIdMaxLength); + TestWithKey(2); +} + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoTest, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoKeyIdLengthTest, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + +/// @} +} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_license_test.cpp b/oemcrypto/test/oemcrypto_license_test.cpp index 25cf89b..fedd8f9 100644 --- a/oemcrypto/test/oemcrypto_license_test.cpp +++ b/oemcrypto/test/oemcrypto_license_test.cpp @@ -6,6 +6,9 @@ #include "oemcrypto_license_test.h" #include "platform.h" +#include "test_sleep.h" + +using ::testing::Range; namespace wvoec { @@ -800,5 +803,168 @@ TEST_F(OEMCryptoSessionTests, CheckMinimumPatchLevel) { } } +// +// Load, Refresh Keys Test +// + +// Refresh keys should work if the license uses a nonce. +TEST_P(OEMCryptoRefreshTest, RefreshWithNonce) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// Refresh keys should work if the license does not use a nonce. +TEST_P(OEMCryptoRefreshTest, RefreshNoNonce) { + license_messages_.set_control(0); + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// Refresh keys should NOT work if a license has not been loaded. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshNoLicense) { + Session s; + s.open(); + constexpr size_t message_size = kMaxCoreMessage + 42; + std::vector data(message_size); + for (size_t i = 0; i < data.size(); i++) data[i] = i & 0xFF; + size_t gen_signature_length = 0; + size_t core_message_length = 0; + OEMCryptoResult sts = OEMCrypto_PrepAndSignRenewalRequest( + s.session_id(), data.data(), data.size(), &core_message_length, nullptr, + &gen_signature_length); + ASSERT_LT(core_message_length, message_size); + if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { + vector gen_signature(gen_signature_length); + sts = OEMCrypto_PrepAndSignRenewalRequest( + s.session_id(), data.data(), data.size(), &core_message_length, + gen_signature.data(), &gen_signature_length); + } + ASSERT_NE(OEMCrypto_SUCCESS, sts); +} + +// Refresh keys should fail if the nonce is not in the session. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadNonce) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + renewal_messages.core_request().nonce ^= 42; + LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); +} + +// Refresh keys should fail if the session_id does not match the license. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadSessionID) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + renewal_messages.core_request().session_id += 1; + LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); +} + +// Refresh keys should handle the maximum message size. +TEST_P(OEMCryptoRefreshTest, RefreshLargeBuffer) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + const size_t max_size = GetResourceValue(kLargeMessageSize); + renewal_messages.set_message_size(max_size); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// This situation would occur if an app only uses one key in the license. When +// that happens, SelectKey would be called before the first decrypt, and then +// would not need to be called again, even if the license is refreshed. +TEST_P(OEMCryptoRefreshTest, RefreshWithNoSelectKey) { + LoadLicense(); + + // Call select key before the refresh. No calls below to TestDecryptCTR with + // select key set to true. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true)); + + // This should still be valid key, even if the refresh failed, because this + // is before the original license duration. + wvutil::TestSleep::Sleep(kShortSleep); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); + + // This should be after duration of the original license, but before the + // expiration of the refresh message. This should fail until we have loaded + // the renewal. + wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); + + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); + + // After we've loaded the renewal, decrypt should succeed again. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); +} + +// Test that playback clock is correctly started and that the license can be +// renewed. +TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadSuccess) { + license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; + timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. + timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. + // First version to support Renew on Load. + constexpr uint32_t kFeatureVersion = 18; + + // Loading the license should start the playback clock. + LoadLicense(); + // Sleep until just after rental window is over. + wvutil::TestSleep::Sleep(kDuration + kShortSleep); + if (license_api_version_ < kFeatureVersion || + global_features.api_version < kFeatureVersion) { + // If the feature is not supported, then we expect failure because the + // playback clock was not started and we are outside the rental window. + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(true, OEMCrypto_ERROR_KEY_EXPIRED)); + return; + } else { + // If the feature is supported, we expect decrypt to work because we are + // still within the initial renewal window, and the playback clock should + // have started. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true, OEMCrypto_SUCCESS)); + } + // This is after the initial renewal duration, so we expect failure before + // loading the renewal. + wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); + + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); + + // After we've loaded the renewal, decrypt should succeed again. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); +} + +TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadOutsideRentalDuration) { + license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; + timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. + timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. + + // Sleep until just after rental window is over. + wvutil::TestSleep::Sleep(kDuration + kShortSleep); + // Loading the license should start the playback clock. + LoadLicense(); + // If the license is loaded after the rental duration window, we expect + // failure. + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_UNKNOWN_FAILURE)); +} + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoRefreshTest, + Range(kCurrentAPI - 1, kCurrentAPI + 1)); + +// These tests only work when the license has a core message. +INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoRefreshTestAPI16, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + /// @} } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_license_test.h b/oemcrypto/test/oemcrypto_license_test.h index fd59d15..a286050 100644 --- a/oemcrypto/test/oemcrypto_license_test.h +++ b/oemcrypto/test/oemcrypto_license_test.h @@ -17,10 +17,10 @@ #include "oemcrypto_resource_test.h" #include "wvcrc32.h" -using ::testing::WithParamInterface; - namespace wvoec { +using ::testing::WithParamInterface; + // Used for testing oemcrypto APIs with huge buffers. typedef const std::function oemcrypto_function; void TestHugeLengthDoesNotCrashAPI(oemcrypto_function f, @@ -359,6 +359,52 @@ class LicenseWithUsageEntry { bool active_; }; +class OEMCryptoRefreshTest : public OEMCryptoLicenseTest { + protected: + void SetUp() override { + OEMCryptoLicenseTest::SetUp(); + // These values allow us to run a few simple duration tests or just start + // playback right away. All times are in seconds since the license was + // signed. + // Soft expiry false means timers are strictly enforce. + timer_limits_.soft_enforce_rental_duration = true; + timer_limits_.soft_enforce_playback_duration = false; + // Playback may begin immediately. + timer_limits_.earliest_playback_start_seconds = 0; + // First playback may be within the first two seconds. + timer_limits_.rental_duration_seconds = kDuration; + // Once started, playback may last two seconds without a renewal. + timer_limits_.initial_renewal_duration_seconds = kDuration; + // Total playback is not limited. + timer_limits_.total_playback_duration_seconds = 0; + } + + void LoadLicense() { + license_messages_.core_response().timer_limits = timer_limits_; + ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); + } + + void MakeRenewalRequest(RenewalRoundTrip* renewal_messages) { + ASSERT_NO_FATAL_FAILURE(renewal_messages->SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(renewal_messages->CreateDefaultResponse()); + } + + void LoadRenewal(RenewalRoundTrip* renewal_messages, + OEMCryptoResult expected_result) { + ASSERT_NO_FATAL_FAILURE(renewal_messages->EncryptAndSignResponse()); + ASSERT_EQ(expected_result, renewal_messages->LoadResponse()); + } + + ODK_TimerLimits timer_limits_; +}; + +// This class is for the refresh tests that should only be run on licenses with +// a core message. +class OEMCryptoRefreshTestAPI16 : public OEMCryptoRefreshTest {}; + } // namespace wvoec #endif // CDM_OEMCRYPTO_LICENSE_TEST_ \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_provisioning_test.cpp b/oemcrypto/test/oemcrypto_provisioning_test.cpp index ea687ee..5504e76 100644 --- a/oemcrypto/test/oemcrypto_provisioning_test.cpp +++ b/oemcrypto/test/oemcrypto_provisioning_test.cpp @@ -7,12 +7,10 @@ #include "log.h" #include "platform.h" +#include "test_sleep.h" namespace wvoec { -/// @addtogroup provision -/// @{ - // This test is used to print the device ID to stdout. TEST_F(OEMCryptoKeyboxTest, NormalGetDeviceId) { OEMCryptoResult sts; @@ -620,6 +618,42 @@ TEST_F(OEMCryptoProv40Test, ProvisionDrmCert) { ASSERT_EQ(s.IsPublicKeySet(), true); } +TEST_P(OEMCryptoProv40CastTest, ProvisionCastWorks) { + // Generate an OEM key first, to load into next session + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + size_t public_key_size = 10000; + std::vector public_key(public_key_size); + size_t public_key_signature_size = 10000; + std::vector public_key_signature(public_key_signature_size); + size_t wrapped_private_key_size = 10000; + std::vector wrapped_private_key(wrapped_private_key_size); + OEMCrypto_PrivateKeyType key_type; + ASSERT_EQ( + OEMCrypto_GenerateCertificateKeyPair( + s.session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type), + OEMCrypto_SUCCESS); + public_key.resize(public_key_size); + public_key_signature.resize(public_key_signature_size); + wrapped_private_key.resize(wrapped_private_key_size); + ASSERT_NO_FATAL_FAILURE(s.close()); + + // Install OEM key and get cast RSA + Session s1; + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_EQ(OEMCrypto_InstallOemPrivateKey(s1.session_id(), key_type, + wrapped_private_key.data(), + wrapped_private_key_size), + OEMCrypto_SUCCESS); + + ASSERT_NO_FATAL_FAILURE(CreateProv4CastKey(&s1, GetParam())); +} + +INSTANTIATE_TEST_SUITE_P(Prov4CastProvisioningBasic, OEMCryptoProv40CastTest, + testing::Values(true, false)); + TEST_F(OEMCryptoLoadsCertificate, PrepAndSignLicenseRequestCounterAPI18) { ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); Session s; @@ -768,6 +802,9 @@ TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRange4_API16) { // Verify that RewrapDeviceRSAKey checks pointers are within the provisioning // message. TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRange5Prov30_API16) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } Session s; ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); provisioning_messages.PrepareSession(keybox_); @@ -865,5 +902,327 @@ TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionLargeBuffer) { provisioning_messages.encoded_rsa_key())); } -/// @} +// Test that a wrapped RSA key can be loaded. +TEST_F(OEMCryptoLoadsCertificate, LoadWrappedRSAKey) { + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); +} + +class OEMCryptoLoadsCertVariousKeys : public OEMCryptoLoadsCertificate { + public: + void TestKey(const uint8_t* key, size_t key_length) { + encoded_rsa_key_.assign(key, key + key_length); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + LicenseRoundTrip license_messages(&s); + ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR()); + } +}; + +// Test a 3072 bit RSA key certificate. +TEST_F(OEMCryptoLoadsCertVariousKeys, TestLargeRSAKey3072) { + if (!global_features.supports_rsa_3072) { + GTEST_SKIP() << "OEMCrypto does not support RSA 3072"; + } + TestKey(kTestRSAPKCS8PrivateKeyInfo3_3072, + sizeof(kTestRSAPKCS8PrivateKeyInfo3_3072)); +} + +// Test an RSA key certificate which has a private key generated using the +// Carmichael totient. +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelRSAKey) { + TestKey(kTestKeyRSACarmichael_2048, sizeof(kTestKeyRSACarmichael_2048)); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroNormalDer) { + TestKey(kCarmichaelNonZeroNormalDer, kCarmichaelNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroShortDer) { + TestKey(kCarmichaelNonZeroShortDer, kCarmichaelNonZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroNormalDer) { + TestKey(kCarmichaelZeroNormalDer, kCarmichaelZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroShortDer) { + TestKey(kCarmichaelZeroShortDer, kCarmichaelZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroNormalDer) { + TestKey(kDualNonZeroNormalDer, kDualNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroShortDer) { + TestKey(kDualNonZeroShortDer, kDualNonZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroNormalDer) { + TestKey(kDualZeroNormalDer, kDualZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroShortDer) { + TestKey(kDualZeroShortDer, kDualZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerNonZeroNormalDer) { + TestKey(kEulerNonZeroNormalDer, kEulerNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerZeroNormalDer) { + TestKey(kEulerZeroNormalDer, kEulerZeroNormalDerLen); +} + +// This tests that two sessions can use different RSA keys simultaneously. +TEST_F(OEMCryptoLoadsCertificate, TestMultipleRSAKeys) { + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s1; // Session s1 loads the default rsa key, but doesn't use it + // until after s2 uses its key. + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_NO_FATAL_FAILURE(s1.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s1.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + Session s2; // Session s2 uses a different rsa key. + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo4_2048, + kTestRSAPKCS8PrivateKeyInfo4_2048 + + sizeof(kTestRSAPKCS8PrivateKeyInfo4_2048)); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + ASSERT_NO_FATAL_FAILURE(s2.open()); + ASSERT_NO_FATAL_FAILURE(s2.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s2.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + LicenseRoundTrip license_messages2(&s2); + ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s2.TestDecryptCTR()); + s2.close(); + + // After s2 has loaded its rsa key, we continue using s1's key. + LicenseRoundTrip license_messages1(&s1); + ASSERT_NO_FATAL_FAILURE(license_messages1.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages1.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages1.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages1.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s1.TestDecryptCTR()); +} + +// This tests the maximum number of DRM private keys that OEMCrypto can load +TEST_F(OEMCryptoLoadsCertificate, TestMaxDRMKeys) { + const size_t max_total_keys = GetResourceValue(kMaxTotalDRMPrivateKeys); + std::vector> sessions; + std::vector> licenses; + + // It should be able to load up to kMaxTotalDRMPrivateKeys keys + for (size_t i = 0; i < max_total_keys; i++) { + sessions.push_back(std::unique_ptr(new Session())); + licenses.push_back(std::unique_ptr( + new LicenseRoundTrip(sessions[i].get()))); + const size_t key_index = i % kTestRSAPKCS8PrivateKeys_2048.size(); + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeys_2048[key_index].begin(), + kTestRSAPKCS8PrivateKeys_2048[key_index].end()); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + ASSERT_NO_FATAL_FAILURE(sessions[i]->open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(sessions[i].get())); + } + + // Attempts to load one more key than the kMaxTotalDRMPrivateKeys + if (global_features.provisioning_method == OEMCrypto_BootCertificateChain) { + Session s; + const size_t buffer_size = 5000; // Make sure it is large enough. + std::vector public_key(buffer_size); + size_t public_key_size = buffer_size; + std::vector public_key_signature(buffer_size); + size_t public_key_signature_size = buffer_size; + std::vector wrapped_private_key(buffer_size); + size_t wrapped_private_key_size = buffer_size; + OEMCrypto_PrivateKeyType key_type; + OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( + s.session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type); + // Key creation is allowed to fail due to resource restriction + if (result != OEMCrypto_SUCCESS) { + ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || + result == OEMCrypto_ERROR_TOO_MANY_KEYS); + } + } else { + Session s; + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo2_2048, + kTestRSAPKCS8PrivateKeyInfo2_2048 + + sizeof(kTestRSAPKCS8PrivateKeyInfo2_2048)); + Session ps; + ProvisioningRoundTrip provisioning_messages(&ps, encoded_rsa_key_); + provisioning_messages.PrepareSession(keybox_); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); + OEMCryptoResult result = provisioning_messages.LoadResponse(); + // Key loading is allowed to fail due to resource restriction + if (result != OEMCrypto_SUCCESS) { + ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || + result == OEMCrypto_ERROR_TOO_MANY_KEYS); + } + } + // Verifies that the DRM keys which are already loaded should still function + for (size_t i = 0; i < licenses.size(); i++) { + ASSERT_NO_FATAL_FAILURE(licenses[i]->SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(licenses[i]->CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(licenses[i]->EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, licenses[i]->LoadResponse()); + ASSERT_NO_FATAL_FAILURE(sessions[i]->TestDecryptCTR()); + } +} + +// Devices that load certificates, should at least support RSA 2048 keys. +TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) { + ASSERT_NE(0u, + OEMCrypto_Supports_RSA_2048bit & OEMCrypto_SupportedCertificates()) + << "Supported certificates is only " << OEMCrypto_SupportedCertificates(); +} + +// This test is not run by default, because it takes a long time and +// is used to measure RSA performance, not test functionality. +TEST_F(OEMCryptoLoadsCertificate, RSAPerformance) { + const std::chrono::milliseconds kTestDuration(5000); + OEMCryptoResult sts; + std::chrono::steady_clock clock; + wvutil::TestSleep::Sleep(kShortSleep); // Make sure we are not nonce limited. + + auto start_time = clock.now(); + int count = 15; + for (int i = 0; i < count; i++) { // Only 20 nonce available. + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + } + auto delta_time = clock.now() - start_time; + const double provision_time = + delta_time / std::chrono::milliseconds(1) / count; + + Session session; + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + start_time = clock.now(); + count = 0; + while (clock.now() - start_time < kTestDuration) { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + const size_t size = 50; + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 0; + sts = OEMCrypto_GenerateRSASignature(s.session_id(), licenseRequest.data(), + licenseRequest.size(), nullptr, + &signature_length, kSign_RSASSA_PSS); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + if (ShouldGenerateCorpus()) { + const std::string file_name = + GetFileName("oemcrypto_generate_rsa_signature_fuzz_seed_corpus"); + OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + fuzzed_structure.padding_scheme = kSign_RSASSA_PSS; + fuzzed_structure.signature_length = signature_length; + // Cipher mode and algorithm. + AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), + sizeof(fuzzed_structure)); + AppendToFile(file_name, + reinterpret_cast(licenseRequest.data()), + licenseRequest.size()); + } + + std::vector signature(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, kSign_RSASSA_PSS); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + count++; + } + delta_time = clock.now() - start_time; + const double license_request_time = + delta_time / std::chrono::milliseconds(1) / count; + + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + vector session_key; + vector enc_session_key; + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); + vector mac_context; + vector enc_context; + s.FillDefaultContext(&mac_context, &enc_context); + + enc_session_key = wvutil::a2b_hex( + "7789c619aa3b9fa3c0a53f57a4abc6" + "02157c8aa57e3c6fb450b0bea22667fb" + "0c3200f9d9d618e397837c720dc2dadf" + "486f33590744b2a4e54ca134ae7dbf74" + "434c2fcf6b525f3e132262f05ea3b3c1" + "198595c0e52b573335b2e8a3debd0d0d" + "d0306f8fcdde4e76476be71342957251" + "e1688c9ca6c1c34ed056d3b989394160" + "cf6937e5ce4d39cc73d11a2e93da21a2" + "fa019d246c852fe960095b32f120c3c2" + "7085f7b64aac344a68d607c0768676ce" + "d4c5b2d057f7601921b453a451e1dea0" + "843ebfef628d9af2784d68e86b730476" + "e136dfe19989de4be30a4e7878efcde5" + "ad2b1254f80c0c5dd3cf111b56572217" + "b9f58fc1dacbf74b59d354a1e62cfa0e" + "bf"); + start_time = clock.now(); + while (clock.now() - start_time < kTestDuration) { + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + s.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), + mac_context.size(), enc_context.data(), enc_context.size())); + count++; + } + delta_time = clock.now() - start_time; + const double derive_keys_time = + delta_time / std::chrono::milliseconds(1) / count; + + OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); + printf("PERF:head, security, provision (ms), lic req(ms), derive keys(ms)\n"); + printf("PERF:stat, %u, %8.3f, %8.3f, %8.3f\n", + static_cast(level), provision_time, license_request_time, + derive_keys_time); +} + +// Test DeriveKeysFromSessionKey using the maximum size for the HMAC context. +TEST_F(OEMCryptoUsesCertificate, GenerateDerivedKeysLargeBuffer) { + vector session_key; + vector enc_session_key; + ASSERT_TRUE(session_.GenerateSessionKey(&session_key, &enc_session_key)); + const size_t max_size = GetResourceValue(kLargeMessageSize); + vector mac_context(max_size); + vector enc_context(max_size); + // Stripe the data so the two vectors are not identical, and not all zeroes. + for (size_t i = 0; i < max_size; i++) { + mac_context[i] = i % 0x100; + enc_context[i] = (3 * i) % 0x100; + } + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + session_.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), mac_context.size(), + enc_context.data(), enc_context.size())); +} + } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_provisioning_test.h b/oemcrypto/test/oemcrypto_provisioning_test.h index 2233842..b44369c 100644 --- a/oemcrypto/test/oemcrypto_provisioning_test.h +++ b/oemcrypto/test/oemcrypto_provisioning_test.h @@ -10,6 +10,7 @@ #include #include "OEMCryptoCENC.h" +#include "oec_extra_test_keys.h" #include "oemcrypto_basic_test.h" #include "oemcrypto_license_test.h" #include "oemcrypto_resource_test.h" @@ -35,10 +36,37 @@ class OEMCryptoKeyboxTest : public OEMCryptoClientTest { }; // This class is for tests that have an OEM Certificate instead of a keybox. -class OEMCryptoProv30Test : public OEMCryptoClientTest {}; +class OEMCryptoProv30Test : public OEMCryptoClientTest { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } + } +}; // This class is for tests that have boot certificate chain instead of a keybox. -class OEMCryptoProv40Test : public OEMCryptoClientTest {}; +class OEMCryptoProv40Test : public OEMCryptoClientTest { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for Prov 4.0 devices only."; + } + } +}; + +class OEMCryptoProv40CastTest : public OEMCryptoClientTest, + public testing::WithParamInterface { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (!global_features.cast_receiver) { + GTEST_SKIP() << "Test for cast devices only."; + } + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for Prov 4.0 devices only."; + } + } +}; // // Certificate Root of Trust Tests @@ -111,6 +139,31 @@ class OEMCryptoLoadsCertificate : public OEMCryptoSessionTestKeyboxTest { } }; +// These tests are run by all L1 devices that load and use certificates. It is +// also run by a few L3 devices that use a baked in certificate, but cannot load +// a certificate. +class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate { + protected: + void SetUp() override { + OEMCryptoLoadsCertificate::SetUp(); + ASSERT_NO_FATAL_FAILURE(session_.open()); + if (global_features.derive_key_method == + DeviceFeatures::LOAD_TEST_RSA_KEY) { + ASSERT_NO_FATAL_FAILURE(session_.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + } else { + InstallTestDrmKey(&session_); + } + } + + void TearDown() override { + ASSERT_NO_FATAL_FAILURE(session_.close()); + OEMCryptoLoadsCertificate::TearDown(); + } + + Session session_; +}; + } // namespace wvoec #endif // CDM_OEMCRYPTO_PROVISIONING_TEST_ \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_security_test.cpp b/oemcrypto/test/oemcrypto_security_test.cpp index dc39198..af9b046 100644 --- a/oemcrypto/test/oemcrypto_security_test.cpp +++ b/oemcrypto/test/oemcrypto_security_test.cpp @@ -984,6 +984,9 @@ TEST_P(OEMCryptoGenericCryptoTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeHeaderBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -1011,6 +1014,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1035,6 +1041,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryDeactivateUsageEntryForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; std::string pst("pst"); @@ -1054,6 +1063,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeader) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -1078,6 +1090,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P( OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeaderStartingHeaderLengthFrom1) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1094,6 +1109,9 @@ TEST_P( TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1121,6 +1139,9 @@ TEST_P(OEMCryptoUsageTableTest, } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1147,6 +1168,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1167,6 +1191,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryShrinkUsageTableHeaderForHugeHeaderBufferLength) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } LicenseWithUsageEntry entry0; entry0.set_pst("pst 0"); entry0.MakeOfflineAndClose(this); diff --git a/oemcrypto/test/oemcrypto_session_tests_helper.cpp b/oemcrypto/test/oemcrypto_session_tests_helper.cpp index 48e163f..2a3d525 100644 --- a/oemcrypto/test/oemcrypto_session_tests_helper.cpp +++ b/oemcrypto/test/oemcrypto_session_tests_helper.cpp @@ -167,4 +167,45 @@ void SessionUtil::CreateProv4DRMKey() { drm_public_key_ = provisioning_messages.drm_public_key(); } +// Requires stage 1 prov4 to be complete, ie OEM key is available +void SessionUtil::CreateProv4CastKey(Session* s, + bool load_drm_before_prov_req) { + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + FAIL() << "Provisioning 4.0 is required."; + } + + Provisioning40CastRoundTrip prov_cast(s, encoded_rsa_key_); + + // Calls GenerateCertificateKeyPair(). Generated keys stored in + // prov_cast.drm_public_key_ and prov_cast.wrapped_drm_key_ + ASSERT_NO_FATAL_FAILURE(prov_cast.PrepareSession()); + + // Can choose to load DRM key before preparing the provisioning request, or + // after + if (load_drm_before_prov_req) { + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + } + ASSERT_NO_FATAL_FAILURE(s->SetPublicKeyFromSubjectPublicKey( + prov_cast.drm_key_type(), prov_cast.drm_public_key().data(), + prov_cast.drm_public_key().size())); + ASSERT_NO_FATAL_FAILURE(prov_cast.SignAndVerifyRequest()); + if (!load_drm_before_prov_req) { + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + } + + // Generate derived keys in order to verify and decrypt response. + // We are cheating a little bit here since this GenerateDerivedKeys helper + // simulates work on both client side (calls + // OEMCrypto_GenerateDerivedKeysFromSessionKey) and server side (sets + // key_deriver() keys used to create response) + ASSERT_NO_FATAL_FAILURE(s->GenerateDerivedKeysFromSessionKey()); + + // Response is provisioning 2 with CAST key + ASSERT_NO_FATAL_FAILURE(prov_cast.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(prov_cast.EncryptAndSignResponse()); + + // Should parse and load successfully + ASSERT_EQ(OEMCrypto_SUCCESS, prov_cast.LoadResponse()); +} + } // namespace wvoec diff --git a/oemcrypto/test/oemcrypto_session_tests_helper.h b/oemcrypto/test/oemcrypto_session_tests_helper.h index b29f37e..1b35239 100644 --- a/oemcrypto/test/oemcrypto_session_tests_helper.h +++ b/oemcrypto/test/oemcrypto_session_tests_helper.h @@ -44,6 +44,8 @@ class SessionUtil { // Create a new DRM Cert. Only for provisioning 4.0 void CreateProv4DRMKey(); + void CreateProv4CastKey(Session *s, bool load_drm_before_prov_req); + // Used by prov2.0, prov3.0, and prov 4.0 std::vector encoded_rsa_key_; std::vector wrapped_drm_key_; diff --git a/oemcrypto/test/oemcrypto_test.cpp b/oemcrypto/test/oemcrypto_test.cpp index 01647b0..4452e93 100644 --- a/oemcrypto/test/oemcrypto_test.cpp +++ b/oemcrypto/test/oemcrypto_test.cpp @@ -87,11 +87,8 @@ #include "test_sleep.h" #include "wvcrc32.h" -using ::testing::Bool; -using ::testing::Combine; using ::testing::Range; using ::testing::tuple; -using ::testing::Values; using ::testing::WithParamInterface; using namespace std; @@ -294,6 +291,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysAPI17) { } TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -344,6 +344,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, */ TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysNoEntitlementKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } license_messages_.set_license_type(OEMCrypto_EntitlementLicense); ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); @@ -380,6 +383,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysWrongEntitlementKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -414,6 +420,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysWrongEntitledKeySessionAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -452,6 +461,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysOemcryptoSessionAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -942,11 +954,7 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); - // Setup another session. - Session session2; - ASSERT_NO_FATAL_FAILURE(session2.open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session2)); - ASSERT_NO_FATAL_FAILURE(session2.GenerateDerivedKeysFromSessionKey()); + // Setup an entitled key session in the first OEMCrypto session. uint32_t key_session_id; OEMCryptoResult sts = OEMCrypto_CreateEntitledKeySession( @@ -957,7 +965,12 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { entitled_message.SetEntitledKeySession(key_session_id); ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); - // Now reassociate the entitled key session to the second OEMCrypto session. + // Setup another session. + Session session2; + ASSERT_NO_FATAL_FAILURE(session2.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session2)); + // session2 does not have entitlement keys. Re-associating the entitled key + // session to session2 should fail OEMCryptoResult status = OEMCrypto_ReassociateEntitledKeySession( key_session_id, session2.session_id()); if (status == OEMCrypto_ERROR_NOT_IMPLEMENTED && @@ -965,15 +978,39 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { GTEST_SKIP() << "Skipping test because " "OEMCrypto_ReassociateEntitledKeySession not implemented."; } - ASSERT_EQ(OEMCrypto_SUCCESS, status); - // session2 does not have entitlement keys. - ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(false)); + EXPECT_NE(OEMCrypto_SUCCESS, status); + + // session2 loads the correct entitlement keys. + LicenseRoundTrip license_messages2(&session2); + license_messages2.set_license_type(OEMCrypto_EntitlementLicense); + ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); + // Re-associating to session2 should succeed. + ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( + key_session_id, session2.session_id())); // Now reassociate the entitled key session back to the first OEMCrypto // session. ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( key_session_id, session_.session_id())); ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); + + // session3 has unmatched key policies + Session session3; + ASSERT_NO_FATAL_FAILURE(session3.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session3)); + LicenseRoundTrip license_messages3(&session3); + license_messages3.set_license_type(OEMCrypto_EntitlementLicense); + license_messages3.set_control(license_messages_.control() + 1); + ASSERT_NO_FATAL_FAILURE(license_messages3.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages3.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages3.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages3.LoadResponse()); + // Re-associating to session3 should fail. + EXPECT_NE(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( + key_session_id, session3.session_id())); } /// @} @@ -1376,233 +1413,6 @@ INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoLicenseOverflowTest, /// @addtogroup cas /// @{ -// Used to test the different HDCP versions. This test is parameterized by the -// required HDCP version in the key control block. -class OEMCryptoSessionTestLoadCasKeysWithHDCP : public OEMCryptoSessionTests, - public WithParamInterface { - protected: - void LoadCasKeysWithHDCP(OEMCrypto_HDCP_Capability version) { - OEMCryptoResult sts; - OEMCrypto_HDCP_Capability current, maximum; - sts = OEMCrypto_GetHDCPCapability(¤t, &maximum); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&s)); - LicenseRoundTrip license_messages(&s); - license_messages.set_control((version << wvoec::kControlHDCPVersionShift) | - wvoec::kControlObserveHDCP | - wvoec::kControlHDCPRequired); - license_messages.set_license_type(OEMCrypto_EntitlementLicense); - ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); - - uint32_t key_session_id; - sts = OEMCrypto_CreateEntitledKeySession(s.session_id(), &key_session_id); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - EntitledMessage entitled_message_1(&license_messages); - entitled_message_1.FillKeyArray(); - entitled_message_1.SetEntitledKeySession(key_session_id); - - if (((version <= HDCP_V2_3 || current >= HDCP_V1_0) && version > current) || - (current == HDCP_V1 && version >= HDCP_V1_0)) { - ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( - /*load_even=*/true, /*load_odd=*/true, - OEMCrypto_ERROR_INSUFFICIENT_HDCP)) - << "Failed when current HDCP = " << HDCPCapabilityAsString(current) - << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) - << ", license HDCP = " << HDCPCapabilityAsString(version); - } else { - ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( - /*load_even=*/true, /*load_odd=*/true, OEMCrypto_SUCCESS)) - << "Failed when current HDCP = " << HDCPCapabilityAsString(current) - << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) - << ", license HDCP = " << HDCPCapabilityAsString(version); - } - } -}; - -TEST_P(OEMCryptoSessionTestLoadCasKeysWithHDCP, CasOnlyLoadCasKeysAPI17) { - // Test parameterized by HDCP version. - LoadCasKeysWithHDCP(static_cast(GetParam())); -} -INSTANTIATE_TEST_SUITE_P(TestHDCP, OEMCryptoSessionTestLoadCasKeysWithHDCP, - Range(1, 6)); -/// @} - -/// @addtogroup renewal -/// @{ - -// -// Load, Refresh Keys Test -// - -// This class is for the refresh tests that should only be run on licenses with -// a core message. -class OEMCryptoRefreshTestAPI16 : public OEMCryptoRefreshTest {}; - -// Refresh keys should work if the license uses a nonce. -TEST_P(OEMCryptoRefreshTest, RefreshWithNonce) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// Refresh keys should work if the license does not use a nonce. -TEST_P(OEMCryptoRefreshTest, RefreshNoNonce) { - license_messages_.set_control(0); - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// Refresh keys should NOT work if a license has not been loaded. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshNoLicense) { - Session s; - s.open(); - constexpr size_t message_size = kMaxCoreMessage + 42; - std::vector data(message_size); - for (size_t i = 0; i < data.size(); i++) data[i] = i & 0xFF; - size_t gen_signature_length = 0; - size_t core_message_length = 0; - OEMCryptoResult sts = OEMCrypto_PrepAndSignRenewalRequest( - s.session_id(), data.data(), data.size(), &core_message_length, nullptr, - &gen_signature_length); - ASSERT_LT(core_message_length, message_size); - if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { - vector gen_signature(gen_signature_length); - sts = OEMCrypto_PrepAndSignRenewalRequest( - s.session_id(), data.data(), data.size(), &core_message_length, - gen_signature.data(), &gen_signature_length); - } - ASSERT_NE(OEMCrypto_SUCCESS, sts); -} - -// Refresh keys should fail if the nonce is not in the session. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadNonce) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - renewal_messages.core_request().nonce ^= 42; - LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); -} - -// Refresh keys should fail if the session_id does not match the license. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadSessionID) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - renewal_messages.core_request().session_id += 1; - LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); -} - -// Refresh keys should handle the maximum message size. -TEST_P(OEMCryptoRefreshTest, RefreshLargeBuffer) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - const size_t max_size = GetResourceValue(kLargeMessageSize); - renewal_messages.set_message_size(max_size); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// This situation would occur if an app only uses one key in the license. When -// that happens, SelectKey would be called before the first decrypt, and then -// would not need to be called again, even if the license is refreshed. -TEST_P(OEMCryptoRefreshTest, RefreshWithNoSelectKey) { - LoadLicense(); - - // Call select key before the refresh. No calls below to TestDecryptCTR with - // select key set to true. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true)); - - // This should still be valid key, even if the refresh failed, because this - // is before the original license duration. - wvutil::TestSleep::Sleep(kShortSleep); - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); - - // This should be after duration of the original license, but before the - // expiration of the refresh message. This should fail until we have loaded - // the renewal. - wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); - - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); - - // After we've loaded the renewal, decrypt should succeed again. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); -} - -// Test that playback clock is correctly started and that the license can be -// renewed. -TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadSuccess) { - license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; - timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. - timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. - // First version to support Renew on Load. - constexpr uint32_t kFeatureVersion = 18; - - // Loading the license should start the playback clock. - LoadLicense(); - // Sleep until just after rental window is over. - wvutil::TestSleep::Sleep(kDuration + kShortSleep); - if (license_api_version_ < kFeatureVersion || - global_features.api_version < kFeatureVersion) { - // If the feature is not supported, then we expect failure because the - // playback clock was not started and we are outside the rental window. - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(true, OEMCrypto_ERROR_KEY_EXPIRED)); - return; - } else { - // If the feature is supported, we expect decrypt to work because we are - // still within the initial renewal window, and the playback clock should - // have started. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true, OEMCrypto_SUCCESS)); - } - // This is after the initial renewal duration, so we expect failure before - // loading the renewal. - wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); - - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); - - // After we've loaded the renewal, decrypt should succeed again. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); -} - -TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadOutsideRentalDuration) { - license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; - timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. - timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. - - // Sleep until just after rental window is over. - wvutil::TestSleep::Sleep(kDuration + kShortSleep); - // Loading the license should start the playback clock. - LoadLicense(); - // If the license is loaded after the rental duration window, we expect - // failure. - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_UNKNOWN_FAILURE)); - return; -} - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoRefreshTest, - Range(kCurrentAPI - 1, kCurrentAPI + 1)); - -// These tests only work when the license has a core message. -INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoRefreshTestAPI16, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); - /// @} /// @addtogroup security @@ -1739,6 +1549,9 @@ TEST_F(OEMCryptoLoadsCertificate, TEST_F( OEMCryptoLoadsCertificate, OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyLengthProv30) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } TestLoadProvisioningForOutOfRangeSubstringOffsetAndLengths( [](size_t response_message_length, ProvisioningRoundTrip* provisioning_messages) { @@ -1752,6 +1565,9 @@ TEST_F( TEST_F( OEMCryptoLoadsCertificate, OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyOffsetProv30) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } TestLoadProvisioningForOutOfRangeSubstringOffsetAndLengths( [](size_t response_message_length, ProvisioningRoundTrip* provisioning_messages) { @@ -1764,201 +1580,6 @@ TEST_F( /// @} -/// @addtogroup provision -/// @{ - -// Test that a wrapped RSA key can be loaded. -TEST_F(OEMCryptoLoadsCertificate, LoadWrappedRSAKey) { - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); -} - -class OEMCryptoLoadsCertVariousKeys : public OEMCryptoLoadsCertificate { - public: - void TestKey(const uint8_t* key, size_t key_length) { - encoded_rsa_key_.assign(key, key + key_length); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - LicenseRoundTrip license_messages(&s); - ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR()); - } -}; - -// Test a 3072 bit RSA key certificate. -TEST_F(OEMCryptoLoadsCertVariousKeys, TestLargeRSAKey3072) { - TestKey(kTestRSAPKCS8PrivateKeyInfo3_3072, - sizeof(kTestRSAPKCS8PrivateKeyInfo3_3072)); -} - -// Test an RSA key certificate which has a private key generated using the -// Carmichael totient. -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelRSAKey) { - TestKey(kTestKeyRSACarmichael_2048, sizeof(kTestKeyRSACarmichael_2048)); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroNormalDer) { - TestKey(kCarmichaelNonZeroNormalDer, kCarmichaelNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroShortDer) { - TestKey(kCarmichaelNonZeroShortDer, kCarmichaelNonZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroNormalDer) { - TestKey(kCarmichaelZeroNormalDer, kCarmichaelZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroShortDer) { - TestKey(kCarmichaelZeroShortDer, kCarmichaelZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroNormalDer) { - TestKey(kDualNonZeroNormalDer, kDualNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroShortDer) { - TestKey(kDualNonZeroShortDer, kDualNonZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroNormalDer) { - TestKey(kDualZeroNormalDer, kDualZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroShortDer) { - TestKey(kDualZeroShortDer, kDualZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerNonZeroNormalDer) { - TestKey(kEulerNonZeroNormalDer, kEulerNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerZeroNormalDer) { - TestKey(kEulerZeroNormalDer, kEulerZeroNormalDerLen); -} - -// This tests that two sessions can use different RSA keys simultaneously. -TEST_F(OEMCryptoLoadsCertificate, TestMultipleRSAKeys) { - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s1; // Session s1 loads the default rsa key, but doesn't use it - // until after s2 uses its key. - ASSERT_NO_FATAL_FAILURE(s1.open()); - ASSERT_NO_FATAL_FAILURE(s1.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s1.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - Session s2; // Session s2 uses a different rsa key. - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo4_2048, - kTestRSAPKCS8PrivateKeyInfo4_2048 + - sizeof(kTestRSAPKCS8PrivateKeyInfo4_2048)); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - ASSERT_NO_FATAL_FAILURE(s2.open()); - ASSERT_NO_FATAL_FAILURE(s2.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s2.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - LicenseRoundTrip license_messages2(&s2); - ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s2.TestDecryptCTR()); - s2.close(); - - // After s2 has loaded its rsa key, we continue using s1's key. - LicenseRoundTrip license_messages1(&s1); - ASSERT_NO_FATAL_FAILURE(license_messages1.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages1.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages1.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages1.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s1.TestDecryptCTR()); -} - -// This tests the maximum number of DRM private keys that OEMCrypto can load -TEST_F(OEMCryptoLoadsCertificate, TestMaxDRMKeys) { - const size_t max_total_keys = GetResourceValue(kMaxTotalDRMPrivateKeys); - std::vector> sessions; - std::vector> licenses; - - // It should be able to load up to kMaxTotalDRMPrivateKeys keys - for (size_t i = 0; i < max_total_keys; i++) { - sessions.push_back(std::unique_ptr(new Session())); - licenses.push_back(std::unique_ptr( - new LicenseRoundTrip(sessions[i].get()))); - const size_t key_index = i % kTestRSAPKCS8PrivateKeys_2048.size(); - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeys_2048[key_index].begin(), - kTestRSAPKCS8PrivateKeys_2048[key_index].end()); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - ASSERT_NO_FATAL_FAILURE(sessions[i]->open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(sessions[i].get())); - } - - // Attempts to load one more key than the kMaxTotalDRMPrivateKeys - if (global_features.provisioning_method == OEMCrypto_BootCertificateChain) { - Session s; - const size_t buffer_size = 5000; // Make sure it is large enough. - std::vector public_key(buffer_size); - size_t public_key_size = buffer_size; - std::vector public_key_signature(buffer_size); - size_t public_key_signature_size = buffer_size; - std::vector wrapped_private_key(buffer_size); - size_t wrapped_private_key_size = buffer_size; - OEMCrypto_PrivateKeyType key_type; - OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( - s.session_id(), public_key.data(), &public_key_size, - public_key_signature.data(), &public_key_signature_size, - wrapped_private_key.data(), &wrapped_private_key_size, &key_type); - // Key creation is allowed to fail due to resource restriction - if (result != OEMCrypto_SUCCESS) { - ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || - result == OEMCrypto_ERROR_TOO_MANY_KEYS); - } - } else { - Session s; - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo2_2048, - kTestRSAPKCS8PrivateKeyInfo2_2048 + - sizeof(kTestRSAPKCS8PrivateKeyInfo2_2048)); - Session ps; - ProvisioningRoundTrip provisioning_messages(&ps, encoded_rsa_key_); - provisioning_messages.PrepareSession(keybox_); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); - OEMCryptoResult result = provisioning_messages.LoadResponse(); - // Key loading is allowed to fail due to resource restriction - if (result != OEMCrypto_SUCCESS) { - ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || - result == OEMCrypto_ERROR_TOO_MANY_KEYS); - } - } - // Verifies that the DRM keys which are already loaded should still function - for (size_t i = 0; i < licenses.size(); i++) { - ASSERT_NO_FATAL_FAILURE(licenses[i]->SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(licenses[i]->CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(licenses[i]->EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, licenses[i]->LoadResponse()); - ASSERT_NO_FATAL_FAILURE(sessions[i]->TestDecryptCTR()); - } -} - -// Devices that load certificates, should at least support RSA 2048 keys. -TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) { - ASSERT_NE(0u, - OEMCrypto_Supports_RSA_2048bit & OEMCrypto_SupportedCertificates()) - << "Supported certificates is only " << OEMCrypto_SupportedCertificates(); -} - -/// @} - /// @addtogroup security /// @{ @@ -1991,1794 +1612,8 @@ TEST_F(OEMCryptoLoadsCertificate, /// @} -/// @addtogroup provision -/// @{ - -// These tests are run by all L1 devices that load and use certificates. It is -// also run by a few L3 devices that use a baked in certificate, but cannot load -// a certificate. -class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate { - protected: - void SetUp() override { - OEMCryptoLoadsCertificate::SetUp(); - ASSERT_NO_FATAL_FAILURE(session_.open()); - if (global_features.derive_key_method == - DeviceFeatures::LOAD_TEST_RSA_KEY) { - ASSERT_NO_FATAL_FAILURE(session_.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - } else { - InstallTestDrmKey(&session_); - } - } - - void TearDown() override { - ASSERT_NO_FATAL_FAILURE(session_.close()); - OEMCryptoLoadsCertificate::TearDown(); - } - - Session session_; -}; - -// This test is not run by default, because it takes a long time and -// is used to measure RSA performance, not test functionality. -TEST_F(OEMCryptoLoadsCertificate, RSAPerformance) { - const std::chrono::milliseconds kTestDuration(5000); - OEMCryptoResult sts; - std::chrono::steady_clock clock; - wvutil::TestSleep::Sleep(kShortSleep); // Make sure we are not nonce limited. - - auto start_time = clock.now(); - int count = 15; - for (int i = 0; i < count; i++) { // Only 20 nonce available. - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - } - auto delta_time = clock.now() - start_time; - const double provision_time = - delta_time / std::chrono::milliseconds(1) / count; - - Session session; - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - start_time = clock.now(); - count = 0; - while (clock.now() - start_time < kTestDuration) { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - const size_t size = 50; - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 0; - sts = OEMCrypto_GenerateRSASignature(s.session_id(), licenseRequest.data(), - licenseRequest.size(), nullptr, - &signature_length, kSign_RSASSA_PSS); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - if (ShouldGenerateCorpus()) { - const std::string file_name = - GetFileName("oemcrypto_generate_rsa_signature_fuzz_seed_corpus"); - OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; - fuzzed_structure.padding_scheme = kSign_RSASSA_PSS; - fuzzed_structure.signature_length = signature_length; - // Cipher mode and algorithm. - AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), - sizeof(fuzzed_structure)); - AppendToFile(file_name, - reinterpret_cast(licenseRequest.data()), - licenseRequest.size()); - } - - std::vector signature(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, kSign_RSASSA_PSS); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - count++; - } - delta_time = clock.now() - start_time; - const double license_request_time = - delta_time / std::chrono::milliseconds(1) / count; - - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - vector session_key; - vector enc_session_key; - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); - vector mac_context; - vector enc_context; - s.FillDefaultContext(&mac_context, &enc_context); - - enc_session_key = wvutil::a2b_hex( - "7789c619aa3b9fa3c0a53f57a4abc6" - "02157c8aa57e3c6fb450b0bea22667fb" - "0c3200f9d9d618e397837c720dc2dadf" - "486f33590744b2a4e54ca134ae7dbf74" - "434c2fcf6b525f3e132262f05ea3b3c1" - "198595c0e52b573335b2e8a3debd0d0d" - "d0306f8fcdde4e76476be71342957251" - "e1688c9ca6c1c34ed056d3b989394160" - "cf6937e5ce4d39cc73d11a2e93da21a2" - "fa019d246c852fe960095b32f120c3c2" - "7085f7b64aac344a68d607c0768676ce" - "d4c5b2d057f7601921b453a451e1dea0" - "843ebfef628d9af2784d68e86b730476" - "e136dfe19989de4be30a4e7878efcde5" - "ad2b1254f80c0c5dd3cf111b56572217" - "b9f58fc1dacbf74b59d354a1e62cfa0e" - "bf"); - start_time = clock.now(); - while (clock.now() - start_time < kTestDuration) { - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - s.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), - mac_context.size(), enc_context.data(), enc_context.size())); - count++; - } - delta_time = clock.now() - start_time; - const double derive_keys_time = - delta_time / std::chrono::milliseconds(1) / count; - - OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); - printf("PERF:head, security, provision (ms), lic req(ms), derive keys(ms)\n"); - printf("PERF:stat, %u, %8.3f, %8.3f, %8.3f\n", - static_cast(level), provision_time, license_request_time, - derive_keys_time); -} - -// Test DeriveKeysFromSessionKey using the maximum size for the HMAC context. -TEST_F(OEMCryptoUsesCertificate, GenerateDerivedKeysLargeBuffer) { - vector session_key; - vector enc_session_key; - ASSERT_TRUE(session_.GenerateSessionKey(&session_key, &enc_session_key)); - const size_t max_size = GetResourceValue(kLargeMessageSize); - vector mac_context(max_size); - vector enc_context(max_size); - // Stripe the data so the two vectors are not identical, and not all zeroes. - for (size_t i = 0; i < max_size; i++) { - mac_context[i] = i % 0x100; - enc_context[i] = (3 * i) % 0x100; - } - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - session_.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), mac_context.size(), - enc_context.data(), enc_context.size())); -} - -/// @} - /// @addtogroup cast /// @{ -// This test attempts to use alternate algorithms for loaded device certs. -class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate { - protected: - void DisallowForbiddenPadding(RSA_Padding_Scheme scheme, size_t size) { - OEMCryptoResult sts; - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - // Sign a Message - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 256; - vector signature(signature_length); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - // Allow OEMCrypto to request a full buffer. - if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { - ASSERT_NE(static_cast(0), signature_length); - signature.assign(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - } - - EXPECT_NE(OEMCrypto_SUCCESS, sts) - << "Signed with forbidden padding scheme=" << (int)scheme - << ", size=" << (int)size; - const vector zero(signature.size(), 0); - ASSERT_EQ(zero, signature); // signature should not be computed. - } - - void TestSignature(RSA_Padding_Scheme scheme, size_t size) { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 0; - OEMCryptoResult sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), nullptr, - &signature_length, scheme); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - std::vector signature(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - - ASSERT_EQ(OEMCrypto_SUCCESS, sts) - << "Failed to sign with padding scheme=" << (int)scheme - << ", size=" << size; - signature.resize(signature_length); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( - licenseRequest, signature.data(), signature_length, scheme)); - } - - void DisallowDeriveKeys() { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - s.GenerateNonce(); - vector session_key; - vector enc_session_key; - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); - vector mac_context; - vector enc_context; - s.FillDefaultContext(&mac_context, &enc_context); - ASSERT_NE(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - s.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), - mac_context.size(), enc_context.data(), enc_context.size())); - } - - // If force is true, we assert that the key loads successfully. - void LoadWithAllowedSchemes(uint32_t schemes, bool force) { - Session s; - ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); - provisioning_messages.set_allowed_schemes(schemes); - provisioning_messages.PrepareSession(keybox_); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); - OEMCryptoResult sts = provisioning_messages.LoadResponse(); - key_loaded_ = (OEMCrypto_SUCCESS == sts); - if (key_loaded_) { - uint8_t* ptr = provisioning_messages.response_data().rsa_key; - size_t len = provisioning_messages.response_data().rsa_key_length; - encoded_rsa_key_ = std::vector(ptr, ptr + len); - wrapped_drm_key_ = provisioning_messages.wrapped_rsa_key(); - drm_key_type_ = OEMCrypto_RSA_Private_Key; - EXPECT_GT(wrapped_drm_key_.size(), 0u); - EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); - } - if (force) { - EXPECT_EQ(OEMCrypto_SUCCESS, sts); - } - } - - bool key_loaded_ = false; -}; - -// The alternate padding is only required for cast receivers, but all devices -// should forbid the alternate padding for regular certificates. -TEST_F(OEMCryptoLoadsCertificateAlternates, DisallowForbiddenPaddingAPI09) { - LoadWithAllowedSchemes(kSign_RSASSA_PSS, true); // Use default padding scheme - DisallowForbiddenPadding(kSign_PKCS1_Block1, 50); -} - -// The alternate padding is only required for cast receivers, but if a device -// does load an alternate certificate, it should NOT use it for generating -// a license request signature. -TEST_F(OEMCryptoLoadsCertificateAlternates, TestSignaturePKCS1) { - // Try to load an RSA key with alternative padding schemes. This signing - // scheme is used by cast receivers. - LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); - // If the device is a cast receiver, then this scheme is required. - if (global_features.cast_receiver) { - ASSERT_TRUE(key_loaded_); - } - // If the key loaded with no error, then we will verify that it is not used - // for forbidden padding schemes. - if (key_loaded_) { - // The other padding scheme should fail. - DisallowForbiddenPadding(kSign_RSASSA_PSS, 83); - DisallowDeriveKeys(); - if (global_features.cast_receiver) { - // A signature with a valid size should succeed. - TestSignature(kSign_PKCS1_Block1, 83); - TestSignature(kSign_PKCS1_Block1, 50); - } - // A signature with padding that is too big should fail. - DisallowForbiddenPadding(kSign_PKCS1_Block1, 84); // too big. - } -} - -// This test verifies RSA signing with the alternate padding scheme used by -// Android cast receivers, PKCS1 Block 1. These tests are not required for -// other devices, and should be filtered out by DeviceFeatures::Initialize for -// those devices. -class OEMCryptoCastReceiverTest : public OEMCryptoLoadsCertificateAlternates { - protected: - void SetUp() override { - OEMCryptoLoadsCertificateAlternates::SetUp(); - if (!global_features.cast_receiver) { - GTEST_SKIP() << "OEMCrypto does not support CAST Receiver functionality"; - } - } - - vector encode(uint8_t type, const vector& substring) { - vector result; - result.push_back(type); - if (substring.size() < 0x80) { - uint8_t length = substring.size(); - result.push_back(length); - } else if (substring.size() < 0x100) { - result.push_back(0x81); - uint8_t length = substring.size(); - result.push_back(length); - } else { - result.push_back(0x82); - uint16_t length = substring.size(); - result.push_back(length >> 8); - result.push_back(length & 0xFF); - } - result.insert(result.end(), substring.begin(), substring.end()); - return result; - } - vector concat(const vector& a, const vector& b) { - vector result = a; - result.insert(result.end(), b.begin(), b.end()); - return result; - } - - // This encodes the RSA key used in the PKCS#1 signing tests below. - void BuildRSAKey() { - vector field_n = - encode(0x02, wvutil::a2b_hex("00" - "df271fd25f8644496b0c81be4bd50297" - "ef099b002a6fd67727eb449cea566ed6" - "a3981a71312a141cabc9815c1209e320" - "a25b32464e9999f18ca13a9fd3892558" - "f9e0adefdd3650dd23a3f036d60fe398" - "843706a40b0b8462c8bee3bce12f1f28" - "60c2444cdc6a44476a75ff4aa24273cc" - "be3bf80248465f8ff8c3a7f3367dfc0d" - "f5b6509a4f82811cedd81cdaaa73c491" - "da412170d544d4ba96b97f0afc806549" - "8d3a49fd910992a1f0725be24f465cfe" - "7e0eabf678996c50bc5e7524abf73f15" - "e5bef7d518394e3138ce4944506aaaaf" - "3f9b236dcab8fc00f87af596fdc3d9d6" - "c75cd508362fae2cbeddcc4c7450b17b" - "776c079ecca1f256351a43b97dbe2153")); - vector field_e = encode(0x02, wvutil::a2b_hex("010001")); - vector field_d = - encode(0x02, wvutil::a2b_hex("5bd910257830dce17520b03441a51a8c" - "ab94020ac6ecc252c808f3743c95b7c8" - "3b8c8af1a5014346ebc4242cdfb5d718" - "e30a733e71f291e4d473b61bfba6daca" - "ed0a77bd1f0950ae3c91a8f901118825" - "89e1d62765ee671e7baeea309f64d447" - "bbcfa9ea12dce05e9ea8939bc5fe6108" - "581279c982b308794b3448e7f7b95229" - "2df88c80cb40142c4b5cf5f8ddaa0891" - "678d610e582fcb880f0d707caf47d09a" - "84e14ca65841e5a3abc5e9dba94075a9" - "084341f0edad9b68e3b8e082b80b6e6e" - "8a0547b44fb5061b6a9131603a5537dd" - "abd01d8e863d8922e9aa3e4bfaea0b39" - "d79283ad2cbc8a59cce7a6ecf4e4c81e" - "d4c6591c807defd71ab06866bb5e7745")); - vector field_p = - encode(0x02, wvutil::a2b_hex("00" - "f44f5e4246391f482b2f5296e3602eb3" - "4aa136427710f7c0416d403fd69d4b29" - "130cfebef34e885abdb1a8a0a5f0e9b5" - "c33e1fc3bfc285b1ae17e40cc67a1913" - "dd563719815ebaf8514c2a7aa0018e63" - "b6c631dc315a46235716423d11ff5803" - "4e610645703606919f5c7ce2660cd148" - "bd9efc123d9c54b6705590d006cfcf3f")); - vector field_q = - encode(0x02, wvutil::a2b_hex("00" - "e9d49841e0e0a6ad0d517857133e36dc" - "72c1bdd90f9174b52e26570f373640f1" - "c185e7ea8e2ed7f1e4ebb951f70a5802" - "3633b0097aec67c6dcb800fc1a67f9bb" - "0563610f08ebc8746ad129772136eb1d" - "daf46436450d318332a84982fe5d28db" - "e5b3e912407c3e0e03100d87d436ee40" - "9eec1cf85e80aba079b2e6106b97bced")); - vector field_exp1 = - encode(0x02, wvutil::a2b_hex("00" - "ed102acdb26871534d1c414ecad9a4d7" - "32fe95b10eea370da62f05de2c393b1a" - "633303ea741b6b3269c97f704b352702" - "c9ae79922f7be8d10db67f026a8145de" - "41b30c0a42bf923bac5f7504c248604b" - "9faa57ed6b3246c6ba158e36c644f8b9" - "548fcf4f07e054a56f768674054440bc" - "0dcbbc9b528f64a01706e05b0b91106f")); - vector field_exp2 = - encode(0x02, wvutil::a2b_hex("6827924a85e88b55ba00f8219128bd37" - "24c6b7d1dfe5629ef197925fecaff5ed" - "b9cdf3a7befd8ea2e8dd3707138b3ff8" - "7c3c39c57f439e562e2aa805a39d7cd7" - "9966d2ece7845f1dbc16bee99999e4d0" - "bf9eeca45fcda8a8500035fe6b5f03bc" - "2f6d1bfc4d4d0a3723961af0cdce4a01" - "eec82d7f5458ec19e71b90eeef7dff61")); - vector field_invq = - encode(0x02, wvutil::a2b_hex("57b73888d183a99a6307422277551a3d" - "9e18adf06a91e8b55ceffef9077c8496" - "948ecb3b16b78155cb2a3a57c119d379" - "951c010aa635edcf62d84c5a122a8d67" - "ab5fa9e5a4a8772a1e943bafc70ae3a4" - "c1f0f3a4ddffaefd1892c8cb33bb0d0b" - "9590e963a69110fb34db7b906fc4ba28" - "36995aac7e527490ac952a02268a4f18")); - - // Header of rsa key is constant. - encoded_rsa_key_ = wvutil::a2b_hex( - // 0x02 0x01 0x00 == integer, size 1 byte, value = 0 (field=version) - "020100" - // 0x30, sequence, size = d = 13 (field=pkeyalg) AlgorithmIdentifier - "300d" - // 0x06 = object identifier. length = 9 - // (this should be 1.2.840.113549.1.1.1) (field=algorithm) - "0609" - "2a" // 1*0x40 + 2 = 42 = 0x2a. - "8648" // 840 = 0x348, 0x03 *2 + 0x80 + (0x48>>15) = 0x86. - // 0x48 -> 0x48 - "86f70d" // 113549 = 0x1668d -> (110 , 1110111, 0001101) - // -> (0x80+0x06, 0x80+0x77, 0x0d) - "01" // 1 - "01" // 1 - "01" // 1 - "05" // null object. (field=parameter?) - "00" // size of null object - ); - - vector pkey = wvutil::a2b_hex("020100"); // integer, version = 0. - pkey = concat(pkey, field_n); - pkey = concat(pkey, field_e); - pkey = concat(pkey, field_d); - pkey = concat(pkey, field_p); - pkey = concat(pkey, field_q); - pkey = concat(pkey, field_exp1); - pkey = concat(pkey, field_exp2); - pkey = concat(pkey, field_invq); - pkey = encode(0x30, pkey); - pkey = encode(0x04, pkey); - - encoded_rsa_key_ = concat(encoded_rsa_key_, pkey); - encoded_rsa_key_ = encode(0x30, encoded_rsa_key_); // 0x30=sequence - } - - // This is used to test a signature from the file pkcs1v15sign-vectors.txt. - void TestSignature(RSA_Padding_Scheme scheme, const vector& message, - const vector& correct_signature) { - OEMCryptoResult sts; - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - // The application will compute the SHA-1 Hash of the message, so this - // test must do that also. - uint8_t hash[SHA_DIGEST_LENGTH]; - if (!SHA1(message.data(), message.size(), hash)) { - dump_boringssl_error(); - FAIL() << "boringssl error creating SHA1 hash."; - } - - // The application will prepend the digest info to the hash. - // SHA-1 digest info prefix = 0x30 0x21 0x30 ... - vector digest = wvutil::a2b_hex("3021300906052b0e03021a05000414"); - digest.insert(digest.end(), hash, hash + SHA_DIGEST_LENGTH); - - // OEMCrypto will apply the padding, and encrypt to generate the signature. - size_t signature_length = 0; - sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), - digest.size(), nullptr, - &signature_length, scheme); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - vector signature(signature_length); - sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), - digest.size(), signature.data(), - &signature_length, scheme); - - ASSERT_EQ(OEMCrypto_SUCCESS, sts) - << "Failed to sign with padding scheme=" << (int)scheme - << ", size=" << message.size(); - signature.resize(signature_length); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - - // Verify that the signature matches the official test vector. - ASSERT_EQ(correct_signature.size(), signature_length); - signature.resize(signature_length); - ASSERT_EQ(correct_signature, signature); - - // Also verify that our verification algorithm agrees. This is not needed - // to test OEMCrypto, but it does verify that this test is valid. - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature(digest, signature.data(), - signature_length, scheme)); - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( - digest, correct_signature.data(), correct_signature.size(), scheme)); - } -}; - -// CAST Receivers should report that they support cast certificates. -TEST_F(OEMCryptoCastReceiverTest, SupportsCertificatesAPI13) { - ASSERT_NE(0u, - OEMCrypto_Supports_RSA_CAST & OEMCrypto_SupportedCertificates()); -} - -// # PKCS#1 v1.5 Signature Example 15.1 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_1) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "f45d55f35551e975d6a8dc7ea9f48859" - "3940cc75694a278f27e578a163d839b3" - "4040841808cf9c58c9b8728bf5f9ce8e" - "e811ea91714f47bab92d0f6d5a26fcfe" - "ea6cd93b910c0a2c963e64eb1823f102" - "753d41f0335910ad3a977104f1aaf6c3" - "742716a9755d11b8eed690477f445c5d" - "27208b2e284330fa3d301423fa7f2d08" - "6e0ad0b892b9db544e456d3f0dab85d9" - "53c12d340aa873eda727c8a649db7fa6" - "3740e25e9af1533b307e61329993110e" - "95194e039399c3824d24c51f22b26bde" - "1024cd395958a2dfeb4816a6e8adedb5" - "0b1f6b56d0b3060ff0f1c4cb0d0e001d" - "d59d73be12"); - vector signature = wvutil::a2b_hex( - "b75a5466b65d0f300ef53833f2175c8a" - "347a3804fc63451dc902f0b71f908345" - "9ed37a5179a3b723a53f1051642d7737" - "4c4c6c8dbb1ca20525f5c9f32db77695" - "3556da31290e22197482ceb69906c46a" - "758fb0e7409ba801077d2a0a20eae7d1" - "d6d392ab4957e86b76f0652d68b83988" - "a78f26e11172ea609bf849fbbd78ad7e" - "dce21de662a081368c040607cee29db0" - "627227f44963ad171d2293b633a392e3" - "31dca54fe3082752f43f63c161b447a4" - "c65a6875670d5f6600fcc860a1caeb0a" - "88f8fdec4e564398a5c46c87f68ce070" - "01f6213abe0ab5625f87d19025f08d81" - "dac7bd4586bc9382191f6d2880f6227e" - "5df3eed21e7792d249480487f3655261"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} -// # PKCS#1 v1.5 Signature Example 15.2 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_2) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c14b4c6075b2f9aad661def4ecfd3cb9" - "33c623f4e63bf53410d2f016d1ab98e2" - "729eccf8006cd8e08050737d95fdbf29" - "6b66f5b9792a902936c4f7ac69f51453" - "ce4369452dc22d96f037748114662000" - "dd9cd3a5e179f4e0f81fa6a0311ca1ae" - "e6519a0f63cec78d27bb726393fb7f1f" - "88cde7c97f8a66cd66301281dac3f3a4" - "33248c75d6c2dcd708b6a97b0a3f325e" - "0b2964f8a5819e479b"); - vector signature = wvutil::a2b_hex( - "afa7343462bea122cc149fca70abdae7" - "9446677db5373666af7dc313015f4de7" - "86e6e394946fad3cc0e2b02bedba5047" - "fe9e2d7d099705e4a39f28683279cf0a" - "c85c1530412242c0e918953be000e939" - "cf3bf182525e199370fa7907eba69d5d" - "b4631017c0e36df70379b5db8d4c695a" - "979a8e6173224065d7dc15132ef28cd8" - "22795163063b54c651141be86d36e367" - "35bc61f31fca574e5309f3a3bbdf91ef" - "f12b99e9cc1744f1ee9a1bd22c5bad96" - "ad481929251f0343fd36bcf0acde7f11" - "e5ad60977721202796fe061f9ada1fc4" - "c8e00d6022a8357585ffe9fdd59331a2" - "8c4aa3121588fb6cf68396d8ac054659" - "9500c9708500a5972bd54f72cf8db0c8"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.3 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_3) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "d02371ad7ee48bbfdb2763de7a843b94" - "08ce5eb5abf847ca3d735986df84e906" - "0bdbcdd3a55ba55dde20d4761e1a21d2" - "25c1a186f4ac4b3019d3adf78fe63346" - "67f56f70c901a0a2700c6f0d56add719" - "592dc88f6d2306c7009f6e7a635b4cb3" - "a502dfe68ddc58d03be10a1170004fe7" - "4dd3e46b82591ff75414f0c4a03e605e" - "20524f2416f12eca589f111b75d639c6" - "1baa80cafd05cf3500244a219ed9ced9" - "f0b10297182b653b526f400f2953ba21" - "4d5bcd47884132872ae90d4d6b1f4215" - "39f9f34662a56dc0e7b4b923b6231e30" - "d2676797817f7c337b5ac824ba93143b" - "3381fa3dce0e6aebd38e67735187b1eb" - "d95c02"); - vector signature = wvutil::a2b_hex( - "3bac63f86e3b70271203106b9c79aabd" - "9f477c56e4ee58a4fce5baf2cab4960f" - "88391c9c23698be75c99aedf9e1abf17" - "05be1dac33140adb48eb31f450bb9efe" - "83b7b90db7f1576d33f40c1cba4b8d6b" - "1d3323564b0f1774114fa7c08e6d1e20" - "dd8fbba9b6ac7ad41e26b4568f4a8aac" - "bfd178a8f8d2c9d5f5b88112935a8bc9" - "ae32cda40b8d20375510735096536818" - "ce2b2db71a9772c9b0dda09ae10152fa" - "11466218d091b53d92543061b7294a55" - "be82ff35d5c32fa233f05aaac7585030" - "7ecf81383c111674397b1a1b9d3bf761" - "2ccbe5bacd2b38f0a98397b24c83658f" - "b6c0b4140ef11970c4630d44344e76ea" - "ed74dcbee811dbf6575941f08a6523b8"); - TestSignature(kSign_PKCS1_Block1, message, signature); -}; - -// # PKCS#1 v1.5 Signature Example 15.4 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_4) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "29035584ab7e0226a9ec4b02e8dcf127" - "2dc9a41d73e2820007b0f6e21feccd5b" - "d9dbb9ef88cd6758769ee1f956da7ad1" - "8441de6fab8386dbc693"); - vector signature = wvutil::a2b_hex( - "28d8e3fcd5dddb21ffbd8df1630d7377" - "aa2651e14cad1c0e43ccc52f907f946d" - "66de7254e27a6c190eb022ee89ecf622" - "4b097b71068cd60728a1aed64b80e545" - "7bd3106dd91706c937c9795f2b36367f" - "f153dc2519a8db9bdf2c807430c451de" - "17bbcd0ce782b3e8f1024d90624dea7f" - "1eedc7420b7e7caa6577cef43141a726" - "4206580e44a167df5e41eea0e69a8054" - "54c40eefc13f48e423d7a32d02ed42c0" - "ab03d0a7cf70c5860ac92e03ee005b60" - "ff3503424b98cc894568c7c56a023355" - "1cebe588cf8b0167b7df13adcad82867" - "6810499c704da7ae23414d69e3c0d2db" - "5dcbc2613bc120421f9e3653c5a87672" - "97643c7e0740de016355453d6c95ae72"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.5 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_5) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex("bda3a1c79059eae598308d3df609"); - vector signature = wvutil::a2b_hex( - "a156176cb96777c7fb96105dbd913bc4" - "f74054f6807c6008a1a956ea92c1f81c" - "b897dc4b92ef9f4e40668dc7c556901a" - "cb6cf269fe615b0fb72b30a513386923" - "14b0e5878a88c2c7774bd16939b5abd8" - "2b4429d67bd7ac8e5ea7fe924e20a6ec" - "662291f2548d734f6634868b039aa5f9" - "d4d906b2d0cb8585bf428547afc91c6e" - "2052ddcd001c3ef8c8eefc3b6b2a82b6" - "f9c88c56f2e2c3cb0be4b80da95eba37" - "1d8b5f60f92538743ddbb5da2972c71f" - "e7b9f1b790268a0e770fc5eb4d5dd852" - "47d48ae2ec3f26255a3985520206a1f2" - "68e483e9dbb1d5cab190917606de31e7" - "c5182d8f151bf41dfeccaed7cde690b2" - "1647106b490c729d54a8fe2802a6d126"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.6 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_6) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c187915e4e87da81c08ed4356a0cceac" - "1c4fb5c046b45281b387ec28f1abfd56" - "7e546b236b37d01ae71d3b2834365d3d" - "f380b75061b736b0130b070be58ae8a4" - "6d12166361b613dbc47dfaeb4ca74645" - "6c2e888385525cca9dd1c3c7a9ada76d" - "6c"); - vector signature = wvutil::a2b_hex( - "9cab74163608669f7555a333cf196fe3" - "a0e9e5eb1a32d34bb5c85ff689aaab0e" - "3e65668ed3b1153f94eb3d8be379b8ee" - "f007c4a02c7071ce30d8bb341e58c620" - "f73d37b4ecbf48be294f6c9e0ecb5e63" - "fec41f120e5553dfa0ebebbb72640a95" - "37badcb451330229d9f710f62e3ed8ec" - "784e50ee1d9262b42671340011d7d098" - "c6f2557b2131fa9bd0254636597e88ec" - "b35a240ef0fd85957124df8080fee1e1" - "49af939989e86b26c85a5881fae8673d" - "9fd40800dd134eb9bdb6410f420b0aa9" - "7b20efcf2eb0c807faeb83a3ccd9b51d" - "4553e41dfc0df6ca80a1e81dc234bb83" - "89dd195a38b42de4edc49d346478b9f1" - "1f0557205f5b0bd7ffe9c850f396d7c4"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.7 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_7) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "abfa2ecb7d29bd5bcb9931ce2bad2f74" - "383e95683cee11022f08e8e7d0b8fa05" - "8bf9eb7eb5f98868b5bb1fb5c31ceda3" - "a64f1a12cdf20fcd0e5a246d7a1773d8" - "dba0e3b277545babe58f2b96e3f4edc1" - "8eabf5cd2a560fca75fe96e07d859def" - "b2564f3a34f16f11e91b3a717b41af53" - "f6605323001aa406c6"); - vector signature = wvutil::a2b_hex( - "c4b437bcf703f352e1faf74eb9622039" - "426b5672caf2a7b381c6c4f0191e7e4a" - "98f0eebcd6f41784c2537ff0f99e7498" - "2c87201bfbc65eae832db71d16dacadb" - "0977e5c504679e40be0f9db06ffd848d" - "d2e5c38a7ec021e7f68c47dfd38cc354" - "493d5339b4595a5bf31e3f8f13816807" - "373df6ad0dc7e731e51ad19eb4754b13" - "4485842fe709d378444d8e36b1724a4f" - "da21cafee653ab80747f7952ee804dea" - "b1039d84139945bbf4be82008753f3c5" - "4c7821a1d241f42179c794ef7042bbf9" - "955656222e45c34369a384697b6ae742" - "e18fa5ca7abad27d9fe71052e3310d0f" - "52c8d12ea33bf053a300f4afc4f098df" - "4e6d886779d64594d369158fdbc1f694"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.8 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_8) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "df4044a89a83e9fcbf1262540ae3038b" - "bc90f2b2628bf2a4467ac67722d8546b" - "3a71cb0ea41669d5b4d61859c1b4e47c" - "ecc5933f757ec86db0644e311812d00f" - "b802f03400639c0e364dae5aebc5791b" - "c655762361bc43c53d3c7886768f7968" - "c1c544c6f79f7be820c7e2bd2f9d73e6" - "2ded6d2e937e6a6daef90ee37a1a52a5" - "4f00e31addd64894cf4c02e16099e29f" - "9eb7f1a7bb7f84c47a2b594813be02a1" - "7b7fc43b34c22c91925264126c89f86b" - "b4d87f3ef131296c53a308e0331dac8b" - "af3b63422266ecef2b90781535dbda41" - "cbd0cf22a8cbfb532ec68fc6afb2ac06"); - vector signature = wvutil::a2b_hex( - "1414b38567ae6d973ede4a06842dcc0e" - "0559b19e65a4889bdbabd0fd02806829" - "13bacd5dc2f01b30bb19eb810b7d9ded" - "32b284f147bbe771c930c6052aa73413" - "90a849f81da9cd11e5eccf246dbae95f" - "a95828e9ae0ca3550325326deef9f495" - "30ba441bed4ac29c029c9a2736b1a419" - "0b85084ad150426b46d7f85bd702f48d" - "ac5f71330bc423a766c65cc1dcab20d3" - "d3bba72b63b3ef8244d42f157cb7e3a8" - "ba5c05272c64cc1ad21a13493c3911f6" - "0b4e9f4ecc9900eb056ee59d6fe4b8ff" - "6e8048ccc0f38f2836fd3dfe91bf4a38" - "6e1ecc2c32839f0ca4d1b27a568fa940" - "dd64ad16bd0125d0348e383085f08894" - "861ca18987227d37b42b584a8357cb04"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.9 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_9) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "ea941ff06f86c226927fcf0e3b11b087" - "2676170c1bfc33bda8e265c77771f9d0" - "850164a5eecbcc5ce827fbfa07c85214" - "796d8127e8caa81894ea61ceb1449e72" - "fea0a4c943b2da6d9b105fe053b9039a" - "9cc53d420b7539fab2239c6b51d17e69" - "4c957d4b0f0984461879a0759c4401be" - "ecd4c606a0afbd7a076f50a2dfc2807f" - "24f1919baa7746d3a64e268ed3f5f8e6" - "da83a2a5c9152f837cb07812bd5ba7d3" - "a07985de88113c1796e9b466ec299c5a" - "c1059e27f09415"); - vector signature = wvutil::a2b_hex( - "ceeb84ccb4e9099265650721eea0e8ec" - "89ca25bd354d4f64564967be9d4b08b3" - "f1c018539c9d371cf8961f2291fbe0dc" - "2f2f95fea47b639f1e12f4bc381cef0c" - "2b7a7b95c3adf27605b7f63998c3cbad" - "542808c3822e064d4ad14093679e6e01" - "418a6d5c059684cd56e34ed65ab605b8" - "de4fcfa640474a54a8251bbb7326a42d" - "08585cfcfc956769b15b6d7fdf7da84f" - "81976eaa41d692380ff10eaecfe0a579" - "682909b5521fade854d797b8a0345b9a" - "864e0588f6caddbf65f177998e180d1f" - "102443e6dca53a94823caa9c3b35f322" - "583c703af67476159ec7ec93d1769b30" - "0af0e7157dc298c6cd2dee2262f8cddc" - "10f11e01741471bbfd6518a175734575"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.10 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_10) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "d8b81645c13cd7ecf5d00ed2c91b9acd" - "46c15568e5303c4a9775ede76b48403d" - "6be56c05b6b1cf77c6e75de096c5cb35" - "51cb6fa964f3c879cf589d28e1da2f9d" - "ec"); - vector signature = wvutil::a2b_hex( - "2745074ca97175d992e2b44791c323c5" - "7167165cdd8da579cdef4686b9bb404b" - "d36a56504eb1fd770f60bfa188a7b24b" - "0c91e881c24e35b04dc4dd4ce38566bc" - "c9ce54f49a175fc9d0b22522d9579047" - "f9ed42eca83f764a10163997947e7d2b" - "52ff08980e7e7c2257937b23f3d279d4" - "cd17d6f495546373d983d536efd7d1b6" - "7181ca2cb50ac616c5c7abfbb9260b91" - "b1a38e47242001ff452f8de10ca6eaea" - "dcaf9edc28956f28a711291fc9a80878" - "b8ba4cfe25b8281cb80bc9cd6d2bd182" - "5246eebe252d9957ef93707352084e6d" - "36d423551bf266a85340fb4a6af37088" - "0aab07153d01f48d086df0bfbec05e7b" - "443b97e71718970e2f4bf62023e95b67"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.11 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_11) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "e5739b6c14c92d510d95b826933337ff" - "0d24ef721ac4ef64c2bad264be8b44ef" - "a1516e08a27eb6b611d3301df0062dae" - "fc73a8c0d92e2c521facbc7b26473876" - "7ea6fc97d588a0baf6ce50adf79e600b" - "d29e345fcb1dba71ac5c0289023fe4a8" - "2b46a5407719197d2e958e3531fd54ae" - "f903aabb4355f88318994ed3c3dd62f4" - "20a7"); - vector signature = wvutil::a2b_hex( - "be40a5fb94f113e1b3eff6b6a33986f2" - "02e363f07483b792e68dfa5554df0466" - "cc32150950783b4d968b639a04fd2fb9" - "7f6eb967021f5adccb9fca95acc8f2cd" - "885a380b0a4e82bc760764dbab88c1e6" - "c0255caa94f232199d6f597cc9145b00" - "e3d4ba346b559a8833ad1516ad5163f0" - "16af6a59831c82ea13c8224d84d0765a" - "9d12384da460a8531b4c407e04f4f350" - "709eb9f08f5b220ffb45abf6b75d1579" - "fd3f1eb55fc75b00af8ba3b087827fe9" - "ae9fb4f6c5fa63031fe582852fe2834f" - "9c89bff53e2552216bc7c1d4a3d5dc2b" - "a6955cd9b17d1363e7fee8ed7629753f" - "f3125edd48521ae3b9b03217f4496d0d" - "8ede57acbc5bd4deae74a56f86671de2"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.12 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_12) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "7af42835917a88d6b3c6716ba2f5b0d5" - "b20bd4e2e6e574e06af1eef7c81131be" - "22bf8128b9cbc6ec00275ba80294a5d1" - "172d0824a79e8fdd830183e4c00b9678" - "2867b1227fea249aad32ffc5fe007bc5" - "1f21792f728deda8b5708aa99cabab20" - "a4aa783ed86f0f27b5d563f42e07158c" - "ea72d097aa6887ec411dd012912a5e03" - "2bbfa678507144bcc95f39b58be7bfd1" - "759adb9a91fa1d6d8226a8343a8b849d" - "ae76f7b98224d59e28f781f13ece605f" - "84f6c90bae5f8cf378816f4020a7dda1" - "bed90c92a23634d203fac3fcd86d68d3" - "182a7d9ccabe7b0795f5c655e9acc4e3" - "ec185140d10cef053464ab175c83bd83" - "935e3dabaf3462eebe63d15f573d269a"); - vector signature = wvutil::a2b_hex( - "4e78c5902b807914d12fa537ae6871c8" - "6db8021e55d1adb8eb0ccf1b8f36ab7d" - "ad1f682e947a627072f03e627371781d" - "33221d174abe460dbd88560c22f69011" - "6e2fbbe6e964363a3e5283bb5d946ef1" - "c0047eba038c756c40be7923055809b0" - "e9f34a03a58815ebdde767931f018f6f" - "1878f2ef4f47dd374051dd48685ded6e" - "fb3ea8021f44be1d7d149398f98ea9c0" - "8d62888ebb56192d17747b6b8e170954" - "31f125a8a8e9962aa31c285264e08fb2" - "1aac336ce6c38aa375e42bc92ab0ab91" - "038431e1f92c39d2af5ded7e43bc151e" - "6ebea4c3e2583af3437e82c43c5e3b5b" - "07cf0359683d2298e35948ed806c063c" - "606ea178150b1efc15856934c7255cfe"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.13 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_13) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "ebaef3f9f23bdfe5fa6b8af4c208c189" - "f2251bf32f5f137b9de4406378686b3f" - "0721f62d24cb8688d6fc41a27cbae21d" - "30e429feacc7111941c277"); - vector signature = wvutil::a2b_hex( - "c48dbef507114f03c95fafbeb4df1bfa" - "88e0184a33cc4f8a9a1035ff7f822a5e" - "38cda18723915ff078244429e0f6081c" - "14fd83331fa65c6ba7bb9a12dbf66223" - "74cd0ca57de3774e2bd7ae823677d061" - "d53ae9c4040d2da7ef7014f3bbdc95a3" - "61a43855c8ce9b97ecabce174d926285" - "142b534a3087f9f4ef74511ec742b0d5" - "685603faf403b5072b985df46adf2d25" - "29a02d40711e2190917052371b79b749" - "b83abf0ae29486c3f2f62477b2bd362b" - "039c013c0c5076ef520dbb405f42cee9" - "5425c373a975e1cdd032c49622c85079" - "b09e88dab2b13969ef7a723973781040" - "459f57d5013638483de2d91cb3c490da" - "81c46de6cd76ea8a0c8f6fe331712d24"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.14 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_14) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c5a2711278761dfcdd4f0c99e6f5619d" - "6c48b5d4c1a80982faa6b4cf1cf7a60f" - "f327abef93c801429efde08640858146" - "1056acc33f3d04f5ada21216cacd5fd1" - "f9ed83203e0e2fe6138e3eae8424e591" - "5a083f3f7ab76052c8be55ae882d6ec1" - "482b1e45c5dae9f41015405327022ec3" - "2f0ea2429763b255043b1958ee3cf6d6" - "3983596eb385844f8528cc9a9865835d" - "c5113c02b80d0fca68aa25e72bcaaeb3" - "cf9d79d84f984fd417"); - vector signature = wvutil::a2b_hex( - "6bd5257aa06611fb4660087cb4bc4a9e" - "449159d31652bd980844daf3b1c7b353" - "f8e56142f7ea9857433b18573b4deede" - "818a93b0290297783f1a2f23cbc72797" - "a672537f01f62484cd4162c3214b9ac6" - "28224c5de01f32bb9b76b27354f2b151" - "d0e8c4213e4615ad0bc71f515e300d6a" - "64c6743411fffde8e5ff190e54923043" - "126ecfc4c4539022668fb675f25c07e2" - "0099ee315b98d6afec4b1a9a93dc3349" - "6a15bd6fde1663a7d49b9f1e639d3866" - "4b37a010b1f35e658682d9cd63e57de0" - "f15e8bdd096558f07ec0caa218a8c06f" - "4788453940287c9d34b6d40a3f09bf77" - "99fe98ae4eb49f3ff41c5040a50cefc9" - "bdf2394b749cf164480df1ab6880273b"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.15 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_15) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "9bf8aa253b872ea77a7e23476be26b23" - "29578cf6ac9ea2805b357f6fc3ad130d" - "baeb3d869a13cce7a808bbbbc969857e" - "03945c7bb61df1b5c2589b8e046c2a5d" - "7e4057b1a74f24c711216364288529ec" - "9570f25197213be1f5c2e596f8bf8b2c" - "f3cb38aa56ffe5e31df7395820e94ecf" - "3b1189a965dcf9a9cb4298d3c88b2923" - "c19fc6bc34aacecad4e0931a7c4e5d73" - "dc86dfa798a8476d82463eefaa90a8a9" - "192ab08b23088dd58e1280f7d72e4548" - "396baac112252dd5c5346adb2004a2f7" - "101ccc899cc7fafae8bbe295738896a5" - "b2012285014ef6"); - vector signature = wvutil::a2b_hex( - "27f7f4da9bd610106ef57d32383a448a" - "8a6245c83dc1309c6d770d357ba89e73" - "f2ad0832062eb0fe0ac915575bcd6b8b" - "cadb4e2ba6fa9da73a59175152b2d4fe" - "72b070c9b7379e50000e55e6c269f665" - "8c937972797d3add69f130e34b85bdec" - "9f3a9b392202d6f3e430d09caca82277" - "59ab825f7012d2ff4b5b62c8504dbad8" - "55c05edd5cab5a4cccdc67f01dd6517c" - "7d41c43e2a4957aff19db6f18b17859a" - "f0bc84ab67146ec1a4a60a17d7e05f8b" - "4f9ced6ad10908d8d78f7fc88b76adc8" - "290f87daf2a7be10ae408521395d54ed" - "2556fb7661854a730ce3d82c71a8d493" - "ec49a378ac8a3c74439f7cc555ba13f8" - "59070890ee18ff658fa4d741969d70a5"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.16 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_16) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "32474830e2203754c8bf0681dc4f842a" - "fe360930378616c108e833656e5640c8" - "6856885bb05d1eb9438efede679263de" - "07cb39553f6a25e006b0a52311a063ca" - "088266d2564ff6490c46b5609818548f" - "88764dad34a25e3a85d575023f0b9e66" - "5048a03c350579a9d32446c7bb96cc92" - "e065ab94d3c8952e8df68ef0d9fa456b" - "3a06bb80e3bbc4b28e6a94b6d0ff7696" - "a64efe05e735fea025d7bdbc4139f3a3" - "b546075cba7efa947374d3f0ac80a68d" - "765f5df6210bca069a2d88647af7ea04" - "2dac690cb57378ec0777614fb8b65ff4" - "53ca6b7dce6098451a2f8c0da9bfecf1" - "fdf391bbaa4e2a91ca18a1121a7523a2" - "abd42514f489e8"); - vector signature = wvutil::a2b_hex( - "6917437257c22ccb5403290c3dee82d9" - "cf7550b31bd31c51bd57bfd35d452ab4" - "db7c4be6b2e25ac9a59a1d2a7feb627f" - "0afd4976b3003cc9cffd8896505ec382" - "f265104d4cf8c932fa9fe86e00870795" - "9912389da4b2d6b369b36a5e72e29d24" - "c9a98c9d31a3ab44e643e6941266a47a" - "45e3446ce8776abe241a8f5fc6423b24" - "b1ff250dc2c3a8172353561077e850a7" - "69b25f0325dac88965a3b9b472c494e9" - "5f719b4eac332caa7a65c7dfe46d9aa7" - "e6e00f525f303dd63ab7919218901868" - "f9337f8cd26aafe6f33b7fb2c98810af" - "19f7fcb282ba1577912c1d368975fd5d" - "440b86e10c199715fa0b6f4250b53373" - "2d0befe1545150fc47b876de09b00a94"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.17 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_17) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "008e59505eafb550aae5e845584cebb0" - "0b6de1733e9f95d42c882a5bbeb5ce1c" - "57e119e7c0d4daca9f1ff7870217f7cf" - "d8a6b373977cac9cab8e71e420"); - vector signature = wvutil::a2b_hex( - "922503b673ee5f3e691e1ca85e9ff417" - "3cf72b05ac2c131da5603593e3bc259c" - "94c1f7d3a06a5b9891bf113fa39e59ff" - "7c1ed6465e908049cb89e4e125cd37d2" - "ffd9227a41b4a0a19c0a44fbbf3de55b" - "ab802087a3bb8d4ff668ee6bbb8ad89e" - "6857a79a9c72781990dfcf92cd519404" - "c950f13d1143c3184f1d250c90e17ac6" - "ce36163b9895627ad6ffec1422441f55" - "e4499dba9be89546ae8bc63cca01dd08" - "463ae7f1fce3d893996938778c1812e6" - "74ad9c309c5acca3fde44e7dd8695993" - "e9c1fa87acda99ece5c8499e468957ad" - "66359bf12a51adbe78d3a213b449bf0b" - "5f8d4d496acf03d3033b7ccd196bc22f" - "68fb7bef4f697c5ea2b35062f48a36dd"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.18 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_18) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "6abc54cf8d1dff1f53b17d8160368878" - "a8788cc6d22fa5c2258c88e660b09a89" - "33f9f2c0504ddadc21f6e75e0b833beb" - "555229dee656b9047b92f62e76b8ffcc" - "60dab06b80"); - vector signature = wvutil::a2b_hex( - "0b6daf42f7a862147e417493c2c401ef" - "ae32636ab4cbd44192bbf5f195b50ae0" - "96a475a1614f0a9fa8f7a026cb46c650" - "6e518e33d83e56477a875aca8c7e714c" - "e1bdbd61ef5d535239b33f2bfdd61771" - "bab62776d78171a1423cea8731f82e60" - "766d6454265620b15f5c5a584f55f95b" - "802fe78c574ed5dacfc831f3cf2b0502" - "c0b298f25ccf11f973b31f85e4744219" - "85f3cff702df3946ef0a6605682111b2" - "f55b1f8ab0d2ea3a683c69985ead93ed" - "449ea48f0358ddf70802cb41de2fd83f" - "3c808082d84936948e0c84a131b49278" - "27460527bb5cd24bfab7b48e071b2417" - "1930f99763272f9797bcb76f1d248157" - "5558fcf260b1f0e554ebb3df3cfcb958"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.19 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_19) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "af2d78152cf10efe01d274f217b177f6" - "b01b5e749f1567715da324859cd3dd88" - "db848ec79f48dbba7b6f1d33111ef31b" - "64899e7391c2bffd69f49025cf201fc5" - "85dbd1542c1c778a2ce7a7ee108a309f" - "eca26d133a5ffedc4e869dcd7656596a" - "c8427ea3ef6e3fd78fe99d8ddc71d839" - "f6786e0da6e786bd62b3a4f19b891a56" - "157a554ec2a2b39e25a1d7c7d37321c7" - "a1d946cf4fbe758d9276f08563449d67" - "414a2c030f4251cfe2213d04a5410637" - "87"); - vector signature = wvutil::a2b_hex( - "209c61157857387b71e24bf3dd564145" - "50503bec180ff53bdd9bac062a2d4995" - "09bf991281b79527df9136615b7a6d9d" - "b3a103b535e0202a2caca197a7b74e53" - "56f3dd595b49acfd9d30049a98ca88f6" - "25bca1d5f22a392d8a749efb6eed9b78" - "21d3110ac0d244199ecb4aa3d735a83a" - "2e8893c6bf8581383ccaee834635b7fa" - "1faffa45b13d15c1da33af71e89303d6" - "8090ff62ee615fdf5a84d120711da53c" - "2889198ab38317a9734ab27d67924cea" - "74156ff99bef9876bb5c339e93745283" - "e1b34e072226b88045e017e9f05b2a8c" - "416740258e223b2690027491732273f3" - "229d9ef2b1b3807e321018920ad3e53d" - "ae47e6d9395c184b93a374c671faa2ce"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.20 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_20) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "40ee992458d6f61486d25676a96dd2cb" - "93a37f04b178482f2b186cf88215270d" - "ba29d786d774b0c5e78c7f6e56a956e7" - "f73950a2b0c0c10a08dbcd67e5b210bb" - "21c58e2767d44f7dd4014e3966143bf7" - "e3d66ff0c09be4c55f93b39994b8518d" - "9c1d76d5b47374dea08f157d57d70634" - "978f3856e0e5b481afbbdb5a3ac48d48" - "4be92c93de229178354c2de526e9c65a" - "31ede1ef68cb6398d7911684fec0babc" - "3a781a66660783506974d0e14825101c" - "3bfaea"); - vector signature = wvutil::a2b_hex( - "927502b824afc42513ca6570de338b8a" - "64c3a85eb828d3193624f27e8b1029c5" - "5c119c9733b18f5849b3500918bcc005" - "51d9a8fdf53a97749fa8dc480d6fe974" - "2a5871f973926528972a1af49e3925b0" - "adf14a842719b4a5a2d89fa9c0b6605d" - "212bed1e6723b93406ad30e86829a5c7" - "19b890b389306dc5506486ee2f36a8df" - "e0a96af678c9cbd6aff397ca200e3edc" - "1e36bd2f08b31d540c0cb282a9559e4a" - "dd4fc9e6492eed0ccbd3a6982e5faa2d" - "dd17be47417c80b4e5452d31f72401a0" - "42325109544d954c01939079d409a5c3" - "78d7512dfc2d2a71efcc3432a765d1c6" - "a52cfce899cd79b15b4fc3723641ef6b" - "d00acc10407e5df58dd1c3c5c559a506"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -/// @} - -/// @addtogroup generic -/// @{ - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyLoad) { EncryptAndLoadKeys(); } - -// Test that the Generic_Encrypt function works correctly. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncrypt) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector encrypted(clear_buffer_.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); -} - -// Test that the Generic_Encrypt function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadEncrypt) { - EncryptAndLoadKeys(); - BadEncrypt(0, OEMCrypto_HMAC_SHA256, buffer_size_); - // The buffer size must be a multiple of 16, so subtracting 10 is bad. - BadEncrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); - BadEncrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadEncrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadEncrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); -} - -// Test that the Generic_Encrypt works if the input and output buffers are the -// same. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptSameBufferAPI12) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - // Input and output are same buffer: - vector buffer = clear_buffer_; - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), buffer.data(), - buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - buffer.data())); - ASSERT_EQ(expected_encrypted, buffer); -} - -TEST_P( - OEMCryptoGenericCryptoTest, - OEMCryptoMemoryGenericKeyEncryptForHugeBufferWithBufferLengthNotMultipleOf16) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector buffer(17); - ASSERT_NO_FATAL_FAILURE(OEMCrypto_Generic_Encrypt( - key_handle.data(), key_handle.size(), buffer.data(), buffer.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, buffer.data())); -} - -// Test Generic_Decrypt works correctly. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecrypt) { - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); -} - -// Test that Generic_Decrypt works correctly when the input and output buffers -// are the same. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptSameBufferAPI12) { - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector buffer = encrypted; - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), buffer.data(), - buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - buffer.data())); - ASSERT_EQ(clear_buffer_, buffer); -} - -// Test that Generic_Decrypt fails to decrypt to an insecure buffer if the key -// requires a secure data path. -TEST_P(OEMCryptoGenericCryptoTest, GenericSecureToClear) { - license_messages_.set_control(wvoec::kControlObserveDataPath | - wvoec::kControlDataPathSecure); - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_NE(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_NE(clear_buffer_, resultant); -} - -// Test that the Generic_Decrypt function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadDecrypt) { - EncryptAndLoadKeys(); - BadDecrypt(1, OEMCrypto_HMAC_SHA256, buffer_size_); - // The buffer size must be a multiple of 16, so subtracting 10 is bad. - BadDecrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); - BadDecrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadDecrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadDecrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); -} - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeySign) { - EncryptAndLoadKeys(); - unsigned int key_index = 2; - vector expected_signature; - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - size_t gen_signature_length = 0; - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, - GenericSign(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), - OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); - ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); - vector signature(SHA256_DIGEST_LENGTH); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &gen_signature_length)); - ASSERT_EQ(expected_signature, signature); -} - -// Test that the Generic_Sign function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadSign) { - EncryptAndLoadKeys(); - BadSign(0, OEMCrypto_HMAC_SHA256); // Can't sign with encrypt key. - BadSign(1, OEMCrypto_HMAC_SHA256); // Can't sign with decrypt key. - BadSign(3, OEMCrypto_HMAC_SHA256); // Can't sign with verify key. - BadSign(2, OEMCrypto_AES_CBC_128_NO_PADDING); // Bad signing algorithm. -} - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerify) { - EncryptAndLoadKeys(); - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); -} - -// Test that the Generic_Verify function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadVerify) { - EncryptAndLoadKeys(); - BadVerify(0, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(1, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(2, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, true); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH - 1, false); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH + 1, false); - BadVerify(3, OEMCrypto_AES_CBC_128_NO_PADDING, SHA256_DIGEST_LENGTH, false); -} - -// Test Generic_Encrypt with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector encrypted(clear_buffer_.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); -} - -// Test Generic_Decrypt with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptLargeBuffer) { - // Some applications are known to pass in a block that is almost 400k. - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); -} - -// Test Generic_Sign with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeySignLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 2; - vector expected_signature; - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - size_t gen_signature_length = 0; - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, - GenericSign(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), - OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); - ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); - vector signature(SHA256_DIGEST_LENGTH); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &gen_signature_length)); - ASSERT_EQ(expected_signature, signature); -} - -// Test Generic_Verify with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerifyLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); -} - -// Test Generic_Encrypt when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationEncrypt) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - vector expected_encrypted; - EncryptBuffer(0, clear_buffer_, &expected_encrypted); - unsigned int key_index = 0; - vector encrypted(clear_buffer_.size()); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - encrypted.assign(clear_buffer_.size(), 0); - OEMCryptoResult status = OEMCrypto_Generic_Encrypt( - key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - encrypted.data()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(encrypted, expected_encrypted); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Decrypt when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationDecrypt) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - // Should be valid key at the start. - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - resultant.assign(encrypted.size(), 0); - OEMCryptoResult status = GenericDecrypt( - key_handle.data(), key_handle.size(), encrypted.data(), encrypted.size(), - iv_, OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(clear_buffer_, resultant); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Sign when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationSign) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - unsigned int key_index = 2; - vector expected_signature; - vector signature(SHA256_DIGEST_LENGTH); - size_t signature_length = signature.size(); - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &signature_length)); - ASSERT_EQ(expected_signature, signature); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - signature.assign(SHA256_DIGEST_LENGTH, 0); - OEMCryptoResult status = - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &signature_length); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(expected_signature, signature); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Verify when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationVerify) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - OEMCryptoResult status = OEMCrypto_Generic_Verify( - key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - signature.size()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -const unsigned int kLongKeyId = 2; - -// Test that short key ids are allowed. -class OEMCryptoGenericCryptoKeyIdLengthTest - : public OEMCryptoGenericCryptoTest { - protected: - void SetUp() override { - OEMCryptoGenericCryptoTest::SetUp(); - license_messages_.set_num_keys(5); - license_messages_.set_control(wvoec::kControlAllowDecrypt); - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); - SetUniformKeyIdLength(16); // Start with all key ids being 16 bytes. - // But, we are testing that the key ids do not have to have the same length. - // 12 bytes (common key id length). - license_messages_.SetKeyId(0, "123456789012"); - license_messages_.SetKeyId(1, "12345"); // short key id. - // 16 byte key id. (default) - license_messages_.SetKeyId(2, "1234567890123456"); - license_messages_.SetKeyId(3, "12345678901234"); // 14 byte. (uncommon) - license_messages_.SetKeyId(4, "1"); // very short key id. - ASSERT_EQ(2u, kLongKeyId); - ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); - } - - // Make all four keys have the same length. - void SetUniformKeyIdLength(size_t key_id_length) { - for (size_t i = 0; i < license_messages_.num_keys(); i++) { - string key_id; - key_id.resize(key_id_length, i + 'a'); - license_messages_.SetKeyId(i, key_id); - } - ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); - } - - void TestWithKey(unsigned int key_index) { - ASSERT_LT(key_index, license_messages_.num_keys()); - EncryptAndLoadKeys(); - vector encrypted; - // To make sure OEMCrypto is not expecting the key_id to be zero padded, we - // will create a buffer that is padded with 'Z'. - // Then, we use fill the buffer with the longer of the three keys. If - // OEMCrypto is paying attention to the key id length, it should pick out - // the correct key. - vector key_id_buffer( - session_.license().keys[kLongKeyId].key_id_length + 5, - 'Z'); // Fill a bigger buffer with letter 'Z'. - memcpy(key_id_buffer.data(), session_.license().keys[kLongKeyId].key_id, - session_.license().keys[kLongKeyId].key_id_length); - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), key_id_buffer.data(), - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, - resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); - } -}; - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, MediumKeyId) { TestWithKey(0); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, ShortKeyId) { TestWithKey(1); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, LongKeyId) { TestWithKey(2); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, FourteenByteKeyId) { - TestWithKey(3); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, VeryShortKeyId) { - TestWithKey(4); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformShortKeyId) { - SetUniformKeyIdLength(5); - TestWithKey(2); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformLongKeyId) { - SetUniformKeyIdLength(kTestKeyIdMaxLength); - TestWithKey(2); -} - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoTest, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoKeyIdLengthTest, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); /// @} } // namespace wvoec diff --git a/oemcrypto/test/oemcrypto_test_android.cpp b/oemcrypto/test/oemcrypto_test_android.cpp index 4e3ab9b..074eb4b 100644 --- a/oemcrypto/test/oemcrypto_test_android.cpp +++ b/oemcrypto/test/oemcrypto_test_android.cpp @@ -25,6 +25,9 @@ namespace wvoec { class OEMCryptoAndroidLMPTest : public ::testing::Test { protected: void SetUp() override { + if (OEMCrypto_GetProvisioningMethod() == OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for non Prov 4.0 devices only."; + } OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_Initialize()); OEMCrypto_SetMaxAPIVersion(kCurrentAPI); diff --git a/oemcrypto/test/oemcrypto_unittests.gypi b/oemcrypto/test/oemcrypto_unittests.gypi index 44d0984..3ccd422 100644 --- a/oemcrypto/test/oemcrypto_unittests.gypi +++ b/oemcrypto/test/oemcrypto_unittests.gypi @@ -18,7 +18,9 @@ 'oemcrypto_corpus_generator_helper.cpp', 'oemcrypto_session_tests_helper.cpp', 'oemcrypto_basic_test.cpp', + 'oemcrypto_cast_test.cpp', 'oemcrypto_decrypt_test.cpp', + 'oemcrypto_generic_crypto_test.cpp', 'oemcrypto_license_test.cpp', 'oemcrypto_provisioning_test.cpp', 'oemcrypto_usage_table_test.cpp', diff --git a/oemcrypto/test/oemcrypto_usage_table_test.cpp b/oemcrypto/test/oemcrypto_usage_table_test.cpp index 8b78b14..77c6240 100644 --- a/oemcrypto/test/oemcrypto_usage_table_test.cpp +++ b/oemcrypto/test/oemcrypto_usage_table_test.cpp @@ -10,9 +10,6 @@ using ::testing::Values; namespace wvoec { -/// @addtogroup usage_table -/// @{ - // Test that successive calls to PrepAndSignProvisioningRequest only increase // the provisioning count in the ODK message TEST_F(OEMCryptoSessionTests, Provisioning_IncrementCounterAPI18) { @@ -986,6 +983,39 @@ TEST_P(OEMCryptoUsageTableDefragTest, MoveUsageEntries) { FailReloadLicense(&entries[3], OEMCrypto_ERROR_UNKNOWN_FAILURE)); } +TEST_P(OEMCryptoUsageTableDefragTest, MakeAndMoveEntry) { + // 1. Make an entry then close. + LicenseWithUsageEntry entry; + ASSERT_NO_FATAL_FAILURE(entry.set_pst("pst 0")); + ASSERT_NO_FATAL_FAILURE(entry.MakeOfflineAndClose(this)); + ASSERT_NO_FATAL_FAILURE(entry.OpenAndReload(this)); + ASSERT_NO_FATAL_FAILURE(entry.session().close()); + + // 2. Make an entry then immediately move it into the previous slot. + // Not using helper functions because they shoehorn the session state into + // a limited set of possibilities. We want to create the specific case of + // immediately moving a newly created entry. + + // Like LicenseWithUsageEntry::MakeAndLoad() but stop after creating the new + // usage entry. + Session session; + ASSERT_NO_FATAL_FAILURE(session.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session)); + LicenseRoundTrip license_messages_(&session); + license_messages_.set_control(wvoec::kControlNonceOrEntry); + ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); + OEMCryptoResult result; + ASSERT_NO_FATAL_FAILURE(session.CreateNewUsageEntry(&result)); + + // Not the same as Session::MoveUsageEntry, which opens and closes a session + // around the move operation. We just want to call MoveEntry on the current + // state. + ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_MoveEntry(session.session_id(), 0)); + ASSERT_NO_FATAL_FAILURE(session.close()); +} + // A usage table entry cannot be moved into an entry where an open session is // currently using the entry. TEST_P(OEMCryptoUsageTableDefragTest, MoveUsageEntriesToOpenSession) { @@ -1703,5 +1733,4 @@ INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoUsageTableDefragTest, INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoUsageTableTestWallClock, Values(kCurrentAPI)); -/// @} } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_usage_table_test.h b/oemcrypto/test/oemcrypto_usage_table_test.h index 9ffd3fc..ce5d7ab 100644 --- a/oemcrypto/test/oemcrypto_usage_table_test.h +++ b/oemcrypto/test/oemcrypto_usage_table_test.h @@ -19,48 +19,6 @@ namespace wvoec { -class OEMCryptoRefreshTest : public OEMCryptoLicenseTest { - protected: - void SetUp() override { - OEMCryptoLicenseTest::SetUp(); - // These values allow us to run a few simple duration tests or just start - // playback right away. All times are in seconds since the license was - // signed. - // Soft expiry false means timers are strictly enforce. - timer_limits_.soft_enforce_rental_duration = true; - timer_limits_.soft_enforce_playback_duration = false; - // Playback may begin immediately. - timer_limits_.earliest_playback_start_seconds = 0; - // First playback may be within the first two seconds. - timer_limits_.rental_duration_seconds = kDuration; - // Once started, playback may last two seconds without a renewal. - timer_limits_.initial_renewal_duration_seconds = kDuration; - // Total playback is not limited. - timer_limits_.total_playback_duration_seconds = 0; - } - - void LoadLicense() { - license_messages_.core_response().timer_limits = timer_limits_; - ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); - } - - void MakeRenewalRequest(RenewalRoundTrip* renewal_messages) { - ASSERT_NO_FATAL_FAILURE(renewal_messages->SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(renewal_messages->CreateDefaultResponse()); - } - - void LoadRenewal(RenewalRoundTrip* renewal_messages, - OEMCryptoResult expected_result) { - ASSERT_NO_FATAL_FAILURE(renewal_messages->EncryptAndSignResponse()); - ASSERT_EQ(expected_result, renewal_messages->LoadResponse()); - } - - ODK_TimerLimits timer_limits_; -}; - // This class is for testing the generic crypto functionality. class OEMCryptoGenericCryptoTest : public OEMCryptoRefreshTest { protected: diff --git a/oemcrypto/util/src/oemcrypto_oem_cert.cpp b/oemcrypto/util/src/oemcrypto_oem_cert.cpp index 1741d44..3f0bb69 100644 --- a/oemcrypto/util/src/oemcrypto_oem_cert.cpp +++ b/oemcrypto/util/src/oemcrypto_oem_cert.cpp @@ -207,7 +207,9 @@ OEMCryptoResult OemCertificate::GetPublicCertificate( return OEMCrypto_ERROR_SHORT_BUFFER; } *public_cert_length = cert_data.size(); - memcpy(public_cert, cert_data.data(), cert_data.size()); + if (public_cert != nullptr) { + memcpy(public_cert, cert_data.data(), cert_data.size()); + } return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/util/src/oemcrypto_rsa_key.cpp b/oemcrypto/util/src/oemcrypto_rsa_key.cpp index 0c4ce06..b700a68 100644 --- a/oemcrypto/util/src/oemcrypto_rsa_key.cpp +++ b/oemcrypto/util/src/oemcrypto_rsa_key.cpp @@ -92,7 +92,7 @@ bool ParseRsaPrivateKeyInfo(const uint8_t* buffer, size_t length, } ScopedBio bio; // Check allowed scheme type. - if (!memcmp("SIGN", buffer, 4)) { + if (memcmp("SIGN", buffer, 4) == 0) { uint32_t allowed_schemes_bno; memcpy(&allowed_schemes_bno, reinterpret_cast(&buffer[4]), 4); @@ -811,7 +811,9 @@ OEMCryptoResult RsaPublicKey::EncryptOaep(const uint8_t* message, return OEMCrypto_ERROR_SHORT_BUFFER; } *enc_message_length = enc_size; - memcpy(enc_message, encrypt_buffer.data(), enc_size); + if (enc_message != nullptr) { + memcpy(enc_message, encrypt_buffer.data(), enc_size); + } return OEMCrypto_SUCCESS; } diff --git a/util/include/error_string_util.h b/util/include/error_string_util.h deleted file mode 100644 index 8be4eaa..0000000 --- a/util/include/error_string_util.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ERROR_STRING_UTIL_H_ -#define ERROR_STRING_UTIL_H_ - -#include - -namespace wvutil { - -const std::string OEMCryptoResultToString(int oemcrypto_result); - -} // namespace wvutil -#endif // ERROR_STRING_UTIL_H_ diff --git a/util/include/file_store.h b/util/include/file_store.h index 6bb1773..9563b5e 100644 --- a/util/include/file_store.h +++ b/util/include/file_store.h @@ -58,6 +58,7 @@ class FileSystem { virtual std::unique_ptr Open(const std::string& file_path, int flags); virtual bool Exists(const std::string& file_path); + virtual bool Exists(const std::string& file_path, int* errno_value); virtual bool Remove(const std::string& file_path); virtual ssize_t FileSize(const std::string& file_path); diff --git a/util/include/string_format.h b/util/include/string_format.h index 62f9fd9..49ac381 100644 --- a/util/include/string_format.h +++ b/util/include/string_format.h @@ -13,6 +13,11 @@ namespace wvutil { #endif bool FormatString(std::string* out, const char* fmt, ...); +#ifdef __GNUC__ +[[gnu::format(printf, 2, 0)]] +#endif +bool VFormatString(std::string* out, const char* fmt, va_list vlist); + } // namespace wvutil #endif // WVCDM_UTIL_STRING_FORMAT_H_ diff --git a/util/src/error_string_util.cpp b/util/src/error_string_util.cpp deleted file mode 100644 index d70a6a8..0000000 --- a/util/src/error_string_util.cpp +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary -// source code may only be used and distributed under the Widevine License -// Agreement. -// - -#include "error_string_util.h" - -#include "OEMCryptoCENC.h" -#include "wv_cdm_types.h" - -namespace wvutil { -const std::string OEMCryptoResultToString(int oemcrypto_result) { - switch (oemcrypto_result) { - case OEMCrypto_SUCCESS: - return "SUCCESS"; - case OEMCrypto_ERROR_INIT_FAILED: - return "INIT_FAILED"; - case OEMCrypto_ERROR_TERMINATE_FAILED: - return "TERMINATE_FAILED"; - case OEMCrypto_ERROR_OPEN_FAILURE: - return "OPEN_FAILURE"; - case OEMCrypto_ERROR_CLOSE_FAILURE: - return "CLOSE_FAILURE"; - case OEMCrypto_ERROR_ENTER_SECURE_PLAYBACK_FAILED: - return "ENTER_SECURE_PLAYBACK_FAILED"; - case OEMCrypto_ERROR_EXIT_SECURE_PLAYBACK_FAILED: - return "EXIT_SECURE_PLAYBACK_FAILED"; - case OEMCrypto_ERROR_SHORT_BUFFER: - return "SHORT_BUFFER"; - case OEMCrypto_ERROR_NO_DEVICE_KEY: - return "NO_DEVICE_KEY"; - case OEMCrypto_ERROR_NO_ASSET_KEY: - return "NO_ASSET_KEY"; - case OEMCrypto_ERROR_KEYBOX_INVALID: - return "KEYBOX_INVALID"; - case OEMCrypto_ERROR_NO_KEYDATA: - return "NO_KEYDATA"; - case OEMCrypto_ERROR_NO_CW: - return "NO_CW"; - case OEMCrypto_ERROR_DECRYPT_FAILED: - return "DECRYPT_FAILED"; - case OEMCrypto_ERROR_WRITE_KEYBOX: - return "WRITE_KEYBOX"; - case OEMCrypto_ERROR_WRAP_KEYBOX: - return "WRAP_KEYBOX"; - case OEMCrypto_ERROR_BAD_MAGIC: - return "BAD_MAGIC"; - case OEMCrypto_ERROR_BAD_CRC: - return "BAD_CRC"; - case OEMCrypto_ERROR_NO_DEVICEID: - return "NO_DEVICEID"; - case OEMCrypto_ERROR_RNG_FAILED: - return "RNG_FAILED"; - case OEMCrypto_ERROR_RNG_NOT_SUPPORTED: - return "RNG_NOT_SUPPORTED"; - case OEMCrypto_ERROR_SETUP: - return "SETUP"; - case OEMCrypto_ERROR_OPEN_SESSION_FAILED: - return "OPEN_SESSION_FAILED"; - case OEMCrypto_ERROR_CLOSE_SESSION_FAILED: - return "CLOSE_SESSION_FAILED"; - case OEMCrypto_ERROR_INVALID_SESSION: - return "INVALID_SESSION"; - case OEMCrypto_ERROR_NOT_IMPLEMENTED: - return "NOT_IMPLEMENTED"; - case OEMCrypto_ERROR_NO_CONTENT_KEY: - return "NO_CONTENT_KEY"; - case OEMCrypto_ERROR_CONTROL_INVALID: - return "CONTROL_INVALID"; - case OEMCrypto_ERROR_UNKNOWN_FAILURE: - return "UNKNOWN_FAILURE"; - case OEMCrypto_ERROR_INVALID_CONTEXT: - return "INVALID_CONTEXT"; - case OEMCrypto_ERROR_SIGNATURE_FAILURE: - return "SIGNATURE_FAILURE"; - case OEMCrypto_ERROR_TOO_MANY_SESSIONS: - return "TOO_MANY_SESSIONS"; - case OEMCrypto_ERROR_INVALID_NONCE: - return "INVALID_NONCE"; - case OEMCrypto_ERROR_TOO_MANY_KEYS: - return "TOO_MANY_KEYS"; - case OEMCrypto_ERROR_DEVICE_NOT_RSA_PROVISIONED: - return "DEVICE_NOT_RSA_PROVISIONED"; - case OEMCrypto_ERROR_INVALID_RSA_KEY: - return "INVALID_RSA_KEY"; - case OEMCrypto_ERROR_KEY_EXPIRED: - return "KEY_EXPIRED"; - case OEMCrypto_ERROR_INSUFFICIENT_RESOURCES: - return "INSUFFICIENT_RESOURCES"; - case OEMCrypto_ERROR_INSUFFICIENT_HDCP: - return "INSUFFICIENT_HDCP"; - case OEMCrypto_ERROR_BUFFER_TOO_LARGE: - return "BUFFER_TOO_LARGE"; - case OEMCrypto_WARNING_GENERATION_SKEW: - return "OEMCrypto_WARNING_GENERATION_SKEW"; - case OEMCrypto_ERROR_GENERATION_SKEW: - return "GENERATION_SKEW"; - case OEMCrypto_LOCAL_DISPLAY_ONLY: - return "OEMCrypto_LOCAL_DISPLAY_ONLY"; - case OEMCrypto_ERROR_ANALOG_OUTPUT: - return "ANALOG_OUTPUT"; - case OEMCrypto_ERROR_WRONG_PST: - return "WRONG_PST"; - case OEMCrypto_ERROR_WRONG_KEYS: - return "WRONG_KEYS"; - case OEMCrypto_ERROR_MISSING_MASTER: - return "MISSING_MASTER"; - case OEMCrypto_ERROR_LICENSE_INACTIVE: - return "LICENSE_INACTIVE"; - case OEMCrypto_ERROR_ENTRY_NEEDS_UPDATE: - return "ENTRY_NEEDS_UPDATE"; - case OEMCrypto_ERROR_ENTRY_IN_USE: - return "ENTRY_IN_USE"; - case OEMCrypto_ERROR_USAGE_TABLE_UNRECOVERABLE: - return "USAGE_TABLE_UNRECOVERABLE"; - case OEMCrypto_KEY_NOT_LOADED: - return "OEMCrypto_KEY_NOT_LOADED"; - case OEMCrypto_KEY_NOT_ENTITLED: - return "OEMCrypto_KEY_NOT_ENTITLED"; - case OEMCrypto_ERROR_BAD_HASH: - return "BAD_HASH"; - case OEMCrypto_ERROR_OUTPUT_TOO_LARGE: - return "OUTPUT_TOO_LARGE"; - case OEMCrypto_ERROR_SESSION_LOST_STATE: - return "SESSION_LOST_STATE"; - case OEMCrypto_ERROR_SYSTEM_INVALIDATED: - return "SYSTEM_INVALIDATED"; - case OEMCrypto_ERROR_LICENSE_RELOAD: - return "LICENSE_RELOAD"; - case OEMCrypto_ERROR_MULTIPLE_USAGE_ENTRIES: - return "MULTIPLE_USAGE_ENTRIES"; - case OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION: - return "MIXED_OUTPUT_PROTECTION"; - case OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION: - return "INVALID_ENTITLED_KEY_SESSION"; - case OEMCrypto_ERROR_NEEDS_KEYBOX_PROVISIONING: - return "NEEDS_KEYBOX_PROVISIONING"; - case OEMCrypto_ERROR_UNSUPPORTED_CIPHER: - return "OEMCrypto_ERROR_UNSUPPORTED_CIPHER"; - case OEMCrypto_ERROR_DVR_FORBIDDEN: - return "OEMCrypto_ERROR_DVR_FORBIDDEN"; - case OEMCrypto_ERROR_INSUFFICIENT_PRIVILEGE: - return "OEMCrypto_ERROR_INSUFFICIENT_PRIVILEGE"; - case OEMCrypto_ERROR_INVALID_KEY: - return "INVALID_KEY"; - // ODK Values. - case ODK_ERROR_CORE_MESSAGE: - return "CORE_MESSAGE"; - case ODK_SET_TIMER: - return "SET_TIMER"; - case ODK_DISABLE_TIMER: - return "DISABLE_TIMER"; - case ODK_TIMER_EXPIRED: - return "TIMER_EXPIRED"; - case ODK_UNSUPPORTED_API: - return "UNSUPPORTED_API"; - case ODK_STALE_RENEWAL: - return "STALE_RENEWAL"; - // OPK Values. - case OPK_ERROR_INCOMPATIBLE_VERSION: - return "INCOMPATIBLE_VERSION"; - case OPK_ERROR_REMOTE_CALL: - return "REMOTE_CALL"; - case OPK_ERROR_NO_PERSISTENT_DATA: - return "NO_PERSISTENT_DATA"; - default: - return "Invalid OEMCrypto error."; - } -} - -} // namespace wvutil diff --git a/util/src/string_format.cpp b/util/src/string_format.cpp index 91cce37..3926fc4 100644 --- a/util/src/string_format.cpp +++ b/util/src/string_format.cpp @@ -16,20 +16,27 @@ namespace wvutil { bool FormatString(std::string* out, const char* fmt, ...) { if (out == nullptr || fmt == nullptr) return false; - va_list ap1; - va_start(ap1, fmt); - const int desired_size = vsnprintf(nullptr, 0, fmt, ap1); - va_end(ap1); + va_list vlist; + va_start(vlist, fmt); + const bool result = VFormatString(out, fmt, vlist); + va_end(vlist); + return result; +} + +bool VFormatString(std::string* out, const char* fmt, va_list vlist) { + if (out == nullptr || fmt == nullptr) return false; + + va_list vlist_copy; + va_copy(vlist_copy, vlist); + const int desired_size = vsnprintf(nullptr, 0, fmt, vlist_copy); + va_end(vlist_copy); if (desired_size < 0) return false; const size_t buffer_size = static_cast(desired_size) + 1; // +1 for null std::unique_ptr buffer(new char[buffer_size]); - va_list ap2; - va_start(ap2, fmt); - const int actual_size = vsnprintf(buffer.get(), buffer_size, fmt, ap2); - va_end(ap2); + const int actual_size = vsnprintf(buffer.get(), buffer_size, fmt, vlist); if (actual_size != desired_size) return false; diff --git a/util/test/file_store_unittest.cpp b/util/test/file_store_unittest.cpp index 340a621..a62bfc0 100644 --- a/util/test/file_store_unittest.cpp +++ b/util/test/file_store_unittest.cpp @@ -39,9 +39,17 @@ class FileTest : public testing::Test { }; TEST_F(FileTest, FileExists) { + int errno_value = -1; EXPECT_TRUE(file_system_.Exists(wvcdm::test_vectors::kExistentFile)); + EXPECT_TRUE( + file_system_.Exists(wvcdm::test_vectors::kExistentFile, &errno_value)); + EXPECT_EQ(0, errno_value); EXPECT_TRUE(file_system_.Exists(wvcdm::test_vectors::kExistentDir)); + EXPECT_FALSE(file_system_.Exists(wvcdm::test_vectors::kNonExistentFile)); + EXPECT_FALSE( + file_system_.Exists(wvcdm::test_vectors::kNonExistentFile, &errno_value)); + EXPECT_EQ(ENOENT, errno_value); EXPECT_FALSE(file_system_.Exists(wvcdm::test_vectors::kNonExistentDir)); } diff --git a/util/test/test_sleep.cpp b/util/test/test_sleep.cpp index 281e042..439a46d 100644 --- a/util/test/test_sleep.cpp +++ b/util/test/test_sleep.cpp @@ -14,6 +14,7 @@ #endif #include +#include #include #include @@ -53,6 +54,18 @@ void TestSleep::Sleep(unsigned int seconds) { if (callback_ != nullptr) callback_->ElapseTime(milliseconds); } +void TestSleep::SleepUntil(int64_t desired_time) { + SyncFakeClock(); + const int64_t now = Clock().GetCurrentTime(); + if (desired_time < now) { + LOGE("Test Clock skew sleeping from time %" PRId64 " to %" PRId64, now, + desired_time); + return; + } + const unsigned int sleep_time = static_cast(desired_time - now); + TestSleep::Sleep(sleep_time); +} + void TestSleep::SyncFakeClock() { // Syncing can be done by sleeping 0 seconds. Sleep(0); diff --git a/util/test/test_sleep.h b/util/test/test_sleep.h index 155b89d..f20e27a 100644 --- a/util/test/test_sleep.h +++ b/util/test/test_sleep.h @@ -13,7 +13,9 @@ namespace wvutil { class TestSleep { public: - // The callback is called when the clock should be advanced. + // The callback is called when the test clock should be advanced. If the + // system uses a real clock, it is used to sync the real and test + // clock. Otherwise it is used to simulate sleep in the test clock. class CallBack { public: virtual void ElapseTime(int64_t milliseconds) = 0; @@ -27,6 +29,9 @@ class TestSleep { // callback exists, this calls the callback. static void Sleep(unsigned int seconds); + // Like sleep, above, except it sleeps until the specified time. + static void SleepUntil(int64_t desired_time); + // If we are using a real clock and a fake clock, then the real clock advances // a little while we are doing work, but the fake one only advances when we // sleep. This function advances the fake clock to be in sync with the real