From e9bb4bd1a200e34714bb21dae68535fdc5affbad Mon Sep 17 00:00:00 2001 From: Max Bires Date: Fri, 12 May 2023 16:00:02 +0000 Subject: Add a missing LazyInitProdBcc call. With the introduction of the generateCertificateRequestV2 call, there was a new code path introduce in android_keymaster to handle this additional HAL method. The underlying code this HAL called in the pure software provisioning context did not also trigger generation of the BCC and device private key for the new HAL method. This is now fixed by initializing the Bcc in BuildCsr Fixes: 270522174 Test: N/A (cherry picked from https://android-review.googlesource.com/q/commit:84260d0c6c50675b006113178796a6a0021116b2) Merged-In: Ic49008d832e6b1fdc846817a8e7dcda07657983a Change-Id: Ic49008d832e6b1fdc846817a8e7dcda07657983a --- contexts/pure_soft_remote_provisioning_context.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contexts/pure_soft_remote_provisioning_context.cpp b/contexts/pure_soft_remote_provisioning_context.cpp index 72232ac..fcafec4 100644 --- a/contexts/pure_soft_remote_provisioning_context.cpp +++ b/contexts/pure_soft_remote_provisioning_context.cpp @@ -207,6 +207,7 @@ void PureSoftRemoteProvisioningContext::GetHwInfo(GetHwInfoResponse* hwInfo) con cppcose::ErrMsgOr PureSoftRemoteProvisioningContext::BuildCsr(const std::vector& challenge, cppbor::Array keysToSign) const { + LazyInitProdBcc(); uint32_t csrVersion = 3; auto deviceInfo = std::move(*CreateDeviceInfo(csrVersion)); auto csrPayload = cppbor::Array() -- cgit v1.2.3