Source release 17.1.2

This commit is contained in:
John "Juce" Bruce
2023-06-23 15:37:42 -07:00
parent a10f13a2dc
commit 2baa7c6e2b
353 changed files with 12903 additions and 2305 deletions

View File

@@ -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);

View File

@@ -127,8 +127,7 @@ OEMCrypto implementations on linux.
information locally.
* Build and test fuzz scripts locally using following commands. The build
script builds fuzz binaries for both oemcrypto reference implementation
as well as opk implementation.
script builds fuzz binaries for opk implementation.
```shell
$ cd PATH_TO_CDM_DIR

View File

@@ -6,18 +6,21 @@
set -ex
# CDM_DIR is used by several script, especially when there is some confusion
if [ -z "$CDM_DIR" ]; then
export CDM_DIR="$(readlink -e $(dirname $0)/../../..)"
fi
cd $CDM_DIR
export CXX=clang++
export CC=clang
export GYP_DEFINES="$GYP_DEFINES clang=1"
export PATH_TO_CDM_DIR=.
export PYTHONPATH="$PYTHONPATH:$PATH_TO_CDM_DIR/third_party"
echo "CDM_DIR = $CDM_DIR"
export PYTHONPATH="$PYTHONPATH:$CDM_DIR/third_party"
python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \
--depth=$(pwd) oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp
ninja -C out/Default
# oemcrypto_opk_fuzztests.gypi has flags to instrument all the gyp targets
# with fuzzer flags.
python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \
python3 $CDM_DIR/third_party/gyp/__init__.py --format=ninja \
--depth=$(pwd) \
--include=oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi \
oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp

Some files were not shown because too many files have changed in this diff Show More