Fix SRM Version in mock

Merge from Widevine repo of http://go/wvgerrit/26522

The modifiable OEMCrypto mock did not use the correct initial SRM
version as specified in the options file.  This CL fixes that.

b/37713658

Change-Id: I5ab5f5549dd7815edd4a3d69b804440faedeb657
This commit is contained in:
Fred Gylys-Colwell
2017-04-26 20:01:20 -07:00
parent ad94e69d03
commit 1e451340ba
2 changed files with 15 additions and 10 deletions

View File

@@ -346,14 +346,18 @@ class AndroidModifiableCryptoEngine : public CryptoEngine {
OEMCryptoResult current_srm_version(uint16_t *version) {
if (srm_loaded_) {
LOGV("SRM loaded. version used is %d.", srm_version_);
*version = srm_version_;
return OEMCrypto_SUCCESS;
}
int value = GetOption("srm_initial_version", -1);
if (value > 0) {
*version = srm_version_;
LOGV("SRM version from get option: %d.", value);
srm_version_ = value;
*version = value;
return OEMCrypto_SUCCESS;
} else {
LOGI("SRM initial version is %d -- reporting not implemented.", value);
return OEMCrypto_ERROR_NOT_IMPLEMENTED;
}
}