From ef3ad135c9f7adb25d547463fabe9714a4a31dcb Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Thu, 7 Sep 2023 13:45:38 -0700 Subject: [PATCH] Add new test files for OEMCrypto v17.2 The previous commit did not include some new files. --- oemcrypto/odk/test/odk_golden_v16.cpp | 4134 +++++++++++++++++ oemcrypto/odk/test/odk_golden_v17.cpp | 3847 +++++++++++++++ .../oemcrypto_ta/wtpi/wtpi_cas_interface.h | 146 + .../oemcrypto_ta/wtpi_reference/odk_endian.c | 54 + .../opk/oemcrypto_ta/wtpi_test/cose_util.cpp | 176 + .../opk/oemcrypto_ta/wtpi_test/cose_util.h | 36 + .../opk/oemcrypto_ta/wtpi_useless/wtpi_cas.c | 51 + .../wtpi_useless/wtpi_persistent_storage.c | 54 + oemcrypto/opk/ports/linux/Makefile | 59 + oemcrypto/opk/ports/linux/README.md | 105 + oemcrypto/opk/ports/linux/cas/Makefile | 53 + oemcrypto/opk/ports/linux/cas/README.md | 227 + .../linux/cas/ree/cas_unittests/Makefile | 41 + .../ports/linux/cas/ree/hello_world/Makefile | 35 + .../ports/linux/cas/ree/hello_world/main.c | 31 + .../ports/linux/cas/ree/liboemcrypto/Makefile | 39 + .../opk/ports/linux/cas/ree/libtuner/Makefile | 43 + .../linux/cas/ree/tuner_ree_serialization.c | 135 + .../linux/cas/ree/tuner_ree_serialization.h | 17 + .../opk/ports/linux/cas/scripts/build.sh | 21 + oemcrypto/opk/ports/linux/cas/scripts/run.sh | 43 + .../linux/cas/tee/tee_simulator_cas/Makefile | 64 + .../cas/tee/tee_simulator_cas/data_share.h | 75 + .../tee/tee_simulator_cas/data_share_impl.c | 212 + .../tee/tee_simulator_cas/tee_simulator.cpp | 112 + .../cas/tee/tee_simulator_cas/tuner_impl.c | 76 + .../cas/tee/tee_simulator_cas/wtpi_cas.c | 92 + .../linux/cas/tee/tuner_tee_serialization.c | 153 + .../linux/cas/tee/tuner_tee_serialization.h | 27 + oemcrypto/opk/ports/linux/cas/tuner_hal.h | 40 + .../opk/ports/linux/common/posix_resources.h | 19 + .../opk/ports/linux/common/posix_services.h | 136 + .../linux/common/test/shared_memory_test.cpp | 237 + .../linux/common/test/shared_memory_test.gyp | 28 + .../opk/ports/linux/common/tos_logging.cpp | 68 + .../ports/linux/common/tos_secure_buffers.c | 34 + .../ports/linux/common/tos_shared_memory.cpp | 88 + .../opk/ports/linux/common/tos_transport.cpp | 155 + .../opk/ports/linux/common/tos_transport.h | 26 + .../ports/linux/host/liboemcrypto/Makefile | 39 + .../linux/host/liboemcrypto/load_library.cpp | 17 + .../linux/host/oemcrypto_helloworld/Makefile | 31 + .../linux/host/oemcrypto_helloworld/main.c | 20 + .../linux/host/oemcrypto_unittests/Makefile | 38 + .../ports/linux/host/wtpi_unittests/Makefile | 51 + oemcrypto/opk/ports/linux/liboemcrypto.gyp | 31 + .../ports/linux/oemcrypto_tee_simulator.gyp | 74 + oemcrypto/opk/ports/linux/rules.mk | 84 + oemcrypto/opk/ports/linux/scripts/build.sh | 20 + oemcrypto/opk/ports/linux/scripts/run.sh | 57 + oemcrypto/opk/ports/linux/ta/common/clock.cpp | 20 + .../ports/linux/ta/common/tee_simulator.cpp | 104 + .../wtpi_impl/layer2_crypto_key_table.c | 227 + .../wtpi_impl/layer2_crypto_key_table.h | 87 + .../linux/ta/common/wtpi_impl/sources.mk | 53 + .../test-only/DO-NOT-RELEASE-TO-PARTNERS | 0 .../test-only/file_store_interface.c | 167 + .../test-only/file_store_interface.h | 59 + .../ta/common/wtpi_impl/test-only/wtpi_cas.c | 51 + .../test-only/wtpi_device_key_access.c | 21 + .../test-only/wtpi_init_and_clock_no_ipc.cpp | 48 + .../test-only/wtpi_persistent_storage.c | 59 + ...wtpi_crypto_and_key_management_layer2_hw.c | 479 ++ .../wtpi_device_renewal_layer2_test.c | 30 + .../wtpi_impl/wtpi_init_and_clock_ipc.c | 30 + .../common/wtpi_impl/wtpi_oemcrypto_config.c | 87 + .../ta/common/wtpi_impl/wtpi_test_impl.gyp | 84 + .../opk/ports/linux/ta/oemcrypto_ta/Makefile | 56 + .../ports/linux/ta/tee_simulator/README.md | 23 + .../opk/ports/linux/ta/wtpi_test_ta/Makefile | 66 + .../opk/ports/linux/wtpi_tee_simulator.gyp | 60 + .../opk/ports/optee/scripts/install_ta.sh | 46 + oemcrypto/opk/ports/optee/scripts/push.sh | 26 + .../opk/ports/optee/scripts/qemu-check.py | 89 + .../ports/optee/scripts/qemu-check.py.vpython | 17 + .../optee/scripts/qemu-check.py.vpython3 | 17 + .../optee/ta/common/wtpi_impl/crypto_common.h | 25 + .../tee/special_case_request_handlers.c | 48 + .../tee/special_case_request_handlers.h | 25 + oemcrypto/opk/setup.sh | 84 + oemcrypto/test/GEN_api_lock_file.c | 306 ++ .../23ef7d98cdd44b07f7a582b24e44984a835aeb59 | Bin 0 -> 280 bytes .../b02efc63fc06ecac3df93523d2318ec8a67e8d21 | Bin 0 -> 280 bytes .../f8b4afb2db6344296026dad1cd863f04bab5f6b0 | Bin 0 -> 280 bytes .../0285ab6852dc82c1adee1ef77a6573df480161d7 | Bin 0 -> 368 bytes .../03705943a03b55af8796a85ef076751c1a35dab3 | Bin 0 -> 512 bytes .../04f3c6813639af694f3b8752798ddff9bbfa5fea | Bin 0 -> 122 bytes .../080308d9a78045272feb864835800f3c963e4110 | Bin 0 -> 368 bytes .../09064c11a50f1e5a7e3e561495aa4148c425ee41 | Bin 0 -> 288 bytes .../096509f3e835e6235b48d6fb33ce73093f2996dc | Bin 0 -> 162 bytes .../0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 | Bin 0 -> 122 bytes .../10e69df82df7df7a5d3cffe390d5073a37527c78 | Bin 0 -> 368 bytes .../1121c84038be5099dc3ce3d2d69d5e8d0b094c98 | Bin 0 -> 406 bytes .../114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d | Bin 0 -> 288 bytes .../11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 | Bin 0 -> 288 bytes .../11c19b2cc104b1cf85422685340d5e917498ee16 | Bin 0 -> 852 bytes .../120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 | Bin 0 -> 341 bytes .../14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 | Bin 0 -> 368 bytes .../151941252771d6c9173ee1397d457db28bc20059 | Bin 0 -> 406 bytes .../1522db2eb65a0eafe367151d77b3a4dbfe65bee4 | Bin 0 -> 128 bytes .../161778100a4dcf30cb49fe57d0ed8cd55a1230ca | Bin 0 -> 288 bytes .../180835f71f4a9bfde27b61579c2a3a6d8d8e78ef | Bin 0 -> 852 bytes .../1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 | Bin 0 -> 341 bytes .../1ba27988b89d8936e9237fb758059df1bc3ac36a | Bin 0 -> 288 bytes .../1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 | Bin 0 -> 512 bytes .../1be21d7100f97ffba5b208ee5715d2f7531f383b | Bin 0 -> 128 bytes .../1efe003a4fc59c06e4e40756025e59753418e53e | Bin 0 -> 341 bytes .../2032071963b1e60dac0ccd91cbd564e3c9e26a63 | Bin 0 -> 512 bytes .../21f47f867c422f05c68997e44f395bf6d6d0c4b3 | Bin 0 -> 128 bytes .../249806515cd342087c40b0d529e68ea01e1b128e | Bin 0 -> 122 bytes .../27c685d38645723287ce2a36cf338aa3126ca787 | Bin 0 -> 122 bytes .../2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 | Bin 0 -> 512 bytes .../2dce8534f57150afe93ca38282a60e6db0d0f7ab | Bin 0 -> 368 bytes .../2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 | Bin 0 -> 852 bytes .../2e7e7652ce6f56d00ab740749d65a886172ad01a | Bin 0 -> 341 bytes .../30bc1ad7affa6c1e83b008e02d3d78e765b27a6c | Bin 0 -> 368 bytes .../31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 | Bin 0 -> 406 bytes .../31cf7b90c83d6d4f1373d967fc7e230b13707cad | Bin 0 -> 162 bytes .../325cc084469713e200c0af60c74292f395da6064 | Bin 0 -> 368 bytes .../337fde52cf8682af547dd23d8c0c4f47d41e168b | Bin 0 -> 128 bytes .../366aef68845adf6f2e1bcc4bc4928ff2e301aa06 | Bin 0 -> 368 bytes .../372062024cbde403d2c135674db50d3013718eca | Bin 0 -> 368 bytes .../3c522e95e036fbedf884b59caba80f4d4a5eb9a9 | Bin 0 -> 162 bytes .../3db0d75cfdb383714d6bb3c1d7ededaed2123be1 | Bin 0 -> 512 bytes .../403143beed32fa7cd4255ff9153515713447605d | Bin 0 -> 406 bytes .../42105d003732a222e40d25c877bd182983d1d07e | Bin 0 -> 852 bytes .../437e26ba4817162fda786201e9f9348e8badf9fe | Bin 0 -> 341 bytes .../456ce34099fe25289e165eaa1f93a94b8c0beee9 | Bin 0 -> 341 bytes .../48bc8352918a8225afcb7c6990a9d68983fb22db | Bin 0 -> 341 bytes .../4a1e8694a2a9ef8f55364a473c3160a15b7e979e | Bin 0 -> 341 bytes .../4badb31c370b762025e980d3d0e6e90dc0c4b22a | Bin 0 -> 368 bytes .../4bda3ac6a2ed0e63735181845273e44ee096a02d | Bin 0 -> 368 bytes .../4be9a6a1a463c1babc2fc82de8b855c622227200 | Bin 0 -> 341 bytes .../4c4b4ac81d0444b917c445c46f568e1ade6eebc8 | Bin 0 -> 368 bytes .../4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f | Bin 0 -> 512 bytes .../52c1fe05c67dd4caae0cc36ac41024600474e775 | Bin 0 -> 162 bytes .../565383265f1550107176113eb22943ad2178a731 | Bin 0 -> 288 bytes .../569fe4adef9b529c33facecf2b14c320cebd820d | Bin 0 -> 512 bytes .../584cafd42a17936992f68b152b2a7af0ac5695bb | Bin 0 -> 512 bytes .../59ac68c41431dc78942624816ddaf1c9284b90a1 | Bin 0 -> 512 bytes .../5c3a4b2851af7350171172b52b354049b77be5d5 | Bin 0 -> 406 bytes .../5d15891a80d8172de682be6dace7f5bb300e4d36 | Bin 0 -> 512 bytes .../649a785d4fa52fc0db4d90d51b084353ad1e6f6d | Bin 0 -> 406 bytes .../64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 | Bin 0 -> 512 bytes .../65d11e1a8031645bd1bd1a21e1f1fa24e048999c | Bin 0 -> 406 bytes .../6708bf88a56c292dd3c45abaa0e99314c4fddd9f | Bin 0 -> 122 bytes .../69dd5d28b00400a20a1887ab5b655c4bb468f70f | Bin 0 -> 162 bytes .../6d020263a43603c5caa8f3274ed65dfc90e467d0 | Bin 0 -> 122 bytes .../6f63549f4969ebcf0d8504159519f9b20cb259aa | Bin 0 -> 288 bytes .../70daf8991859146fff0f147d190594f07b2952b3 | Bin 0 -> 368 bytes .../733b4e9024aa0f32227da45a08b12d0715ed0834 | Bin 0 -> 406 bytes .../7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 | Bin 0 -> 406 bytes .../7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa | Bin 0 -> 852 bytes .../80a95f4446f5e696769fc1e738a6b9166f8880b3 | Bin 0 -> 122 bytes .../82d659133954be19147475562b9ca11f4bcf2056 | Bin 0 -> 852 bytes .../840a171b28b5c4d7b7b52d71a9926c8ad516fc0d | Bin 0 -> 368 bytes .../84ff4cce4c529e07e5b68e143d54a665c5969534 | Bin 0 -> 128 bytes .../8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a | Bin 0 -> 368 bytes .../87bc4b02fd7544d306e8db2629ee73fda0e4d581 | Bin 0 -> 368 bytes .../87e457fd00f48571ecc482ca7ff96e3375869ac3 | Bin 0 -> 122 bytes .../8b7a5c18731be9ba1c9d836667ec007a4169de23 | Bin 0 -> 162 bytes .../8d47cedfb8c23677b10651e05645ab8b1835b6c1 | Bin 0 -> 162 bytes .../8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 | Bin 0 -> 512 bytes .../8f55993eb44bc293d662c18a407f915f03df1e9d | Bin 0 -> 512 bytes .../903baaa085161d75d34d28dc743227c85f2f5b47 | Bin 0 -> 406 bytes .../905f7519227f6a03890b23f2d4fa1808912c1709 | Bin 0 -> 512 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 .../9f7fefbfe661e56b0c07e931851389b041692567 | Bin 0 -> 341 bytes .../9fa54bed19e057df5194cf2232117e86d3b6dc0b | Bin 0 -> 128 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 .../a9d9462a602e9e54ebe86ad523a4cf509202239b | Bin 0 -> 162 bytes .../aacbeaf7eadf2c9354f8b5cef48604212008eb33 | Bin 0 -> 288 bytes .../ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 | Bin 0 -> 368 bytes .../adfd0ced22d4b14d9472dd39ef6ada4137180844 | Bin 0 -> 368 bytes .../ae4904456f7c98fa460127cad5722629eaf375b7 | Bin 0 -> 288 bytes .../b0671a9ca0688908c35b0197bda0ff7cd91a7802 | Bin 0 -> 368 bytes .../b147ac2fd9218077a901f82afcbbbd71a032be28 | Bin 0 -> 341 bytes .../b3ae974d2558a81d2ce7f10caacced4f1f47c533 | Bin 0 -> 122 bytes .../b428deb46505b6dddd37f4e68312096200804f1c | Bin 0 -> 852 bytes .../b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 | Bin 0 -> 852 bytes .../b53b0c974f3296788ed15885cdd393c19eaa833a | Bin 0 -> 162 bytes .../b572c5d6854c1a5048682c66e8856e9d36e7432d | Bin 0 -> 406 bytes .../b7360deec7bff31dae35d0dbdd8de5d275f1191a | Bin 0 -> 288 bytes .../ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 | Bin 0 -> 288 bytes .../bc08741066ebc87d7d46ef6a5984971ae6186fa2 | Bin 0 -> 162 bytes .../c195fa7da39afc1bf330ae04bce401bb200b5aef | Bin 0 -> 128 bytes .../c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 | Bin 0 -> 162 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 .../d32eb599a72c10c702179987c3bf9162c44e1a96 | Bin 0 -> 128 bytes .../d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 | Bin 0 -> 122 bytes .../d4be74f6acbd8a4ee481ce49a35659f7f3549e06 | Bin 0 -> 162 bytes .../d53171a36056241ea76c8ae089770d740241ab4b | Bin 0 -> 128 bytes .../d6210463c5504048832ec428987ae12196879dbf | Bin 0 -> 368 bytes .../d7041c3322321256350b0295456d933798b89c3b | Bin 0 -> 288 bytes .../d8569cb9f35686a68ea12980ffcf452f9fceb5aa | Bin 0 -> 852 bytes .../d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 | Bin 0 -> 368 bytes .../da19453351c3c97a6638c6459d5e6d52530ef2b0 | Bin 0 -> 368 bytes .../dacb7f933d8091949eb58a1d4742d63852b4940d | Bin 0 -> 852 bytes .../db05326428a371755ad51eacbdce730d9fdfeb4e | Bin 0 -> 512 bytes .../dc30a02c1536990acb36cb29373edbc7ad6637cd | Bin 0 -> 288 bytes .../dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d | Bin 0 -> 128 bytes .../e0282b8026051307d6821f4214fd732a82d2ca14 | Bin 0 -> 128 bytes .../e0a42c3dd45b6b2b1af036784202c319ca10f146 | Bin 0 -> 122 bytes .../e9019d481211e8c40574ccc15907bd89922381e6 | Bin 0 -> 368 bytes .../e974276349af1ab8387631f597bfba994bd5da9c | Bin 0 -> 852 bytes .../eb533db3c1a3fb6e75363004769aab5a45dedddb | Bin 0 -> 512 bytes .../ee63e1eec358c118f02bc9a0f426cd9df72fabf1 | Bin 0 -> 512 bytes .../f2db36b7af0430c073936a17a9005dc45265ff3b | Bin 0 -> 406 bytes .../f64d8aac4b4c11f8226965fa11a2cfb4295f7987 | Bin 0 -> 122 bytes .../f85ac377234f5f7b4b15ace9365eefae27881876 | Bin 0 -> 128 bytes .../f8eec32608e9d330b3973576735646427a6731f8 | Bin 0 -> 512 bytes .../fb655444ed95def5326f642c7ac3a6a7e7cae5de | Bin 0 -> 406 bytes .../fba13dc4063739e6d3b1651a742cfb80e5053fdf | Bin 0 -> 288 bytes .../fd63517f1edf14196b80b795c08995f3a4cdbd35 | Bin 0 -> 368 bytes .../feabcbfd6a97b797941d0989be77e8156a75a02e | Bin 0 -> 852 bytes .../02e3dc401871be9b4fcbf6dfd658842567ca7c1c | Bin 0 -> 178 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 0 -> 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 0 -> 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 .../714731f02b06f331811f54cd92dede72377d6e7e | Bin 0 -> 772 bytes .../72a401ddc314e9cdf3cd79080610a57cfedc47ad | Bin 0 -> 772 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 .../fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc | 70 + .../oemcrypto_entitled_key_session_fuzz.cc | 136 + ...ypto_generate_certificate_key_pair_fuzz.cc | 63 + ...mcrypto_get_boot_certificate_chain_fuzz.cc | 41 + .../fuzz_tests/oemcrypto_get_random_fuzz.cc | 24 + .../oemcrypto_install_oem_private_key_fuzz.cc | 25 + .../oemcrypto_move_usage_entry_fuzz.cc | 29 + .../oemcrypto_query_key_control_fuzz.cc | 43 + .../oemcrypto_reuse_usage_entry_fuzz.cc | 26 + .../fuzz_tests/oemcrypto_select_key_fuzz.cc | 38 + ...emcrypto_shrink_usage_table_header_fuzz.cc | 34 + oemcrypto/util/test/oem_cert_test.h | 27 + util/include/string_format.h | 18 + util/src/string_format.cpp | 40 + util/test/string_format_unittest.cpp | 64 + 308 files changed, 14623 insertions(+) create mode 100644 oemcrypto/odk/test/odk_golden_v16.cpp create mode 100644 oemcrypto/odk/test/odk_golden_v17.cpp create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_cas_interface.h create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi_reference/odk_endian.c create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.cpp create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.h create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_cas.c create mode 100644 oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_persistent_storage.c create mode 100644 oemcrypto/opk/ports/linux/Makefile create mode 100644 oemcrypto/opk/ports/linux/README.md create mode 100644 oemcrypto/opk/ports/linux/cas/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/README.md create mode 100644 oemcrypto/opk/ports/linux/cas/ree/cas_unittests/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/ree/hello_world/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/ree/hello_world/main.c create mode 100644 oemcrypto/opk/ports/linux/cas/ree/liboemcrypto/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/ree/libtuner/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.c create mode 100644 oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.h create mode 100755 oemcrypto/opk/ports/linux/cas/scripts/build.sh create mode 100755 oemcrypto/opk/ports/linux/cas/scripts/run.sh create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/Makefile create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share.h create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share_impl.c create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tee_simulator.cpp create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tuner_impl.c create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/wtpi_cas.c create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.c create mode 100644 oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.h create mode 100644 oemcrypto/opk/ports/linux/cas/tuner_hal.h create mode 100644 oemcrypto/opk/ports/linux/common/posix_resources.h create mode 100644 oemcrypto/opk/ports/linux/common/posix_services.h create mode 100644 oemcrypto/opk/ports/linux/common/test/shared_memory_test.cpp create mode 100644 oemcrypto/opk/ports/linux/common/test/shared_memory_test.gyp create mode 100644 oemcrypto/opk/ports/linux/common/tos_logging.cpp create mode 100644 oemcrypto/opk/ports/linux/common/tos_secure_buffers.c create mode 100644 oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp create mode 100644 oemcrypto/opk/ports/linux/common/tos_transport.cpp create mode 100644 oemcrypto/opk/ports/linux/common/tos_transport.h create mode 100644 oemcrypto/opk/ports/linux/host/liboemcrypto/Makefile create mode 100644 oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp create mode 100644 oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/Makefile create mode 100644 oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/main.c create mode 100644 oemcrypto/opk/ports/linux/host/oemcrypto_unittests/Makefile create mode 100644 oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile create mode 100644 oemcrypto/opk/ports/linux/liboemcrypto.gyp create mode 100644 oemcrypto/opk/ports/linux/oemcrypto_tee_simulator.gyp create mode 100644 oemcrypto/opk/ports/linux/rules.mk create mode 100755 oemcrypto/opk/ports/linux/scripts/build.sh create mode 100755 oemcrypto/opk/ports/linux/scripts/run.sh create mode 100644 oemcrypto/opk/ports/linux/ta/common/clock.cpp create mode 100644 oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.h create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/DO-NOT-RELEASE-TO-PARTNERS create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.h create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_cas.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_device_key_access.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_init_and_clock_no_ipc.cpp create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_persistent_storage.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_device_renewal_layer2_test.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_init_and_clock_ipc.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_oemcrypto_config.c create mode 100644 oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp create mode 100644 oemcrypto/opk/ports/linux/ta/oemcrypto_ta/Makefile create mode 100644 oemcrypto/opk/ports/linux/ta/tee_simulator/README.md create mode 100644 oemcrypto/opk/ports/linux/ta/wtpi_test_ta/Makefile create mode 100644 oemcrypto/opk/ports/linux/wtpi_tee_simulator.gyp create mode 100755 oemcrypto/opk/ports/optee/scripts/install_ta.sh create mode 100755 oemcrypto/opk/ports/optee/scripts/push.sh create mode 100644 oemcrypto/opk/ports/optee/scripts/qemu-check.py create mode 100644 oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython create mode 100644 oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython3 create mode 100644 oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h create mode 100644 oemcrypto/opk/serialization/tee/special_case_request_handlers.c create mode 100644 oemcrypto/opk/serialization/tee/special_case_request_handlers.h create mode 100755 oemcrypto/opk/setup.sh create mode 100644 oemcrypto/test/GEN_api_lock_file.c 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 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 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 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 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 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 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 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 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 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 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 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b 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 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 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 create mode 100644 oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 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 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 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 create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_entitled_key_session_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc create mode 100644 oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc create mode 100644 oemcrypto/util/test/oem_cert_test.h create mode 100644 util/include/string_format.h create mode 100644 util/src/string_format.cpp create mode 100644 util/test/string_format_unittest.cpp diff --git a/oemcrypto/odk/test/odk_golden_v16.cpp b/oemcrypto/odk/test/odk_golden_v16.cpp new file mode 100644 index 0000000..ba0e6aa --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v16.cpp @@ -0,0 +1,4134 @@ +// 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 "odk.h" + +#include +#include + +#include + +#include "gtest/gtest.h" + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.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, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + 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_; + // TODO(fredgc): padding is removed in protocol 2.2. + 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_LICENSE="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..2a73408 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v17.cpp @@ -0,0 +1,3847 @@ +// 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 "odk.h" + +#include +#include + +#include + +#include "gtest/gtest.h" + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.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, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + 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_; + // TODO(fredgc): padding is removed in protocol 2.2. + 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_LICENSE="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/opk/oemcrypto_ta/wtpi/wtpi_cas_interface.h b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_cas_interface.h new file mode 100644 index 0000000..a48a451 --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_cas_interface.h @@ -0,0 +1,146 @@ +/* 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 OEMCRYPTO_TA_WTPI_CAS_INTERFACE_H_ +#define OEMCRYPTO_TA_WTPI_CAS_INTERFACE_H_ + +#include "OEMCryptoCENC.h" +#include "wtpi_crypto_and_key_management_interface_layer1.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup cas CAS + * + * This interface includes functions for CAS only. + * + * If a device is not using CAS, then these functions can return + * OEMCRYPTO_NOT_IMPLEMENTED. + * + * @{ + */ + +/** + * Initializes CAS. + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_UNKNOWN_FAILURE otherwise + */ +OEMCryptoResult WTPI_InitializeCas(void); + +/** + * Terminates CAS. + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_UNKNOWN_FAILURE otherwise + */ +OEMCryptoResult WTPI_TerminateCas(void); + +/** + * Allocates a key slot descriptor for |session_id|, and places the result in + * *|key_slot_descriptor|. Key slot descriptor is used to track key slot info, + * and store additional vendor-specific properties of the key slot, if any. The + * implementation of a key slot descriptor is vendor-specific: a. a key slot + * descriptor can directly point to the allocation of a key slot, or b. a key + * slot descriptor is allocated apart from a key slot, and holds a handle to the + * key slot + * + * Caller retains ownership of all pointers. + * + * @param[in] session_id: entitled key session id + * @param[out] key_slot_descriptor: key slot and properties holder + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INSUFFICIENT_RESOURCES if key slot descriptor cannot + * be allocated + * @retval OEMCrypto_ERROR_INVALID_CONTEXT if |key_slot_descriptor| is NULL + */ +OEMCryptoResult WTPI_AllocateKeySlotDescriptor(OEMCrypto_SESSION session_id, + void** key_slot_descriptor); + +/** + * Frees key slot descriptor. + * + * Caller retains ownership of all pointers. + * + * @param[in] key_slot_descriptor: key slot and properties holder + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_UNKNOWN_FAILURE otherwise + */ +OEMCryptoResult WTPI_FreeKeySlotDescriptor(void* key_slot_descriptor); + +/** + * Installs entitled content key to a key slot specified in + * |key_slot_descriptor|. + * + * Caller retains ownership of all pointers. + * + * @param[in] key_slot_descriptor: info of the destination key slot where the + * key is to be installed + * @param[in] key_handle: key to install + * @param[in] cipher_mode: the encryption mode of the media content + * @param[in] is_even: key parity flag + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INVALID_CONTEXT any of the pointers are NULL, or + * |key_handle| is invalid + */ +OEMCryptoResult WTPI_InstallContentKey(void* key_slot_descriptor, + WTPI_K1_SymmetricKey_Handle key_handle, + OEMCryptoCipherMode cipher_mode, + bool is_even); + +/** + * Installs entitled content IV to a key slot specified in + * |key_slot_descriptor|. + * + * Caller retains ownership of all pointers. + * + * @param[in] key_slot_descriptor: info of the destination key slot where the IV + * is to be installed + * @param[in] iv: pointer to the initialization vector to be installed + * @param[in] iv_length: size of the initialization vector + * @param[in] is_even: key parity flag + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INVALID_CONTEXT any of the pointers are NULL + */ +OEMCryptoResult WTPI_InstallContentIV(void* key_slot_descriptor, uint8_t* iv, + size_t iv_length, bool is_even); + +/** + * Get the key token from |key_slot_descriptor|, and places the result + * in |key_token| and sets |key_token_length| to the appropriate length. The key + * token is implementation-specific and is used by the key consumer to locate + * the key slot. It can be as simple as just an index into a shared key table, + * or it can hold more information as required by the key consumer. The key + * token is expected to leave the TEE and be used elsewhere, which is different + * from the key slot descriptor which never leaves the TEE. + * + * Caller retains ownership of all pointers. + * + * @param[in] key_slot_descriptor: key slot info and properties holder + * @param[out] key_token: key token that identifies the key slot + * @param[in,out] key_token_length: length of the key slot, in bytes + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INVALID_CONTEXT any of the pointers are NULL + */ +OEMCryptoResult WTPI_GetKeyToken(void* key_slot_descriptor, uint8_t* key_token, + size_t* key_token_length); + +/** + * Returns the key token length for OEMCrypto_GetOEMKeyToken. + */ +size_t WTPI_GetKeyTokenSize(void); + +/// @} + +#ifdef __cplusplus +} +#endif + +#endif /* OEMCRYPTO_TA_WTPI_CAS_INTERFACE_H_ */ diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/odk_endian.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/odk_endian.c new file mode 100644 index 0000000..343d08e --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/odk_endian.c @@ -0,0 +1,54 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include + +#include "odk_endian.h" + +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 + +// default is little endian unless specified otherwise at build time +#ifndef BYTE_ORDER +# define BYTE_ORDER LITTLE_ENDIAN +#endif + +/* Swap bytes in 16-bit value. */ +#define __bswap_constant_16(x) \ + ((uint16_t)((((x) >> 8) & 0xff) | (((x)&0xff) << 8))) + +/* Swap bytes in 32-bit value. */ +#define __bswap_constant_32(x) \ + ((((x)&0xff000000u) >> 24) | (((x)&0x00ff0000u) >> 8) | \ + (((x)&0x0000ff00u) << 8) | (((x)&0x000000ffu) << 24)) + +/* Swap bytes in 64-bit value. */ +#define __bswap_constant_64(x) \ + ((((x)&0xff00000000000000ull) >> 56) | (((x)&0x00ff000000000000ull) >> 40) | \ + (((x)&0x0000ff0000000000ull) >> 24) | (((x)&0x000000ff00000000ull) >> 8) | \ + (((x)&0x00000000ff000000ull) << 8) | (((x)&0x0000000000ff0000ull) << 24) | \ + (((x)&0x000000000000ff00ull) << 40) | (((x)&0x00000000000000ffull) << 56)) + +#if BYTE_ORDER == LITTLE_ENDIAN +// Little endian +// swap all + +uint32_t oemcrypto_htobe16(uint16_t u16) { return __bswap_constant_16(u16); } +uint32_t oemcrypto_be16toh(uint16_t u16) { return __bswap_constant_16(u16); } +uint32_t oemcrypto_htobe32(uint32_t u32) { return __bswap_constant_32(u32); } +uint32_t oemcrypto_be32toh(uint32_t u32) { return __bswap_constant_32(u32); } +uint64_t oemcrypto_htobe64(uint64_t u64) { return __bswap_constant_64(u64); } +uint64_t oemcrypto_be64toh(uint64_t u64) { return __bswap_constant_64(u64); } + +#elif BYTE_ORDER == BIG_ENDIAN +// Big endian +// keep all + +uint32_t oemcrypto_htobe16(uint16_t u16) { return u16; } +uint32_t oemcrypto_be16toh(uint16_t u16) { return u16; } +uint32_t oemcrypto_htobe32(uint32_t u32) { return u32; } +uint32_t oemcrypto_be32toh(uint32_t u32) { return u32; } +uint64_t oemcrypto_htobe64(uint64_t u64) { return u64; } +uint64_t oemcrypto_be64toh(uint64_t u64) { return u64; } +#endif diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.cpp b/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.cpp new file mode 100644 index 0000000..aae843a --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.cpp @@ -0,0 +1,176 @@ +// 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 "cose_util.h" +#include "dice/cbor_reader.h" +#include "log.h" + +using wtpi_test::ScopedCbor; + +OEMCryptoResult GetCoseSign1OffsetInBcc(uint8_t* bytes, size_t bytes_len, + size_t* offset, size_t* len) { + if (!bytes || bytes_len == 0 || !offset || !len) + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + + struct CborIn in; + CborInInit(bytes, bytes_len, &in); + size_t bcc_item_count = 0; + enum CborReadResult res = CborReadArray(&in, &bcc_item_count); + if (res != CBOR_READ_RESULT_OK) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + if (bcc_item_count < 2) { + // There should at least be the public key and one entry. + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + + // The first item in the BCC array is the device public key + res = CborReadSkip(&in); + if (res != CBOR_READ_RESULT_OK) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + + const size_t cosesign_offset = CborInOffset(&in); + // Skip the item to know the size + res = CborReadSkip(&in); + if (res != CBOR_READ_RESULT_OK) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + size_t data_size = CborInOffset(&in) - cosesign_offset; + *offset = cosesign_offset; + *len = data_size; + return OEMCrypto_SUCCESS; +} + +void print_cbor(cn_cbor* cn, uint32_t type) { + if (!cn) return; + + cn_cbor_errback error; + cn_cbor* e; + ScopedCbor c; + switch (type) { + case CN_CBOR_BYTES: + LOGE("bytes with length %zu", cn->length); + c = ScopedCbor(cn_cbor_decode(cn->v.bytes, cn->length, &error)); + e = c.get(); + if (!e) { + LOGE("decoded bytes returned nil with error %d at pos %zu", error.err, + error.pos); + return; + } + print_cbor(e, e->type); + break; + case CN_CBOR_ARRAY: + for (size_t i = 0; i < cn->length; i++) { + e = cn_cbor_index(cn, i); + LOGE("element #%zu:", i); + LOGE("type: %d", e->type); + print_cbor(e, e->type); + } + break; + case CN_CBOR_MAP: + e = cn; + for (cn_cbor* cp = e->first_child; cp && cp->next; cp = cp->next->next) { + if (cp->type == CN_CBOR_UINT) { + LOGE("cp->v.uint %lu", cp->v.uint); + } else if (cp->type == CN_CBOR_INT) { + LOGE("cp->v.sint %ld", cp->v.sint); + } else { + LOGE("tag type is %d", cp->type); + } + } + break; + default: + LOGE("processing other type: %d", type); + } +} + +namespace wtpi_test { +// Copied and modified from open-dice test_utils.cc +ScopedCbor ExtractCwtFromCborCertificate(const uint8_t* certificate, + size_t certificate_size) { + // BCC structure is something like + /* + * ARRAY[ + * MAP{ <-- DK_pub + * tag 1 + * ... + * }, + * ARRAY[ <-- CoseSign1 + * BYTES-MAP{ + * }, + * MAP{ + * }, + * BYTES-MAP{ <-- CWT, aka "BCC payload" + * tag -4670552 <-- public key + * tag -4670553 + * }, + * BYTES{ <-- signature + * }, + * ... + * + */ + + if (!certificate) return nullptr; + cn_cbor_errback error; + ScopedCbor bcc(cn_cbor_decode(certificate, certificate_size, &error)); + if (!bcc) { + return nullptr; + } + + // print tree of current bcc struct for debugging. May have to inspect error + // if cn_cbor_decode() fails. + // print_cbor(bcc.get(), bcc->type); + + if (bcc->type != CN_CBOR_ARRAY || bcc->length < 2) { + return nullptr; + } + + cn_cbor* inner_arr = cn_cbor_index(bcc.get(), 1); + if (!inner_arr || inner_arr->type != CN_CBOR_ARRAY || inner_arr->length < 4) { + return nullptr; + } + + cn_cbor* payload = cn_cbor_index(inner_arr, 2); + if (!payload || payload->type != CN_CBOR_BYTES) { + return nullptr; + } + + ScopedCbor cwt(cn_cbor_decode(payload->v.bytes, payload->length, &error)); + if (cwt && cwt->type != CN_CBOR_MAP) { + return nullptr; + } + return cwt; +} + +// Copied from open-dice test_utils.cc +ScopedCbor ExtractPublicKeyFromCwt(const cn_cbor* cwt) { + cn_cbor_errback error; + cn_cbor* key_bytes = cn_cbor_mapget_int(cwt, -4670552); + if (!key_bytes || key_bytes->type != CN_CBOR_BYTES) { + return nullptr; + } + ScopedCbor key(cn_cbor_decode(key_bytes->v.bytes, key_bytes->length, &error)); + if (key && key->type != CN_CBOR_MAP) { + return nullptr; + } + return key; +} + +ScopedCbor ExtractPublicKeyFromBcc(const uint8_t* bytes, size_t bytes_len) { + // Get bcc payload, which is a CBOR Web Token. + ScopedCbor cwt = ExtractCwtFromCborCertificate(bytes, bytes_len); + if (!cwt) { + return nullptr; + } + + // Extract public key from CWT struct + ScopedCbor public_key_cbor = ExtractPublicKeyFromCwt(cwt.get()); + if (!public_key_cbor) { + return nullptr; + } + + return public_key_cbor; +} +} // namespace wtpi_test diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.h b/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.h new file mode 100644 index 0000000..63593df --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/cose_util.h @@ -0,0 +1,36 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#ifndef WTPI_TEST_COSE_UTIL_H_ +#define WTPI_TEST_COSE_UTIL_H_ + +#include +#include + +#include "OEMCryptoCENC.h" +#include "cose/cose.h" + +namespace wtpi_test { +// A scoped pointer for cn_cbor. +struct CborDeleter { + void operator()(cn_cbor* c) { cn_cbor_free(c); } +}; + +using ScopedCbor = std::unique_ptr; + +// Given BCC data in |bytes| and |bytes_len|, return a unique ptr to a cn_cbor +// struct of type CN_CBOR_BYTE that contains the public key. Must be a cn_cbor +// pointer to be compatible with COSE-C library's COSE_Sign1_validate() func +ScopedCbor ExtractPublicKeyFromBcc(const uint8_t* bytes, size_t bytes_len); +} // namespace wtpi_test + +// Print basic type and tag information for a cn_cbor* tree for array, map, and +// byte CBOR types +void print_cbor(cn_cbor* cn, uint32_t type); + +// Given BCC data in |bytes| and |bytes_len|, find the byte offset of the +// CoseSign1 entry and return that. Also return the length of the entry. +OEMCryptoResult GetCoseSign1OffsetInBcc(uint8_t* bytes, size_t bytes_len, + size_t* offset, size_t* len); +#endif diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_cas.c b/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_cas.c new file mode 100644 index 0000000..930ca25 --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_cas.c @@ -0,0 +1,51 @@ +/* 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 "wtpi_cas_interface.h" + +OEMCryptoResult WTPI_InitializeCas(void) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_TerminateCas(void) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_AllocateKeySlotDescriptor(OEMCrypto_SESSION session_id, + void** key_slot_descriptor) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_FreeKeySlotDescriptor(void* key_slot_descriptor) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentKey(void* key_slot_descriptor, + WTPI_K1_SymmetricKey_Handle key_handle, + OEMCryptoCipherMode cipher_mode, + bool is_even) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentIV(void* key_slot_descriptor, uint8_t* iv, + size_t iv_length, bool is_even) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_GetKeyToken(void* key_slot_descriptor, uint8_t* key_token, + size_t* key_token_length) { + // TODO + return OEMCrypto_SUCCESS; +} + +size_t WTPI_GetKeyTokenSize(void) { + // TODO + return 0; +} diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_persistent_storage.c b/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_persistent_storage.c new file mode 100644 index 0000000..f86e3fd --- /dev/null +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_useless/wtpi_persistent_storage.c @@ -0,0 +1,54 @@ +/* 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 + +#include "oemcrypto_check_macros.h" +#include "wtpi_persistent_storage.h" + +/* This implementation does not meet persistent storage reqiurements. It will + * pass most unit tests, but will fail under more realistic scenarios such as + * reboot. This will not work on an actual device. This file should be replaced + * with an implementation that stores data securely and persistently across + * reboots. + */ + +#define FAKE_PERSISTENT_DATA_MAX_SIZE 5 * 1024 +static uint8_t fake_persistent_data[FAKE_PERSISTENT_DATA_MAX_SIZE]; +static size_t pdata_used = 0; + +OEMCryptoResult WTPI_PrepareStoredPersistentData(void) { + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_LoadPersistentData(uint8_t* data, size_t* data_length) { + RETURN_INVALID_CONTEXT_IF_NULL(data); + RETURN_INVALID_CONTEXT_IF_NULL(data_length); + + if (pdata_used == 0) { + return OPK_ERROR_NO_PERSISTENT_DATA; + } + + if (*data_length < pdata_used) { + *data_length = pdata_used; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + + memcpy(data, fake_persistent_data, pdata_used); + *data_length = pdata_used; + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_StorePersistentData(const uint8_t* data, + size_t data_length) { + RETURN_INVALID_CONTEXT_IF_NULL(data); + + if (data_length > FAKE_PERSISTENT_DATA_MAX_SIZE) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + memset(fake_persistent_data, 0, FAKE_PERSISTENT_DATA_MAX_SIZE); + memcpy(fake_persistent_data, data, data_length); + pdata_used = data_length; + return OEMCrypto_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/Makefile b/oemcrypto/opk/ports/linux/Makefile new file mode 100644 index 0000000..38e28ae --- /dev/null +++ b/oemcrypto/opk/ports/linux/Makefile @@ -0,0 +1,59 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# $CDM_DIR must be defined as the path to the top level of the OPK release +ifndef CDM_DIR + $(error CDM_DIR is undefined) +endif + +.EXPORT_ALL_VARIABLES: + +WTPI_BUILD_INFO := Linux_TEE_Simulator +ARCH := 64 +IS_ARM := 0 + +.PHONY: all +all: host ta + +.PHONY: ta +ta: oemcrypto_ta wtpi_ta + +.PHONY: host +host: oemcrypto_helloworld oemcrypto_unittests wtpi_unittests + +.PHONY: oemcrypto_ta +oemcrypto_ta: + +$(MAKE) -C ta/oemcrypto_ta + +.PHONY: wtpi_ta +wtpi_ta: + +$(MAKE) -C ta/wtpi_test_ta + +.PHONY: liboemcrypto +liboemcrypto: + +$(MAKE) -C host/liboemcrypto + +.PHONY: oemcrypto_helloworld +oemcrypto_helloworld: liboemcrypto + +$(MAKE) -C host/oemcrypto_helloworld + +.PHONY: oemcrypto_unittests +oemcrypto_unittests: liboemcrypto + +$(MAKE) -C host/oemcrypto_unittests + +.PHONY: wtpi_unittests +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 + diff --git a/oemcrypto/opk/ports/linux/README.md b/oemcrypto/opk/ports/linux/README.md new file mode 100644 index 0000000..f2ae772 --- /dev/null +++ b/oemcrypto/opk/ports/linux/README.md @@ -0,0 +1,105 @@ +# Linux example port + +This folder contains an end-to-end OPK example implementation using a simulated +REE/TEE boundary. Everything runs on the REE in Linux. + +** This implementation is for testing only! There is no reason for the provided +TA code to ever run in a non-secure environment in production. ** + +The following examples can be run +- `oemcrypto_unittests`: runs OEMCrypto API unit tests against the OEMCrypto TA +- `wtpi_unittests`: runs WTPI unit tests against the WTPI Test TA +- `oemcrypto_helloworld`: calls OEMCrypto_Initialize() to prove that the + serialization and execution works correctly between the REE and TEE. + +Before running each example, make sure the matching TEE simulator has been +started. The `oemcrypto_unittests` and `oemcrypto_helloworld` executables work +with tee_simulator_oemcrypto, and `wtpi_unittests` work with tee_simulator_wtpi. +Running in the background is sufficient, eg `./tee_simulator_oemcrypto &`. + +Instead of running in the TEE as a trusted app, the TA code is compiled as +a REE-side binary. The transport and shared memory interfaces of both host and +trusted apps are implemented using the POSIX shared memory and semaphore +libraries. The request and response messages are located in a shared memory +block and the request and response semaphores are used to synchronize the REE +and TEE communication by signaling when messages are available. + +# Build and run + +``` +$ make -C oemcrypto/opk/ports/linux all + +# Run simulated TEE with OEMCrypto TA +# If scripting around this, wait 1 second to allow TA time to start +$ ./oemcrypto_ta & + +# Capture pid +$ export TEE_SIM_PID=$! + +# Run host app +$ ./oemcrypto_helloworld + +# Stop TEE simulator +$ kill $TEE_SIM_PID +``` + +# Code organization + +``` +├── common +│   └── TOS implementation, POSIX resources +├── host +│   ├── liboemcrypto +│   │   └── builds liboemcrypto.so +│   ├── oemcrypto_helloworld +│   │   └── builds oemcrypto_helloworld executable +│   ├── oemcrypto_unittests +│   │   └── builds oemcrypto_unittests executable +│   └── wtpi_unittests +│   └── builds wtpi_unittests executable +├── rules.mk # Common build rules for all executables +└── ta + ├── common + │   ├── clock.cpp + │   ├── tee_simulator.cpp # Entry point for TAs + │   └── wtpi_impl + │   └── WTPI implementations specific to Linux test port + ├── oemcrypto_ta + │   └── builds simulated OEMCrypto TA + ├── gyp + │   └── internal GYP files + └── wtpi_test_ta + └── builds simulated WTPI Test TA + +``` + + +# OPK_SendMessage + +``` + +-----+ +-------------------+ +---------------+ +-------------------+ +-----+ + | REE | | ResponseSemaphore | | SharedMemory | | RequestSemaphore | | TEE | + +-----+ +-------------------+ +---------------+ +-------------------+ +-----+ + | | | | | + | | | | wait | + | | | |<-------------| + | | | | | + | write request | | | | + |----------------------------------->| | | + | | | | | + | post | | | | + |------------------------------------------------------->| | + | | | | | + | wait | | | | + |--------------->| | | | + | | | | | + | | | | read request | + | | |<---------------------------------| + | | | | | + | | | | post | + | |<-----------------------------------------------------| + | | | | | + | read response | | | | + |----------------------------------->| | | + | | | | | +``` diff --git a/oemcrypto/opk/ports/linux/cas/Makefile b/oemcrypto/opk/ports/linux/cas/Makefile new file mode 100644 index 0000000..c92e5a9 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/Makefile @@ -0,0 +1,53 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# $CDM_DIR must be defined as the path to the top level of the OPK release +ifndef CDM_DIR + $(error CDM_DIR is undefined) +endif + +.EXPORT_ALL_VARIABLES: + +ARCH := 64 +IS_ARM := 0 + +.PHONY: all +all: ree tee + +.PHONY: ree +ree: hello_world cas_unittests + +.PHONY: tee +tee: tee_simulator_cas + +.PHONY: liboemcrypto +liboemcrypto: + +$(MAKE) -C ree/liboemcrypto + +.PHONY: libtuner +libtuner: + +$(MAKE) -C ree/libtuner + +.PHONY: hello_world +hello_world: liboemcrypto libtuner + +$(MAKE) -C ree/hello_world + +.PHONY: cas_unittests +cas_unittests: liboemcrypto libtuner + +$(MAKE) -C ree/cas_unittests + +.PHONY: tee_simulator_cas +tee_simulator_cas: + +$(MAKE) -C tee/tee_simulator_cas + +.PHONY: clean +clean: + +$(MAKE) -C tee/tee_simulator_cas clean + +$(MAKE) -C ree/liboemcrypto clean + +$(MAKE) -C ree/libtuner clean + +$(MAKE) -C ree/hello_world clean + +$(MAKE) -C ree/cas_unittests clean + diff --git a/oemcrypto/opk/ports/linux/cas/README.md b/oemcrypto/opk/ports/linux/cas/README.md new file mode 100644 index 0000000..1d23708 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/README.md @@ -0,0 +1,227 @@ +# OEMCrypto CAS demo on Linux + +## Quick Start + +to build: `CDM_DIR= ./scripts/build.sh` +to run: `CDM_DIR= ./scripts/run.sh` + +Can set CDM_DIR as a global variable, or inject every time you run. + +To build manually, call `CDM_DIR= make liboemcrypto -j32` +from this directory. Feel free to replace `liboemcrypto` with whichever make +recipe you want. + +## Overview + +This is a Linux-based demo of the OEMCrypto CAS functionality in the OPK. The +demo itself is very narrow in scope, and is not suitable for production without +significant modification. + +In particular, the "TA" portion runs as a separate process in the REE for ease +of debugging and inspection. At the very least, this code must be ported to a +TEE in order to run in a secure manner. + +This project demonstrates the connection from REE (liboemcrypto.so and +libtuner.so) to the TA (tee_simulator_cas) to call OEMCrypto functions +and the Tuner descrambler together. + +## Design + +This CAS demo is a modified version of the Linux OEMCrypto port +(oemcrypto/opk/ports/linux). It generally follows the same design as that port, +such as choosing to run the TA code in a separate Linux process rather than a +TEE. + +The CAS demo builds three types of output: + +1. _App level_ (hello_world, cas_unittests). These call OEMCrypto and Tuner +functions directly. A real system would use plugins, CDM, etc. +2. _Libraries_ (liboemcrypto.so and libtuner.so). These serialize the OEMCrypto +and Tuner function calls into message bytes to send to the TA. +3. _TA_ (tee_simulator_cas). This is a single application that combines all code +for message deserialization, OEMCrypto function execution, Tuner descrambling, +and data sharing for CAS ECM keys. Because it is a single binary, the shared +data can exist as global variables or statically linked functions. A real +system would likely separate the OEMCrypto, descrambling, and shared data into +individual trusted apps. + +The app and libraries are expected to run in a REE no matter what. The "TA" +portion should realistically run in a TEE, but for the purposes of this demo +all TA code runs in a separate Linux process. This avoids the need to support +TEE-specific communication protocols -- instead, the two Linux apps use POSIX +shared mem and semaphores to pass messages back and forth. + +### Apps + +hello_world calls basic OEMCrypto and Tuner functions to prove that the +serialization and deserialization paths work and can communicate with the +tee_simulator_cas process. + +cas_unittests is intended to run the expected OEMCrypto setup functions before +calling Tuner_Decrypt() on real content. However, this is incomplete until we +can cleanly extract sample content and matching entitlement keys for a local +test (no network access). + +### Libraries + +liboemcrypto.so is almost the exact same as an OEMCrypto implementation for a +DRM-only (not CAS) target. Like a typical DRM use case, this serializes all +OEMCrypto functions for sending to the TEE. The one minor difference is the +addition of a CAS-specific field in some data structures. + +libtuner.so is new, specific to this demo. It uses the same serialization +scheme as liboemcrypto.so, but for a single Decrypt() function. In a real +system this might not be necessary at all, as a platform-specific descrambler +can take its place. The `tuner_ree_serialization` files provide the REE-side +serialization code used in this library, while the *_tee_* equivalent is used +in the TA. + +### TA + +The TA code runs in a single application called `tee_simulator_cas`. This is +similar to the name of the Linux OPK port, which is "tee simulator". This +application runs in Linux userspace as a while loop, watching when POSIX +shared memory contains messages from liboemcrypto.so and libtuner.so. Then those +messages are deserialized and executed as either OEMCrypto or Tuner functions. + +Apart from the while loop and POSIX resource management, the rest of the code +is in C and should be portable to any platform-specific use case with the OPK. + +The while loop and POSIX messaging scheme is not intended to be used on a real +device. It is a shortcut to run easily on Linux. + +One limitation of having all TA code run in a single application is that +incoming messages are received in a single thread. So liboemcrypto.so and +libtuner.so functions can be called from the app in multiple threads, but they +will be received and executed sequentially, potentially blocking the calling +threads until previous function execution is complete. This is a limitation of +the OPK C functions used in message deserialization and temporary memory +allocation -- both OEMCrypto and Tuner deserialization paths have to use the +same statically allocated resouces in this case, which we cannot easily thread +proof. + +## How to modify this demo for a real world use case + +This demo cuts corners in a few ways and is not usable as-is for production. A +few modifications are necessary: + +1. Separation of OEMCrypto, Descrambler, and data share in TEE. Add platform- +specific TA entry points for each. +2. Completely rewrite data_share_impl.c to reflect platform-specific key +descriptors, key tokens, key table, and concurrency. Possible changes to +wtpi_cas.c to match. +3. Replace libtuner.so and Tuner_Decrypt() with actual tuner integration if +applicable. + +More details in sections below + +### Move OEMCrypto, Tuner, data share to TEE + +A real system would likely have completely separate OEMCrypto, Tuner, and data +share portions (3 parts) running in a TEE. In order to access the shared data, +TEE-specific mechanisms would need to be used. Using the code in this demo as a +reference, those three parts would be divided roughly as follows: + +1. OEMCrypto: all `opk_base_ta_sources`, `wtpi_impl_sources`, +`boringssl_sources`, and `dice_sources` for a typical OEMCrypto build. Also +`wtpi_cas.c` to access shared_data. +2. Tuner: `tuner_impl.c`, `tuner_tee_serialization.c` +3. Data share: `data_share_impl.c` + +The source code in each portion above will need to be modified to access the +shared data in a TEE-specific way. + +For example, running in OP-TEE would require the shared data to be a separate +TA. OEMCrypto would call the wtpi_cas functions to access the data, and those +implementations would use TEE_OpenTASession()/TEE_InvokeTACommand()/ +TA_CloseTASession() GlobalPlatform methods to access that TA. The Tuner would +use the same functions to acess the shared data from its side. + +Similarly, the `tee_simulator_cas/tee_simulator.cpp` file would need to be +completely replaced with TEE-specific entry points for the OEMCrypto and Tuner +portions. + +A Tuner TA using these files might not be necessary, as it might already exist +on some platforms. + +### More secure and portable Key Tokens + +The data returned by OEMCrypto_GetOEMKeyToken() is visible to the REE. As such, +it should not convey any information about the underlying key data, and should +be generally tamperproof. The demo implementation here only uses the key table +index and does not check for tampering. + +In particular, the functions in `data_share.h` will need updated implementations +to match any new key token and key descriptor design. + +This demo leverages the OEMCrypto code to take advantage of the common key +handle creation and management. Since the TA code executes in the same binary, +an OEMCrypto key handle can be directly used in the Tuner decrypt function. If +everything is separated, the key handle may not be directly shareable the way +it is in this demo. + +### Possible changes to data share mutex + +The demo uses a data share with a global mutex to guard against simultaneous +reads and writes. Some TEEs may not be able to use the same POSIX mutex +structures, and may need to rely on other mechanisms. Some TEE's already allow +only one TA accessor at a time, effectively accomplishing the same end goal as a +mutex. + +### REE/TEE communication + +The current serialization interface uses POSIX shared memory to communicate +between the REE and TEE. This will need to be changed to a TEE-specific +mechanism. In particular, the TOS functions (the files under +`oemcrypto/opk/ports/linux/common/`) will need to be modified. See the OP-TEE +port or Trusty port `tos_` files for example implementations of +this REE/TEE communication layer in a real world example. + +### Integration with more realistic REE code + +This demo uses Google Test on the REE to call the OEMCrypto and Tuner functions. +This is not realistic. The MediaCAS plugin would be a better exerciser of the +code, either in VTS tests or other high-level integration suite. + +### Improved data share management + +This demo uses a rudimentary data share implementation that only writes more +information without freeing up unused slots. None of the shared key data from +OEMCrypto will be free'd, so eventually the key table will run out of space, +even when sessions are closed. An improved implementation would use +WTPI_FreeKeySlotDescriptor() to clean up a slot on session close. + +## Folder structure + +oemcrypto/opk/ports/linux/cas +├── Makefile +├── README.md +├── ree +│   ├── cas_unittests +│   │   ├── cas_tests.cpp +│   │   └── Makefile +│   ├── hello_world +│   │   ├── main.c +│   │   └── Makefile +│   ├── liboemcrypto +│   │   └── Makefile +│   ├── libtuner +│   │   └── Makefile +│   ├── tuner_ree_serialization.c +│   └── tuner_ree_serialization.h +├── scripts +│   ├── build.sh +│   └── run.sh +├── tee +│   ├── tee_simulator_cas +│   │   ├── data_share.h +│   │   ├── data_share_impl.c +│   │   ├── Makefile +│   │   ├── tee_simulator.cpp +│   │   ├── tuner_impl.c +│   │   └── wtpi_cas.c +│   ├── tuner_tee_serialization.c +│   └── tuner_tee_serialization.h +└── tuner_hal.h + +9 directories, 21 files diff --git a/oemcrypto/opk/ports/linux/cas/ree/cas_unittests/Makefile b/oemcrypto/opk/ports/linux/cas/ree/cas_unittests/Makefile new file mode 100644 index 0000000..04ca79e --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/cas_unittests/Makefile @@ -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. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux/cas// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/cas/$(project)/ +output = $(project) + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(srcdir)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(oemcrypto_unittests_sources) \ + +incs += \ + $(oemcrypto_unittests_includes) \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/ree \ + +ldflags = \ + -lrt -ldl \ + -L$(builddir)/../liboemcrypto/ -loemcrypto \ + -L$(builddir)/../libtuner/ -ltuner \ + -static-libstdc++ \ + +cppflags += \ + -DOPENSSL_NO_ASM \ + -Wnon-virtual-dtor \ + -DCAS_TEST \ + +include ../../../rules.mk + + diff --git a/oemcrypto/opk/ports/linux/cas/ree/hello_world/Makefile b/oemcrypto/opk/ports/linux/cas/ree/hello_world/Makefile new file mode 100644 index 0000000..7d22b9e --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/hello_world/Makefile @@ -0,0 +1,35 @@ +# +# Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux/cas// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/cas/$(project)/ +output = $(project) + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(srcdir)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/ree/hello_world/main.c \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/include \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/ree \ + +ldflags = \ + -lrt -ldl \ + -L$(builddir)/../liboemcrypto/ -loemcrypto \ + -L$(builddir)/../libtuner/ -ltuner \ + +include ../../../rules.mk + + diff --git a/oemcrypto/opk/ports/linux/cas/ree/hello_world/main.c b/oemcrypto/opk/ports/linux/cas/ree/hello_world/main.c new file mode 100644 index 0000000..87ef32f --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/hello_world/main.c @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#include +#include "OEMCryptoCENC.h" +#include "tuner_hal.h" + +int main(void) { + printf("Hello world\n"); + + OEMCryptoResult res; + res = OEMCrypto_Initialize(); + printf("OEMCrypto_Initialize() returned %d\n", res); + + // TODO: get expected call hierarchy for example usage + // OEMCrypto_CreateEntitledKeySession() + // OEMCrypto_LoadKeys() + // OEMCrypto_LoadCasECMKeys() + // OEMCrypto_GetOEMKeyToken() + + // TODO: populate with test data + TunerHalResult res2 = TunerHal_Decrypt(NULL, 0, 0, NULL, 0, NULL); + printf("TunerHal_Decrypt() returned %d\n", res2); + + OEMCrypto_Terminate(); + + return 0; +} diff --git a/oemcrypto/opk/ports/linux/cas/ree/liboemcrypto/Makefile b/oemcrypto/opk/ports/linux/cas/ree/liboemcrypto/Makefile new file mode 100644 index 0000000..3d5c0d1 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/liboemcrypto/Makefile @@ -0,0 +1,39 @@ +# +# Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux/cas// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/cas/$(project)/ +output = $(project).so + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(CDM_DIR)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp \ + $(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.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp \ + $(liboemcrypto_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/oemcrypto_ta/include \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/liboemcrypto \ + $(liboemcrypto_includes) \ + +cflags += \ + -DWV_POSIX_RESOURCE_ID=\"tee_simulator_cas\" \ + +ldflags = -lpthread -shared -lrt + +include ../../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/cas/ree/libtuner/Makefile b/oemcrypto/opk/ports/linux/cas/ree/libtuner/Makefile new file mode 100644 index 0000000..4c85ccd --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/libtuner/Makefile @@ -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. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux/cas// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/cas/$(project)/ +output = $(project).so + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(CDM_DIR)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(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.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.c \ + $(liboemcrypto_sources) \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/ \ + $(liboemcrypto_includes) \ + $(oemcrypto_dir)/opk/oemcrypto_ta \ + $(oemcrypto_dir)/include \ + +# Here the liboemcrypto.so and libtuner.so transport layers share the same +# destination, which is a POSIX shm with the tag "tee_simulator_cas" +cflags += \ + -DWV_POSIX_RESOURCE_ID=\"tee_simulator_cas\" \ + +ldflags = -lpthread -shared -lrt + +include ../../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.c b/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.c new file mode 100644 index 0000000..3e3bc17 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.c @@ -0,0 +1,135 @@ + +/* + * 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 "GEN_common_serializer.h" +#include "GEN_ree_serializer.h" +#include "OEMCryptoCENC.h" +#include "api_support.h" +#include "bump_allocator.h" +#include "log_macros.h" +#include "message_debug.h" +#include "ree_special_cases.h" +#include "ree_version.h" +#include "shared_buffer_allocator.h" +#include "tos_shared_memory_interface.h" +#include "tos_transport_interface.h" +#include "tuner_ree_serialization.h" + +#define TUNER_HAL_DECRYPT_API_VALUE 12345 + +TunerHalResult TunerHal_Decrypt( + const uint8_t* key_token, + size_t key_token_length, + KeyParityType key_parity, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern) { + pthread_mutex_lock(&api_lock); + TunerHalResult result = TUNER_HAL_ERROR_UNKNOWN_FAILURE; + ODK_Message request = ODK_Message_Create(NULL, 0); + ODK_Message response = ODK_Message_Create(NULL, 0); + API_Initialize(); + request = + // OPK_Pack_TunerHal_Decrypt_Request(session, samples, samples_length, pattern); + OPK_Pack_TunerHal_Decrypt_Request(key_token, key_token_length, key_parity, samples, samples_length, pattern); + if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { + if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { + api_result = TUNER_HAL_ERROR_BUFFER_TOO_LARGE; + } else { + api_result = TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + goto cleanup_and_return; + } + response = API_Transact(&request); + OPK_Unpack_TunerHal_Decrypt_Response(&response, &result); + + if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { + api_result = TUNER_HAL_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; +} + +ODK_Message OPK_Pack_TunerHal_Decrypt_Request( + const uint8_t* key_token, + size_t key_token_length, + KeyParityType key_parity, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern) { + uint32_t api_value = + TUNER_HAL_DECRYPT_API_VALUE; // TODO: how will this interact on the TEE + // side? + 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, &key_token_length); + OPK_PackMemory(&msg, (const uint8_t*)key_token, + OPK_ToLengthType(key_token_length)); + + OPK_Pack_uint32_t(&msg, &key_parity); + + OPK_Pack_size_t(&msg, &samples_length); + /* pack object array with packer function OPK_Pack_OEMCrypto_SampleDescription + */ + ODK_Message* const odk_message = &msg; + const void* const objs = (const void*)samples; + const LengthType count = OPK_ToLengthType(samples_length); + const size_t size = sizeof(OEMCrypto_SampleDescription); + const bool is_null = objs == NULL || OPK_LengthIsNull(count); + if (!OPK_PackBoolValue(odk_message, is_null)) { + for (size_t i = 0; i < OPK_ToSizeT(count); i++) { + OPK_Pack_OEMCrypto_SampleDescription( + odk_message, (const OEMCrypto_SampleDescription*)(objs + i * size)); + } + } + OPK_PackNullable_OEMCrypto_CENCEncryptPatternDesc(&msg, pattern); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + +void OPK_Unpack_TunerHal_Decrypt_Response(ODK_Message* msg, + TunerHalResult* result) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != TUNER_HAL_DECRYPT_API_VALUE) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + OPK_Unpack_uint32_t(msg, result); + if (!Is_Valid_TunerHalResult(*result)) { + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); + } + OPK_UnpackEOM(msg); + + if (SuccessResult(*result)) { + OPK_SharedBuffer_FinalizeUnpacking(); + } +} + +bool Is_Valid_TunerHalResult(uint32_t value) { + switch (value) { + case 0: /* TUNER_HAL_SUCCESS */ + case 1: /* TUNER_HAL_ERROR_UNKNOWN_FAILURE */ + case 2: /* TUNER_HAL_ERROR_BUFFER_TOO_LARGE */ + case 3: /* TUNER_HAL_ERROR_NOT_IMPLEMENTED */ + + return true; + default: + return false; + } +} \ No newline at end of file diff --git a/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.h b/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.h new file mode 100644 index 0000000..8d3bfd8 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/ree/tuner_ree_serialization.h @@ -0,0 +1,17 @@ + +#ifndef _TUNER_REE_SERIALIZATION_H_ +#define _TUNER_REE_SERIALIZATION_H_ + +#include "tuner_hal.h" + +ODK_Message OPK_Pack_TunerHal_Decrypt_Request( + const uint8_t* key_token, size_t key_token_length, KeyParityType key_parity, + const OEMCrypto_SampleDescription* samples, size_t samples_length, + const OEMCrypto_CENCEncryptPatternDesc* pattern); + +void OPK_Unpack_TunerHal_Decrypt_Response(ODK_Message* msg, + TunerHalResult* result); + +bool Is_Valid_TunerHalResult(uint32_t value); + +#endif \ No newline at end of file diff --git a/oemcrypto/opk/ports/linux/cas/scripts/build.sh b/oemcrypto/opk/ports/linux/cas/scripts/build.sh new file mode 100755 index 0000000..a25eb06 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/scripts/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Builds OEMCrypto CAS demo test file and TA simulator + +if [ -z "$CDM_DIR" ]; then + echo "CDM_DIR must be set to the top of the repo" + exit +fi + +# relative to CDM_DIR +PROJECT_DIR=./oemcrypto/opk/ports/linux/cas + +build() { + pushd $CDM_DIR + make -j$(nproc) -C $PROJECT_DIR cas_unittests hello_world tee_simulator_cas $1 + popd +} + +build PROVISIONING_METHOD=OEMCrypto_Keybox + +# build PROVISIONING_METHOD=OEMCrypto_BootCertificateChain + diff --git a/oemcrypto/opk/ports/linux/cas/scripts/run.sh b/oemcrypto/opk/ports/linux/cas/scripts/run.sh new file mode 100755 index 0000000..3e296f8 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/scripts/run.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Runs OEMCrypto CAS demo test +# +# Race conditions sometimes occur, causing the executables to hang at the +# beginning of each test suite, so don't rely on these for CI/CD or production. + +if [ -z "$CDM_DIR" ]; then + echo "CDM_DIR must be set to the top of the repo" + exit +fi + +kill_ta_simulators() { + tee_simulator_cas_pid=$(ps aux | grep '[t]ee_simulator_cas' | awk '{print $2}') + + if [ -n "$tee_simulator_cas_pid" ]; then + echo "Terminating CAS TEE simulator (PID $tee_simulator_cas_pid)" + kill $tee_simulator_cas_pid + fi +} + +run_tests() { + builddir=$CDM_DIR/out/linux/cas + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$builddir/liboemcrypto:$builddir/libtuner + + $builddir/tee_simulator_cas/tee_simulator_cas & + + trap kill_ta_simulators EXIT + + sleep 1 + tee_simulator_cas_pid=$(ps aux | grep '[t]ee_simulator_cas' | awk '{print $2}') + if [[ -f "/proc/$tee_simulator_cas_pid/stat" ]]; then + $builddir/cas_unittests/cas_unittests --gtest_filter="*OEMCryptoCasDemoTest*" + # $builddir/hello_world/hello_world + else + echo "CAS TEE simulator did not start." + FINAL_RESULT=43 + fi +} + +run_tests + +exit $FINAL_RESULT diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/Makefile b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/Makefile new file mode 100644 index 0000000..1931349 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/Makefile @@ -0,0 +1,64 @@ +# +# Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This Makefile is not intended to be invoked on its own. It is possible +# though. Be sure to set the following variables. +# - CDM_DIR: path to top of CDM repo + +# Place outputs in $CDM_DIR/out/linux/cas// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/cas/$(project)/ +output = $(project) + +# Define this for tee-sources.mk, which uses it as a prefix for source file +# locations +OPK_REPO_TOP := +# tee-sources.mk provides opk_base_ta_sources and opk_base_ta_includes +include $(CDM_DIR)/oemcrypto/opk/build/tee-sources.mk +include $(CDM_DIR)/oemcrypto/opk/build/ree-sources.mk + +# Definitions for wtpi_impl sources.mk +wtpi_impl_dir := $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl + +# Provides wtpi_impl_sources and wtpi_impl_includes +include $(CDM_DIR)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tee_simulator.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/clock.cpp \ + $(tos_impl_dir)/tos_shared_memory.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share_impl.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tuner_impl.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/wtpi_cas.c \ + $(opk_base_ta_sources) \ + $(wtpi_impl_sources) \ + $(boringssl_sources) \ + $(dice_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common \ + $(OPK_REPO_TOP)/util/include \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/cas/tee \ + $(opk_base_ta_includes) \ + $(wtpi_impl_includes) \ + $(boringssl_includes) \ + $(dice_includes) \ + +cflags += \ + -DWTPI_BUILD_INFO=\"$(WTPI_BUILD_INFO)\" \ + -DSUPPORT_CAS \ + -DWV_POSIX_RESOURCE_ID=\"$(project)\" \ + -D_DEFAULT_SOURCE + +ldflags = \ + -lrt -lpthread \ + +include ../../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share.h b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share.h new file mode 100644 index 0000000..8b623e0 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share.h @@ -0,0 +1,75 @@ +/* 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 _CAS_DATA_SHARE_H_ +#define _CAS_DATA_SHARE_H_ + +#include +#include +#include +#include "OEMCryptoCENC.h" +#include "wtpi_config_macros.h" +#include "wtpi_crypto_and_key_management_interface_layer1.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_NUMBER_OF_CAS_KEYTABLE_ENTRIES \ + (CONTENT_KEYS_PER_SESSION * MAX_NUMBER_OF_ENTITLED_KEY_SESSIONS) + +typedef uint32_t CasKeyDescriptor; + +// Sets up key table. Returns false if already initialized. +// Called by OEMCrypto (writer) +bool CasKeyTable_Init(); + +// Tears down key table. Returns false if already uninitialized. +// Called by OEMCrypto (writer) +bool CasKeyTable_Close(); + +// Claims an empty key slot. Returns true if successful, false if unable to +// find an empty key slot. Writes a pointer to a CasKeyDescriptor object that +// can be used to reference the slot later. +// Returns false if key table not initialized. +// Called by OEMCrypto (writer) +bool CasKeyTable_ClaimSlot(CasKeyDescriptor** slot_descriptor); + +// Writes a key and/or IV to a slot's even or odd space. If a key or IV has +// already been written, returns false. +// If WTPI_K1_SymmetricKey_Handle is NULL, it is ignored. If iv is NULL, it is +// ignored. +// Called by OEMCrypto (writer) +bool CasKeyTable_WriteKey(CasKeyDescriptor descriptor, bool is_even, + const WTPI_K1_SymmetricKey_Handle key, + OEMCryptoCipherMode cipher_mode); +bool CasKeyTable_WriteIV(CasKeyDescriptor descriptor, bool is_even, + const uint8_t* iv, size_t iv_length); + +// Reads a key and iv from a slot's even or odd space. If a key or cipher mode +// have not been written yet, returns false. If an IV has not been written, then +// iv_length is set to 0 but this function returns true. +// Called by Tuner (reader) +bool CasKeyTable_Read(CasKeyDescriptor descriptor, bool is_even, + WTPI_K1_SymmetricKey_Handle* key, + OEMCryptoCipherMode* cipher_mode, uint8_t* iv, + size_t* iv_length); + +// Converts a descriptor to a token. Tokens can be exported to the REE. +// Returns false if pointers are NULL or the conversion fails. +// Called by OEMCrypto +bool CasKeyTable_DescriptorToToken(CasKeyDescriptor descriptor, uint8_t* token, + size_t* token_length); + +// Converts a token to a descriptor. +// Returns false if pointers are NULL or the conversion fails. +// Called by Tuner +bool CasKeyTable_TokenToDescriptor(const uint8_t* token, size_t token_length, + CasKeyDescriptor* descriptor); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share_impl.c b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share_impl.c new file mode 100644 index 0000000..04cd461 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/data_share_impl.c @@ -0,0 +1,212 @@ +/* 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 +#include "data_share.h" +#include "oemcrypto_api_macros.h" + +OEMCryptoResult WTPI_K1_CopyKeyHandle(WTPI_K1_SymmetricKey_Handle key, + WTPI_K1_SymmetricKey_Handle* out); + +typedef struct KeyData { + WTPI_K1_SymmetricKey_Handle key; + uint8_t iv[16]; + OEMCryptoCipherMode cipher_mode; + bool key_written; + bool iv_written; +} KeyData; + +typedef struct KeySlot { + KeyData even; + KeyData odd; + CasKeyDescriptor descriptor; + bool available; +} KeySlot; + +typedef struct CasKeyTable { + KeySlot keys[MAX_NUMBER_OF_CAS_KEYTABLE_ENTRIES]; + size_t next_free_index; + bool is_initialized; +} CasKeyTable; + +static CasKeyTable g_cas_key_table = {0}; +static pthread_mutex_t g_cas_key_table_lock = PTHREAD_MUTEX_INITIALIZER; + +// Convert CasKeyDescriptor to index into table +bool Helper_DescriptorToIndex(CasKeyDescriptor descriptor, size_t* index) { + size_t result = (uint32_t)descriptor; + if (result >= MAX_NUMBER_OF_CAS_KEYTABLE_ENTRIES) { + return false; + } + + *index = result; + return true; +} + +bool CasKeyTable_DescriptorToToken(CasKeyDescriptor descriptor, uint8_t* token, + size_t* token_length) { + if (token == NULL || token_length == NULL) return false; + if (*token_length < sizeof(CasKeyDescriptor)) return false; + + memcpy(token, &descriptor, sizeof(CasKeyDescriptor)); + *token_length = sizeof(CasKeyDescriptor); + + return true; +} + +bool CasKeyTable_TokenToDescriptor(const uint8_t* token, size_t token_length, + CasKeyDescriptor* descriptor) { + if (token == NULL || descriptor == NULL || + token_length != sizeof(CasKeyDescriptor)) { + return false; + } + + memcpy(descriptor, token, sizeof(CasKeyDescriptor)); + + return true; +} + +// Boilerplate check to see if table is initialized (or not) before proceeding. +// Be sure to lock the global mutex before calling this. +#define CAS_RETURN_IF_INIT_IS(INITIALIZED) \ + do { \ + if (g_cas_key_table.is_initialized == INITIALIZED) { \ + pthread_mutex_unlock(&g_cas_key_table_lock); \ + return false; \ + } \ + } while (0) + +bool CasKeyTable_Init() { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(true); + + memset(&g_cas_key_table, 0, sizeof(g_cas_key_table)); + g_cas_key_table.is_initialized = true; + pthread_mutex_unlock(&g_cas_key_table_lock); + return true; +} + +bool CasKeyTable_Close() { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(false); + + memset(&g_cas_key_table, 0, sizeof(g_cas_key_table)); + g_cas_key_table.is_initialized = false; + pthread_mutex_unlock(&g_cas_key_table_lock); + return true; +} + +bool CasKeyTable_WriteKey(CasKeyDescriptor descriptor, bool is_even, + const WTPI_K1_SymmetricKey_Handle key, + OEMCryptoCipherMode cipher_mode) { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(false); + + size_t index = 0; + if (!Helper_DescriptorToIndex(descriptor, &index)) { + return false; + } + + KeySlot* slot = &(g_cas_key_table.keys[index]); + KeyData* data = is_even ? &(slot->even) : &(slot->odd); + + if (key != NULL) { + WTPI_K1_SymmetricKey_Handle key_handle_copy; + OEMCryptoResult result = WTPI_K1_CopyKeyHandle(key, &key_handle_copy); + if (result!= OEMCrypto_SUCCESS) return false; + data->key = key_handle_copy; + data->cipher_mode = cipher_mode; + data->key_written = true; + } + + pthread_mutex_unlock(&g_cas_key_table_lock); + return true; +} + +bool CasKeyTable_WriteIV(CasKeyDescriptor descriptor, bool is_even, + const uint8_t* iv, size_t iv_length) { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(false); + + size_t index = 0; + if (!Helper_DescriptorToIndex(descriptor, &index)) { + return false; + } + + KeySlot* slot = &(g_cas_key_table.keys[index]); + KeyData* data = is_even ? &(slot->even) : &(slot->odd); + + if (iv != NULL) { + if (iv_length > sizeof(data->iv)) { + // iv_length is too long + return false; + } + memcpy(data->iv, iv, iv_length); + data->iv_written = true; + } + + pthread_mutex_unlock(&g_cas_key_table_lock); + return true; +} + +bool CasKeyTable_Read(CasKeyDescriptor descriptor, bool is_even, + WTPI_K1_SymmetricKey_Handle* key, + OEMCryptoCipherMode* cipher_mode, uint8_t* iv, + size_t* iv_length) { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(false); + + size_t index = 0; + if (!Helper_DescriptorToIndex(descriptor, &index)) { + return false; + } + + KeySlot* slot = &(g_cas_key_table.keys[index]); + KeyData* data = is_even ? &(slot->even) : &(slot->odd); + + if (!data || !data->key_written) return false; + + if (key == NULL) return false; + *key = data->key; + + if (cipher_mode == NULL) return false; + *cipher_mode = data->cipher_mode; + + if (data->iv_written) { + if (iv == NULL || iv_length == NULL) return false; + if (*iv_length < sizeof(data->iv)) { + *iv_length = sizeof(data->iv); + return false; + } + + memcpy(iv, data->iv, sizeof(data->iv)); + *iv_length = sizeof(data->iv); + } + + pthread_mutex_unlock(&g_cas_key_table_lock); + + return true; +} + +bool CasKeyTable_ClaimSlot(CasKeyDescriptor** slot_descriptor) { + pthread_mutex_lock(&g_cas_key_table_lock); + CAS_RETURN_IF_INIT_IS(false); + + size_t i = g_cas_key_table.next_free_index; + if (i >= MAX_NUMBER_OF_CAS_KEYTABLE_ENTRIES) { + // out of space + return false; + } + + g_cas_key_table.keys[i].descriptor = i; + *slot_descriptor = &(g_cas_key_table.keys[i].descriptor); + + g_cas_key_table.next_free_index++; + + pthread_mutex_unlock(&g_cas_key_table_lock); + return true; +} diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tee_simulator.cpp b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tee_simulator.cpp new file mode 100644 index 0000000..e31aa94 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tee_simulator.cpp @@ -0,0 +1,112 @@ +/* + * Copyright 2021 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 + +#include "log_macros.h" +#include "odk_message.h" +#include "opk_dispatcher.h" +#include "opk_init.h" +#include "string.h" +#include "tuner_tee_serialization.h" +#include "tos_transport.h" +#include "tos_transport_interface.h" + +static pthread_t main_thread_tid; +static bool thread_running = false; + +void signalHandler(int signum) { + // TODO(fredgc): this doesn't actually kill anything because the main loop is + // stuck waiting for a new message. + thread_running = false; + // This exits, but then we skip the OPK_Terminate call. + exit(0); +} + +// The request message data must be copied into a local buffer +// so the contents can't be modified while being parsed. +static uint8_t local_buffer[OPK_TRANSPORT_MESSAGE_SIZE]; + +static void* MainLoop(void* arg) { + OPK_Initialize(); + thread_running = true; + while (thread_running) { + ODK_Message request, response; + OPK_TransportStatus transport_status = + TOS_Transport_ReceiveRequest(&request); + if (transport_status != OPK_TRANSPORT_STATUS_OK) { + LOGE("Receive request failed: status=%s", + OPK_TransportStatus_Str(transport_status)); + continue; + } + // + // !! IMPORTANT NOTE !! + // The request payload buffer MUST be copied out to TEE local + // storage so it can't be tampered with while being + // parsed. Failure to do so could introduce security + // vulnerabilities. + // + size_t payload_size = ODK_Message_GetSize(&request); + memcpy(local_buffer, ODK_Message_GetBase(&request), payload_size); + ODK_Message safe_request = + ODK_Message_Create(local_buffer, sizeof(local_buffer)); + ODK_Message_SetSize(&safe_request, payload_size); + + ODK_MessageStatus message_status = + OPK_DispatchMessage(&safe_request, &response); + if (message_status != MESSAGE_STATUS_OK) { + LOGE("Dispatch failed: status=%s", OPK_MessageStatus_Str(message_status)); + // Try tuner-specific dispatch just to be sure + message_status = Tuner_DispatchMessage(&safe_request, &response); + + if (message_status != MESSAGE_STATUS_OK) { + LOGE("Tuner dispatch failed: status=%s", + OPK_MessageStatus_Str(message_status)); + } + } + transport_status = TOS_Transport_SendResponse(&response); + if (transport_status != OPK_TRANSPORT_STATUS_OK) { + LOGE("Send response failed: status=%s", + OPK_TransportStatus_Str(transport_status)); + continue; + } + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + } + OPK_Terminate(); + return nullptr; +} + +int main(int argc, char** argv) { + pthread_attr_t p_attr; + + int result = pthread_attr_init(&p_attr); + if (result != 0) { + LOGF("Failed pthread_attr_init: %s", strerror(errno)); + abort(); + } + + LOGI("Reset shared resource state"); + system("rm /dev/shm/*opk*"); + + LOGI("Starting the main loop thread"); + result = pthread_create(&main_thread_tid, &p_attr, &MainLoop, nullptr); + if (result != 0) { + LOGF("Failed to spawn a thread: %s", strerror(errno)); + abort(); + } + signal(SIGTERM, signalHandler); + LOGI("Main is waiting for the main loop thread to exit"); + void* retval; + result = pthread_join(main_thread_tid, &retval); + if (result != 0) { + LOGF("Failed to join main thread: %s", strerror(errno)); + abort(); + } + return 0; +} diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tuner_impl.c b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tuner_impl.c new file mode 100644 index 0000000..b4b48fb --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/tuner_impl.c @@ -0,0 +1,76 @@ + +#include "OEMCryptoCENC.h" +#include "data_share.h" +#include "tuner_hal.h" +#include "wtpi_crypto_and_key_management_interface_layer1.h" +#include "wtpi_decrypt_sample_interface.h" +#include "wtpi_logging_interface.h" + +// This Tuner_Decrypt implementation takes heavy advantage of the shared +// OEMCrypto and WTPI implementations in this demo. Since everything is +// compiled into the same binary, we have access to all the OEMCrypto helpers. +// For example, the key management is built in. A key handle created by the +// WTPI helpers is immediately usable since everything is in the same memory +// space. A separate Tuner TA would need to figure out how to make key handles +// portable from OEMCrypto. + +TunerHalResult TunerHal_Decrypt( + const uint8_t* key_token, size_t key_token_length, KeyParityType key_parity, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern) { + // Argument checks + if (key_token == NULL || samples == NULL || pattern == NULL) { + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + if (key_parity != TunerHal_KeyParityType_OddKey && + key_parity != TunerHal_KeyParityType_EvenKey) { + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + + // Get key slot + CasKeyDescriptor descriptor; + if (!CasKeyTable_TokenToDescriptor(key_token, key_token_length, + &descriptor)) { + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + + // Turn key slot data into key handle + bool is_even = key_parity == TunerHal_KeyParityType_EvenKey ? true : false; + WTPI_K1_SymmetricKey_Handle key_handle = NULL; + uint8_t iv[16]; + size_t iv_length = 16; + OEMCryptoCipherMode cipher_mode = OEMCrypto_CipherMode_CTR; // default CTR + + if (!CasKeyTable_Read(descriptor, is_even, &key_handle, &cipher_mode, iv, + &iv_length)) { + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + + for (size_t i = 0; i < samples_length; i++) { + OPK_OutputBuffer output_buffer; + size_t output_offset; + if (OEMCrypto_SUCCESS != + OPK_ParseDestBufferDesc(&samples[i].buffers.output_descriptor, + &output_buffer, &output_offset)) { + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + + // TODO: bounds check output buffer, check license limits, etc + + // NOTE: + // This demo impl re-uses WTPI_DecryptSample to perform CTR decryption. This + // uses the SampleDescription IV instead of the entitled key IV. Since the + // incoming sample description is const, we have to modify it before + // calling TunerHal_Decrypt() for this demo. + OEMCryptoResult res = + WTPI_DecryptSample(key_handle, &samples[i], pattern, &output_buffer, + output_offset, cipher_mode); + if (res != OEMCrypto_SUCCESS) { + LOGE("Decrypt returned %d", res); + return TUNER_HAL_ERROR_UNKNOWN_FAILURE; + } + } + + return TUNER_HAL_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/wtpi_cas.c b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/wtpi_cas.c new file mode 100644 index 0000000..964d8b0 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tee_simulator_cas/wtpi_cas.c @@ -0,0 +1,92 @@ +/* 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 "data_share.h" +#include "oemcrypto_check_macros.h" +#include "wtpi_cas_interface.h" + +OEMCryptoResult WTPI_InitializeCas(void) { + if (!CasKeyTable_Init()) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_TerminateCas(void) { + if (!CasKeyTable_Close()) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_AllocateKeySlotDescriptor(OEMCrypto_SESSION session_id, + void** key_slot_descriptor) { + RETURN_INVALID_CONTEXT_IF_NULL(key_slot_descriptor); + + // Rely on CasKeyTable_ClaimSlot() using a pre allocated table, return pointer + // to descriptor in table key slot + CasKeyDescriptor* descriptor = NULL; + if (!CasKeyTable_ClaimSlot(&descriptor)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + *key_slot_descriptor = descriptor; + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_FreeKeySlotDescriptor(void* key_slot_descriptor) { + RETURN_INVALID_CONTEXT_IF_NULL(key_slot_descriptor); + + // Do nothing + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentKey(void* key_slot_descriptor, + WTPI_K1_SymmetricKey_Handle key_handle, + OEMCryptoCipherMode cipher_mode, + bool is_even) { + RETURN_INVALID_CONTEXT_IF_NULL(key_slot_descriptor); + RETURN_INVALID_CONTEXT_IF_NULL(key_handle); + CasKeyDescriptor* descriptor = (CasKeyDescriptor*)key_slot_descriptor; + if (!CasKeyTable_WriteKey(*descriptor, is_even, key_handle, cipher_mode)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentIV(void* key_slot_descriptor, uint8_t* iv, + size_t iv_length, bool is_even) { + RETURN_INVALID_CONTEXT_IF_NULL(key_slot_descriptor); + RETURN_INVALID_CONTEXT_IF_ZERO(iv_length); + + CasKeyDescriptor* descriptor = (CasKeyDescriptor*)key_slot_descriptor; + if (!CasKeyTable_WriteIV(*descriptor, is_even, iv, iv_length)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_GetKeyToken(void* key_slot_descriptor, uint8_t* key_token, + size_t* key_token_length) { + RETURN_INVALID_CONTEXT_IF_NULL(key_slot_descriptor); + RETURN_INVALID_CONTEXT_IF_NULL(key_token); + RETURN_INVALID_CONTEXT_IF_NULL(key_token_length); + + size_t required_size = WTPI_GetKeyTokenSize(); + + if (*key_token_length < required_size) { + *key_token_length = required_size; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + + *key_token_length = required_size; + CasKeyDescriptor* descriptor = (CasKeyDescriptor*)key_slot_descriptor; + if (!CasKeyTable_DescriptorToToken(*descriptor, key_token, + key_token_length)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +size_t WTPI_GetKeyTokenSize(void) { return sizeof(CasKeyDescriptor); } diff --git a/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.c b/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.c new file mode 100644 index 0000000..e75233b --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.c @@ -0,0 +1,153 @@ +/* + * 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 "GEN_common_serializer.h" +#include "GEN_tee_serializer.h" +#include "OEMCryptoCENC.h" +#include "bump_allocator.h" +#include "log_macros.h" +#include "marshaller_base.h" +#include "message_debug.h" +#include "odk_overflow.h" +#include "oemcrypto_wall_clock.h" +#include "opk_dispatcher.h" + +#include "shared_buffer_allocator.h" +#include "tee_special_cases.h" +#include "tos_shared_memory_interface.h" +#include "tos_transport_interface.h" + +#include "tuner_tee_serialization.h" + +static ODK_Message CreateEmptyMessage(void) { + static uint8_t buffer[1]; + ODK_Message msg = ODK_Message_Create(buffer, sizeof(buffer)); + OPK_PackEOM(&msg); + return msg; +} + +static ODK_Message NullMessage(void) { return ODK_Message_Create(NULL, 0); } + +void OPK_Init_OEMCrypto_CENCEncryptPatternDesc( + OEMCrypto_CENCEncryptPatternDesc* obj); + +/* See opk_dispatcher.h for definition of OPK_DispatchMessage() */ +ODK_MessageStatus Tuner_DispatchMessage(ODK_Message* request, + ODK_Message* response) { + if (request == NULL || response == NULL) + return MESSAGE_STATUS_NULL_POINTER_ERROR; + *response = NullMessage(); + uint32_t api_value; + OPK_Unpack_uint32_t(request, &api_value); + uint64_t timestamp; + OPK_Unpack_uint64_t(request, ×tamp); + OPK_SetWallClockTime(timestamp); + OPK_BumpAllocator_Reset(); + OPK_SharedBuffer_Reset(); + ODK_Message_Reset(request); + switch (api_value) { + case 12345: /* TunerHal_Decrypt */ + size_t key_token_length; + OPK_Init_size_t((size_t*)&key_token_length); + size_t* wrapped_key_token_length = (size_t*)OPK_VarAlloc(sizeof(size_t)); + OPK_Init_size_t(wrapped_key_token_length); + uint8_t* key_token; + OPK_InitPointer((uint8_t**)&key_token); + KeyParityType key_parity; + OPK_Init_uint32_t((uint32_t*)&key_parity); + size_t samples_length; + OPK_Init_size_t((size_t*)&samples_length); + OEMCrypto_SampleDescription* samples; + OPK_InitPointer((uint8_t**)&samples); + OEMCrypto_CENCEncryptPatternDesc* pattern = + (OEMCrypto_CENCEncryptPatternDesc*)OPK_VarAlloc( + sizeof(OEMCrypto_CENCEncryptPatternDesc)); + OPK_Init_OEMCrypto_CENCEncryptPatternDesc( + (OEMCrypto_CENCEncryptPatternDesc*)pattern); + // OPK_Unpack_DecryptCENC_Request(request, &session, &samples, + // &samples_length, &pattern); + OPK_Unpack_TunerHal_Decrypt_Request(request, &key_token, + &key_token_length, &key_parity, + &samples, &samples_length, &pattern); + if (!ODK_Message_IsValid(request)) goto handle_invalid_request; + TunerHalResult result; + OPK_Init_uint32_t((uint32_t*)&result); + result = TunerHal_Decrypt(key_token, key_token_length, key_parity, + samples, samples_length, pattern); + *response = OPK_Pack_TunerHal_Decrypt_Response(result); + break; + default: + return MESSAGE_STATUS_API_VALUE_ERROR; + } + return ODK_Message_GetStatus(response); + +handle_invalid_request: + LOGE("invalid request"); + *response = CreateEmptyMessage(); + return MESSAGE_STATUS_OK; +} + +void OPK_Unpack_TunerHal_Decrypt_Request( + ODK_Message* msg, uint8_t** key_token, size_t* key_token_length, + KeyParityType* key_parity, OEMCrypto_SampleDescription** samples, + size_t* samples_length, OEMCrypto_CENCEncryptPatternDesc** pattern) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 12345) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + uint64_t timestamp; + OPK_Unpack_uint64_t(msg, ×tamp); + + OPK_Unpack_size_t(msg, key_token_length); + OPK_UnpackInPlace(msg, (uint8_t**)key_token, + OPK_FromSizeTPtr(key_token_length)); + OPK_Unpack_uint32_t(msg, key_parity); + + OPK_Unpack_size_t(msg, samples_length); + /* unpack object array with unpacker function + * OPK_Unpack_OEMCrypto_SampleDescription */ + ODK_Message* odk_message = msg; + void** address = (void**)samples; + LengthType count = OPK_FromSizeTPtr(samples_length); + size_t size = sizeof(OEMCrypto_SampleDescription); + if (address) { + *address = NULL; + } + if (!OPK_UnpackIsNull(odk_message)) { + if (address && !OPK_LengthIsNull(count)) { + size_t bytes_to_unpack = 0; + if (odk_mul_overflow_ux(OPK_ToSizeT(count), size, &bytes_to_unpack)) { + ODK_MESSAGE_SETSTATUS(odk_message, MESSAGE_STATUS_PARSE_ERROR); + } else { + *address = OPK_BumpAllocate(bytes_to_unpack); + if (!*address) { + ODK_MESSAGE_SETSTATUS(odk_message, MESSAGE_STATUS_OUT_OF_MEMORY); + } else { + for (size_t i = 0; i < OPK_ToSizeT(count); i++) { + OPK_Unpack_OEMCrypto_SampleDescription( + odk_message, + (OEMCrypto_SampleDescription*)((*address) + size * i)); + } + } + } + } + } + OPK_UnpackNullable_OEMCrypto_CENCEncryptPatternDesc(msg, pattern); + OPK_UnpackEOM(msg); + OPK_SharedBuffer_FinalizeUnpacking(); +} + +ODK_Message OPK_Pack_TunerHal_Decrypt_Response(TunerHalResult result) { + uint32_t api_value = 12345; /* from _oecc8 */ + 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/ports/linux/cas/tee/tuner_tee_serialization.h b/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.h new file mode 100644 index 0000000..c072559 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tee/tuner_tee_serialization.h @@ -0,0 +1,27 @@ +#ifndef TUNER_TEE_SERIALIZER_H_ +#define TUNER_TEE_SERIALIZER_H_ + +#include "log_macros.h" +#include "opk_serialization_base.h" +#include "tuner_hal.h" + +#ifdef __cplusplus +extern "C" { +#endif + +ODK_Message OPK_Pack_TunerHal_Decrypt_Response(TunerHalResult result); +void OPK_Unpack_TunerHal_Decrypt_Request( + ODK_Message* msg, uint8_t** key_token, size_t* key_token_length, + KeyParityType* key_parity, OEMCrypto_SampleDescription** samples, + size_t* samples_length, OEMCrypto_CENCEncryptPatternDesc** pattern); + +// void OPK_Init_OEMCrypto_CENCEncryptPatternDesc( +// OEMCrypto_CENCEncryptPatternDesc* obj); + +/* See opk_dispatcher.h for definition of OPK_DispatchMessage() */ +ODK_MessageStatus Tuner_DispatchMessage(ODK_Message* request, + ODK_Message* response); +#ifdef __cplusplus +} // extern "C" +#endif +#endif /* TUNER_TEE_SERIALIZER_H_ */ diff --git a/oemcrypto/opk/ports/linux/cas/tuner_hal.h b/oemcrypto/opk/ports/linux/cas/tuner_hal.h new file mode 100644 index 0000000..be03385 --- /dev/null +++ b/oemcrypto/opk/ports/linux/cas/tuner_hal.h @@ -0,0 +1,40 @@ +/* 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 _TUNER_HAL_H_ +#define _TUNER_HAL_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum TunerHalResult { + TUNER_HAL_SUCCESS = 0, + TUNER_HAL_ERROR_UNKNOWN_FAILURE = 1, + TUNER_HAL_ERROR_BUFFER_TOO_LARGE = 2, + TUNER_HAL_ERROR_NOT_IMPLEMENTED = 3, +} TunerHalResult; + +typedef enum KeyParityType { + TunerHal_KeyParityType_NotEncrypted, // Should never be used. + TunerHal_KeyParityType_OddKey, + TunerHal_KeyParityType_EvenKey, + TunerHal_KeyParityType_MaxValue = TunerHal_KeyParityType_EvenKey, +} KeyParityType; + +TunerHalResult TunerHal_Decrypt( + const uint8_t* key_token, size_t key_token_length, KeyParityType key_parity, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/oemcrypto/opk/ports/linux/common/posix_resources.h b/oemcrypto/opk/ports/linux/common/posix_resources.h new file mode 100644 index 0000000..80cee64 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/posix_resources.h @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#ifndef POSIX_RESOURCES__H_ +#define POSIX_RESOURCES__H_ + +#include "posix_services.h" + +// Global allocation of posix shared memory and semaphore +// resources for the transport and shared memory buffers + +typedef posix::SharedMemory<0> RequestResponseBlock; +typedef posix::SharedMemory<1> MailboxBlock; +typedef posix::SharedMemory<2> SerializationBlock; +typedef posix::Semaphore<0> RequestSemaphore; +typedef posix::Semaphore<1> ResponseSemaphore; + +#endif // POSIX_RESOURCES__H_ diff --git a/oemcrypto/opk/ports/linux/common/posix_services.h b/oemcrypto/opk/ports/linux/common/posix_services.h new file mode 100644 index 0000000..67242b2 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/posix_services.h @@ -0,0 +1,136 @@ +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#ifndef LINUX_IPC_POSIX_SERVICES_H_ +#define LINUX_IPC_POSIX_SERVICES_H_ + +#include +#include +#include +#include +#include +#include +#include +#include "log_macros.h" + +#ifndef WV_POSIX_RESOURCE_ID +# define WV_POSIX_RESOURCE_ID "tee-sim" +#endif + +namespace posix { + +// Services for shared memory and semaphores layered on the POSIX +// shm_* and sem_* functions + +// The Semaphore class is used to synchronize execution across process +// boundaries using the POSIX semaphore lib. N is an integer +// identifying the semaphore instance. +class Resource { + public: + Resource(const std::string& name, const std::string& posix_prefix) + : dev_path_("/dev/shm/" + posix_prefix + WV_POSIX_RESOURCE_ID + name), + posix_name_("/" WV_POSIX_RESOURCE_ID + name) {} + ~Resource() {} + + protected: + const std::string dev_path_; + const std::string posix_name_; +}; + +template +class Semaphore : public Resource { + public: + Semaphore() : Resource("opk-" + std::to_string(N), "sem."), sem_(nullptr) { + sem_ = sem_open(posix_name_.c_str(), O_CREAT, 0600, 0); + if (!sem_) { + LOGE("failed to open semaphore %s", posix_name_.c_str()); + } + } + + ~Semaphore() { + if (sem_) { + sem_close(sem_); + } + } + + void post() { + if (sem_) sem_post(sem_); + } + void wait() { + if (sem_) sem_wait(sem_); + } + + private: + sem_t* sem_; + + Semaphore(const Semaphore&) = delete; + void operator=(const Semaphore&) = delete; +}; + +// Manage blocks of shared memory across process boundaries using +// the POSIX shared memory functions. N is an integer identifying the +// shared memory block. + +template +class SharedMemory : public Resource { + public: + SharedMemory() + : Resource("opk-shm-" + std::to_string(N), ""), + fd_(-1), + address_(nullptr), + size_(0) { + Open(); + } + + ~SharedMemory() { Close(); } + + uint8_t* GetAddress() const { return address_; } + size_t GetSize() const { return size_; } + + bool Allocate(size_t size) { + if (fd_ == -1) { + return false; + } + if (ftruncate(fd_, size) == -1) { + LOGE("failed to set shared memory %s to size %zd: %s", dev_path_.c_str(), + size_, strerror(errno)); + return false; + } else { + address_ = (uint8_t*)mmap(nullptr, size, PROT_READ | PROT_WRITE, + MAP_SHARED, fd_, 0); + if (address_ == nullptr) { + LOGE("mmap of size %zu failed: %s", size, strerror(errno)); + return false; + } else { + size_ = size; + } + } + return true; + } + + private: + int fd_; + uint8_t* address_; + size_t size_; + + void Open() { fd_ = shm_open(posix_name_.c_str(), O_CREAT | O_RDWR, 0600); } + + void Close() { + if (address_) { + munmap(address_, size_); + address_ = nullptr; + size_ = 0; + } + if (fd_ != -1) { + close(fd_); + fd_ = -1; + } + } + + SharedMemory(const SharedMemory&) = delete; + void operator=(const SharedMemory&) = delete; +}; +}; // namespace posix + +#endif /* LINUX_IPC_POSIX_SERVICES_H_ */ diff --git a/oemcrypto/opk/ports/linux/common/test/shared_memory_test.cpp b/oemcrypto/opk/ports/linux/common/test/shared_memory_test.cpp new file mode 100644 index 0000000..dfb3f3f --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/test/shared_memory_test.cpp @@ -0,0 +1,237 @@ +// Copyright 2019 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 "gtest/gtest.h" +#include "posix_services.h" +#include "tos_shared_memory_interface.h" +#include "tos_transport.h" + +using namespace posix; + +/* + * Entry point for the TEE process + */ +static void RunTEE(); + +int main(int argc, char** argv) { + if (argc == 2) { + if (*argv[1] == '1') { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); + } else { + RunTEE(); + } + } else { + if (fork()) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); + } else { + RunTEE(); + return 0; + } + } +} + +// utility functions shared by REE and TEE +static const unsigned KiB = 1024; +static const unsigned MiB = KiB * 1024; + +static uint8_t test_buffer[1024]; + +/* rand() seed for FillMemory/TestMemory, needs to be the same in REE and TEE */ +unsigned seed = 1234; + +/* Utility functions common to REE and TEE */ +void FillMemory(uint8_t* addr, size_t length, unsigned seed) { + std::srand(seed); + for (size_t i = 0; i < length; i++) { + addr[i] = static_cast(std::rand() & 0xff); + } +} + +bool TestMemory(uint8_t* addr, size_t length, unsigned seed) { + std::srand(seed); + for (size_t i = 0; i < length; i++) { + if (addr[i] != static_cast(std::rand() & 0xff)) { + return false; + } + } + return true; +} + +bool TestZero(uint8_t* addr, size_t length) { + for (size_t i = 0; i < length; i++) { + if (addr[i] != 0) { + return false; + } + } + return true; +} + +uint8_t* GetAddress() { return TOS_SharedMemory_GetAddress(); } +size_t GetSize() { return TOS_SharedMemory_GetSize(); } + +class SharedMemoryInterfaceTest : public testing::Test { + protected: + void SetUp() override {} + void TearDown() override {} +}; + +// Map sizes must meet the minum requirements +TEST_F(SharedMemoryInterfaceTest, AvailableSize) { + EXPECT_LE(2 * MiB + 32 * KiB, TOS_SharedMemory_AvailableSize()); +} + +// Make sure everything starts out initialized +TEST_F(SharedMemoryInterfaceTest, InitialState) { + EXPECT_EQ(nullptr, GetAddress()); + EXPECT_EQ(0, GetSize()); +} + +// Allocate a block with a 1 KiB size +TEST_F(SharedMemoryInterfaceTest, Allocate1KiBSize) { + size_t size = 1 * KiB; + TOS_SharedMemory_Allocate(size); + EXPECT_NE(nullptr, GetAddress()); + EXPECT_EQ(size, GetSize()); +} + +// Allocate the block with a 1 KiB size and make sure +// we can read/write it +TEST_F(SharedMemoryInterfaceTest, AllocateAllWith1KiBSizeAndRead) { + size_t size = 1 * KiB; + TOS_SharedMemory_Allocate(size); + FillMemory(GetAddress(), size, seed); + EXPECT_TRUE(TestMemory(GetAddress(), size, seed)); +} + +// Test releasing the block +TEST_F(SharedMemoryInterfaceTest, Release) { + size_t size = 1 * KiB; + TOS_SharedMemory_Allocate(size); + EXPECT_NE(nullptr, GetAddress()); + TOS_SharedMemory_Release(); + // all released? + EXPECT_EQ(nullptr, GetAddress()); + EXPECT_EQ(0, GetSize()); +} + +// Allocate a block with zero size +TEST_F(SharedMemoryInterfaceTest, AllocateZeroSize) { + size_t size = 0; + TOS_SharedMemory_Allocate(size); + EXPECT_NE(nullptr, GetAddress()); + EXPECT_EQ(size, GetSize()); +} + +// Allocate a block with the declared available size +TEST_F(SharedMemoryInterfaceTest, AllocateToAvailableSize) { + size_t size = TOS_SharedMemory_AvailableSize(); + TOS_SharedMemory_Allocate(size); + EXPECT_NE(nullptr, GetAddress()); + EXPECT_EQ(size, GetSize()); +} + +// Allocate a block and see if it will copy in from REE address on +// finalization. +TEST_F(SharedMemoryInterfaceTest, CopyIn) { + // fill test buffer + FillMemory(&test_buffer[0], sizeof(test_buffer), seed); + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + OPK_SharedMemory_CopyVector copy_vec = { + .address = &test_buffer[0], .offset = 0, .length = sizeof(test_buffer)}; + TOS_SharedMemory_Finalize(©_vec, 1, NULL, 0); + EXPECT_TRUE(TestMemory(GetAddress(), sizeof(test_buffer), seed)); +} + +// Allocate a block and ee if it will copy in from REE address on +// finalization at a non-zero offset. +TEST_F(SharedMemoryInterfaceTest, CopyInAtOffset) { + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + // Fill the test buffer and zero out the block + FillMemory(&test_buffer[0], sizeof(test_buffer), seed); + memset(GetAddress(), 0, sizeof(test_buffer)); + // copy in the first 512 bytes of the test_buffer into the + // shared memory block at offset 128, leaving the rest as zeros. + OPK_SharedMemory_CopyVector copy_vec = { + .address = &test_buffer[0], .offset = 128, .length = 512}; + TOS_SharedMemory_Finalize(©_vec, 1, NULL, 0); + EXPECT_TRUE(TestMemory(GetAddress() + 128, 512, seed)); + EXPECT_TRUE(TestZero(GetAddress(), 128)); + EXPECT_TRUE(TestZero(GetAddress() + 640, sizeof(test_buffer) - 640)); +} + +// Allocate a block with a non-NULL address and 1KiB size. See if it +// will copy out to REE address on finalization. +TEST_F(SharedMemoryInterfaceTest, CopyOut) { + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + // fill shared memory block + FillMemory(GetAddress(), sizeof(test_buffer), seed); + memset(&test_buffer[0], 0, sizeof(test_buffer)); + OPK_SharedMemory_CopyVector copy_vec = { + .address = &test_buffer[0], .offset = 0, .length = sizeof(test_buffer)}; + TOS_SharedMemory_Finalize(NULL, 0, ©_vec, 1); + EXPECT_TRUE(TestMemory(&test_buffer[0], sizeof(test_buffer), seed)); +} + +// Allocate a block and see if it will copy out from REE address on +// finalization at a non-zero offset. +TEST_F(SharedMemoryInterfaceTest, CopyOutAtOffset) { + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + // fill test buffer + FillMemory(&test_buffer[0], sizeof(test_buffer), seed); + + // Zero out the shared memory block, fill 512 bytes of the shared + // memory block at offset 128 and zero out the test_buffer + memset(GetAddress(), 0, sizeof(test_buffer)); + FillMemory(GetAddress() + 128, 512, seed); + memset(&test_buffer[0], 0, sizeof(test_buffer)); + + // copy out 512 bytes of the shared memory block at offset + // 128 into the test buffer + OPK_SharedMemory_CopyVector copy_vec = { + .address = &test_buffer[0], .offset = 128, .length = 512}; + TOS_SharedMemory_Finalize(NULL, 0, ©_vec, 1); + EXPECT_TRUE(TestMemory(&test_buffer[0], 512, seed)); + EXPECT_TRUE(TestZero(&test_buffer[512], sizeof(test_buffer) - 512)); +} + +// The IPC_SharedMemoryTests make sure that shared memory actually works +// across processes. + +class SharedMemoryIPCTest : public SharedMemoryInterfaceTest {}; + +// Test TEE->REE and REE->TEE on a block +TEST_F(SharedMemoryIPCTest, SharedAccess) { + Semaphore<0> begin; + Semaphore<1> ree_filled; + Semaphore<2> tee_filled; + Semaphore<3> ree_done; + begin.post(); + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + FillMemory(GetAddress(), sizeof(test_buffer), seed); + ree_filled.post(); + tee_filled.wait(); + EXPECT_TRUE(TestMemory(GetAddress(), sizeof(test_buffer), seed + 1)); + ree_done.post(); +} + +static void RunTEE() { + /* SharedAccess test */ + Semaphore<0> begin; + Semaphore<1> ree_filled; + Semaphore<2> tee_filled; + Semaphore<3> ree_done; + begin.wait(); + TOS_SharedMemory_Allocate(sizeof(test_buffer)); + ree_filled.wait(); + EXPECT_TRUE(TestMemory(GetAddress(), sizeof(test_buffer), seed)); + FillMemory(GetAddress(), sizeof(test_buffer), seed + 1); + tee_filled.post(); + ree_done.wait(); +} diff --git a/oemcrypto/opk/ports/linux/common/test/shared_memory_test.gyp b/oemcrypto/opk/ports/linux/common/test/shared_memory_test.gyp new file mode 100644 index 0000000..f5b4220 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/test/shared_memory_test.gyp @@ -0,0 +1,28 @@ +{ + 'includes' : { + '../../../../serialization/settings.gypi', + }, + 'target_defaults': { + 'include_dirs' : [ + '.', + '..', + '<(third_party_dir)/googletest/googletest/include', + ], + }, + 'targets' : [ + { + 'target_name': 'shared_memory_test', + 'type': 'executable', + 'sources': [ + 'shared_memory_test.cpp', + '../tos_shared_memory.cpp', + '../tos_logging.cpp', + ], + 'dependencies': [ + '<(third_party_dir)/googletest.gyp:gtest', + '<(serialization_dir)/tee/tee.gyp:opk_tee', + ], + 'libraries': ['-lrt', '-lpthread', '-ldl'], + }, + ] +} diff --git a/oemcrypto/opk/ports/linux/common/tos_logging.cpp b/oemcrypto/opk/ports/linux/common/tos_logging.cpp new file mode 100644 index 0000000..91e37b1 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/tos_logging.cpp @@ -0,0 +1,68 @@ +// +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +// This is an implementation of the tos_logging_interface for +// the linux trusted OS simulator port of OPK. For both the REE and +// TEE, it just writes the output to stderr. + +#include +#include +#include + +#include "tos_logging_interface.h" + +/******************************************************************* + * See "tos_logging_interface.h" for documentation of TOS_Log. + *******************************************************************/ + +static const char* LevelString(OPK_LogLevel level) { + switch (level) { + case OPK_LogLevel_Fatal: + return "FATAL"; + case OPK_LogLevel_Error: + return "ERROR"; + case OPK_LogLevel_Warning: + return "WARNING"; + case OPK_LogLevel_Info: + return "INFO"; + case OPK_LogLevel_Debug: + return "DEBUG"; + case OPK_LogLevel_Verbose: + return "VERBOSE"; + } + return ""; +} + +#ifdef __GNUC__ +__attribute__((format(printf, 5, 6))) +#endif +void TOS_Log(const char* file, const char* func, int line, + OPK_LogLevel level, const char* fmt, ...) { + /* + * By default, messages with levels at or higher than min_log_level + * will be logged. You can change the defaulit value of + * min_log_level here at compile time, or set the environment + * variable LINUX_IPC_LOG_LEVEL to the integer value of the minimum + * log level desired at runtime. + */ + static OPK_LogLevel min_log_level = OPK_LogLevel_Warning; + static bool set_log_level = true; + if (set_log_level) { + const char* env_level = getenv("LINUX_IPC_LOG_LEVEL"); + if (env_level) { + min_log_level = static_cast(atoi(env_level)); + } + set_log_level = false; + } + if (level >= min_log_level) { + va_list args; + va_start(args, fmt); + fprintf(stderr, "[%s:%s(%d):%s] ", LevelString(level), file, line, func); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); + } +} diff --git a/oemcrypto/opk/ports/linux/common/tos_secure_buffers.c b/oemcrypto/opk/ports/linux/common/tos_secure_buffers.c new file mode 100644 index 0000000..841c723 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/tos_secure_buffers.c @@ -0,0 +1,34 @@ +/* + * Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ +#include "opk_serialization_base.h" +#include "tos_secure_buffer_interface.h" + +/* + * The simulator doesn't do anything special with secure buffers, + * just pass the fields through unmodified + */ + +void TOS_SecureBuffer_Pack(ODK_Message* message, + const OEMCrypto_DestBufferDesc* obj) { + /* secure memory - pack handle, length, offset */ + OPK_Pack_uint64_t(message, + (const uint64_t*)&obj->buffer.secure.secure_buffer); + OPK_Pack_size_t(message, &obj->buffer.secure.secure_buffer_length); + OPK_Pack_size_t(message, &obj->buffer.secure.offset); +} + +void TOS_SecureBuffer_Unpack(ODK_Message* message, + OEMCrypto_DestBufferDesc* obj) { + /* secure memory - unpack handle, length, offset */ + OPK_Unpack_uint64_t(message, (uint64_t*)&obj->buffer.secure.secure_buffer); + OPK_Unpack_size_t(message, &obj->buffer.secure.secure_buffer_length); + OPK_Unpack_size_t(message, &obj->buffer.secure.offset); +} + +bool TOS_SecureBuffer_CheckSize(void* handle, size_t size) { + /* without real secure memory, there's nothing we can do here */ + return true; +} diff --git a/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp b/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp new file mode 100644 index 0000000..93d75e9 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp @@ -0,0 +1,88 @@ +// +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +// This is an implementation of the tos_shared_memory_interface for +// the linux trusted OS simulator port of OPK. It uses the +// posix_services.h implementation of shared memory which is based on +// the POSIX shared memory library. + +#include "posix_resources.h" +#include "tos_shared_memory_interface.h" + +using namespace posix; + +// shared memory for OEMCrypto parameters +static SerializationBlock* shared_memory_ = nullptr; + +/******************************************************************* + * See "tos_shared_memory_interface.h" for documentation + * of each of the TOS_SharedMemory interface functions below. + *******************************************************************/ + +bool TOS_SharedMemory_Allocate(size_t size) { + if (!shared_memory_) { + shared_memory_ = new SerializationBlock(); + if (!shared_memory_) { + LOGE("Failed to initialize shared memory"); + return false; + } + } + if (!shared_memory_->Allocate(size)) { + LOGE("Failed to allocate shared memory of size %zd bytes", size); + return false; + } + return true; +} + +void TOS_SharedMemory_Release(void) { + if (shared_memory_) { + delete shared_memory_; + shared_memory_ = nullptr; + } +} + +uint8_t* TOS_SharedMemory_GetAddress(void) { + return shared_memory_ ? shared_memory_->GetAddress() : nullptr; +} + +size_t TOS_SharedMemory_GetSize(void) { + return shared_memory_ ? shared_memory_->GetSize() : 0; +} + +void TOS_SharedMemory_Finalize(OPK_SharedMemory_CopyVector* in_vec, + size_t in_count, + OPK_SharedMemory_CopyVector* out_vec, + size_t out_count) { + if (shared_memory_) { + uint8_t* address = shared_memory_->GetAddress(); + if (address) { + for (size_t i = 0; i < in_count; i++) { + if (in_vec[i].address) { + memcpy(address + in_vec[i].offset, in_vec[i].address, + in_vec[i].length); + } + } + for (size_t i = 0; i < out_count; i++) { + if (out_vec[i].address) { + memcpy(out_vec[i].address, address + out_vec[i].offset, + out_vec[i].length); + } + } + } + } +} + +/* + * Provide enough shared memory for the max sample size for input and + * output shared memory buffers plus serialization buffer + */ +size_t TOS_SharedMemory_AvailableSize(void) { + const size_t KiB = 1024; + const size_t MiB = 1024 * KiB; + const size_t max_sample_size = 4 * MiB; + const size_t serialization_buffer_size = 32 * KiB; + return 2 * max_sample_size + serialization_buffer_size; +} diff --git a/oemcrypto/opk/ports/linux/common/tos_transport.cpp b/oemcrypto/opk/ports/linux/common/tos_transport.cpp new file mode 100644 index 0000000..8e39108 --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/tos_transport.cpp @@ -0,0 +1,155 @@ +// +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +// This is an implementation of the opk_transport_interface for the +// linux trusted OS simulator port of OPK. It uses the +// posix_services.h implementation of semaphores and shared memory +// which is based on the POSIX shared memory and semaphore libraries. + +#include "odk_message.h" +#include "posix_resources.h" +#include "tos_transport_interface.h" + +/******************************************************************* + * See "tos_transport_interface.h" for documentation of each of the + * TOS_ interface functions below. + *******************************************************************/ + +using namespace posix; + +// message request/response payload data +static RequestResponseBlock* shared_memory_ = nullptr; + +// mailbox containing the size of the payload +static MailboxBlock* mailbox_memory_ = nullptr; + +// post when a request message is ready +static RequestSemaphore* request_semaphore_ = nullptr; + +// post when a response message is ready +static ResponseSemaphore* response_semaphore_ = nullptr; + +static void ReleaseResources() { + if (shared_memory_) { + delete shared_memory_; + shared_memory_ = nullptr; + } + if (mailbox_memory_) { + delete mailbox_memory_; + mailbox_memory_ = nullptr; + } + if (request_semaphore_) { + delete request_semaphore_; + request_semaphore_ = nullptr; + } + if (response_semaphore_) { + delete response_semaphore_; + response_semaphore_ = nullptr; + } +} + +bool TOS_Transport_Initialize(void) { + if (!(shared_memory_ = new RequestResponseBlock()) || + !(shared_memory_->Allocate(OPK_TRANSPORT_MESSAGE_SIZE))) { + ReleaseResources(); + return false; + } + if (!(mailbox_memory_ = new MailboxBlock()) || + !(mailbox_memory_->Allocate(sizeof(uint32_t)))) { + ReleaseResources(); + return false; + } + if (!(request_semaphore_ = new RequestSemaphore())) { + ReleaseResources(); + return false; + } + if (!(response_semaphore_ = new ResponseSemaphore())) { + ReleaseResources(); + return false; + } + return true; +} + +void TOS_Transport_Terminate(void) { ReleaseResources(); } + +ODK_Message TOS_Transport_GetRequest() { + if (!shared_memory_) { + return ODK_Message_Create(nullptr, 0); + } else { + return ODK_Message_Create(shared_memory_->GetAddress(), + shared_memory_->GetSize()); + } +} + +ODK_Message TOS_Transport_GetResponse() { + /* Use the same shared memory block for request & response */ + return TOS_Transport_GetRequest(); +} + +void TOS_Transport_ReleaseMessage(ODK_Message* message) { + // resources are static, nothing to do here +} + +// Get the size of the message from the mailbox and return it +static uint32_t PeekSize(void) { + uint8_t* mailbox = mailbox_memory_->GetAddress(); + uint32_t message_size = (uint32_t)mailbox[0] | (uint32_t)mailbox[1] << 8 | + (uint32_t)mailbox[2] << 16 | + (uint32_t)mailbox[3] << 24; + return message_size; +} + +// Put the size of the message into the mailbox +static void PokeSize(uint32_t size) { + uint8_t* mailbox = mailbox_memory_->GetAddress(); + mailbox[0] = (uint8_t)(size); + mailbox[1] = (uint8_t)(size >> 8); + mailbox[2] = (uint8_t)(size >> 16); + mailbox[3] = (uint8_t)(size >> 24); +} + +// The request has been packed into the shared memory, all we need to +// do is poke the message size in the mailbox and post on the request +// semaphore, then wait for the response semaphore. The response will +// be in the shared memory by then, so return a response message +// constructed from the shared memory with the size in the mailbox. + +OPK_TransportStatus TOS_Transport_SendMessage(ODK_Message* request, + ODK_Message* response) { + PokeSize(static_cast(ODK_Message_GetSize(request))); + request_semaphore_->post(); + response_semaphore_->wait(); + *response = ODK_Message_Create(shared_memory_->GetAddress(), + shared_memory_->GetSize()); + ODK_Message_SetSize(response, PeekSize()); + return OPK_TRANSPORT_STATUS_OK; +} + +/******************************************************************** + * These are TOS functions only used by the tee_simulator, they are + * not an implementation of functions in the TOS transport interface. + ********************************************************************/ + +// Wait for the request until signaled. Then the request payload will +// be in the shared memory and the size in the mailbox. Create a +// request message from the payload data and return it. + +OPK_TransportStatus TOS_Transport_ReceiveRequest(ODK_Message* request) { + request_semaphore_->wait(); + *request = ODK_Message_Create(shared_memory_->GetAddress(), + shared_memory_->GetSize()); + ODK_Message_SetSize(request, PeekSize()); + return OPK_TRANSPORT_STATUS_OK; +} + +// The response has been packed into the shared memory. Put the message +// size in the mailbox then post on the response semaphore to send it. + +OPK_TransportStatus TOS_Transport_SendResponse(ODK_Message* response) { + PokeSize(static_cast(ODK_Message_GetSize(response))); + response_semaphore_->post(); + return OPK_TRANSPORT_STATUS_OK; +} diff --git a/oemcrypto/opk/ports/linux/common/tos_transport.h b/oemcrypto/opk/ports/linux/common/tos_transport.h new file mode 100644 index 0000000..d5e268b --- /dev/null +++ b/oemcrypto/opk/ports/linux/common/tos_transport.h @@ -0,0 +1,26 @@ +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#ifndef TOS_TRANSPORT_H_ +#define TOS_TRANSPORT_H_ + +#include "odk_message.h" +#include "tos_transport_interface.h" + +/******************************************************************* + * These functions are defined in the serialization adapter's + * tos_transport.c and tos_shared_memory.c to allow the tee simulator + * to use the transport and shared memory implementations. They are + * not part of the OPK OS interfaces. + *******************************************************************/ + +// Request is in the shared memory, create a response from the shared +// buffer and post on the response semaphore. +OPK_TransportStatus TOS_Transport_ReceiveRequest(ODK_Message* request); + +// Response is in the shared memory, post on the response +// semaphore to signal to the REE that it's ready. +OPK_TransportStatus TOS_Transport_SendResponse(ODK_Message* response); + +#endif // TOS_TRANSPORT_H_ diff --git a/oemcrypto/opk/ports/linux/host/liboemcrypto/Makefile b/oemcrypto/opk/ports/linux/host/liboemcrypto/Makefile new file mode 100644 index 0000000..3337c3b --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/liboemcrypto/Makefile @@ -0,0 +1,39 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project).so + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(srcdir)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp \ + $(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.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp \ + $(liboemcrypto_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/oemcrypto_ta/include \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/liboemcrypto \ + $(liboemcrypto_includes) \ + +cflags += \ + -DWV_POSIX_RESOURCE_ID=\"oemcrypto_ta\" \ + +ldflags = -lpthread -shared -lrt + +include ../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp b/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp new file mode 100644 index 0000000..f7823eb --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/liboemcrypto/load_library.cpp @@ -0,0 +1,17 @@ +// +// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// + +#include "opk_init.h" + +// When liboemcrypto is loaded, initialize the OPK + +static void __attribute__((constructor)) Initialize_On_Load(void) { + OPK_Initialize(); +} + +static void __attribute__((destructor)) Terminate_On_Close(void) { + OPK_Terminate(); +} diff --git a/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/Makefile b/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/Makefile new file mode 100644 index 0000000..7e93f6c --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/Makefile @@ -0,0 +1,31 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project) + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(srcdir)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/main.c \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/include \ + +ldflags = \ + -lrt -ldl -L$(builddir)/../liboemcrypto/ -loemcrypto \ + +include ../../rules.mk + + diff --git a/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/main.c b/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/main.c new file mode 100644 index 0000000..0587c21 --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/oemcrypto_helloworld/main.c @@ -0,0 +1,20 @@ +/* + * Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#include +#include "OEMCryptoCENC.h" + +int main(void) { + printf("Hello world\n"); + + OEMCryptoResult res; + res = OEMCrypto_Initialize(); + printf("OEMCrypto_Initialize() returned %d", res); + + OEMCrypto_Terminate(); + + return 0; +} diff --git a/oemcrypto/opk/ports/linux/host/oemcrypto_unittests/Makefile b/oemcrypto/opk/ports/linux/host/oemcrypto_unittests/Makefile new file mode 100644 index 0000000..0bba40e --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/oemcrypto_unittests/Makefile @@ -0,0 +1,38 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. +# - TEEC_EXPORT: absolute path to libteec.so +# - PLATFORM: optee platform name, eg vexpress-qemu_virt + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project) + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +include $(srcdir)/oemcrypto/opk/build/ree-sources.mk + +srcs += \ + $(oemcrypto_unittests_sources) \ + +incs += \ + $(oemcrypto_unittests_includes) \ + +ldflags = \ + -lpthread \ + -lrt \ + -L$(builddir)/../liboemcrypto/ -loemcrypto \ + -static-libstdc++ \ + +cppflags += \ + -DOPENSSL_NO_ASM \ + -Wnon-virtual-dtor \ + +include ../../rules.mk diff --git a/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile new file mode 100644 index 0000000..b32f676 --- /dev/null +++ b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile @@ -0,0 +1,51 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file expects the following definitions +# - CDM_DIR: absolute path to top of CDM repo. +# - PLATFORM: optee platform name, eg vexpress-qemu_virt + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project) + +# All file locations are relative to the $CDM_DIR path. +OPK_REPO_TOP := +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_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 \ + $(wtpi_unittests_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/wtpi_test_ta/include \ + $(wtpi_unittests_includes) \ + +ldflags = \ + -lpthread \ + -lrt \ + -static-libstdc++ \ + +cppflags += \ + -DOPENSSL_NO_ASM \ + -DWV_POSIX_RESOURCE_ID=\"wtpi_test_ta\" \ + -Wnon-virtual-dtor \ + -DCOSE_C_USE_OPENSSL \ + -include 'cstdlib' \ + '-DEVP_aes_128_ccm()=EVP_aes_128_gcm()' \ + '-DEVP_aes_256_ccm()=EVP_aes_256_gcm()' \ + '-DEVP_aes_192_ccm()=EVP_aes_192_gcm()' \ + '-DEVP_CTRL_CCM_SET_L=0x14' \ + '-DEVP_CTRL_CCM_GET_TAG=EVP_CTRL_GCM_GET_TAG' \ + '-DEVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG' \ + +include ../../rules.mk diff --git a/oemcrypto/opk/ports/linux/liboemcrypto.gyp b/oemcrypto/opk/ports/linux/liboemcrypto.gyp new file mode 100644 index 0000000..f44feb0 --- /dev/null +++ b/oemcrypto/opk/ports/linux/liboemcrypto.gyp @@ -0,0 +1,31 @@ +{ + 'variables': { + 'serialization_adapter_dir' : 'common', + }, + 'includes' : [ + '../../serialization/settings.gypi', + ], + 'targets' : [ + { + 'toolsets' : [ 'target' ], + 'target_name': 'liboemcrypto', + 'type': 'shared_library', + 'sources': [ + 'host/liboemcrypto/load_library.cpp', + '<(serialization_adapter_dir)/tos_logging.cpp', + '<(serialization_adapter_dir)/tos_secure_buffers.c', + '<(serialization_adapter_dir)/tos_shared_memory.cpp', + '<(serialization_adapter_dir)/tos_transport.cpp', + ], + 'link_settings': { + 'libraries': [ + '-lpthread', + '-lrt' + ], + }, + 'dependencies': [ + '<(ree_dir)/ree.gyp:opk_ree', + ], + }, + ] +} diff --git a/oemcrypto/opk/ports/linux/oemcrypto_tee_simulator.gyp b/oemcrypto/opk/ports/linux/oemcrypto_tee_simulator.gyp new file mode 100644 index 0000000..43b5f05 --- /dev/null +++ b/oemcrypto/opk/ports/linux/oemcrypto_tee_simulator.gyp @@ -0,0 +1,74 @@ +{ + 'variables': { + # Override the variables below for the location of various gyp files. + 'privacy_crypto_impl%': 'boringssl', + 'boringssl_libcrypto_path%': '<(DEPTH)/third_party/boringssl/boringssl.gyp:crypto', + 'boringssl_libssl_path%': '<(DEPTH)/third_party/boringssl/boringssl.gyp:ssl', + 'gtest_dependency%': '<(DEPTH)/third_party/googletest.gyp:gtest', + 'gmock_dependency%': '<(DEPTH)/third_party/googletest.gyp:gmock', + 'oemcrypto_dir%': '<(DEPTH)/oemcrypto', + 'util_dir%': '<(DEPTH)/util', + 'platform_specific_dir%': '<(DEPTH)/linux/src', + 'serialization_adapter_dir' : 'common', + }, + 'includes' : { + '../../serialization/settings.gypi', + }, + 'target_defaults': { + 'include_dirs' : [ + '.', + '<(serialization_adapter_dir)', + '<(serialization_dir)/tee/include', + '<(util_dir)/include', + ], + }, + 'targets' : [ + { + 'target_name': 'tee_simulator_oec_ref', + 'type': 'executable', + 'sources': [ + 'ta/common/clock.cpp', + 'ta/common/tee_simulator.cpp', + '<(platform_specific_dir)/file_store.cpp', + '<(platform_specific_dir)/log.cpp', + '<(serialization_adapter_dir)/tos_logging.cpp', + '<(serialization_adapter_dir)/tos_secure_buffers.c', + '<(serialization_adapter_dir)/tos_shared_memory.cpp', + '<(serialization_adapter_dir)/tos_transport.cpp', + '<(util_dir)/src/platform.cpp', + '<(util_dir)/src/rw_lock.cpp', + '<(util_dir)/src/string_conversions.cpp', + '<(util_dir)/src/string_format.cpp', + ], + 'dependencies': [ + '<(serialization_dir)/tee/tee.gyp:opk_tee', + '../../../testbed/oec_testbed.gyp:oec_testbed', + '../../../testbed/oec_testbed.gyp:utils_props_and_logs', + ], + 'libraries': ['-lrt', '-lpthread', '-ldl'], + }, + { + 'target_name': 'tee_simulator_ta', + 'type': 'executable', + 'sources': [ + 'ta/common/clock.cpp', + 'ta/common/tee_simulator.cpp', + '<(platform_specific_dir)/file_store.cpp', + '<(platform_specific_dir)/log.cpp', + '<(serialization_adapter_dir)/tos_logging.cpp', + '<(serialization_adapter_dir)/tos_secure_buffers.c', + '<(serialization_adapter_dir)/tos_shared_memory.cpp', + '<(serialization_adapter_dir)/tos_transport.cpp', + '<(util_dir)/src/platform.cpp', + '<(util_dir)/src/rw_lock.cpp', + '<(util_dir)/src/string_conversions.cpp', + '<(util_dir)/src/string_format.cpp', + ], + 'dependencies': [ + '<(serialization_dir)/tee/tee.gyp:opk_tee', + '<(oemcrypto_dir)/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp:oemcrypto_ta_test_impl_ipc', + ], + 'libraries': ['-lrt', '-lpthread', '-ldl'], + }, + ] +} diff --git a/oemcrypto/opk/ports/linux/rules.mk b/oemcrypto/opk/ports/linux/rules.mk new file mode 100644 index 0000000..c72afb1 --- /dev/null +++ b/oemcrypto/opk/ports/linux/rules.mk @@ -0,0 +1,84 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This makefile is a simple set of rules for compiling Linux example REE/TEE. +# +# Inputs: +# - srcdir: Relative path from parent Makefile to source file directory, eg top +# of repo. +# - builddir: Relative path from parent Makefile to destination directory. +# - srcs: List of source .c/.cpp/.cc/.S files. All entries in $(srcs) +# must be relative to $(srcdir) +# - incs: List of include paths. Must be relative to $(srcdir). +# - CROSS_COMPILE: prefix for gcc, eg arm-none-gnueabihf- +# +# Can optionally provide additional ldflags, cflags, cppflags, and global-incs + +ifneq ($V,1) +q := @ +cmd-echo := true +cmd-echo-silent := echo +else +q := +cmd-echo := echo +cmd-echo-silent := true +endif + +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))) + +includes += $(addprefix -I, $(addprefix $(srcdir)/, $(incs)) $(global-incs)) + +cflags += -Wall \ + -Werror \ + -fPIC \ + $(includes) \ + +cflags_c += $(cflags) \ + -std=c11 \ + -D_POSIX_C_SOURCE=200809L \ + -fno-inline + +cppflags += $(cflags) \ + $(CPPFLAGS) \ + +all: $(builddir)$(output) + +$(builddir)$(output): $(objs) + @$(cmd-echo-silent) ' LD $@' + ${q}$(cxx) -o $@ $(objs) $(ldadd) $(ldflags) + +.PHONY: clean +clean: + @$(cmd-echo-silent) ' CLEAN $(builddir)' + ${q}rm -f $(objs) $(output) + @if [ -d $(builddir) ]; then rm -r $(builddir); fi + +$(builddir)%.o: $(srcdir)%.c + ${q}mkdir -p $(shell dirname $@) + @$(cmd-echo-silent) ' CC $@' + ${q}$(cc) $(cflags_c) -c $< -o $@ + +$(builddir)%.o: $(srcdir)%.cc + ${q}mkdir -p $(shell dirname $@) + @$(cmd-echo-silent) ' CPP $@' + ${q}$(cxx) $(cppflags) -c $< -o $@ + +$(builddir)%.o: $(srcdir)%.cpp + ${q}mkdir -p $(shell dirname $@) + @$(cmd-echo-silent) ' CPP $@' + ${q}$(cxx) $(cppflags) -c $< -o $@ + +$(builddir)%.o: $(srcdir)%.S + ${q}mkdir -p $(shell dirname $@) + @$(cmd-echo-silent) ' CC $@' + ${q}$(cc) $(cflags_c) -c $< -o $@ diff --git a/oemcrypto/opk/ports/linux/scripts/build.sh b/oemcrypto/opk/ports/linux/scripts/build.sh new file mode 100755 index 0000000..c3c61a6 --- /dev/null +++ b/oemcrypto/opk/ports/linux/scripts/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Builds OEMCrypto unit tests and WTPI unit tests, along with TEE simulators for +# each. + +if [ -z "$CDM_DIR" ]; then + echo "CDM_DIR must be set to the top of the repo" + exit +fi + +build_linux() { + pushd $CDM_DIR + make -j$(nproc) -C ./oemcrypto/opk/ports/linux all $1 + popd +} + +# See Makefiles in oemcrypto_ta and wtpi_test_ta for how the PROVISIONING_METHOD +# var is used +build_linux PROVISIONING_METHOD=OEMCrypto_Keybox + +# build_linux PROVISIONING_METHOD=OEMCrypto_BootCertificateChain diff --git a/oemcrypto/opk/ports/linux/scripts/run.sh b/oemcrypto/opk/ports/linux/scripts/run.sh new file mode 100755 index 0000000..b4ecae4 --- /dev/null +++ b/oemcrypto/opk/ports/linux/scripts/run.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Runs OEMCrypto unit tests and WTPI unit tests, assuming they were built using +# the Makefile provided. +# Race conditions sometimes occur, causing the executables to hang at the +# beginning of each test suite, so don't rely on these for CI/CD or production. + +if [ -z "$CDM_DIR" ]; then + echo "CDM_DIR must be set to the top of the repo" + exit +fi + +kill_ta_simulators() { + oemcrypto_ta_pid=$(ps aux | grep '[o]emcrypto_ta' | awk '{print $2}') + wtpi_ta_pid=$(ps aux | grep '[w]tpi_test_ta' | awk '{print $2}') + + if [ -n "$oemcrypto_ta_pid" ]; then + echo "Terminating OEMCrypto TA simulator (PID $oemcrypto_ta_pid)" + kill $oemcrypto_ta_pid + fi + + if [ -n "$wtpi_ta_pid" ]; then + echo "Terminating WTPI Test TA simulator (PID $wtpi_ta_pid)" + kill $wtpi_ta_pid + fi +} + +run_tests() { + builddir=$CDM_DIR/out/linux + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$builddir/liboemcrypto + + $builddir/oemcrypto_ta/oemcrypto_ta & + $builddir/wtpi_test_ta/wtpi_test_ta & + + trap kill_ta_simulators EXIT + + sleep 1 + wtpi_ta_pid=$(ps aux | grep '[w]tpi_test_ta' | awk '{print $2}') + if [[ -f "/proc/$wtpi_ta_pid/stat" ]]; then + $builddir/wtpi_unittests/wtpi_unittests --gtest_filter="-*Reboot*" + else + echo "WTPI TA simulator did not start." + FINAL_RESULT=43 + fi + + oemcrypto_ta_pid=$(ps aux | grep '[o]emcrypto_ta' | awk '{print $2}') + if [[ -f "/proc/$oemcrypto_ta_pid/stat" ]]; then + $builddir/oemcrypto_unittests/oemcrypto_unittests + else + echo "OEMCrypto TA simulator did not start." + FINAL_RESULT=43 + fi +} + +run_tests + +exit $FINAL_RESULT diff --git a/oemcrypto/opk/ports/linux/ta/common/clock.cpp b/oemcrypto/opk/ports/linux/ta/common/clock.cpp new file mode 100644 index 0000000..1eda0cb --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/clock.cpp @@ -0,0 +1,20 @@ +// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. +// +// Clock - implemented using the standard linux time library + +#include "clock.h" + +#include + +namespace wvutil { + +int64_t Clock::GetCurrentTime() { + struct timeval tv; + tv.tv_sec = tv.tv_usec = 0; + gettimeofday(&tv, nullptr); + return tv.tv_sec; +} + +} // namespace wvutil diff --git a/oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp b/oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp new file mode 100644 index 0000000..258f391 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp @@ -0,0 +1,104 @@ +/* + * Copyright 2021 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 + +#include "log_macros.h" +#include "odk_message.h" +#include "opk_dispatcher.h" +#include "opk_init.h" +#include "string.h" +#include "tos_transport.h" +#include "tos_transport_interface.h" + +static pthread_t main_thread_tid; +static bool thread_running = false; + +void signalHandler(int signum) { + // TODO(fredgc): this doesn't actually kill anything because the main loop is + // stuck waiting for a new message. + thread_running = false; + // This exits, but then we skip the OPK_Terminate call. + exit(0); +} + +// The request message data must be copied into a local buffer +// so the contents can't be modified while being parsed. +static uint8_t local_buffer[OPK_TRANSPORT_MESSAGE_SIZE]; + +static void* MainLoop(void* arg) { + OPK_Initialize(); + thread_running = true; + while (thread_running) { + ODK_Message request, response; + OPK_TransportStatus transport_status = + TOS_Transport_ReceiveRequest(&request); + if (transport_status != OPK_TRANSPORT_STATUS_OK) { + LOGE("Receive request failed: status=%s", + OPK_TransportStatus_Str(transport_status)); + continue; + } + // + // !! IMPORTANT NOTE !! + // The request payload buffer MUST be copied out to TEE local + // storage so it can't be tampered with while being + // parsed. Failure to do so could introduce security + // vulnerabilities. + // + size_t payload_size = ODK_Message_GetSize(&request); + memcpy(local_buffer, ODK_Message_GetBase(&request), payload_size); + ODK_Message safe_request = + ODK_Message_Create(local_buffer, sizeof(local_buffer)); + ODK_Message_SetSize(&safe_request, payload_size); + + ODK_MessageStatus message_status = + OPK_DispatchMessage(&safe_request, &response); + if (message_status != MESSAGE_STATUS_OK) { + LOGE("Dispatch failed: status=%s", OPK_MessageStatus_Str(message_status)); + } + transport_status = TOS_Transport_SendResponse(&response); + if (transport_status != OPK_TRANSPORT_STATUS_OK) { + LOGE("Send response failed: status=%s", + OPK_TransportStatus_Str(transport_status)); + continue; + } + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + } + OPK_Terminate(); + return nullptr; +} + +int main(int argc, char** argv) { + pthread_attr_t p_attr; + + int result = pthread_attr_init(&p_attr); + if (result != 0) { + LOGF("Failed pthread_attr_init: %s", strerror(errno)); + abort(); + } + + LOGI("Reset shared resource state"); + system("rm /dev/shm/*opk*"); + + LOGI("Starting the main loop thread"); + result = pthread_create(&main_thread_tid, &p_attr, &MainLoop, nullptr); + if (result != 0) { + LOGF("Failed to spawn a thread: %s", strerror(errno)); + abort(); + } + signal(SIGTERM, signalHandler); + LOGI("Main is waiting for the main loop thread to exit"); + void* retval; + result = pthread_join(main_thread_tid, &retval); + if (result != 0) { + LOGF("Failed to join main thread: %s", strerror(errno)); + abort(); + } + return 0; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.c new file mode 100644 index 0000000..8624364 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.c @@ -0,0 +1,227 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#include "layer2_crypto_key_table.h" + +#include +#include + +#include "wtpi_abort_interface.h" +#include "wtpi_config_macros.h" + +/****************************************************************************** + * This is a test implementation of the simulation of the crypto key table which + * is supported by hardware. A doubly linked list and a FIFO eviction algorithm + * is implemented. When a key gets evicted, a callback is triggered to notify + * the key holder in the upper layer, presumably, crypto and key management + * layer 2. + ******************************************************************************/ + +/* + * A minimum number of 4 key slots is required in order to successfully open a + * session and load the encryption and mac keys. + */ +#if MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES < 4 +# error "MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES must be at least 4" +#endif + +#define INDEX_OUT_OF_BOUND MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES + +typedef struct k2_symmetric_key { + SymmetricKeyType key_type; + uint8_t aes_key[MAX_SYMMETRIC_KEY_SIZE]; + KeySize size; +} K2_SymmetricKey; + +typedef struct k2_key_table_entry { + K2_SymmetricKey key; + bool is_used; + uint32_t prev; + uint32_t next; +} K2_KeyTableEntry; + +typedef struct k2_key_table { + K2_KeyTableEntry entries[MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES]; + uint32_t first_free, last_free; + uint32_t first_used, last_used; + OEMCryptoResult (*eviction_callback)(uint32_t); +} K2_KeyTable; + +static K2_KeyTable gKeyTable; + +/** Move key |index| from the free queue to the used queue. */ +static void MoveToUsed(K2_KeyTable* table, uint32_t index) { + if (!table || !K2_IsIndexValid(index)) return; + if (table->entries[index].is_used) return; + + // remove from free queue and update first_free or last_free as needed + if (table->entries[index].prev != INDEX_OUT_OF_BOUND) { + table->entries[table->entries[index].prev].next = + table->entries[index].next; + } + if (table->entries[index].next != INDEX_OUT_OF_BOUND) { + table->entries[table->entries[index].next].prev = + table->entries[index].prev; + } + if (index == table->first_free) { + table->first_free = table->entries[table->first_free].next; + } + if (index == table->last_free) { + table->last_free = table->entries[table->last_free].prev; + } + + // add to the tail of used queue + if (table->last_used == INDEX_OUT_OF_BOUND) { + table->first_used = index; + table->entries[index].prev = INDEX_OUT_OF_BOUND; + } else { + table->entries[table->last_used].next = index; + table->entries[index].prev = table->last_used; + } + table->entries[index].is_used = true; + table->entries[index].next = INDEX_OUT_OF_BOUND; + table->last_used = index; +} + +/** Move key |index| from the used queue to the free queue. */ +static void MoveToFree(K2_KeyTable* table, uint32_t index) { + if (!table || !K2_IsIndexValid(index)) return; + if (!table->entries[index].is_used) return; + + memset(&table->entries[index].key, 0, sizeof(table->entries[index].key)); + + // remove from used queue and update first_used or last_used as needed + if (table->entries[index].prev != INDEX_OUT_OF_BOUND) { + table->entries[table->entries[index].prev].next = + table->entries[index].next; + } + if (table->entries[index].next != INDEX_OUT_OF_BOUND) { + table->entries[table->entries[index].next].prev = + table->entries[index].prev; + } + if (index == table->first_used) { + table->first_used = table->entries[table->first_used].next; + } + if (index == table->last_used) { + table->last_used = table->entries[table->last_used].prev; + } + + // add to the tail of free queue + if (table->last_free == INDEX_OUT_OF_BOUND) { + table->first_free = index; + table->entries[index].prev = INDEX_OUT_OF_BOUND; + } else { + table->entries[table->last_free].next = index; + table->entries[index].prev = table->last_free; + } + table->entries[index].is_used = false; + table->entries[index].next = INDEX_OUT_OF_BOUND; + table->last_free = index; +} + +static OEMCryptoResult GetNextAvailable(K2_KeyTable* table, uint32_t* index) { + if (table == NULL || index == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + *index = INDEX_OUT_OF_BOUND; + if (table->first_free < INDEX_OUT_OF_BOUND) { + *index = table->first_free; + return OEMCrypto_SUCCESS; + } + // eviction: key and handle removal is done in callback + uint32_t eviction = table->first_used; + if (!K2_IsIndexValid(eviction)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + OEMCryptoResult result = table->eviction_callback(eviction); + if (result != OEMCrypto_SUCCESS) return result; + MoveToFree(table, eviction); + *index = eviction; + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult K2_InitializeKeyTable(void) { + for (uint32_t i = 0; i < MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES; ++i) { + memset(&gKeyTable.entries[i].key, 0, sizeof(gKeyTable.entries[i].key)); + gKeyTable.entries[i].next = i + 1; + if (i == 0) { + gKeyTable.entries[i].prev = INDEX_OUT_OF_BOUND; + } else { + gKeyTable.entries[i].prev = i - 1; + } + gKeyTable.entries[i].is_used = false; + } + gKeyTable.first_free = 0; + gKeyTable.last_free = INDEX_OUT_OF_BOUND - 1; + gKeyTable.first_used = INDEX_OUT_OF_BOUND; + gKeyTable.last_used = INDEX_OUT_OF_BOUND; + gKeyTable.eviction_callback = NULL; + return OEMCrypto_SUCCESS; +} + +bool K2_IsIndexValid(uint32_t index) { return index < INDEX_OUT_OF_BOUND; } + +bool K2_IsKeyValid(uint32_t index) { + if (!K2_IsIndexValid(index)) return false; + if (!gKeyTable.entries[index].is_used) return false; + K2_SymmetricKey* key = &gKeyTable.entries[index].key; + switch (key->key_type) { + case CONTENT_KEY: + // We cheat a little here. We also call generic crypto keys "content + // keys", even though some of them are 256 bit HMAC keys. + return key->size == KEY_SIZE_128 || key->size == KEY_SIZE_256; + case ENTITLEMENT_KEY: + case MAC_KEY_SERVER: + case MAC_KEY_CLIENT: + return key->size == KEY_SIZE_256; + case ENCRYPTION_KEY: + case DERIVING_KEY: + return key->size == KEY_SIZE_128; + } + return false; +} + +void K2_SetEvictionCallback(OEMCryptoResult (*callback)(uint32_t)) { + gKeyTable.eviction_callback = callback; +} + +uint8_t* K2_GetKey(uint32_t index) { + ABORT_IF(!K2_IsKeyValid(index), "Invalid key."); + return gKeyTable.entries[index].key.aes_key; +} + +KeySize K2_GetKeySize(uint32_t index) { + ABORT_IF(!K2_IsKeyValid(index), "Invalid key."); + return gKeyTable.entries[index].key.size; +} + +SymmetricKeyType K2_GetKeyType(uint32_t index) { + ABORT_IF(!K2_IsKeyValid(index), "Invalid key."); + return gKeyTable.entries[index].key.key_type; +} + +OEMCryptoResult K2_AddKey(const uint8_t* key_bytes, size_t size, + SymmetricKeyType key_type, uint32_t* index) { + if (key_bytes == NULL || size == 0 || index == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint32_t next = INDEX_OUT_OF_BOUND; + OEMCryptoResult result = GetNextAvailable(&gKeyTable, &next); + if (result == OEMCrypto_SUCCESS) { + MoveToUsed(&gKeyTable, next); + gKeyTable.entries[next].key.size = (KeySize)size; + gKeyTable.entries[next].key.key_type = key_type; + memcpy(gKeyTable.entries[next].key.aes_key, key_bytes, size); + } + *index = next; + return result; +} + +OEMCryptoResult K2_RemoveKey(uint32_t index) { + if (!K2_IsIndexValid(index) || !gKeyTable.entries[index].is_used) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + MoveToFree(&gKeyTable, index); + return OEMCrypto_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.h b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.h new file mode 100644 index 0000000..8d285d5 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/layer2_crypto_key_table.h @@ -0,0 +1,87 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#ifndef OEMCRYPTO_TA_LAYER2_CRYPTO_KEY_TABLE_H_ +#define OEMCRYPTO_TA_LAYER2_CRYPTO_KEY_TABLE_H_ + +#include +#include +#include + +#include "OEMCryptoCENCCommon.h" +#include "oemcrypto_key_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * This header file provides functions of the AES key table which simulates a + * hardware-backed key table with a limited number of key slots. They should be + * only called by the TEST implementation of Crypto and Key Management layer 2. + ******************************************************************************/ + +/** + * Initializes the layer 2 key table. + */ +OEMCryptoResult K2_InitializeKeyTable(void); + +/** + * Checks if |index| is a valid key slot in the key table. Returns true if it + * is. Otherwise returns false. + */ +bool K2_IsIndexValid(uint32_t index); + +/** + * Checks if the key in key slot |index| is valid. Returns true if it is. + * Otherwise returns false. + */ +bool K2_IsKeyValid(uint32_t index); + +/** + * Adds |size| bytes of |key_bytes| as a key entry to the key table, and sets + * |index| to the allocated key slot. + * Returns OEMCrypto_ERROR_INVALID_CONTEXT if any of the pointers are NULL, or + * if |size| is 0. Returns OEMCrypto_ERROR_INSUFFICIENT_RESOURCES if the key + * table runs out of key slots and key eviction fails. + * Returns OEMCrypto_ERROR_UNKNOWN_FAILURE if there are any other failures, and + * OEMCrypto_SUCCESS otherwise. + * Caller retains ownership of all pointers. + */ +OEMCryptoResult K2_AddKey(const uint8_t* key_bytes, size_t size, + SymmetricKeyType key_type, uint32_t* index); + +/** + * Removes key in key slot |index|. + * Returns OEMCrypto_ERROR_INVALID_CONTEXT if |index| is not valid, and + * OEMCrypto_SUCCESS otherwise. + */ +OEMCryptoResult K2_RemoveKey(uint32_t index); + +/** + * Returns the AES key bytes from key slot |index|. |index| must be valid. + */ +uint8_t* K2_GetKey(uint32_t index); + +/** + * Returns the AES key size from key slot |index|. |index| must be valid. + */ +KeySize K2_GetKeySize(uint32_t index); + +/** + * Returns the AES key type from key slot |index|. |index| must be valid. + */ +SymmetricKeyType K2_GetKeyType(uint32_t index); + +/** + * Sets the key eviction handler. The handler takes a key slot to be evicted and + * returns OEMCryptoResult. + */ +void K2_SetEvictionCallback(OEMCryptoResult (*callback)(uint32_t)); + +#ifdef __cplusplus +} +#endif + +#endif /* OEMCRYPTO_TA_LAYER2_CRYPTO_KEY_TABLE_H_ */ diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk new file mode 100644 index 0000000..4eba128 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk @@ -0,0 +1,53 @@ +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This file lists out the files that implement the WTPI and transport layer for +# the OPTEE port. This includes a few reference files from `wtpi_reference`, as +# well as stubs from `wtpi_useless` that must be replaced for a production +# build. +# +# This is not necessary for other ports. This only exists to consoldiate all of +# the OPTEE-specific code in one place for use in sub.mk + +wtpi_impl_dir ?= $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl +wtpi_stub_dir ?= $(OPK_REPO_TOP)/oemcrypto/opk/oemcrypto_ta/wtpi_useless +wtpi_ref_dir ?= $(OPK_REPO_TOP)/oemcrypto/opk/oemcrypto_ta/wtpi_reference +tos_impl_dir ?= $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common + +wtpi_impl_sources += \ + $(wtpi_impl_dir)/wtpi_oemcrypto_config.c \ + $(wtpi_ref_dir)/wtpi_crypto_and_key_management_layer1_openssl.c \ + $(wtpi_ref_dir)/wtpi_crypto_asymmetric.c \ + $(wtpi_ref_dir)/wtpi_decrypt_sample.c \ + $(wtpi_impl_dir)/wtpi_init_and_clock_ipc.c \ + $(wtpi_ref_dir)/wtpi_abort.c \ + $(wtpi_ref_dir)/wtpi_device_key.c \ + $(wtpi_ref_dir)/crypto_util.c \ + $(wtpi_ref_dir)/rsa_util.c \ + $(wtpi_ref_dir)/ecc_util.c \ + $(wtpi_ref_dir)/cose_util.c \ + $(wtpi_ref_dir)/wtpi_logging.c \ + $(wtpi_ref_dir)/wtpi_root_of_trust_layer1.c \ + $(wtpi_ref_dir)/renewal_util.c \ + $(wtpi_ref_dir)/wtpi_clock_and_gn_layer1.c \ + $(wtpi_ref_dir)/wtpi_crc32.c \ + $(wtpi_ref_dir)/wtpi_crypto_wrap_asymmetric.c \ + $(wtpi_ref_dir)/wtpi_idle.c \ + $(wtpi_ref_dir)/wtpi_device_renewal_layer1.c \ + $(wtpi_ref_dir)/wtpi_device_renewal_layer2.c \ + $(wtpi_stub_dir)/wtpi_device_key_access.c \ + $(wtpi_stub_dir)/wtpi_persistent_storage.c \ + $(wtpi_stub_dir)/wtpi_root_of_trust_layer2.c \ + $(wtpi_stub_dir)/wtpi_secure_buffer_access.c \ + $(tos_impl_dir)/tos_secure_buffers.c \ + $(tos_impl_dir)/tos_transport.cpp \ + +wtpi_impl_includes += \ + $(wtpi_impl_dir) \ + $(wtpi_ref_dir) \ + $(wtpi_ref_dir)/../wtpi \ + $(oemcrypto_dir)/include \ + + diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/DO-NOT-RELEASE-TO-PARTNERS b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/DO-NOT-RELEASE-TO-PARTNERS new file mode 100644 index 0000000..e69de29 diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.c new file mode 100644 index 0000000..58f9991 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.c @@ -0,0 +1,167 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#include "file_store_interface.h" + +#include +#include +#include +#include +#include + +#include "wtpi_abort_interface.h" +#include "wtpi_logging_interface.h" + +#define PATH_MAX 256 +static const char kDirectoryDelimiter = '/'; + +typedef struct tee_file_handle { + FILE* file; + const char* path; +} tee_file_handle; + +static bool IsFileHandleValid(File_Handle handle) { + return (handle != NULL && handle->file != NULL && PathExists(handle->path)); +} + +/* Create all the subdirectories on |dir|, if they don't exist. |dir| can be + * either a relative or an absolute path to the storage file, not including the + * file name. */ +static bool CreateDirectories(const char* dir) { + if (dir == NULL) return false; + char mutable_dir[PATH_MAX]; + size_t len = strlen(dir); + if (len > sizeof(mutable_dir) - 1) { + return false; + } + memcpy(mutable_dir, dir, len); + mutable_dir[len] = '\0'; + char* pos; + errno = 0; + for (pos = mutable_dir + 1; *pos; pos++) { + if (*pos == kDirectoryDelimiter) { + *pos = '\0'; + if (mkdir(mutable_dir, S_IRWXU) != 0) { + if (errno != EEXIST) return false; + } + *pos = kDirectoryDelimiter; + } + } + if (mkdir(mutable_dir, S_IRWXU) != 0) { + if (errno != EEXIST) { + return false; + } + } + return true; +} + +bool PathExists(const char* path) { + struct stat buf; + return (stat(path, &buf) == 0); +} + +File_Handle FileOpen(const char* path, int flags) { + if (path == NULL) return NULL; + if (!PathExists(path)) { + /* Strip file name off and create all sub-directories. */ + const char* last_delimiter = strrchr(path, kDirectoryDelimiter); + if (last_delimiter != NULL) { + char dir[PATH_MAX]; + size_t len = last_delimiter - path; + if (len > sizeof(dir) - 1) { + return NULL; + } + memcpy(dir, path, len); + dir[len] = '\0'; + if (!PathExists(dir) && !CreateDirectories(dir)) { + return NULL; + } + } + } + FILE* fp; + if (((flags & FILE_OPEN_TRUNCATE) && PathExists(path)) || + ((flags & FILE_OPEN_CREATE) && !PathExists(path))) { + fp = fopen(path, "wb"); + if (fp) { + fclose(fp); + } else { + return NULL; + } + } + const char* open_flags = (flags & FILE_OPEN_READ_ONLY) ? "rb" : "wb"; + if ((fp = fopen(path, open_flags)) == NULL) { + return NULL; + } + File_Handle handle = malloc(sizeof(tee_file_handle)); + if (handle == NULL) { + return NULL; + } + handle->file = fp; + handle->path = path; + return handle; +} + +int FileRead(File_Handle handle, char* buffer, size_t bytes) { + if (handle == NULL) { + LOGE("Handle is NULL"); + return -1; + } + ABORT_IF(!IsFileHandleValid(handle), "Impossible file handle."); + if (buffer == NULL) { + LOGE("Buffer is empty"); + return -1; + } + size_t len = fread(buffer, sizeof(char), bytes, handle->file); + if (len != bytes) { + if (ferror(handle->file)) { + LOGE("Error reading %zu bytes, error=%d", bytes, ferror(handle->file)); + } else if (feof(handle->file)) { + LOGE("Error reading %zu bytes, unexpected EOF", bytes); + } + } + return (int)len; +} + +int FileWrite(File_Handle handle, const char* buffer, size_t bytes) { + if (handle == NULL) { + LOGE("Handle is NULL"); + return -1; + } + ABORT_IF(!IsFileHandleValid(handle), "Impossible file handle."); + if (buffer == NULL) { + LOGE("Buffer is empty"); + return -1; + } + size_t len = fwrite(buffer, sizeof(char), bytes, handle->file); + if (len != bytes) { + LOGE("Error writing %zu bytes, error=%d", bytes, ferror(handle->file)); + } + fflush(handle->file); + return (int)len; +} + +int FileSize(File_Handle handle) { + if (handle == NULL) { + LOGE("Handle is NULL"); + return -1; + } + ABORT_IF(!IsFileHandleValid(handle), "Impossible file handle."); + struct stat buf; + if (stat(handle->path, &buf) == 0) { + return (int)buf.st_size; + } else { + return -1; + } +} + +bool FileClose(File_Handle handle) { + if (handle == NULL) { + LOGE("Handle is NULL"); + return false; + } + ABORT_IF(!IsFileHandleValid(handle), "Impossible file handle."); + fclose(handle->file); + free(handle); + return true; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.h b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.h new file mode 100644 index 0000000..7caa23b --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/file_store_interface.h @@ -0,0 +1,59 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#ifndef OEMCRYPTO_TA_FILE_STORE_INTERFACE_H_ +#define OEMCRYPTO_TA_FILE_STORE_INTERFACE_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define FILE_OPEN_NO_FLAG 0x0 +#define FILE_OPEN_CREATE 0x1 +#define FILE_OPEN_READ_ONLY 0x2 +#define FILE_OPEN_TRUNCATE 0x4 + +typedef struct tee_file_handle* File_Handle; + +/** + * Checks if a file or a directory exists. + */ +bool PathExists(const char* path); + +/** + * Creates a file handle from |path| with open flags |flags|. + */ +File_Handle FileOpen(const char* path, int flags); + +/** + * Reads |bytes| data to |buffer| from file handle |handle|. Returns the + * number of data read on success, -1 on failure. Caller retains ownership of + * all pointers, and ensures the size of |buffer| is at least as big as |bytes|. + */ +int FileRead(File_Handle handle, char* buffer, size_t bytes); + +/** + * Writes |bytes| data from |buffer| to file handle |handle|. Returns the + * number of data written on success, -1 on failure. + */ +int FileWrite(File_Handle handle, const char* buffer, size_t bytes); + +/** + * Returns the size of file on success, -1 on failure. + */ +int FileSize(File_Handle handle); + +/** + * Frees |handle| that was constructed from a previous call to FileOpen. + */ +bool FileClose(File_Handle handle); + +#ifdef __cplusplus +} +#endif + +#endif /* OEMCRYPTO_TA_FILE_STORE_INTERFACE_H_ */ diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_cas.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_cas.c new file mode 100644 index 0000000..930ca25 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_cas.c @@ -0,0 +1,51 @@ +/* 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 "wtpi_cas_interface.h" + +OEMCryptoResult WTPI_InitializeCas(void) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_TerminateCas(void) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_AllocateKeySlotDescriptor(OEMCrypto_SESSION session_id, + void** key_slot_descriptor) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_FreeKeySlotDescriptor(void* key_slot_descriptor) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentKey(void* key_slot_descriptor, + WTPI_K1_SymmetricKey_Handle key_handle, + OEMCryptoCipherMode cipher_mode, + bool is_even) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_InstallContentIV(void* key_slot_descriptor, uint8_t* iv, + size_t iv_length, bool is_even) { + // TODO + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_GetKeyToken(void* key_slot_descriptor, uint8_t* key_token, + size_t* key_token_length) { + // TODO + return OEMCrypto_SUCCESS; +} + +size_t WTPI_GetKeyTokenSize(void) { + // TODO + return 0; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_device_key_access.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_device_key_access.c new file mode 100644 index 0000000..bceb2e7 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_device_key_access.c @@ -0,0 +1,21 @@ +/* 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 "wtpi_device_key_access_interface.h" + +/* This implementation uses a hardcoded fake device key. Reboot tests requires + * a constant device key across reboots. Provisioning 4.0 tests against the + * reference implementation also requires a constant device key for deriving a + * Boot Certificate Chain which can be pre-registered by the provision server. + */ + +static uint8_t fake_device_key[KEY_SIZE_128] = { + 0xa2, 0xe5, 0x11, 0x54, 0x12, 0x60, 0xf0, 0xe1, + 0xa8, 0x72, 0xeb, 0x15, 0x48, 0x41, 0xc7, 0x87}; + +const uint8_t* WTPI_GetDeviceKey(void) { return fake_device_key; } + +KeySize WTPI_GetDeviceKeySize(void) { + return (KeySize)(sizeof(fake_device_key)); +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_init_and_clock_no_ipc.cpp b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_init_and_clock_no_ipc.cpp new file mode 100644 index 0000000..f6e00a5 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_init_and_clock_no_ipc.cpp @@ -0,0 +1,48 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine + License Agreement. */ + +#include "wtpi_clock_interface_layer1.h" +#include "wtpi_clock_interface_layer2.h" + +#include +#include + +#include "OEMCryptoCENC.h" +#include "file_store_interface.h" +#include "oemcrypto_wall_clock.h" +#include "wtpi_initialize_terminate_interface.h" +#include "wtpi_logging_interface.h" + +// These functions are used for the test implementation when +// we do NOT have an IPC to set the wall clock time. + +// We simulate a secure timer by resting it to 0 on initalization. +static uint64_t gInitialTime = 0; + +/* Test implementations of Initialize and Terminate functions. */ +extern "C" OEMCryptoResult WTPI_Initialize(void) { + LOGD("WTPI_Initialize."); + gInitialTime = wvutil::Clock().GetCurrentTime(); + // When running in a test environment without the IPC code, we need to + // initialize the wall clock to be the same as the fake clock. Otherwise, we + // ignore fake sleeps between Terminate and the next Initialize. + OPK_SetWallClockTime(gInitialTime); + return OEMCrypto_SUCCESS; +} + +extern "C" OEMCryptoResult WTPI_Terminate(void) { + LOGD("WTPI_Terminate."); + return OEMCrypto_SUCCESS; +} + +extern "C" OEMCryptoResult WTPI_GetSecureTimer(uint64_t* time_in_s) { + if (!time_in_s) return OEMCrypto_ERROR_INVALID_CONTEXT; + uint64_t now = wvutil::Clock().GetCurrentTime(); + // Since there is no transport layer running, we must set the wall clock + // somewhere. This is as good a place as any. + OPK_SetWallClockTime(now); + // Pretend secure timer started at initialization time. + *time_in_s = now > gInitialTime ? now - gInitialTime : 0; + return OEMCrypto_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_persistent_storage.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_persistent_storage.c new file mode 100644 index 0000000..7abdfcf --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/test-only/wtpi_persistent_storage.c @@ -0,0 +1,59 @@ +/* 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 "wtpi_persistent_storage.h" + +#include + +#include "file_store_interface.h" +#include "wtpi_logging_interface.h" + +static const char* kPersistentDataPath = "./out/generation_number.dat"; + +OEMCryptoResult WTPI_PrepareStoredPersistentData(void) { + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_LoadPersistentData(uint8_t* data, size_t* data_length) { + LOGD("Requesting %zd bytes persistent data", *data_length); + if (!data || !data_length) return OEMCrypto_ERROR_INVALID_CONTEXT; + if (!PathExists(kPersistentDataPath)) { + LOGD("WTPI_LoadPersistentData: no data"); + return OPK_ERROR_NO_PERSISTENT_DATA; + } + File_Handle handle = FileOpen(kPersistentDataPath, FILE_OPEN_READ_ONLY); + if (handle == NULL) { + LOGE("Failed to open file %s", kPersistentDataPath); + return OPK_ERROR_NO_PERSISTENT_DATA; + } + if ((int)*data_length < FileSize(handle)) { + LOGE("Too much persistent data: %d", FileSize(handle)); + *data_length = FileSize(handle); + return OEMCrypto_ERROR_SHORT_BUFFER; + } + // If the file exists, we read the data we can, and return success. + // The calling procedure will deal with a short buffer. + *data_length = FileRead(handle, (char*)(data), *data_length); + FileClose(handle); + LOGD("WTPI_LoadPersistentData: got %zd.", *data_length); + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_StorePersistentData(const uint8_t* data, + size_t data_length) { + LOGD("Saving %zd bytes persistent data", data_length); + File_Handle handle = + FileOpen(kPersistentDataPath, FILE_OPEN_CREATE | FILE_OPEN_TRUNCATE); + if (handle == NULL) { + LOGE("Failed to open file %s", kPersistentDataPath); + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + if (FileWrite(handle, (const char*)data, data_length) != (int)data_length) { + LOGE("Failed to save persistent data"); + FileClose(handle); + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + FileClose(handle); + return OEMCrypto_SUCCESS; +} 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 new file mode 100644 index 0000000..536794b --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c @@ -0,0 +1,479 @@ +/* Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine + License Agreement. */ + +#include "wtpi_crypto_and_key_management_interface_layer2.h" + +#include +#include +#include + +#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" +#include "oemcrypto_overflow.h" +#include "openssl/aes.h" +#include "openssl/bio.h" +#include "openssl/cmac.h" +#include "openssl/evp.h" +#include "openssl/hmac.h" +#include "openssl/rand.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" + +/****************************************************************************** + * This is a test implementation of Crypto and Key Management layer 2, + * which simulates a hardware-backed cryptography. The keys stored in a + * pre-allocated table with limited number of slots. OpenSSL is used here as a + * replacement of the hardware crypto. + ******************************************************************************/ + +typedef struct wtpi_k2_symmetric_key_handle { + uint32_t index; +} wtpi_k2_symmetric_key_handle; + +bool WTPI_K2_IsKeyHandleValid(WTPI_K2_SymmetricKey_Handle key_handle) { + return ((key_handle != NULL) && K2_IsKeyValid(key_handle->index)); +} + +OEMCryptoResult WTPI_K2_GetKeyType(WTPI_K2_SymmetricKey_Handle key_handle, + SymmetricKeyType* type) { + if (key_handle == NULL || type == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + *type = K2_GetKeyType(key_handle->index); + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_K2_GetKeySize(WTPI_K2_SymmetricKey_Handle key_handle, + KeySize* size) { + if (key_handle == NULL || size == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + *size = K2_GetKeySize(key_handle->index); + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_K2_InitializeKeyManagement(void) { + return K2_InitializeKeyTable(); +} + +OEMCryptoResult WTPI_K2_TerminateKeyManagement(void) { + return OEMCrypto_SUCCESS; +} + +/****************************************************************************** + The following implement the key mapping interface. +*******************************************************************************/ + +bool KM_IsLayer2KeyIndexValid(uint32_t k2_index) { + return K2_IsIndexValid(k2_index); +} + +OEMCryptoResult KM_GetLayer2KeyIndex(WTPI_K2_SymmetricKey_Handle key_handle, + uint32_t* k2_index) { + if (key_handle == NULL || k2_index == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + *k2_index = key_handle->index; + return OEMCrypto_SUCCESS; +} + +void KM_SetLayer2KeyEvictionCallback(OEMCryptoResult (*callback)(uint32_t)) { + K2_SetEvictionCallback(callback); +} + +/****************************************************************************** + The following implement the layer 2 crypto interface. +*******************************************************************************/ + +OEMCryptoResult WTPI_C2_AESCBCEncrypt(WTPI_K2_SymmetricKey_Handle key_handle, + const uint8_t* in, size_t in_length, + const uint8_t* iv, uint8_t* out) { + if (key_handle == NULL || in == NULL || in_length == 0 || + in_length % AES_BLOCK_SIZE != 0 || iv == NULL || out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + if (!OPKI_AESCBCEncrypt(in, in_length, iv, key, (size_t)key_size, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +static OEMCryptoResult DeriveKeyWithCMACToKeyHandle( + const uint8_t* key, KeySize key_size, uint8_t counter, + const uint8_t* context, size_t context_length, + SymmetricKeyType out_key_type, KeySize out_key_size, + WTPI_K2_SymmetricKey_Handle* out_key_handle) { + if ((out_key_size != KEY_SIZE_128 && out_key_size != KEY_SIZE_256) || + context == NULL || context_length <= 0 || out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t buffer[KEY_SIZE_256]; + if (!OPKI_DeriveKeyWithCMAC(key, key_size, counter, context, context_length, + out_key_size, buffer)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return WTPI_K2_CreateKeyHandle(buffer, out_key_size, out_key_type, + out_key_handle); +} + +OEMCryptoResult WTPI_C2_AESCBCDecrypt(WTPI_K2_SymmetricKey_Handle key_handle, + size_t key_length, const uint8_t* in, + size_t in_length, const uint8_t* iv, + uint8_t* out) { + if (key_handle == NULL || + (key_length != KEY_SIZE_128 && key_length != KEY_SIZE_256) || + in == NULL || in_length == 0 || in_length % AES_BLOCK_SIZE != 0 || + iv == NULL || out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (key_length > K2_GetKeySize(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + if (!OPKI_AESCBCDecrypt(in, in_length, iv, key, key_length, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_AESCTRDecrypt(WTPI_K2_SymmetricKey_Handle key_handle, + const uint8_t* in, size_t in_length, + const uint8_t* iv, size_t block_offset, + uint8_t* out) { + if (key_handle == NULL || in == NULL || in_length == 0 || + block_offset >= AES_BLOCK_SIZE || iv == NULL || out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + if (!OPKI_AESCTRDecrypt(in, in_length, iv, key, (size_t)key_size, + block_offset, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_HMAC_SHA1(WTPI_K2_SymmetricKey_Handle key_handle, + const uint8_t* message, size_t message_length, + uint8_t* out) { + if (key_handle == NULL || message == NULL || message_length == 0 || + out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + if (!OPKI_HMAC_SHA1(message, message_length, key, (size_t)key_size, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_SHA256(const uint8_t* message, size_t message_length, + uint8_t* out) { + if (message == NULL || message_length == 0 || out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!SHA256(message, message_length, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_HMAC_SHA256(WTPI_K2_SymmetricKey_Handle key_handle, + const uint8_t* message, + size_t message_length, uint8_t* out) { + if (key_handle == NULL || message == NULL || message_length == 0 || + out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!K2_IsKeyValid(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + if (!OPKI_HMAC_SHA256(message, message_length, key, (size_t)key_size, out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_HMAC_SHA256_Verify( + WTPI_K2_SymmetricKey_Handle key_handle, const uint8_t* message, + size_t message_length, const uint8_t* signature) { + if (signature == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t computed_signature[SHA256_DIGEST_LENGTH]; + OEMCryptoResult result = WTPI_C2_HMAC_SHA256( + key_handle, message, message_length, computed_signature); + if (result != OEMCrypto_SUCCESS) return result; + if (crypto_memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { + return OEMCrypto_ERROR_SIGNATURE_FAILURE; + } + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_C2_RandomBytes(uint8_t* out, size_t size) { + if (out == NULL || size == 0) return OEMCrypto_ERROR_INVALID_CONTEXT; + if (RAND_bytes(out, (int)size) != 1) return OEMCrypto_ERROR_UNKNOWN_FAILURE; + return OEMCrypto_SUCCESS; +} + +/****************************************************************************** + The following implement the layer 2 key management interface. +*******************************************************************************/ + +OEMCryptoResult WTPI_K2_CreateKeyHandle( + const uint8_t* serialized_bytes, size_t size, SymmetricKeyType key_type, + WTPI_K2_SymmetricKey_Handle* out_key_handle) { + if (serialized_bytes == NULL || size == 0 || out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (size != KEY_SIZE_128 && size != KEY_SIZE_256) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + WTPI_K2_SymmetricKey_Handle handle = + malloc(sizeof(wtpi_k2_symmetric_key_handle)); + if (handle == NULL) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + uint32_t index; + OEMCryptoResult result = K2_AddKey(serialized_bytes, size, key_type, &index); + if (result != OEMCrypto_SUCCESS) { + free(handle); + return result; + } + handle->index = index; + *out_key_handle = handle; + return result; +} + +OEMCryptoResult WTPI_K2_DeriveDeviceKeyIntoHandle( + uint32_t context, SymmetricKeyType out_key_type, + WTPI_K2_SymmetricKey_Handle* out_key_handle, KeySize out_key_size) { + if (out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + const uint8_t* device_key = WTPI_GetDeviceKey(); + KeySize device_key_size = WTPI_GetDeviceKeySize(); + WTPI_K2_SymmetricKey_Handle temp_key_handle = NULL; + OEMCryptoResult result = WTPI_K2_CreateKeyHandle( + device_key, device_key_size, DERIVING_KEY, &temp_key_handle); + if (result != OEMCrypto_SUCCESS) return result; + // Prepare full context for key derivation + // Server and client MAC keys must derive to the same key. + const SymmetricKeyType type_temp = + out_key_type == MAC_KEY_SERVER ? MAC_KEY_CLIENT : out_key_type; + // Cast the type into 32 bits so it is the same size as the gap left for it in + // full_context. This will be a no-op on most architectures. + const uint32_t type_32 = (uint32_t)type_temp; + // Build a full context that is unique to this starting context / key type + // combination. We start with a context template with blanks at the beginning + // and fill the blanks with the starting context and key type. + uint8_t full_context[20] = {'.', '.', '.', '.', '.', '.', '.', '.', 'W', 'i', + 'd', 'e', 'v', 'i', 'n', 'e', ' ', 'O', 'P', 'K'}; + const size_t context_length = sizeof(full_context); + memcpy(full_context, &context, 4); + memcpy(full_context + 4, &type_32, 4); + const uint8_t counter = 1; + result = WTPI_K2_DeriveKeyFromKeyHandle( + temp_key_handle, counter, (const uint8_t*)full_context, context_length, + out_key_type, out_key_size, out_key_handle); + WTPI_K2_FreeKeyHandle(temp_key_handle); + return result; +} + +OEMCryptoResult WTPI_K2_AESDecryptAndCreateKeyHandle( + WTPI_K2_SymmetricKey_Handle decrypt_key_handle, const uint8_t* enc_key, + size_t enc_key_length, const uint8_t* iv, SymmetricKeyType key_type, + WTPI_K2_SymmetricKey_Handle* out_key_handle) { + if (decrypt_key_handle == NULL || enc_key == NULL || enc_key_length == 0 || + iv == NULL || out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (enc_key_length != KEY_SIZE_128 && enc_key_length != KEY_SIZE_256) { + /* Generic crypto allows both key sizes. */ + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(decrypt_key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t raw_key[KEY_SIZE_256]; + KeySize key_size; + OEMCryptoResult result = WTPI_K2_GetKeySize(decrypt_key_handle, &key_size); + if (result != OEMCrypto_SUCCESS) return result; + result = WTPI_C2_AESCBCDecrypt(decrypt_key_handle, (size_t)key_size, enc_key, + enc_key_length, iv, raw_key); + if (result != OEMCrypto_SUCCESS) return result; + WTPI_K2_SymmetricKey_Handle handle = NULL; + result = WTPI_K2_CreateKeyHandle(raw_key, enc_key_length, key_type, &handle); + if (result != OEMCrypto_SUCCESS) return result; + *out_key_handle = handle; + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_K2_AESDecryptAndCreateKeyHandleForMacKeys( + WTPI_K2_SymmetricKey_Handle decrypt_key_handle, const uint8_t* enc_mac_keys, + size_t enc_mac_keys_length, const uint8_t* iv, + WTPI_K2_SymmetricKey_Handle* out_mac_key_server, + WTPI_K2_SymmetricKey_Handle* out_mac_key_client) { + if (decrypt_key_handle == NULL || enc_mac_keys == NULL || + enc_mac_keys_length == 0 || iv == NULL || out_mac_key_server == NULL || + out_mac_key_client == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (enc_mac_keys_length != 2 * MAC_KEY_SIZE) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(decrypt_key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t raw_mac_keys[2 * MAC_KEY_SIZE]; + KeySize key_size; + OEMCryptoResult result = WTPI_K2_GetKeySize(decrypt_key_handle, &key_size); + if (result != OEMCrypto_SUCCESS) return result; + result = + WTPI_C2_AESCBCDecrypt(decrypt_key_handle, (size_t)key_size, enc_mac_keys, + enc_mac_keys_length, iv, raw_mac_keys); + if (result != OEMCrypto_SUCCESS) return result; + WTPI_K2_SymmetricKey_Handle server_handle = NULL; + result = WTPI_K2_CreateKeyHandle(raw_mac_keys, MAC_KEY_SIZE, MAC_KEY_SERVER, + &server_handle); + if (result != OEMCrypto_SUCCESS) return result; + WTPI_K2_SymmetricKey_Handle client_handle = NULL; + result = WTPI_K2_CreateKeyHandle(raw_mac_keys + MAC_KEY_SIZE, MAC_KEY_SIZE, + MAC_KEY_CLIENT, &client_handle); + if (result != OEMCrypto_SUCCESS) { + WTPI_K2_FreeKeyHandle(server_handle); + return result; + } + *out_mac_key_server = server_handle; + *out_mac_key_client = client_handle; + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_K2_DeriveKeyFromKeyHandle( + WTPI_K2_SymmetricKey_Handle key_handle, uint8_t counter, + const uint8_t* context, size_t context_length, + SymmetricKeyType out_key_type, KeySize out_key_size, + WTPI_K2_SymmetricKey_Handle* out_key_handle) { + if (key_handle == NULL || context == NULL || context_length == 0 || + out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + if (K2_GetKeyType(key_handle->index) != DERIVING_KEY) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + return DeriveKeyWithCMACToKeyHandle(key, key_size, counter, context, + context_length, out_key_type, + out_key_size, out_key_handle); +} + +OEMCryptoResult WTPI_K2_WrapKey(uint32_t context, + WTPI_K2_SymmetricKey_Handle key_handle, + SymmetricKeyType key_type, uint8_t* wrapped_key, + size_t wrapped_key_length) { + if (key_handle == NULL || wrapped_key == NULL || wrapped_key_length == 0) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (key_type != K2_GetKeyType(key_handle->index)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + KeySize key_size = K2_GetKeySize(key_handle->index); + if (wrapped_key_length != key_size) { + /* The caller should give us the correct buffer size. */ + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + uint8_t* key = K2_GetKey(key_handle->index); + + /* TODO(b/158766099): encrypt the data instead of memcpy. */ + memcpy(wrapped_key, key, key_size); + + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_K2_UnwrapIntoKeyHandle( + uint32_t context, const uint8_t* wrapped_key, size_t wrapped_key_length, + SymmetricKeyType key_type, WTPI_K2_SymmetricKey_Handle* out_key_handle) { + if (wrapped_key == NULL || wrapped_key_length == 0 || + out_key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (wrapped_key_length != KEY_SIZE_128 && + wrapped_key_length != KEY_SIZE_256) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + + /* TODO(b/158766099): decrypt the key data before creating key handle. */ + + return WTPI_K2_CreateKeyHandle(wrapped_key, wrapped_key_length, key_type, + out_key_handle); +} + +OEMCryptoResult WTPI_K2_EncryptKeyHandle( + WTPI_K2_SymmetricKey_Handle key_handle, + WTPI_K2_SymmetricKey_Handle encrypt_key_handle, const uint8_t* iv, + uint8_t* out) { + if (key_handle == NULL || encrypt_key_handle == NULL || iv == NULL || + out == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + uint8_t* key = K2_GetKey(key_handle->index); + KeySize key_size = K2_GetKeySize(key_handle->index); + + return WTPI_C2_AESCBCEncrypt(encrypt_key_handle, key, key_size, iv, out); +} + +OEMCryptoResult WTPI_K2_FreeKeyHandle(WTPI_K2_SymmetricKey_Handle key_handle) { + if (key_handle == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + if (!WTPI_K2_IsKeyHandleValid(key_handle)) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + OEMCryptoResult result = K2_RemoveKey(key_handle->index); + free(key_handle); + return result; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_device_renewal_layer2_test.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_device_renewal_layer2_test.c new file mode 100644 index 0000000..95ad421 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_device_renewal_layer2_test.c @@ -0,0 +1,30 @@ +/* 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 "wtpi_device_renewal_interface_layer2.h" + +#include + +#include "oemcrypto_check_macros.h" +#include "oemcrypto_key_types.h" + +OEMCryptoResult WTPI_GetRenewalInfo(uint32_t old_system_id, + uint32_t* new_system_id, + uint8_t* renewal_key, + size_t renewal_key_length) { + ABORT_IF(old_system_id != 0x1ee8, "Unexpected old system ID"); + ABORT_IF_NULL(new_system_id); + ABORT_IF_NULL(renewal_key); + ABORT_IF(renewal_key_length != KEY_SIZE_128, "Unexpected renewal key size"); + + // The following magic values map to the renewal twin of the test keybox and + // were exchanged with the provisioning team out-of-band. + *new_system_id = 25421; + static const uint8_t kRenewalKey[KEY_SIZE_128] = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, + }; + memcpy(renewal_key, kRenewalKey, KEY_SIZE_128); + return OEMCrypto_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_init_and_clock_ipc.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_init_and_clock_ipc.c new file mode 100644 index 0000000..fc02f65 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_init_and_clock_ipc.c @@ -0,0 +1,30 @@ +/* Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine + License Agreement. */ + +#include "wtpi_clock_interface_layer2.h" + +#include + +#include "OEMCryptoCENC.h" +#include "wtpi_initialize_terminate_interface.h" +#include "wtpi_logging_interface.h" + +// This implementation is used when we do not have access to a clock that can do +// fake sleeps. + +OEMCryptoResult WTPI_GetSecureTimer(uint64_t* time_in_s) { + if (!time_in_s) return OEMCrypto_ERROR_INVALID_CONTEXT; + *time_in_s = time(0); + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_Initialize(void) { + LOGD("WTPI_Initialize."); + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult WTPI_Terminate(void) { + LOGD("WTPI_Terminate."); + return OEMCrypto_SUCCESS; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_oemcrypto_config.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_oemcrypto_config.c new file mode 100644 index 0000000..e65baf5 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_oemcrypto_config.c @@ -0,0 +1,87 @@ +/* Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine + License Agreement. */ + +#include "wtpi_config_interface.h" + +OEMCrypto_Security_Level WTPI_GetSecurityLevel(void) { + return OEMCrypto_Level3; +} + +OEMCrypto_ProvisioningMethod WTPI_GetProvisioningMethod(void) { +#ifdef USE_PROVISIONING_40 + return OEMCrypto_BootCertificateChain; +#else + return OEMCrypto_Keybox; +#endif +} + +uint32_t WTPI_GetResourceRatingTier(void) { return 3; } + +OPK_FeatureStatus WTPI_IsTAAntiRollbackEnabled(void) { + return OPK_FEATURE_NOT_SUPPORTED; +} + +bool WTPI_IsProductionReady(void) { return false; } + +OEMCrypto_WatermarkingSupport WTPI_GetWatermarkingSupport(void) { + return OEMCrypto_WatermarkingNotSupported; +} + +OEMCrypto_DTCP2_Capability WTPI_GetDTCP2Capability(void) { + return OEMCrypto_NO_DTCP2; +} + +OEMCryptoResult WTPI_GetCurrentSRMVersion(uint32_t* srm_version) { + if (srm_version == NULL) return OEMCrypto_ERROR_INVALID_CONTEXT; + *srm_version = 0; + return OEMCrypto_SUCCESS; +} + +bool WTPI_IsAntiRollbackHWPresent() { return false; } + +OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field) { + /* No CGMS for test impl. */ + return OEMCrypto_ERROR_UNKNOWN_FAILURE; +} + +bool WTPI_IsCGMS_AActive(void) { return false; } + +bool WTPI_SupportsCGMS_A(void) { return false; } + +bool WTPI_HasAnalogDisplay(void) { return false; } + +bool WTPI_IsAnalogDisplayActive(void) { return false; } + +bool WTPI_CanDisableAnalogDisplay(void) { return false; } + +bool WTPI_DisableAnalogDisplay(void) { return false; } + +size_t WTPI_MaxBufferSizeForDecrypt(void) { + return 1 * 1024 * 1024; /* 1 MiB according to resource rating tier. */ +} + +size_t WTPI_MaxOutputSizeForDecrypt(void) { return 0; /* Unrestricted. */ } + +bool WTPI_IsClosedPlatform(void) { return false; } + +OEMCrypto_HDCP_Capability WTPI_CurrentHDCPCapability(void) { + return HDCP_NO_DIGITAL_OUTPUT; +} + +OEMCrypto_HDCP_Capability WTPI_MaxHDCPCapability(void) { + return HDCP_NO_DIGITAL_OUTPUT; +} + +size_t WTPI_MaxBufferSizeForGenericCrypto(void) { + return 500 * 1024; /* 500 KiB according to resource rating tier. */ +} + +size_t WTPI_MaxSampleSize(void) { + return 16 * 1024 * 1024; /* 16 MiB according to resource rating tier. */ +} + +uint32_t WTPI_SupportedCertificates(void) { + return OEMCrypto_Supports_RSA_2048bit | OEMCrypto_Supports_RSA_3072bit | + OEMCrypto_Supports_ECC_secp256r1; +} diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp new file mode 100644 index 0000000..5655ede --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp @@ -0,0 +1,84 @@ +# Copyright 2021 Google LLC.All Rights Reserved.This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. + +{ + 'variables': { + 'oemcrypto_ta_dir' : '<(DEPTH)/oemcrypto/opk/oemcrypto_ta', + 'odk_dir' : '<(DEPTH)/oemcrypto/odk', + # Include directory that contains wtpi_config_macros.h. + 'config_macros_header_dir%': '<(oemcrypto_ta_dir)/wtpi_reference', + # TODO(b/207176111): add test scripts to cover both reference crypto impl + 'reference_crypto_impl%': 'software', + 'test_renewal%': 0, + # Path to wtpi implementations that pass tests but are unsuitable for + # production use. + 'wtpi_stub_dir': '<(oemcrypto_ta_dir)/wtpi_useless', + 'use_provisioning_40%': 0, + }, + 'target_defaults': { + 'toolsets' : [ 'target' ], + 'type': 'static_library', + 'include_dirs': [ + '<(config_macros_header_dir)', + '<(DEPTH)/util/include', + 'test-only', + '.', + '<(odk_dir)/include', + ], + 'sources': [ + 'wtpi_oemcrypto_config.c', + 'test-only/wtpi_persistent_storage.c', + 'test-only/file_store_interface.c', + 'test-only/wtpi_cas.c', + 'test-only/wtpi_device_key_access.c', + '<(wtpi_stub_dir)/wtpi_root_of_trust_layer2.c', + '<(wtpi_stub_dir)/wtpi_secure_buffer_access.c', + ], + 'conditions': [ + ['reference_crypto_impl=="hardware"', { + 'sources': [ + 'layer2_crypto_key_table.c', + 'wtpi_crypto_and_key_management_layer2_hw.c', + ], + }], + ['test_renewal', { + 'sources': [ + 'wtpi_device_renewal_layer2_test.c', + ], + }], + ['use_provisioning_40', { + 'defines': [ + 'USE_PROVISIONING_40', + ], + }], + ], + 'dependencies': [ + '<(oemcrypto_ta_dir)/oemcrypto_ta.gyp:oemcrypto_ta_linux_tee', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_abort', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_clock', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_crypto', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_idle', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_logging', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_renewal', + '<(oemcrypto_ta_dir)/wtpi_reference/wtpi_reference.gyp:oemcrypto_ta_reference_root_of_trust', + ], + }, + 'targets': [{ + # This target is used when we have the serialization IPC in the loop. In + # that case, we cannot use a fake clock. + 'target_name': 'oemcrypto_ta_test_impl_ipc', + 'sources': [ + 'wtpi_init_and_clock_ipc.c', + ], + }, + { + # This target is used when we do not have the serialization IPC in the + # loop. In that case, we can use a fake clock, but we also don't have the + # serialization level telling us what the wall clock. + 'target_name': 'oemcrypto_ta_test_impl_no_ipc', + 'sources': [ + 'test-only/wtpi_init_and_clock_no_ipc.cpp', + ], + }], +} diff --git a/oemcrypto/opk/ports/linux/ta/oemcrypto_ta/Makefile b/oemcrypto/opk/ports/linux/ta/oemcrypto_ta/Makefile new file mode 100644 index 0000000..6e1d204 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/oemcrypto_ta/Makefile @@ -0,0 +1,56 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This Makefile is not intended to be invoked on its own. It is possible +# though. Be sure to set the following variables. +# - CDM_DIR: path to top of CDM repo + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project) + +# Define this for tee-sources.mk, which uses it as a prefix for source file +# locations +OPK_REPO_TOP := +# tee-sources.mk provides opk_base_ta_sources and opk_base_ta_includes +include $(CDM_DIR)/oemcrypto/opk/build/tee-sources.mk +include $(CDM_DIR)/oemcrypto/opk/build/ree-sources.mk + +# Definitions for wtpi_impl sources.mk +wtpi_impl_dir := $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl + +# Provides wtpi_impl_sources and wtpi_impl_includes +include $(CDM_DIR)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk + +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/clock.cpp \ + $(tos_impl_dir)/tos_shared_memory.cpp \ + $(opk_base_ta_sources) \ + $(wtpi_impl_sources) \ + $(boringssl_sources) \ + $(dice_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common \ + $(OPK_REPO_TOP)/util/include \ + $(opk_base_ta_includes) \ + $(wtpi_impl_includes) \ + $(boringssl_includes) \ + $(dice_includes) \ + +cflags += \ + -DWTPI_BUILD_INFO=\"$(WTPI_BUILD_INFO)\" \ + -DWV_POSIX_RESOURCE_ID=\"$(project)\" \ + -D_DEFAULT_SOURCE + +ldflags = \ + -lrt -lpthread \ + +include ../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/ta/tee_simulator/README.md b/oemcrypto/opk/ports/linux/ta/tee_simulator/README.md new file mode 100644 index 0000000..eda3342 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/tee_simulator/README.md @@ -0,0 +1,23 @@ +# Linux-IPC-Test port of the OPK + +The linux-ipc-test port of OPK is a sample implementation of the OPK transport and +shared memory interfaces that runs in two separate linux processes to verify the +serialization and deserialization functionality. The TEE side is implemented in +a tee_simulator linux process, and the REE side implements the OEMCrypto API. The +TEE side contains the OEMCrypto TA. The REE side runs the oemcrypto test suite. + +``` +File structure: + ./oemcrypto + build file for liboemcrypto.so + ./serialization_adapter + implementation of os_interfaces/tos_transport_interface.h + implementation of os_interfaces/tos_shared_memory_interface.h + implementation of os_interfaces/opk_secure_buffer_interface.h + ./serialization_adapter/test + test for the shared memory implementation + ./tee_simulator + TEE main loop, calls implementation of tee_dispatcher.h +``` + + diff --git a/oemcrypto/opk/ports/linux/ta/wtpi_test_ta/Makefile b/oemcrypto/opk/ports/linux/ta/wtpi_test_ta/Makefile new file mode 100644 index 0000000..abe8243 --- /dev/null +++ b/oemcrypto/opk/ports/linux/ta/wtpi_test_ta/Makefile @@ -0,0 +1,66 @@ +# +# Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# This Makefile is not intended to be invoked on its own. It is possible +# though. Be sure to set the following variables. +# - CROSS_COMPILE: prefix of compiler, eg arm-linux-gnueabihf- +# - CDM_DIR: path to top of CDM repo + +# Place outputs in $CDM_DIR/out/linux// +project := $(shell basename $(CURDIR)) +srcdir := $(shell realpath --relative-to=$(CURDIR) $(CDM_DIR)) +builddir := $(srcdir)/out/linux/$(project)/ +output = $(project) + +# Define this for tee-sources.mk, which uses it as a prefix for source file +# locations +OPK_REPO_TOP := +# tee-sources.mk provides opk_base_ta_sources and opk_base_ta_includes +include $(CDM_DIR)/oemcrypto/opk/build/tee-sources.mk +include $(CDM_DIR)/oemcrypto/opk/build/ree-sources.mk + +# Definitions for wtpi_impl sources.mk +wtpi_impl_dir := $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl + +# Provides wtpi_impl_sources and wtpi_impl_includes +include $(CDM_DIR)/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/sources.mk + +# $(info $(boringssl_sources)) + +# srcs-y, global-incdirs-y, and libnames are used by the OP-TEE TA dev kit +# build system +srcs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/tee_simulator.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/ta/common/clock.cpp \ + $(tos_impl_dir)/tos_shared_memory.cpp \ + $(oemcrypto_ta_dir)/oemcrypto_asymmetric_key_table.c \ + $(oemcrypto_ta_dir)/oemcrypto_object_table.c \ + $(oemcrypto_ta_dir)/oemcrypto_key.c \ + $(opk_base_wtpi_ta_sources) \ + $(wtpi_impl_sources) \ + $(boringssl_sources) \ + $(dice_sources) \ + +incs += \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common \ + $(OPK_REPO_TOP)/util/include \ + $(opk_base_wtpi_ta_includes) \ + $(wtpi_impl_includes) \ + $(oemcrypto_ta_includes) \ + $(boringssl_includes) \ + $(dice_includes) \ + + +cflags += \ + -DWTPI_BUILD_INFO=\"$(WTPI_BUILD_INFO)\" \ + -DWV_POSIX_RESOURCE_ID=\"$(project)\" \ + -D_DEFAULT_SOURCE + +ldflags = \ + -lrt -lpthread \ + +include ../../rules.mk + diff --git a/oemcrypto/opk/ports/linux/wtpi_tee_simulator.gyp b/oemcrypto/opk/ports/linux/wtpi_tee_simulator.gyp new file mode 100644 index 0000000..f376eaa --- /dev/null +++ b/oemcrypto/opk/ports/linux/wtpi_tee_simulator.gyp @@ -0,0 +1,60 @@ +# +# Builds tee_simulator executable, which includes Linux-based +# implementation of transport and shared memory. +# +# Dependencies: +# OPK serialization library for TEE [ 'tee.gyp:opk_tee' ] +# Implementation of porting layer API ['wtpi_test_impl.gyp:oemcrypto_ta_test_impl_ipc'] +{ + 'includes' : { + '../../oemcrypto_ta/wtpi_test/settings.gypi', + }, + 'variables': { + 'wtpi_impl' : '<(oemcrypto_dir)/opk/ports/linux/ta/common/wtpi_impl/wtpi_test_impl.gyp:oemcrypto_ta_test_impl_ipc', + 'platform_specific_dir%': '<(DEPTH)/linux/src', + 'tee_simulator_dir' : '<(oemcrypto_dir)/opk/ports/linux/ta/common', + 'serialization_adapter_dir' : '<(oemcrypto_dir)/opk/ports/linux/common', + + 'privacy_crypto_impl%': 'boringssl', + 'boringssl_libcrypto_path%': '<(DEPTH)/third_party/boringssl/boringssl.gyp:crypto', + 'boringssl_libssl_path%': '<(DEPTH)/third_party/boringssl/boringssl.gyp:ssl', + 'gtest_dependency%': '<(DEPTH)/third_party/googletest.gyp:gtest', + 'gmock_dependency%': '<(DEPTH)/third_party/googletest.gyp:gmock', + 'oemcrypto_dir%': '<(DEPTH)/oemcrypto', + 'util_dir%': '<(DEPTH)/util', + }, + 'target_defaults': { + 'include_dirs' : [ + 'ta/common/wtpi_impl', + '<(serialization_adapter_dir)', + '<(serialization_dir)/tee/include', + '<(tee_dir)', + '<(util_dir)/include', + ], + }, + 'targets' : [ + { + 'target_name': 'tee_simulator', + 'type': 'executable', + 'sources': [ + '<(serialization_adapter_dir)/tos_logging.cpp', + '<(serialization_adapter_dir)/tos_secure_buffers.c', + '<(serialization_adapter_dir)/tos_shared_memory.cpp', + '<(serialization_adapter_dir)/tos_transport.cpp', + '<(tee_simulator_dir)/clock.cpp', + '<(tee_simulator_dir)/tee_simulator.cpp', + '<(platform_specific_dir)/file_store.cpp', + '<(platform_specific_dir)/log.cpp', + '<(util_dir)/src/platform.cpp', + '<(util_dir)/src/rw_lock.cpp', + '<(util_dir)/src/string_conversions.cpp', + '<(util_dir)/src/string_format.cpp', + ], + 'dependencies': [ + '<(tee_dir)/tee.gyp:opk_tee_wtpi_test', + '<(wtpi_impl)', + ], + 'libraries': ['-lrt', '-lpthread', '-ldl'], + }, + ] +} diff --git a/oemcrypto/opk/ports/optee/scripts/install_ta.sh b/oemcrypto/opk/ports/optee/scripts/install_ta.sh new file mode 100755 index 0000000..3feac90 --- /dev/null +++ b/oemcrypto/opk/ports/optee/scripts/install_ta.sh @@ -0,0 +1,46 @@ +# Run this script in the non-secure QEMU login shell to copy the Widevine +# OEMCrypto TA and WTPI Test TA to the directory where the TAs are located and +# set environment variables to access the liboecmrypto.so + +OEMCRYPTO_TA=a92d116c-ce27-4917-b30c-4a416e2d9351.ta +if test -f $OEMCRYPTO_TA; then + echo "Installing OEMCrypto TA" + cp $OEMCRYPTO_TA /lib/optee_armtz + xtest --install-ta /lib/optee_armtz/$OEMCRYPTO_TA +else + if test -f /lib/optee_armtz/$OEMCRYPTO_TA; then + echo "OEMCrypto TA is already installed" + else + echo "OEMCrypto TA not found, run push.sh from host" + fi +fi + +WTPI_TEST_TA=b0f42504-01ec-11ec-9a03-0242ac130003.ta +if test -f $WTPI_TEST_TA; then + echo "Installing WTPI Test TA" + cp $WTPI_TEST_TA /lib/optee_armtz + xtest --install-ta /lib/optee_armtz/$WTPI_TEST_TA +else + if test -f /lib/optee_armtz/$WTPI_TEST_TA; then + echo "WTPI Test TA is already installed" + else + echo "WTPI TEST TA not found, run push.sh from host" + fi +fi + +# restart tee-supplicant +PID=$(ps | grep tee-supplicant | grep -v grep | sed 's/ tee.*//') +if test -z $PID; then + echo "tee-supplicant is not running" +else + echo "stopping tee-supplicant" + kill $PID +fi +echo "starting tee-supplicant" +su tee -c "tee-supplicant -d /dev/teepriv0" & + +# run as "source" to get this to actually propagate to the environment +# eg. `. ./install_ta.sh` instead of just `./install_ta.sh` +export LD_LIBRARY_PATH=$(pwd) +export TOS_LOG_LEVEL=4 + diff --git a/oemcrypto/opk/ports/optee/scripts/push.sh b/oemcrypto/opk/ports/optee/scripts/push.sh new file mode 100755 index 0000000..b5c6474 --- /dev/null +++ b/oemcrypto/opk/ports/optee/scripts/push.sh @@ -0,0 +1,26 @@ +#!/bin/bash +PLATFORM=vexpress-qemu_virt +[ -z "${OPTEE_DIR}" ] && echo "Set \$OPTEE_DIR to your OPTEE SDK root. See README.md" && exit +[ -z "${CDM_DIR}" ] && echo "Set \$CDM_DIR to your CDM_DIR repo root" && exit + +OUT_DIR=$CDM_DIR/out/optee/$PLATFORM +VIRTFS_DIR=$OPTEE_DIR/oemcrypto/test + +test -d $VIRTFS_DIR || mkdir -p $VIRTFS_DIR + +echo "copy oemcrypto_ta (a92d116c-ce27-4917-b30c-4a416e2d9351) to $VIRTFS_DIR" +cp $OUT_DIR/oemcrypto_ta/a92d116c-ce27-4917-b30c-4a416e2d9351.ta $VIRTFS_DIR +cp $OUT_DIR/oemcrypto_helloworld/oemcrypto_helloworld $VIRTFS_DIR + +echo "copy wtpi_test_ta (b0f42504-01ec-11ec-9a03-0242ac130003) to $VIRTFS_DIR" +cp $OUT_DIR/wtpi_test_ta/b0f42504-01ec-11ec-9a03-0242ac130003.ta $VIRTFS_DIR +cp $OUT_DIR/wtpi_unittests/wtpi_unittests $VIRTFS_DIR + +echo "copy oemcrypto unit tests to $VIRTFS_DIR" +cp $OUT_DIR/oemcrypto_unittests/oemcrypto_unittests $VIRTFS_DIR + +echo "copy liboemcrypto.so to $VIRTFS_DIR" +cp $OUT_DIR/liboemcrypto/liboemcrypto.so $VIRTFS_DIR + +echo "copy install_ta.sh to $VIRTFS_DIR" +cp ./install_ta.sh $VIRTFS_DIR diff --git a/oemcrypto/opk/ports/optee/scripts/qemu-check.py b/oemcrypto/opk/ports/optee/scripts/qemu-check.py new file mode 100644 index 0000000..57c1e76 --- /dev/null +++ b/oemcrypto/opk/ports/optee/scripts/qemu-check.py @@ -0,0 +1,89 @@ +# This script starts QEMU, loads and boots Linux/OP-TEE, then runs +# a googletest exe in the guest. The return code is 0 for success, >0 for +# error. +# +# Makes some assumptions about the environment, namely the location of the +# virtfs directory (/mnt/host/oemcrypto/test) and the steps required to install +# and run the tests +# +# Must be run from $OPTEE_DIR/out/bin so that QEMU can locate the required +# bootloader binaries +# +# The following env variables are expected +# OPTEE_DIR: location of the OPTEE repo root +# + +from absl import app +from absl import flags +import os +import sys +import subprocess +import pexpect + +# Required +_QEMU = flags.DEFINE_string('qemu', None, 'Path to QEMU executable.') +_TEST_CMD = flags.DEFINE_string('test_cmd', None, 'Command to run once QEMU is booted and TAs are installed.') + +# Optional +_QEMU_BIOS = flags.DEFINE_string('qemu_bios', os.environ['OPTEE_DIR'] + '/out/bin/bl1.bin', 'Binary for QEMU to run.') +_QEMU_SMP = flags.DEFINE_integer('qemu_smp', 2, 'Number of cores for QEMU.') +_QEMU_GIC = flags.DEFINE_integer('qemu_gic', 2, 'General Interrupt Controller version for QEMU.') +_QEMU_MEM = flags.DEFINE_integer('qemu_mem', 1057, 'QEMU virtual memory size.') +_QUIET = flags.DEFINE_boolean('quiet', False, 'Disable TEE console output.', short_name='q') + +def main(argv): + + # To get QEMU to print TEE output to the same screen as the REE output, log to + # a file and print the tail of that file to stdout. Unfortunately cannot + # easily do this from another pexpect context, so we cannot filter/expect the + # TEE output + tee_serial_out = "null" + if _QUIET.value == False: + tee_serial_out = "file:serial1.log" + os.system('> serial1.log') + + spawn_cmd = '' + if 'aarch64' in _QEMU.value: + spawn_cmd = _QEMU.value + '-nographic -serial mon:stdio -serial ' + tee_serial_out + ' -smp ' + str(_QEMU_SMP.value) + ' -machine virt,secure=on,gic-version=' + str(_QEMU_GIC.value) + ' -cpu cortex-a57 -d unimp -semihosting-config enble=on,target=native -m ' + str(_QEMU_MEM.value) + ' -bios ' + _QEMU_BIOS.value + ' -initrd rootfs.cpio.gz -kernel Image -no-acpi -append "console=ttyAMA0,38400 keep_bootcon root=/dev/vda2" -fsdev local,id=fsdev0,path=' + os.environ['OPTEE_DIR'] + ',security_model=none -device virtio-9p-device,fsdev=fsdev0,mount_tag=host' + else: + spawn_cmd = _QEMU.value + ' -nographic -monitor none -machine virt -machine secure=on -cpu cortex-a15 -smp ' + str(_QEMU_SMP.value) + ' -d unimp -semihosting-config enable=on,target=native -m ' + str(_QEMU_MEM.value) + ' -serial stdio -serial ' + tee_serial_out + ' -bios ' + _QEMU_BIOS.value + ' -fsdev local,id=fsdev0,path=' + os.environ['OPTEE_DIR'] + ',security_model=none -device virtio-9p-device,fsdev=fsdev0,mount_tag=host' + + child = pexpect.spawn(spawn_cmd, encoding='utf-8', timeout=1800) + + p = None + if _QUIET.value == False: + p =subprocess.Popen(['tail', '-f', 'serial1.log']) + + child.logfile = sys.stdout + i = child.expect(['Kernel panic', 'ogin:']) + if i==0: + print("Kernel panic!") + child.terminate() + if _QUIET.value == False: + p.kill() + return 1 + + child.sendline('root') + child.expect('# ') + child.sendline('cd /mnt/host/oemcrypto/test') + child.expect('# ') + child.sendline('. ./install_ta.sh') + child.expect('# ') + child.sendline(_TEST_CMD.value) + + i = child.expect(['^.*su tee -c "tee-supplicant -d /dev/teepriv0"','([^ ]+) FAILED TEST', 'rcu_sched detected stalls', '^.*not found' ]) + if i>0: # Only the 0th element ("su tee etc") is a success case + child.terminate() + if _QUIET.value == False: + p.kill() + return 1 + + child.terminate() + if _QUIET.value == False: + p.kill() + return 0 + +if __name__ == '__main__': + flags.mark_flag_as_required('qemu') + flags.mark_flag_as_required('test_cmd') + app.run(main) diff --git a/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython b/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython new file mode 100644 index 0000000..e891879 --- /dev/null +++ b/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython @@ -0,0 +1,17 @@ +python_version: "3.8" + +wheel: < + name: "infra/python/wheels/pexpect/${vpython_platform}" + version: "version:4.8.0.chromium.1" +> + +wheel: < + name: "infra/python/wheels/six-py2_py3" + version: "version:1.10.0" +> + +wheel: < + name: "infra/python/wheels/absl-py-py3" + version: "version:0.11.0" +> + diff --git a/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython3 b/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython3 new file mode 100644 index 0000000..e891879 --- /dev/null +++ b/oemcrypto/opk/ports/optee/scripts/qemu-check.py.vpython3 @@ -0,0 +1,17 @@ +python_version: "3.8" + +wheel: < + name: "infra/python/wheels/pexpect/${vpython_platform}" + version: "version:4.8.0.chromium.1" +> + +wheel: < + name: "infra/python/wheels/six-py2_py3" + version: "version:1.10.0" +> + +wheel: < + name: "infra/python/wheels/absl-py-py3" + version: "version:0.11.0" +> + 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 new file mode 100644 index 0000000..926b486 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h @@ -0,0 +1,25 @@ +/* + * Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#ifndef _WTPI_CRYPTO_COMMON_H_ +#define _WTPI_CRYPTO_COMMON_H_ + +#include "wtpi_crypto_and_key_management_interface_layer1.h" + +typedef struct wtpi_k1_symmetric_key_handle { + uint8_t* key; + uint32_t key_size; // TODO: change to KeySize type + SymmetricKeyType key_type; + TEE_OperationHandle op_cbc; + TEE_OperationHandle op_ecb; // Used for CTR and CBC. We don't know which will + // be used up front, so pre-allocate both for + // CONTENT_KEY types +} wtpi_k1_symmetric_key_handle; + +OEMCryptoResult Helper_AESEncryptBlock_ECB(WTPI_K1_SymmetricKey_Handle key, + const uint8_t* input, + uint8_t* output); +#endif 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/setup.sh b/oemcrypto/opk/setup.sh new file mode 100755 index 0000000..0360280 --- /dev/null +++ b/oemcrypto/opk/setup.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# This script downloads required dependencies to /third_party + +if [ -z "$CDM_DIR" ]; then + export CDM_DIR="$(readlink -e $(dirname $0)/../..)" +fi + +download() { + REPO_URL=$1 + FOLDER_NAME=$2 + CHECKOUT_VAL=$3 + + if [ -d "$FOLDER_NAME" ]; then + echo "$FOLDER_NAME already exists, skipping" + return 0 + fi + + git clone $REPO_URL $FOLDER_NAME + pushd $FOLDER_NAME + git checkout $CHECKOUT_VAL + popd +} + +download_boringssl() { + pushd $CDM_DIR/third_party + mkdir -p boringssl && cd boringssl + mkdir -p kit && cd kit + + # 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" + python3 ./src/util/generate_build_files.py android + popd +} + +download_googletest() { + pushd $CDM_DIR/third_party + if [ -d "googletest" ]; then return + fi + git clone --depth 1 https://github.com/google/googletest.git googletest + popd +} + +download_jsmn() { + pushd $CDM_DIR/third_party + download https://github.com/zserge/jsmn.git jsmn v1.0.0 + popd +} + +download_cosec() { + pushd $CDM_DIR/third_party + download https://pigweed.googlesource.com/third_party/github/cose-wg/COSE-C COSE-C 97d1805e71b7a6770093c5e6790d46611680d563 + popd +} + +download_cncbor() { + pushd $CDM_DIR/third_party + download https://pigweed.googlesource.com/third_party/github/jimsch/cn-cbor cn-cbor f713bf67bcf3e076d47e474ce060252ef8be48c7 + popd +} + +download_opendice() { + pushd $CDM_DIR/third_party + download https://pigweed.googlesource.com/open-dice/ open-dice 55a2cda + popd +} + +setup_third_party() { + pushd $CDM_DIR + mkdir -p third_party + + download_googletest + download_boringssl + download_jsmn + download_cosec + download_cncbor + download_opendice + popd +} + +setup_third_party + diff --git a/oemcrypto/test/GEN_api_lock_file.c b/oemcrypto/test/GEN_api_lock_file.c new file mode 100644 index 0000000..37e577e --- /dev/null +++ b/oemcrypto/test/GEN_api_lock_file.c @@ -0,0 +1,306 @@ +// Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. +// +// This code is semi-auto-generated, do not edit unless you know what you are +// doing. The script oemcrypto/lock-api-for-release will append to this file. +// +// If this file does not build, then you have modified an OEMCrypto API +// function. Instead, you should rename the old function and give the modified +// function a new oecc number. + +#include "OEMCryptoCENC.h" + +// This initial generation of this file was for v16.4, so older functions will +// not have an accurate version number. + +OEMCryptoResult _oecc84(const uint8_t* sandbox_id, size_t sandbox_id_length); +OEMCryptoResult _oecc01(void); +OEMCryptoResult _oecc02(void); +OEMCryptoResult _oecc09(OEMCrypto_SESSION* session); +OEMCryptoResult _oecc10(OEMCrypto_SESSION session); +OEMCryptoResult _oecc95(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* mac_key_context, + size_t mac_key_context_length, + const OEMCrypto_SharedMemory* enc_key_context, + size_t enc_key_context_length); +OEMCryptoResult _oecc21(OEMCrypto_SESSION session, + const uint8_t* derivation_key, + size_t derivation_key_length, + const OEMCrypto_SharedMemory* mac_key_context, + size_t mac_key_context_length, + const OEMCrypto_SharedMemory* enc_key_context, + size_t enc_key_context_length); +OEMCryptoResult _oecc14(OEMCrypto_SESSION session, uint32_t* nonce); +OEMCryptoResult _oecc96(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc97(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc98(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc55(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc83( + 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); +OEMCryptoResult _oecc99(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length); +OEMCryptoResult _oecc92( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + size_t key_array_length, + const OEMCrypto_EntitledContentKeyObject_V16* key_array); +OEMCryptoResult _oecc91(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length, size_t num_keys, + const OEMCrypto_KeyRefreshObject* key_array); +OEMCryptoResult _oecc101(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length); +OEMCryptoResult _oecc41(OEMCrypto_SESSION session, + const uint8_t* content_key_id, + size_t content_key_id_length, + uint8_t* key_control_block, + size_t* key_control_block_length); +OEMCryptoResult _oecc81(OEMCrypto_SESSION session, + const uint8_t* content_key_id, + size_t content_key_id_length, + OEMCryptoCipherMode cipher_mode); +OEMCryptoResult _oecc105( + OEMCrypto_SESSION session, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern); +OEMCryptoResult _oecc93(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* data_addr, + size_t data_addr_length, + const OEMCrypto_DestBufferDesc* out_buffer_descriptor, + uint8_t subsample_flags); +OEMCryptoResult _oecc24(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* in_buffer, + size_t in_buffer_length, const uint8_t* iv, + OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* out_buffer); +OEMCryptoResult _oecc25(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* in_buffer, + size_t in_buffer_length, const uint8_t* iv, + OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* out_buffer); +OEMCryptoResult _oecc26(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* buffer, + size_t buffer_length, OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* signature, + size_t* signature_length); +OEMCryptoResult _oecc27(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* buffer, + size_t buffer_length, OEMCrypto_Algorithm algorithm, + const OEMCrypto_SharedMemory* signature, + size_t signature_length); +OEMCryptoResult _oecc08(const uint8_t* keybox_or_cert, + size_t keybox_or_cert_length, + uint8_t* wrapped_keybox_or_cert, + size_t* wrapped_keybox_or_cert_length, + const uint8_t* transport_key, + size_t transport_key_length); +OEMCryptoResult _oecc03(const uint8_t* keybox_or_cert, + size_t keybox_or_cert_length); +OEMCrypto_ProvisioningMethod _oecc49(void); +OEMCryptoResult _oecc05(void); +OEMCryptoResult _oecc07(uint8_t* device_id, size_t* device_id_length); +OEMCryptoResult _oecc04(uint8_t* key_data, size_t* key_data_length); +OEMCryptoResult _oecc78(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc103(OEMCrypto_SESSION session); +OEMCryptoResult _oecc104(uint8_t* public_cert, size_t* public_cert_length); +OEMCryptoResult _oecc06(uint8_t* random_data, size_t random_data_length); +uint32_t _oecc22(void); +uint32_t _oecc108(void); +uint8_t _oecc46(void); +OEMCryptoResult _oecc44(OEMCrypto_HDCP_Capability* current, + OEMCrypto_HDCP_Capability* maximum); +bool _oecc29(void); +size_t _oecc94(void); +bool _oecc39(void); +OEMCryptoResult _oecc38(size_t* count); +OEMCryptoResult _oecc37(size_t* max); +uint32_t _oecc52(void); +bool _oecc53(void); +OEMCryptoResult _oecc54(uint16_t* version); +uint32_t _oecc71(void); +uint32_t _oecc85(void); +OEMCryptoResult _oecc102(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length, + uint8_t* wrapped_private_key, + size_t* wrapped_private_key_length); +OEMCryptoResult _oecc107(OEMCrypto_SESSION session, + OEMCrypto_PrivateKeyType key_type, + const uint8_t* wrapped_private_key, + size_t wrapped_private_key_length); +OEMCryptoResult _oecc45(void); +OEMCryptoResult _oecc36(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, uint8_t* signature, + size_t* signature_length, + RSA_Padding_Scheme padding_scheme); +OEMCryptoResult _oecc61(uint8_t* header_buffer, size_t* header_buffer_length); +OEMCryptoResult _oecc62(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc63(OEMCrypto_SESSION session, + uint32_t* usage_entry_number); +OEMCryptoResult _oecc64(OEMCrypto_SESSION session, uint32_t usage_entry_number, + const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc65(OEMCrypto_SESSION session, + OEMCrypto_SharedMemory* header_buffer, + size_t* header_buffer_length, + OEMCrypto_SharedMemory* entry_buffer, + size_t* entry_buffer_length); +OEMCryptoResult _oecc66(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length); +OEMCryptoResult _oecc32(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length, uint8_t* buffer, + size_t* buffer_length); +OEMCryptoResult _oecc68(OEMCrypto_SESSION session, uint32_t new_index); +OEMCryptoResult _oecc67(uint32_t new_entry_count, uint8_t* header_buffer, + size_t* header_buffer_length); +OEMCryptoResult _oecc57(void); +uint32_t _oecc86(void); +OEMCryptoResult _oecc88(OEMCrypto_SESSION session, uint32_t frame_number, + const uint8_t* hash, size_t hash_length); +OEMCryptoResult _oecc89(OEMCrypto_SESSION session, + uint32_t* failed_frame_number); +OEMCryptoResult _oecc109(OEMCrypto_SESSION session, size_t buffer_size, + OEMCrypto_DestBufferDesc* output_descriptor, + int* secure_fd); +OEMCryptoResult _oecc110(OEMCrypto_SESSION session, + OEMCrypto_DestBufferDesc* output_descriptor, + int secure_fd); +OEMCryptoResult _oecc115(uint32_t* ree_major, uint32_t* ree_minor, + uint32_t* tee_major, uint32_t* tee_minor); +OEMCryptoResult _oecc113(OEMCrypto_SESSION session, uint8_t* buffer, + size_t* buffer_length, uint32_t use_test_key); +OEMCryptoResult _oecc114(OEMCrypto_SESSION session, const uint8_t* buffer, + size_t buffer_length, uint32_t use_test_key); +OEMCryptoResult _oecc13(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, uint8_t* signature, + size_t* signature_length); +OEMCryptoResult _oecc51(OEMCrypto_SESSION session, + const uint32_t* unaligned_nonce, + const uint8_t* encrypted_message_key, + size_t encrypted_message_key_length, + const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, + const uint8_t* enc_rsa_key_iv, uint8_t* wrapped_rsa_key, + size_t* wrapped_rsa_key_length); +OEMCryptoResult _oecc18(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length, + const uint32_t* unaligned_nonce, + const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, + const uint8_t* enc_rsa_key_iv, uint8_t* wrapped_rsa_key, + size_t* wrapped_rsa_key_length); +OEMCryptoResult _oecc30(void); +OEMCryptoResult _oecc33(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length); +OEMCryptoResult _oecc43(const uint8_t* pst, size_t pst_length); +OEMCryptoResult _oecc69(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length); +OEMCryptoResult _oecc34(void); +OEMCryptoResult _oecc70(uint64_t time_since_license_received, + uint64_t time_since_first_decrypt, + uint64_t time_since_last_decrypt, + OEMCrypto_Usage_Entry_Status status, + uint8_t* server_mac_key, uint8_t* client_mac_key, + const uint8_t* pst, size_t pst_length); +OEMCryptoResult _oecc12(OEMCrypto_SESSION session, + const uint8_t* mac_key_context, + uint32_t mac_key_context_length, + const uint8_t* enc_key_context, + uint32_t enc_key_context_length); +OEMCryptoResult _oecc48(OEMCrypto_SESSION session, const uint8_t* data_addr, + size_t data_addr_length, bool is_encrypted, + const uint8_t* iv, + size_t block_offset, // used for CTR "cenc" mode only. + OEMCrypto_DestBufferDesc* out_buffer, + const OEMCrypto_CENCEncryptPatternDesc_V15* pattern, + uint8_t subsample_flags); +OEMCryptoResult _oecc50(OEMCrypto_SESSION session, uint8_t* public_cert, + size_t* public_cert_length); +OEMCryptoResult _oecc19(OEMCrypto_SESSION session, + const uint8_t* wrapped_rsa_key, + size_t wrapped_rsa_key_length); + +// OEMCrypto_Idle defined in v17.1 +OEMCryptoResult _oecc123(OEMCrypto_IdleState state, uint32_t os_specific_code); + +// OEMCrypto_Wake defined in v17.1 +OEMCryptoResult _oecc124(void); + +// OEMCrypto_CreateEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc111(OEMCrypto_SESSION oec_session, + OEMCrypto_SESSION* key_session); + +// OEMCrypto_RemoveEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc112(OEMCrypto_SESSION key_session); + +// OEMCrypto_LoadEntitledContentKeys defined in v17.1 +OEMCryptoResult _oecc121(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t key_array_length, + const OEMCrypto_EntitledContentKeyObject* key_array); + +// OEMCrypto_BuildInformation defined in v17.1 +OEMCryptoResult _oecc125(char* buffer, size_t* buffer_length); + +// OEMCrypto_SecurityLevel defined in v17.1 +OEMCrypto_Security_Level _oecc126(void); + +// OEMCrypto_GetDTCP2Capability defined in v17.1 +OEMCryptoResult _oecc128(OEMCrypto_DTCP2_Capability* capability); + +// OEMCrypto_ProductionReady defined in v17.1 +OEMCryptoResult _oecc122(void); + +// OEMCrypto_GetWatermarkingSupport defined in v17.1 +OEMCrypto_WatermarkingSupport _oecc129(void); + +// OEMCrypto_ReuseUsageEntry defined in v17.1 +OEMCryptoResult _oecc127(OEMCrypto_SESSION session, + uint32_t usage_entry_number); + +// OEMCrypto_GetBootCertificateChain defined in v17.1 +OEMCryptoResult _oecc116(uint8_t* bcc, size_t* bcc_length, + uint8_t* additional_signature, + size_t* additional_signature_length); + +// OEMCrypto_GenerateCertificateKeyPair defined in v17.1 +OEMCryptoResult _oecc117(OEMCrypto_SESSION session, uint8_t* public_key, + size_t* public_key_length, + uint8_t* public_key_signature, + size_t* public_key_signature_length, + uint8_t* wrapped_private_key, + size_t* wrapped_private_key_length, + OEMCrypto_PrivateKeyType* key_type); + +// OEMCrypto_InstallOemPrivateKey defined in v17.1 +OEMCryptoResult _oecc118(OEMCrypto_SESSION session, + OEMCrypto_PrivateKeyType key_type, + const uint8_t* wrapped_private_key, + size_t wrapped_private_key_length); + +// OEMCrypto_ReassociateEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc119(OEMCrypto_SESSION key_session, + OEMCrypto_SESSION oec_session); + +// OEMCrypto_LoadCasECMKeys defined in v17.1 +OEMCryptoResult _oecc120(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key); + +// OEMCrypto_GetOEMKeyToken defined in v17.2 +OEMCryptoResult _oecc130(OEMCrypto_SESSION key_session, uint8_t* key_token, + size_t* key_token_length); 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/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_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/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/080308d9a78045272feb864835800f3c963e4110 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 new file mode 100644 index 0000000000000000000000000000000000000000..1829d6004cfbece19d780b4ef6be7cfdb40a0ab9 GIT binary patch literal 368 zcmZQ%fB;rBnt>520HdJ%kTWvh!}&XucJ^tlpAjAE3{$2X9~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?}@Ou3NuhH29`B{>k(oA@ezx^ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 new file mode 100644 index 0000000000000000000000000000000000000000..59420467ab3c874ba670f60c1d10adeb1d57efa0 GIT binary patch literal 288 zcmZQ%fB-Hi4Wl-|7*HC<*FE2Vy>i>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/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/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 new file mode 100644 index 0000000000000000000000000000000000000000..8150c2fe43ead29b2d3f6c75b22c5c686d0ef7f7 GIT binary patch literal 288 zcmZQzzz#N`3B&lwEC-%-U0SnjOUup|>}J^xj8JvD@p17Cj7-cdtZeKYoLt;IynOru zfkx|hxv2pPUiAl*RscGpMnOWI6xq0~og+;|BrDf$6 zl~vU>wRQCkjZMuht!?ccon75My?y-?CQh0>W$Lu)GiJ`3J!kH``3n{Fk|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/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 new file mode 100644 index 0000000000000000000000000000000000000000..138d4de3cdc89e1dc4f667df76b8737eaa789a17 GIT binary patch literal 368 zcmZQ%fB;4)4X4lrp#02M>D!x7;u#p3m|0la*f}`4xOsT_ z_yq)oghfQf#3dx9q-A8~>V7P zoLyYq+&w(KynTHA`~w1mfX!XqN1qGMv?;u8{+l2cOC(lau%vU76t@(T)!ic3n% z$}1|Xs%vWN>KhuHnp;}i+B-VCx_f&2`X@}BGo;uNw0XRJbd){$~I}^!dxzZ{L6X{Pp|K-+%uhVE_+7 OFoU^)WzFAugcty{GLGH= literal 0 HcmV?d00001 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/161778100a4dcf30cb49fe57d0ed8cd55a1230ca b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca new file mode 100644 index 0000000000000000000000000000000000000000..1fec89e355eb00d3d7d01d3ab5022ce539004381 GIT binary patch literal 288 zcmZQ%fB;4)4Wl-|7*HCAt@y-BP%Dbps1v*qN=8@p{b>IRvK4a#r*>mR3o4;V;qQy&= dE?d50<*LXEu{H;fL9su~0OcwwE literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef new file mode 100644 index 0000000000000000000000000000000000000000..c0cca32617475ce3580f73e17dd24e6b57765227 GIT binary patch literal 852 zcmZQzzz&u$p^C%!t-EpzRTpaTuD@k|?Mkxs1ZJo*-T1h821X`k7FITP4o)s^9$r3v z0YM>Q5m7O52}vnw8Cf}b1w|!g6;(BL4NWa=9bG+r14AQY6H_yD3rj0&8(TYj2S+Do z7gslT4^J;|A74NJfWV;OkkGL3h{&kunAo`Zgv6xel+?8JjLfX;oZP(pg2JNWlG3vB zipr|$n%cVhhQ_Amme#iRj?S*`p5DIx2@@wxo-%dX^cgc}&7L!N-uwj%7cE}0blLJ1 zD_5;vvv%G34I4LY-m-Pu_8mKS?cTF@-~Iy!4;?;o^w{weCr_O|bN1Z%3l}e4zH;^2 z^&2;D-M(}8-u(v;A3c8Z^x5+lFJHZW^Y-2Q4a!-~Unn5B~TE jrBg|0nq2^;8S7cr{H=#_fRqu8$p~ej$)oFMLX!so2O>y6 literal 0 HcmV?d00001 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/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/1efe003a4fc59c06e4e40756025e59753418e53e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e new file mode 100644 index 0000000000000000000000000000000000000000..44e1534d09062a7abe1b6a50e56bed69e6a918c4 GIT binary patch literal 341 zcmZQzzz&w838V92(#%kXZhTxkOl(loAcsmqUC05Y8S7cr{H;eg8z!#+6N1Xa)WhVB Jpz=&;@&NHo44D7` literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 new file mode 100644 index 0000000000000000000000000000000000000000..5afd7766178fcea3197386a652c480bfafe8f221 GIT binary patch literal 512 zcmZQ%fB;4)4WlNY3BdSg_J;I1Z3yEmi4$mBEM->)Q>Ggq7tg@R#LU9V#?HaX#m&RZ z$1fl#BrGB-CN3cC$FHWq^zQrLCi@r*B|rWNcz;W^Q3=Wo=_?XYb(X zC_@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/2dce8534f57150afe93ca38282a60e6db0d0f7ab b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab new file mode 100644 index 0000000000000000000000000000000000000000..88d5f37409d4ee6f946d599ff7960e488726a23b GIT binary patch literal 368 zcmZQ%fB;rBnt>520HdJ%|ES;}Oqp(cTs#9K6Eh1d8#@Ol7dHqnoxOvjle3Gfo4bdnm$#3v zpMOALP;f|SSa?KaRCG*iTzo=eQgTXaT6#uiR(4KqUVcGgQE^FWS$RceRdr2mU427i zQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_iknLBU(f`y9~FIl>5`HGdRRKIRx^4T8ox67L*}HH5frEz*A31vL_=%IJPM`HPpYUcY(!?)`_4pFV&2`tAFVpTB z!O_Xt#nsK-!_&*#$Jft4ATTI6Bs45MA~GsECN?fUAu%aAB{eNQBQq;ICpRy@ps=X8 zq_nKOqOz*GrnauWp|PpCrM0cSqqD2Kr?;^62`R(BuIy{z;Mm literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a new file mode 100644 index 0000000000000000000000000000000000000000..832f1d5477f367d730f90609225cce9808782dee GIT binary patch literal 341 zcmZQ%fB;4)%?YKKLTMO<&WDLJLm9g9aq%!Q(&>VJkiH(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/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 new file mode 100644 index 0000000000000000000000000000000000000000..c03096db618b9bb5dce886ca7fbb8697ccb2ba94 GIT binary patch literal 406 zcmZQ%fB;rB`WciDqhS0=%loP&-|rNSxw6jeabghfQf#3dx9q-A8~V2w-hct`7}XM-~`J~>5XjMlVHkpLc_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{~=+3 O8g9%DENlMOBg6o}4vNJ9 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b new file mode 100644 index 0000000000000000000000000000000000000000..cf6fd6c8e4a7a486ac94d6b3cf9f0ab8810b5a3b GIT binary patch literal 128 zcmZQ%fB;S?%?PChpfrqv@p(PCr!JklrYk}};6$uu*EE=V-T1h821X`k7FITP4o)s^ X9$r3vuo#+o%ndAS{?@}xWncgRoB0f= literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 new file mode 100644 index 0000000000000000000000000000000000000000..03fbf779ee780fda761d22addab04de44461873b GIT binary patch literal 368 zcmZQ%fB;4)%?YI$U;=3TU9s1LA1^y%lQ4Bn)&G|N-(bpgLc_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{~=)j Q3or=H+`zKtZ#_Z`02-=~E&u=k literal 0 HcmV?d00001 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/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 new file mode 100644 index 0000000000000000000000000000000000000000..5f3450035d9c312256d8c69d89c2212fbd6c415d GIT binary patch literal 162 zcmZQ%fB;rB+6c;rQ850om4`C3Z!pwuTqPshPQjrIodft)0Dtqm#3X ztDC!rrnub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2OX<2zi zWmR=eZC!msV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=K{(^;z7B5-4Z25|n zt5&aByKeo4jhi-a*}84}j-9)9@7cR=|AB*t4j(ys?D&b3r%snAuU@}-`|kaRkDoq&`TFhqkDtGO|M~mx|6ub!C{AGU R28&JR29`B{>tQ?w1^`MJwtfHr literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d new file mode 100644 index 0000000000000000000000000000000000000000..41a05087db7c495408642401c0fe9798fde39bfd GIT binary patch literal 406 zcmZQ%fBBh&!GcYnSv#_$Ub8vET z^YHTV3kV7ci-?MeOGrvd%gD;fD<~={tEj4}YiMd|>*(s~8yFfHo0yuJTUc6I+t}LK zJ2*NyySTc!dw6-L?y_wGM<_~`MIry!qlL4(BzN;B58tod6H3o8Z&n7lVkh=4p3nmhnP C%6s?# literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e new file mode 100644 index 0000000000000000000000000000000000000000..d846bb15352fe3cba3370102299e495d798c86ef GIT binary patch literal 852 zcmZQ%fB;rBdI=L$07}95{~TG~{hHe%8)_h3IYE1}1T$1#H$E<&fsu)sg_Vt+gOiJ! zhnJ6EKu}0nL{v;%LQ+avMpjN z!O_Xt#nsK-!_&*#$Jft4ATTI6Bs45MA~GsECN?fUAu%aAB{eNQBQq;ICpRy@ps=X8 zq_nKOqOz*GrnauWp|PpCrM0cSqqD2Kr?;^62`R(BuJ)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/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(?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/4badb31c370b762025e980d3d0e6e90dc0c4b22a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a new file mode 100644 index 0000000000000000000000000000000000000000..09ef7f54218eb756cd7ab98cd26e6684587e4b14 GIT binary patch literal 368 zcmZQzzyTQ1#G(BEsNf$=nQnYsJOd*WGYcylI|nBhHxDl#zkr~Su!yLbxP+vXw2Z8r zyn>>VvWlvjx`w8fwvMizzJZ~Uv5BdfxrL>bwT-Qvy@R8Zvx}>nyN9Qjw~w!%e?VYR za7buactm7WbWChqd_rPUa!P7idPZhec1~_yenDYTaY<=ec|~PabxmzueM4hYb4zPm zdq-zicTaC$|AdK?CQq3EN?fQ+Iw{G9Ld++{(hmRgV zdHU@6i1oj8u=@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%fBmZ{DBxzdZQ1DomMfd|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 Q0SKX)8(7x-tw)Ff0IWxi`~Uy| literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f new file mode 100644 index 0000000000000000000000000000000000000000..2be6fc5d731f8f4ce631d973055e3dc7a03a1ee5 GIT binary patch literal 512 zcmZQ%fB-Hi4WlM7!dMU*#@`Y6!zy-;_R$U@Mn0Y0*OXz(bmQaVL%(#-N;QrT47;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/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/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/569fe4adef9b529c33facecf2b14c320cebd820d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d new file mode 100644 index 0000000000000000000000000000000000000000..b34e5b903e76388242e5bfa13b31ab1c760438eb GIT binary patch literal 512 zcmZQ%fB;4)4WlNY3BdUMjjT}t91I#ATfdi_nR}-lrc5_JE}nsriJ66!jh%y&i<^g+ zk6%DgNLWNvOk6@zN?Jx%PF_J#Nm)fzObj ze8tLDtJkbuw|>LMO`ErD-L`$l&Rx6r?A^Ejz`;X@j~qRA{KUyqr_Y={cmBe~OP8-) zy>|V^&0Dwc+`V`I!NW(7pFDl`{Kd;xuiw0V_x{7jPoKYh{r3IG&tJd){QdWTu=yVp UC$M;f#Vd0I%bLISFdhQ~0Ch>W6951J literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb new file mode 100644 index 0000000000000000000000000000000000000000..883d0779968e85efc0c012dd00b7730ff893b4eb GIT binary patch literal 512 zcmZQ%fB;S?%?PC@z!+$JmFq@p*pG6FoVve$W?$2{YcOTH@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?Ys9MK7RWA_*)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!< V6eqBFgT*Fu1IwDf^)Ma-0|1|#wjKZg literal 0 HcmV?d00001 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/5d15891a80d8172de682be6dace7f5bb300e4d36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 new file mode 100644 index 0000000000000000000000000000000000000000..f6db7363ee4071b9c9bafdc82bfdb83cca63080d GIT binary patch literal 512 zcmZQ%fB-Hi4WlM7!dMU*#xIflP_ZbIPd7SJ|J$bvH-uoybmQaV85o(ESy_}RaDi~H8i!fb#(Rg4GfKpO-#+qEiA39ZEWrA z9UPsUU0mJVJv_aQ&Q8?GcvQXb8_?Y3kr*h zOG?YiD=Mq1YijH28ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGi-6T(o$} z(q+q6tX#Ev&DwSAH*DOrdCS&q+js2TwR_Lreftj_JaqWT(PPI?oIG{<%-M72FI>EI z`O4L6*Kgdsb^FfUd-oqaeDwIq(`V0LynOZg&D(eHKYaZ3`ODXD-+%o4_507?fBy%Y X|3PsAi#J$oGB>cS`CAX;F)#oC7Z$c@ literal 0 HcmV?d00001 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/65d11e1a8031645bd1bd1a21e1f1fa24e048999c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c new file mode 100644 index 0000000000000000000000000000000000000000..f0af3576e4ef20f8984dadb7c8c6b5c1af4f95b3 GIT binary patch literal 406 zcmZQ%fB-Hi4WpjH7*HCuA!-=t)r`_Z(wL-Y+`C=ZeeL?c?j`9}pN691d4oFfuW-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/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)UYJ>QjR U9xGG^Ml(0Ctod6HGmn7*0Bqz8rT_o{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa new file mode 100644 index 0000000000000000000000000000000000000000..ed18658ec82566668490f88ea83f3229838b097a GIT binary patch literal 288 zcmZQ%fB-Hi4Wl-|7*HCJ-vPX6DCfYJZ0*%=`&`|nmuRky!i_jE?T@~ d>9XZ3R<2sTX6?H5U^k=rkGX+m&EI;2=K=0tO6vds literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 new file mode 100644 index 0000000000000000000000000000000000000000..23dda90b2ecc156d4f6c9e5ac79342dce5621080 GIT binary patch literal 368 zcmZQ%fB;S?%?PC#;0#oW|ES;}Oqp(cTs#9K6Eh1d8#@Ol7dHqnoxOvjle3Gfo4bdnm$#3v zpMOALP;f|SSa?KaRCG*iTzo=eQgTXaT6#uiR(4KqUVcGgQE^FWS$RceRdr2mU427i zQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_iknLBU(f`y9~FIl>5`HGdRRKIRx^4T8ox67L*}HH5frEz*A31vL_=%IJPM`HPpYUcY(!?)`_4pFV&2`tAFVpTBrjW85o(ESy_}RaDi~H8i!fb#(Rg4GfKpO-#+qEiA39ZEWrA z9UPsUU0mJVJv_aQ&Q8?GcvQXb8_?Y3kr*h zOG?YiD=Mq1YijH28ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGi-6T(o$} z(q+q6tX#Ev&DwSAH*DOrdCS&q+js2TwR_Lreftj_JaqWT(PPI?oIG{<%-M72FI>EI z`O4L6*Kgdsb^FfUd-oqaeDwIqQ;<)&puRSO(v0;iYyQ?lIY0^~?+p_oAkTy*4*>ty Be2f49 literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 new file mode 100644 index 0000000000000000000000000000000000000000..1ca4d68e3220fe10afcc1dfcd5ddf2f7a2391ae3 GIT binary patch literal 406 zcmZQ%fB;rB`WciDqhS06TRjg(yd4oFfuW-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/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa new file mode 100644 index 0000000000000000000000000000000000000000..1d950a8941d5088010a62ec84374a2981741bef5 GIT binary patch literal 852 zcmZQ%fBU#{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=U(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/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d new file mode 100644 index 0000000000000000000000000000000000000000..6c4b98b094c223880bbe1bf351e81882923e3056 GIT binary patch literal 368 zcmZQ%fB;4)%?YI$U;=3T|ES;}Oqp(cTs#9K6Eh1d8#@Ol7dHqnoxOvjle3Gfo4bdnm$#3v zpMOALP;f|SSa?KaRCG*iTzo=eQgTXaT6#uiR(4KqUVcGgQE^FWS$RceRdr2mU427i zQ*%peTYE=mS9ecuU;l)OlO|7@I&J!lnX_iknLBU(f`y9~FIl>5`HGdRRKIRx^4T8ox67L*}HH5frEz*A31vL_=%IJPM`HPpYUcY(!?)`_4pFV&2`tAFVpTBbje8tLD 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/8b7a5c18731be9ba1c9d836667ec007a4169de23 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 new file mode 100644 index 0000000000000000000000000000000000000000..57c6a928f436eaf9db7feaf6d01100726ebc7232 GIT binary patch literal 162 zcmZQ%fB-Hi4Wo=;3@8obr>|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/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/8f55993eb44bc293d662c18a407f915f03df1e9d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d new file mode 100644 index 0000000000000000000000000000000000000000..bdb8151d2f10d73657ea72092f982a7ed98e9af0 GIT binary patch literal 512 zcmZQ%fB-Hi4WlM7!dMU*#@~Bx$!_+92`e>JJd_+AedJ-vbmQaV85o(ESy_}RaDi~H8i!fb#(Rg4GfKpO-#+qEiA39ZEWrA z9UPsUU0mJVJv_aQ&Q8?GcvQXb8_?Y3kr*h zOG?YiD=Mq1YijH28ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGi-6T(o$} z(q+q6tX#Ev&DwSAH*DOrdCS&q+js2TwR_Lreftj_JaqWT(PPI?oIG{<%-M72FI>EI z`O4L6*Kgdsb^FfUd-oqaeDwIq(`V0LynOZg&D(eHKYaZ3`ODXD-+%o4_507?fBy%Y X|3PsAi#J$oGB>cS`CAX;F)#oCc6YSq literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 new file mode 100644 index 0000000000000000000000000000000000000000..cd9b42c460f7c09f136f30422be4ca9f483db5b3 GIT binary patch literal 406 zcmZQzzz&|F3B&lh&kE1oe>Br5?CpeE(_$8!V1}yGjgO0GU}R!uVP#|I;N;@w;pO8O z5EK#?5fu}ckd%^^k(HBIP*hS@QB_md(A3h_(bdy8Ff=kYF*P%{u(Yzav9+^zaCCBZ zadmU|@bvQb@%8f$2n-4i2@MO6h>VJkiH(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>piK|bYz`q~IeGuE@L`CE?&GMKzKOb9B^1m&a4GePBfq4EH~ CG=1Ly literal 0 HcmV?d00001 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/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}Rn~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/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?;tz;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/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 new file mode 100644 index 0000000000000000000000000000000000000000..695b4d06d42acbce427c7e93d6d741619cfab4b6 GIT binary patch literal 368 zcmZQzzyTQ1#G(BEsNf$=nQnYsyoBGnu!yY25CJ*Sy?zJQ@!h$&V)>U%^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;dtX0n0BKP}PZnn(NrC*%*cji`CC9j5nppdYLsF=8f zq?ELbtem`pqLQ+Ts+zinrk1vjuAaVup^>qPshPQjrIodft)0Dtqm#3XtDC!rrn zub+QFU{G*KXjpheWK?uaY+QUoVp4KSYFc_mW>$7iZeD&tVNr2OX<2ziWmR=eZC!ms zV^ecWYg>CqXIFPmZ(sj}iIXNznL2IyjG41$&zU=Ke%>vE9(LoC8g~4>NoNFt)@<0g zY4et?+qUo6xoh{Hz5DhbIC$vrk)y|spE!By^qI5g&R@8A>GGAU*RJ2VdF%F_yZ7!t zc=+h?lc&#~zj*oT^_#cv-hcS`>GPMb-@gC&`Rn(ezyJP&!T=Uru<&E9XIb;N9xloN E0Hx5FYXATM literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 new file mode 100644 index 0000000000000000000000000000000000000000..d569563f0eb31f5d53228fc44e265b72880a35da GIT binary patch literal 288 zcmZQ%fB;rBdIOXXqhNgh?|Cb3pW>~%8`|?dmZ`#o5vo8pJ}#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~;!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/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*gapq&j{ literal 0 HcmV?d00001 diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c new file mode 100644 index 0000000000000000000000000000000000000000..7bc1890c7b3d89129ab7c264a7ed505e325f59cc GIT binary patch literal 852 zcmZQ%fB;4)4WpJY!B`L)#=oJb&vLuxgQ7}kaH2&0iUZ70WxDZk@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?} o{vZ7D4@#$!&@{UMN;B58tod6HqMtm%^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=RimhlLdb15Dl;M1& literal 0 HcmV?d00001 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&U000wVCAuT!(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/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/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/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/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/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/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 new file mode 100644 index 0000000000000000000000000000000000000000..8f86ed90164aec9a9b90739240cb03c4d77a7d27 GIT binary patch literal 368 zcmZQ%fB-Hi4W}64EC>V2zxy+dWlrCF-e=*nvgc`8euXL1jgO0GU}R!uVP#|I;N;@w z;pO8O5EK#?5fu}ckd%^^k(HBIP*hS@QB_md(A3h_(bdy8Ff=kYF*P%{u(Yzav9+^z zaCCBZadmU|@bvQb@%8f$2n-4i2@MO6h>VJkiH(a-NK8sjNli=7$jr*l$<50zC@d;2 zDJ?6nsI024sjaJTXl!b3X>Duo=Fw*EFmcl4DO0CSpD}aR>^XDi&0nx^(c&db zmn~nha@FcJYuBycuyNDoEnBy3-?4Mo?mc_=?LTnv(BUITj~zd8^3>@wXV0C#aPiXR zD_5^wzj5={?K^kx-GA`#(c>pipFMx^^404%Z{NND@bS~~S4{fC4B PYPc~su&nu8j}QX@0(y;a literal 0 HcmV?d00001 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/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/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@8obTgAQV7nV2|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/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/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 new file mode 100644 index 0000000000000000000000000000000000000000..4ae7c11b4f777b9889ee7c2f64a1e839ae6d6359 GIT binary patch literal 512 zcmZQ%fB-Hi4WlM7!dMU*#?Q$AzH<%lAJ^@b9CAKllO_}RaDi~H8i!fb#(Rg4GfKpO-#+qEiA39ZEWrA z9UPsUU0mJVJv_aQ&Q8?GcvQXb8_?Y3kr*h zOG?YiD=Mq1YijH28ycIMTUy)NJ370%dwTo&Crq3)dCJsj(`U?_HG9t7dGi-6T(o$} z(q+q6tX#Ev&DwSAH*DOrdCS&q+js2TwR_Lreftj_JaqWT(PPI?oIG{<%-M72FI>EI z`O4L6*Kgdsb^FfUd-oqaeDwIq(`V0LynOZg&D(eHKYaZ3`ODXD-+%o4_507?fBy%Y V|G{wrjYe4fF*mTR`CE^OTL88dwVeO} literal 0 HcmV?d00001 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/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 new file mode 100644 index 0000000000000000000000000000000000000000..d4b9e737e94409328acd64b0449e91fa1d4f9b54 GIT binary patch literal 122 zcmZQ%fB-Hi4Wn@Jw@jG7pvd#`;`w1l`+0JN)-pmh=*GvzGcYnSv#_$Ub8v!qtWX&k P&D_AU=5IaBde7jKgbZ1DLd7$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/f8eec32608e9d330b3973576735646427a6731f8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 new file mode 100644 index 0000000000000000000000000000000000000000..32c83fdbab9ceee8b0d1cc1b6d414026643a90fa GIT binary patch literal 512 zcmZQ%fBsTvho_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/feabcbfd6a97b797941d0989be77e8156a75a02e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e new file mode 100644 index 0000000000000000000000000000000000000000..e90b66278346eab175a19e0e6e6229a8d02ee4e4 GIT binary patch literal 852 zcmZQ%fB-Hi4WpJY!B`L)#-Gz(bi~W`9ZRm9=;z4YGwv`$mFdRE#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?lc&#~zj*oT^_#cv-hcS`>GPMb-@gC&`Rn(ezyJP^ o`hW1pKPa6_LeuO5D9u>UvgU6+lmn!UU`$3R15F-XKNFff0L&Rk&;S4c literal 0 HcmV?d00001 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{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/080255be6f3f6d8f95f8779116af43da3c7c7fe1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 new file mode 100644 index 0000000000000000000000000000000000000000..083b686ecf2936c5adae8b030c8e6475a185c271 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$(tYoiYHb!erYJ@UDI!bN}2*K*shie7&4+HPsgls`WF E0QFQv%>V!Z literal 0 HcmV?d00001 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/76a08035bc9c0772c895b73439a9d19d84737744 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 new file mode 100644 index 0000000000000000000000000000000000000000..ee4a672fae0ca5676cc57bb2309c064afc0f2d42 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&AG78kHY9=mnyXDus3Q^37D7wf&{qK@ztbl)`2<#Yf5 DqINBQ|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/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~>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/oemcrypto_decrypt_hash_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc new file mode 100644 index 0000000..3ee5523 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc @@ -0,0 +1,70 @@ +// 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(); + OEMCrypto_SelectKey(session_id, content_key_id.data(), content_key_id.size(), + OEMCrypto_CipherMode_CENC); + OEMCrypto_SetDecryptHash(session_id, frame_number, hash.data(), hash.size()); + OEMCrypto_DecryptCENC(session_id, &sample, 1, &pattern); + OEMCrypto_GetHashErrorCode(session_id, failed_frame_number); + + license_api_fuzz.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_entitled_key_session_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_entitled_key_session_fuzz.cc new file mode 100644 index 0000000..78323dd --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_entitled_key_session_fuzz.cc @@ -0,0 +1,136 @@ +// 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 { + +enum class ApiMethod { + kOpenSession, + kCloseSession, + kCreateEntitledKeySession, + kReassociateEntitledKeySession, + kRemoveEntitledKeySession, + kMaxValue = kRemoveEntitledKeySession, +}; + +struct Session { + OEMCrypto_SESSION value; + std::vector::const_iterator iterator; +}; + +Session PickSession(FuzzedDataProvider& fuzzed_data, + const std::vector& sessions) { + Session session; + + session.iterator = + sessions.cbegin() + + fuzzed_data.ConsumeIntegralInRange(0, sessions.size()); + + if (session.iterator != sessions.cend()) { + session.value = *session.iterator; + } else { + session.value = fuzzed_data.ConsumeIntegral(); + } + + return session; +} + +} // namespace + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + + // Contains all open and some closed OEMCrypto sessions. + std::vector oec_sessions; + + // Contains all current and some removed key sessions. + std::vector key_sessions; + + FuzzedDataProvider fuzzed_data(data, size); + + while (fuzzed_data.remaining_bytes() > 0) { + switch (fuzzed_data.ConsumeEnum()) { + case ApiMethod::kOpenSession: { + OEMCrypto_SESSION session = 0; + const OEMCryptoResult result = OEMCrypto_OpenSession(&session); + + if (result == OEMCrypto_SUCCESS) { + oec_sessions.push_back(session); + } + + break; + } + + case ApiMethod::kCloseSession: { + const Session session = PickSession(fuzzed_data, oec_sessions); + + const OEMCryptoResult result = OEMCrypto_CloseSession(session.value); + + if (result == OEMCrypto_SUCCESS && + session.iterator != oec_sessions.cend() && + fuzzed_data.ConsumeBool()) { + oec_sessions.erase(session.iterator); + } + + break; + } + + case ApiMethod::kCreateEntitledKeySession: { + const OEMCrypto_SESSION oec_session = + PickSession(fuzzed_data, oec_sessions).value; + + OEMCrypto_SESSION key_session_data = 0; + OEMCrypto_SESSION* const key_session = + fuzzed_data.ConsumeBool() ? &key_session_data : nullptr; + + const OEMCryptoResult result = + OEMCrypto_CreateEntitledKeySession(oec_session, key_session); + + if (result == OEMCrypto_SUCCESS) { + key_sessions.push_back(*key_session); + } + + break; + } + + case ApiMethod::kReassociateEntitledKeySession: { + const OEMCrypto_SESSION key_session = + PickSession(fuzzed_data, key_sessions).value; + + const OEMCrypto_SESSION oec_session = + PickSession(fuzzed_data, oec_sessions).value; + + OEMCrypto_ReassociateEntitledKeySession(key_session, oec_session); + + break; + } + + case ApiMethod::kRemoveEntitledKeySession: { + const Session key_session = PickSession(fuzzed_data, key_sessions); + + const OEMCryptoResult result = + OEMCrypto_RemoveEntitledKeySession(key_session.value); + + if (result == OEMCrypto_SUCCESS && + key_session.iterator != key_sessions.cend() && + fuzzed_data.ConsumeBool()) { + key_sessions.erase(key_session.iterator); + } + + break; + } + } + } + + OEMCrypto_Terminate(); + return 0; +} 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..cff4bd2 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc @@ -0,0 +1,63 @@ +// 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(); + 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_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_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 new file mode 100644 index 0000000..310999c --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc @@ -0,0 +1,25 @@ +// 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 "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + FuzzedDataProvider fuzzed_data(data, size); + const OEMCrypto_PrivateKeyType key_type = wvoec::ConvertDataToValidEnum( + fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); + const std::vector wrapped_private_key = + fuzzed_data.ConsumeRemainingBytes(); + OEMCrypto_InstallOemPrivateKey(session_fuzz.session().session_id(), key_type, + wrapped_private_key.data(), + wrapped_private_key.size()); + session_fuzz.Terminate(); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc new file mode 100644 index 0000000..1abd6fe --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// 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" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + entry.InstallTestRSAKey(); + 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; +} 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_reuse_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc new file mode 100644 index 0000000..eea4a09 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// 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" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + entry.InstallTestRSAKey(); + entry.session().CreateNewUsageEntry(); + entry.session().close(); + + entry.session().open(); + OEMCrypto_ReuseUsageEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc new file mode 100644 index 0000000..0bf0a18 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc @@ -0,0 +1,38 @@ +// 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); + + const OEMCryptoCipherMode cipher_mode = + wvoec::ConvertDataToValidEnum(fuzzed_data, OEMCrypto_CipherMode_MaxValue); + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_SelectKey(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + cipher_mode); + + return 0; +} 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 new file mode 100644 index 0000000..4806ed5 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc @@ -0,0 +1,34 @@ +// 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 + +#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::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + + 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; +} diff --git a/oemcrypto/util/test/oem_cert_test.h b/oemcrypto/util/test/oem_cert_test.h new file mode 100644 index 0000000..a19b952 --- /dev/null +++ b/oemcrypto/util/test/oem_cert_test.h @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. +// +// This header is used to access the testing OEM certificate. +#ifndef OEM_CERT_TEST_H_ +#define OEM_CERT_TEST_H_ + +#include +#include + +namespace wvoec { +namespace util { + +// Refer to the following in main modules +extern const uint32_t kOEMSystemId; + +extern const uint8_t* kOEMPrivateKey; +extern const uint8_t* kOEMPublicCert; + +extern const size_t kOEMPrivateKeySize; +extern const size_t kOEMPublicCertSize; + +} // namespace util +} // namespace wvoec + +#endif // OEM_CERT_TEST_H_ diff --git a/util/include/string_format.h b/util/include/string_format.h new file mode 100644 index 0000000..62f9fd9 --- /dev/null +++ b/util/include/string_format.h @@ -0,0 +1,18 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. +#ifndef WVCDM_UTIL_STRING_FORMAT_H_ +#define WVCDM_UTIL_STRING_FORMAT_H_ + +#include + +namespace wvutil { + +#ifdef __GNUC__ +[[gnu::format(printf, 2, 3)]] +#endif +bool FormatString(std::string* out, const char* fmt, ...); + +} // namespace wvutil + +#endif // WVCDM_UTIL_STRING_FORMAT_H_ diff --git a/util/src/string_format.cpp b/util/src/string_format.cpp new file mode 100644 index 0000000..91cce37 --- /dev/null +++ b/util/src/string_format.cpp @@ -0,0 +1,40 @@ +// 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 "string_format.h" + +#include +#include +#include +#include + +#include + +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); + + 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); + + if (actual_size != desired_size) return false; + + out->assign(buffer.get(), actual_size); + return true; +} + +} // namespace wvutil diff --git a/util/test/string_format_unittest.cpp b/util/test/string_format_unittest.cpp new file mode 100644 index 0000000..282a43d --- /dev/null +++ b/util/test/string_format_unittest.cpp @@ -0,0 +1,64 @@ +// 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 "string_format.h" + +#include +#include + +#include + +namespace wvutil { + +TEST(StringFormatTest, SignedInteger) { + constexpr char kFormat[] = "Version %d"; + constexpr char kResult[] = "Version -123"; + std::string result; + EXPECT_TRUE(FormatString(&result, kFormat, -123)); + EXPECT_EQ(result, kResult); +} + +TEST(StringFormatTest, UnsignedInteger) { + constexpr char kFormat[] = "Version %u"; + constexpr char kResult[] = "Version 27"; + std::string result; + EXPECT_TRUE(FormatString(&result, kFormat, 27)); + EXPECT_EQ(result, kResult); +} + +TEST(StringFormatTest, HexInteger) { + constexpr char kFormat[] = "Version %X"; + constexpr char kResult[] = "Version FF"; + std::string result; + EXPECT_TRUE(FormatString(&result, kFormat, 0xFF)); + EXPECT_EQ(result, kResult); +} + +TEST(StringFormatTest, Strings) { + constexpr char kFormat[] = "Hello, %s."; + constexpr char kResult[] = "Hello, DRM."; + std::string result; + EXPECT_TRUE(FormatString(&result, kFormat, "DRM")); + EXPECT_EQ(result, kResult); +} + +TEST(StringFormatTest, Nothing) { + constexpr char kString[] = "No format fields."; + std::string result; + EXPECT_TRUE(FormatString(&result, kString)); + EXPECT_EQ(result, kString); +} + +TEST(StringFormatTest, NullOutput) { + constexpr char kString[] = "This will never be referenced."; + EXPECT_FALSE(FormatString(nullptr, kString)); +} + +TEST(StringFormatTest, NullFormat) { + std::string result; + EXPECT_FALSE(FormatString(&result, nullptr)); + EXPECT_TRUE(result.empty()); +} + +} // namespace wvutil