Add Sandbox ID support
Merge from master branch of Widevine repo of http://go/wvgerrit/66078 Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64022 This CL updates OEMCrypto ref code, unit tests, and core code for setting the sandbox id before initializing OEMCrypto. Test: unit tests only Test: tested as part of http://go/ag/5501993 Bug: 115834255 Change-Id: Id9831680fe4db1c69413815931cae4bc80df0c01
This commit is contained in:
@@ -216,7 +216,14 @@ void CryptoSession::Init() {
|
||||
AutoLock auto_lock(crypto_lock_);
|
||||
session_count_ += 1;
|
||||
if (!initialized_) {
|
||||
std::string sandbox_id;
|
||||
OEMCryptoResult sts;
|
||||
if (Properties::GetSandboxId(&sandbox_id) && !sandbox_id.empty()) {
|
||||
sts = OEMCrypto_SetSandbox(
|
||||
reinterpret_cast<const uint8_t*>(sandbox_id.c_str()),
|
||||
sandbox_id.length());
|
||||
// TODO(blueeyes): it might be worth saving the sandbox id in a metric.
|
||||
}
|
||||
M_TIME(sts = OEMCrypto_Initialize(), metrics_, oemcrypto_initialize_, sts);
|
||||
if (OEMCrypto_SUCCESS != sts) {
|
||||
LOGE("OEMCrypto_Initialize failed: %d", sts);
|
||||
|
||||
Reference in New Issue
Block a user