diff options
Diffstat (limited to 'security/keymint/aidl/default/RemotelyProvisionedComponent.cpp')
-rw-r--r-- | security/keymint/aidl/default/RemotelyProvisionedComponent.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/security/keymint/aidl/default/RemotelyProvisionedComponent.cpp b/security/keymint/aidl/default/RemotelyProvisionedComponent.cpp index 2373b2682b..4dbaa05d54 100644 --- a/security/keymint/aidl/default/RemotelyProvisionedComponent.cpp +++ b/security/keymint/aidl/default/RemotelyProvisionedComponent.cpp @@ -156,7 +156,7 @@ StatusOr<bytevec /* pubkeys */> validateAndExtractPubkeys(bool testMode, } auto protectedParms = macedKeyItem->asArray()->get(kCoseMac0ProtectedParams)->asBstr(); - auto unprotectedParms = macedKeyItem->asArray()->get(kCoseMac0UnprotectedParams)->asBstr(); + auto unprotectedParms = macedKeyItem->asArray()->get(kCoseMac0UnprotectedParams)->asMap(); auto payload = macedKeyItem->asArray()->get(kCoseMac0Payload)->asBstr(); auto tag = macedKeyItem->asArray()->get(kCoseMac0Tag)->asBstr(); if (!protectedParms || !unprotectedParms || !payload || !tag) { @@ -322,8 +322,8 @@ ScopedAStatus RemotelyProvisionedComponent::generateEcdsaP256KeyPair(bool testMo ScopedAStatus RemotelyProvisionedComponent::generateCertificateRequest( bool testMode, const vector<MacedPublicKey>& keysToSign, - const bytevec& endpointEncCertChain, const bytevec& challenge, bytevec* keysToSignMac, - ProtectedData* protectedData) { + const bytevec& endpointEncCertChain, const bytevec& challenge, DeviceInfo* deviceInfo, + ProtectedData* protectedData, bytevec* keysToSignMac) { auto pubKeysToSign = validateAndExtractPubkeys(testMode, keysToSign, testMode ? remote_prov::kTestMacKey : macKey_); if (!pubKeysToSign.isOk()) return pubKeysToSign.moveError(); @@ -343,11 +343,12 @@ ScopedAStatus RemotelyProvisionedComponent::generateCertificateRequest( bcc = bcc_.clone(); } + deviceInfo->deviceInfo = createDeviceInfo(); auto signedMac = constructCoseSign1(devicePrivKey /* Signing key */, // ephemeralMacKey /* Payload */, cppbor::Array() /* AAD */ .add(challenge) - .add(createDeviceInfo()) + .add(deviceInfo->deviceInfo) .encode()); if (!signedMac) return Status(signedMac.moveMessage()); |