// 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); // OEMCrypto_SetMaxAPIVersion defined in v18.1 OEMCryptoResult _oecc132(uint32_t max_version); // OEMCrypto_GetKeyHandle defined in v18.1 OEMCryptoResult _oecc133(OEMCrypto_SESSION session, const uint8_t* content_key_id, size_t content_key_id_length, OEMCryptoCipherMode cipher_mode, uint8_t* key_handle, size_t* key_handle_length); // OEMCrypto_DecryptCENC defined in v18.1 OEMCryptoResult _oecc134( const uint8_t* key_handle, size_t key_handle_length, const OEMCrypto_SampleDescription* samples, // an array of samples. size_t samples_length, // the number of samples. const OEMCrypto_CENCEncryptPatternDesc* pattern); // OEMCrypto_Generic_Encrypt defined in v18.1 OEMCryptoResult _oecc135(const uint8_t* key_handle, size_t key_handle_length, const OEMCrypto_SharedMemory* in_buffer, size_t in_buffer_length, const uint8_t* iv, OEMCrypto_Algorithm algorithm, OEMCrypto_SharedMemory* out_buffer); // OEMCrypto_Generic_Decrypt defined in v18.1 OEMCryptoResult _oecc136(const uint8_t* key_handle, size_t key_handle_length, const OEMCrypto_SharedMemory* in_buffer, size_t in_buffer_length, const uint8_t* iv, OEMCrypto_Algorithm algorithm, OEMCrypto_SharedMemory* out_buffer); // OEMCrypto_Generic_Sign defined in v18.1 OEMCryptoResult _oecc137(const uint8_t* key_handle, size_t key_handle_length, const OEMCrypto_SharedMemory* buffer, size_t buffer_length, OEMCrypto_Algorithm algorithm, OEMCrypto_SharedMemory* signature, size_t* signature_length); // OEMCrypto_Generic_Verify defined in v18.1 OEMCryptoResult _oecc138(const uint8_t* key_handle, size_t key_handle_length, const OEMCrypto_SharedMemory* buffer, size_t buffer_length, OEMCrypto_Algorithm algorithm, const OEMCrypto_SharedMemory* signature, size_t signature_length); // OEMCrypto_GetSignatureHashAlgorithm defined in v18.1 OEMCryptoResult _oecc139(OEMCrypto_SESSION session, OEMCrypto_SignatureHashAlgorithm* algorithm); // OEMCrypto_GetDeviceInformation defined in v18.1 OEMCryptoResult _oecc131(uint8_t* device_info, size_t* device_info_length); // OEMCrypto_GetDeviceSignedCsrPayload defined in v18.1 OEMCryptoResult _oecc141(const uint8_t* challenge, size_t challenge_length, const uint8_t* encoded_device_info, size_t encoded_device_info_length, uint8_t* signed_csr_payload, size_t* signed_csr_payload_length); // OEMCrypto_EnterTestMode defined in v18.1 OEMCryptoResult _oecc140(void); // OEMCrypto_FactoryInstallBCCSignature defined in v18.3 OEMCryptoResult _oecc142(const uint8_t* signature, size_t signature_length); // OEMCrypto_PrepAndSignReleaseRequest defined in v19.0 OEMCryptoResult _oecc147(OEMCrypto_SESSION session, uint8_t* message, size_t message_length, size_t* core_message_size, uint8_t* signature, size_t* signature_length); // OEMCrypto_LoadLicense defined in v19.0 OEMCryptoResult _oecc144(OEMCrypto_SESSION session, const uint8_t* context, size_t context_length, const uint8_t* derivation_key, size_t derivation_key_length, const uint8_t* message, size_t message_length, size_t core_message_length, const uint8_t* signature, size_t signature_length); // OEMCrypto_LoadRelease defined in v19.0 OEMCryptoResult _oecc150(OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, size_t core_message_length, const uint8_t* signature, size_t signature_length); // OEMCrypto_GetBCCType defined in v19.0 OEMCryptoResult _oecc149(OEMCrypto_BCCType* bcc_type); // OEMCrypto_LoadProvisioning defined in v19.0 OEMCryptoResult _oecc145(OEMCrypto_SESSION session, const uint8_t* provision_request, size_t provision_request_length, 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); // OEMCrypto_LoadProvisioningCast defined in v19.0 OEMCryptoResult _oecc146(OEMCrypto_SESSION session, const uint8_t* derivation_key, size_t derivation_key_length, const uint8_t* provision_request, size_t provision_request_length, 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); // OEMCrypto_GetUsageEntryInfo defined in v19.0 OEMCryptoResult _oecc148(OEMCrypto_SESSION session, OEMCrypto_Usage_Entry_Status* status, int64_t* seconds_since_license_received, int64_t* seconds_since_first_decrypt); // OEMCrypto_SetDecryptHash defined in v19.0 OEMCryptoResult _oecc143(OEMCrypto_SESSION session, uint32_t frame_number, uint32_t crc32); // OEMCrypto_GetEmbeddedDrmCertificate defined in v19.1 OEMCryptoResult _oecc151(uint8_t* public_cert, size_t* public_cert_length); // OEMCrypto_UseSecondaryKey defined in v19.1 OEMCryptoResult _oecc152(OEMCrypto_SESSION session_id, bool dual_key); // OEMCrypto_WrapClearPrivateKey defined in v19.2 OEMCryptoResult _oecc154(const uint8_t* clear_private_key_bytes, size_t clear_private_key_length, uint8_t* wrapped_private_key, size_t* wrapped_private_key_length); // OEMCrypto_MarkOfflineSession defined in v19.2 OEMCryptoResult _oecc153(OEMCrypto_SESSION session); // OEMCrypto_SetSessionUsage defined in v18.7 OEMCryptoResult _oecc155(OEMCrypto_SESSION session, uint32_t intent, uint32_t mode); // OEMCrypto_GetBCCSignatureType defined in v19.4 OEMCryptoResult _oecc156(OEMCrypto_BCCSignatureType* bcc_signature_type); // OEMCrypto_GetPVRKey defined in v18.9 OEMCryptoResult _oecc157(OEMCrypto_SESSION session, uint8_t* wrapped_pvr_key, size_t* wrapped_pvr_key_length); // OEMCrypto_LoadPVRKey defined in v18.9 OEMCryptoResult _oecc158(OEMCrypto_SESSION session, const uint8_t* wrapped_pvr_key, size_t wrapped_pvr_key_length); // OEMCrypto_LoadLicenseData defined in v19.6 OEMCryptoResult _oecc159(OEMCrypto_SESSION session, const uint8_t* data, size_t data_length); // OEMCrypto_SaveLicenseData defined in v19.6 OEMCryptoResult _oecc160(OEMCrypto_SESSION session, uint8_t* data, size_t* data_length);