Add example binary for testing building the SDK after 'git clone' from our repo. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=227583629
44 lines
1.5 KiB
C++
44 lines
1.5 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// 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 {
|
|
Status VerifyVmpData(const std::string& vmp_data,
|
|
PlatformVerificationStatus* platform_verification_status) {
|
|
*platform_verification_status = PLATFORM_UNVERIFIED;
|
|
VmpChecker::Result vmp_result;
|
|
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
|