Loading security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,9 @@ package android.hardware.security.keymint; @VintfStability @VintfStability parcelable DeviceInfo { parcelable DeviceInfo { /** /** * DeviceInfo is a CBOR Map structure described by the following CDDL. * DeviceInfo is a CBOR Map structure described by the following CDDL. DeviceInfo must be * canonicalized according to the specification in RFC 7049. The ordering presented here is * non-canonical to group similar entries semantically. * * * DeviceInfo = { * DeviceInfo = { * "brand" : tstr, * "brand" : tstr, Loading security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -422,7 +422,7 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { ASSERT_TRUE(deviceInfoMap) << "Failed to parse deviceInfo: " << deviceInfoErrMsg; ASSERT_TRUE(deviceInfoMap) << "Failed to parse deviceInfo: " << deviceInfoErrMsg; ASSERT_TRUE(deviceInfoMap->asMap()); ASSERT_TRUE(deviceInfoMap->asMap()); checkDeviceInfo(deviceInfoMap->asMap()); checkDeviceInfo(deviceInfoMap->asMap(), deviceInfo.deviceInfo); auto& signingKey = bccContents->back().pubKey; auto& signingKey = bccContents->back().pubKey; auto macKey = verifyAndParseCoseSign1(signedMac->asArray(), signingKey, auto macKey = verifyAndParseCoseSign1(signedMac->asArray(), signingKey, Loading Loading @@ -466,7 +466,7 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { } } } } void checkDeviceInfo(const cppbor::Map* deviceInfo) { void checkDeviceInfo(const cppbor::Map* deviceInfo, bytevec deviceInfoBytes) { const auto& version = deviceInfo->get("version"); const auto& version = deviceInfo->get("version"); ASSERT_TRUE(version); ASSERT_TRUE(version); ASSERT_TRUE(version->asUint()); ASSERT_TRUE(version->asUint()); Loading Loading @@ -518,6 +518,8 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { default: default: FAIL() << "Unrecognized version: " << version->asUint()->value(); FAIL() << "Unrecognized version: " << version->asUint()->value(); } } ASSERT_EQ(deviceInfo->clone()->asMap()->canonicalize().encode(), deviceInfoBytes) << "DeviceInfo ordering is non-canonical."; } } bytevec eekId_; bytevec eekId_; Loading Loading
security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,9 @@ package android.hardware.security.keymint; @VintfStability @VintfStability parcelable DeviceInfo { parcelable DeviceInfo { /** /** * DeviceInfo is a CBOR Map structure described by the following CDDL. * DeviceInfo is a CBOR Map structure described by the following CDDL. DeviceInfo must be * canonicalized according to the specification in RFC 7049. The ordering presented here is * non-canonical to group similar entries semantically. * * * DeviceInfo = { * DeviceInfo = { * "brand" : tstr, * "brand" : tstr, Loading
security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -422,7 +422,7 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { ASSERT_TRUE(deviceInfoMap) << "Failed to parse deviceInfo: " << deviceInfoErrMsg; ASSERT_TRUE(deviceInfoMap) << "Failed to parse deviceInfo: " << deviceInfoErrMsg; ASSERT_TRUE(deviceInfoMap->asMap()); ASSERT_TRUE(deviceInfoMap->asMap()); checkDeviceInfo(deviceInfoMap->asMap()); checkDeviceInfo(deviceInfoMap->asMap(), deviceInfo.deviceInfo); auto& signingKey = bccContents->back().pubKey; auto& signingKey = bccContents->back().pubKey; auto macKey = verifyAndParseCoseSign1(signedMac->asArray(), signingKey, auto macKey = verifyAndParseCoseSign1(signedMac->asArray(), signingKey, Loading Loading @@ -466,7 +466,7 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { } } } } void checkDeviceInfo(const cppbor::Map* deviceInfo) { void checkDeviceInfo(const cppbor::Map* deviceInfo, bytevec deviceInfoBytes) { const auto& version = deviceInfo->get("version"); const auto& version = deviceInfo->get("version"); ASSERT_TRUE(version); ASSERT_TRUE(version); ASSERT_TRUE(version->asUint()); ASSERT_TRUE(version->asUint()); Loading Loading @@ -518,6 +518,8 @@ class CertificateRequestTest : public VtsRemotelyProvisionedComponentTests { default: default: FAIL() << "Unrecognized version: " << version->asUint()->value(); FAIL() << "Unrecognized version: " << version->asUint()->value(); } } ASSERT_EQ(deviceInfo->clone()->asMap()->canonicalize().encode(), deviceInfoBytes) << "DeviceInfo ordering is non-canonical."; } } bytevec eekId_; bytevec eekId_; Loading