Fix a few Vts failures in factory_upload_tool am: 2caa832158

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/23753310

Change-Id: Id5bc17f2c2c690862afdc873cb10dec919bbc56b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cong Lin
2023-06-23 23:23:56 +00:00
committed by Automerger Merge Worker
2 changed files with 13 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.security.keymint</name>
<version>3</version>
<fqname>IRemotelyProvisionedComponent/widevine</fqname>
</hal>
</manifest>

View File

@@ -28,6 +28,8 @@
#include <variant>
#include "log.h"
namespace aidl::android::hardware::security::keymint {
using ::std::string;
@@ -77,7 +79,8 @@ ScopedAStatus WidevineRemotelyProvisionedComponent::getHardwareInfo(
RpcHardwareInfo* info) {
info->versionNumber = 3;
info->rpcAuthorName = "Google";
info->supportedEekCurve = RpcHardwareInfo::CURVE_25519;
info->supportedEekCurve = RpcHardwareInfo::CURVE_NONE;
info->supportedNumKeysInCsr = RpcHardwareInfo::MIN_SUPPORTED_NUM_KEYS_IN_CSR;
info->uniqueId = "Widevine Implementation";
return ScopedAStatus::ok();
}
@@ -85,33 +88,17 @@ ScopedAStatus WidevineRemotelyProvisionedComponent::getHardwareInfo(
ScopedAStatus WidevineRemotelyProvisionedComponent::generateEcdsaP256KeyPair(
bool /* testMode */, MacedPublicKey* /* macedPublicKey */,
bytevec* /* privateKeyHandle */) {
return Status("Invalid operation.");
return Status(
"Invalid operation: generateEcdsaP256KeyPair() is not supported.");
}
ScopedAStatus WidevineRemotelyProvisionedComponent::generateCertificateRequest(
bool testMode, const vector<MacedPublicKey>& keysToSign,
const bytevec& endpointEncCertChain, const bytevec& /* challenge */,
DeviceInfo* deviceInfo, ProtectedData* protectedData,
bool /* testMode */, const vector<MacedPublicKey>& /* keysToSign */,
const bytevec& /* endpointEncCertChain */, const bytevec& /* challenge */,
DeviceInfo* /* deviceInfo */, ProtectedData* /* protectedData */,
bytevec* /* keysToSignMac */) {
if (!keysToSign.empty()) {
return Status("Invalid operation: Keys to sign must be empty.");
}
if (deviceInfo == nullptr) {
return Status("Parameter deviceInfo must not be null.");
}
if (protectedData == nullptr) {
return Status("Parameter protectedData must not be null.");
}
if (provisioner_ == nullptr) {
provisioner_ = std::make_unique<widevine::WidevineProvisioner>();
}
if (!provisioner_->GenerateCertificateRequest(testMode, endpointEncCertChain,
deviceInfo->deviceInfo,
protectedData->protectedData)) {
return Status("Failed to generate certificate request.");
}
return ScopedAStatus::ok();
return Status(IRemotelyProvisionedComponent::STATUS_REMOVED,
"generateCertificateRequestV1 not supported.");
}
ScopedAStatus
@@ -119,7 +106,7 @@ WidevineRemotelyProvisionedComponent::generateCertificateRequestV2(
const std::vector<MacedPublicKey>& keysToSign,
const std::vector<uint8_t>& challenge, std::vector<uint8_t>* csr) {
if (!keysToSign.empty()) {
return Status("Invalid operation: Keys to sign must be empty.");
LOGW("Keys to sign should be empty.");
}
if (csr == nullptr) {
return Status("Parameter csr must not be null.");