Export media_cas_packager_sdk
This commit is contained in:
45
common/verified_media_pipeline.cc
Normal file
45
common/verified_media_pipeline.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2017 Google LLC.
|
||||
//
|
||||
// This software is licensed under the terms defined in the Widevine Master
|
||||
// License Agreement. For a copy of this agreement, please contact
|
||||
// widevine-licensing@google.com.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Description:
|
||||
// Helper methods for verifying VMP (Verified Media Pipeline) data.
|
||||
|
||||
#include "common/verified_media_pipeline.h"
|
||||
|
||||
#include "common/vmp_checker.h"
|
||||
|
||||
namespace widevine {
|
||||
util::Status VerifyVmpData(
|
||||
const std::string& vmp_data,
|
||||
PlatformVerificationStatus* platform_verification_status) {
|
||||
*platform_verification_status = PLATFORM_UNVERIFIED;
|
||||
VmpChecker::Result vmp_result;
|
||||
util::Status status =
|
||||
VmpChecker::Instance()->VerifyVmpData(vmp_data, &vmp_result);
|
||||
if (status.ok()) {
|
||||
switch (vmp_result) {
|
||||
case VmpChecker::kUnverified:
|
||||
*platform_verification_status = PLATFORM_UNVERIFIED;
|
||||
break;
|
||||
case VmpChecker::kVerified:
|
||||
*platform_verification_status = PLATFORM_SOFTWARE_VERIFIED;
|
||||
break;
|
||||
case VmpChecker::kSecureStorageVerified:
|
||||
*platform_verification_status =
|
||||
PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED;
|
||||
break;
|
||||
case VmpChecker::kTampered:
|
||||
*platform_verification_status = PLATFORM_TAMPERED;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
*platform_verification_status = PLATFORM_TAMPERED;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
} // namespace widevine
|
||||
Reference in New Issue
Block a user