From 72abbbd36d37b2e6b449f72755623645c3c0cb38 Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Wed, 29 Mar 2023 07:11:23 +0000 Subject: [PATCH] Correct the expection of DeviceInfo size Bug: 275645815 Test: VtsHalRemotelyProvisionedComponentTargetTest Change-Id: I24187be5b7b34285aa53ddaa420b871826a3b825 --- security/keymint/support/remote_prov_utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp index 72142344b1..23e2192c30 100644 --- a/security/keymint/support/remote_prov_utils.cpp +++ b/security/keymint/support/remote_prov_utils.cpp @@ -467,16 +467,16 @@ ErrMsgOr> parseAndValidateDeviceInfo( case 3: if (isTeeDeviceInfo(*parsed) && parsed->size() != kNumTeeDeviceInfoEntries) { error += fmt::format( - "Err: Incorrect number of device info entries. Expected {} but got" + "Err: Incorrect number of device info entries. Expected {} but got " "{}\n", kNumTeeDeviceInfoEntries, parsed->size()); } // TEE IRPC instances require all entries to be present in DeviceInfo. Non-TEE instances // may omit `os_version` - if (!isTeeDeviceInfo(*parsed) && (parsed->size() != kNumTeeDeviceInfoEntries || + if (!isTeeDeviceInfo(*parsed) && (parsed->size() != kNumTeeDeviceInfoEntries && parsed->size() != kNumTeeDeviceInfoEntries - 1)) { error += fmt::format( - "Err: Incorrect number of device info entries. Expected {} or {} but got" + "Err: Incorrect number of device info entries. Expected {} or {} but got " "{}\n", kNumTeeDeviceInfoEntries - 1, kNumTeeDeviceInfoEntries, parsed->size()); }