Extract creation and expiration times from DRM cert
[ Merge of http://go/wvgerrit/119843 ] Creation and expiration times are extracted from the device DRM certificate. They are reported as * -1 if not set in the proto * 0 if unlimited * positive number otherwise Bug: 169740403 Test: WV unit, integraiton tests Change-Id: I9463954dfeb82b6a88ff5d608ed74d20f2424e83
This commit is contained in:
@@ -500,7 +500,8 @@ bool CertificateProvisioning::ExtractAndDecodeSignedMessageForTesting(
|
||||
|
||||
bool CertificateProvisioning::ExtractDeviceInfo(
|
||||
const std::string& device_certificate, std::string* serial_number,
|
||||
uint32_t* system_id) {
|
||||
uint32_t* system_id, int64_t* creation_time_seconds,
|
||||
int64_t* expiration_time_seconds) {
|
||||
LOGV("Extracting device info");
|
||||
if (serial_number == nullptr && system_id == nullptr) {
|
||||
LOGE("Output parameters |serial_number| and |system_id| not provided");
|
||||
@@ -527,6 +528,16 @@ bool CertificateProvisioning::ExtractDeviceInfo(
|
||||
if (system_id != nullptr) {
|
||||
*system_id = drm_certificate.system_id();
|
||||
}
|
||||
if (creation_time_seconds != nullptr) {
|
||||
*creation_time_seconds = drm_certificate.has_creation_time_seconds()
|
||||
? drm_certificate.creation_time_seconds()
|
||||
: INVALID_TIME;
|
||||
}
|
||||
if (expiration_time_seconds != nullptr) {
|
||||
*expiration_time_seconds = drm_certificate.has_expiration_time_seconds()
|
||||
? drm_certificate.expiration_time_seconds()
|
||||
: INVALID_TIME;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user