Replace hardcoded parameters
This commit is contained in:
@@ -85,7 +85,8 @@ PreprovKeysMap* PreprovKeysMap::GetSingleton() {
|
||||
} // namespace
|
||||
|
||||
WvmTokenHandler::PreprovKey::PreprovKey(uint32_t system_id,
|
||||
const std::string& key_bytes, Cipher cipher,
|
||||
const std::string& key_bytes,
|
||||
Cipher cipher,
|
||||
const std::string& model_filter)
|
||||
: system_id(system_id),
|
||||
key_bytes(key_bytes),
|
||||
@@ -93,7 +94,8 @@ WvmTokenHandler::PreprovKey::PreprovKey(uint32_t system_id,
|
||||
model_filter(model_filter) {}
|
||||
|
||||
WvmTokenHandler::PreprovKey::PreprovKey(uint32_t system_id,
|
||||
const std::string& key_bytes, Cipher cipher)
|
||||
const std::string& key_bytes,
|
||||
Cipher cipher)
|
||||
: system_id(system_id), key_bytes(key_bytes), cipher(cipher) {}
|
||||
|
||||
WvmTokenHandler::PreprovKey::PreprovKey(uint32_t system_id,
|
||||
@@ -230,8 +232,10 @@ Status WvmTokenHandler::DecryptDeviceKeyWithPreprovKey(
|
||||
return Status(error::INVALID_ARGUMENT, "Keybox token is too short.");
|
||||
}
|
||||
if (version) {
|
||||
// Bytes 0-3 contain the keybox version.
|
||||
*version = BigEndian::Load32(token.data());
|
||||
}
|
||||
|
||||
// This was checked at initialization, so if it fails now something is wrong.
|
||||
CHECK_EQ(preprov_key.size(), kPreProvisioningKeySizeBytes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user