KeyMint: use a smaller invalid IMEI value

The invalid value used for the second IMEI attestation test is
potentially wrong in two ways:
- It doesn't match the provisioned value.
- It's not a valid IMEI, not least because it is longer than 16 bytes.

Make the test value shorter so the second failure doesn't apply and
the test can reliably expect CANNOT_ATTEST_IDS.

Bug: 292959871
Bug: 327123694
Test: VtsAidlKeyMintTargetTest
Change-Id: If8c6b9e08b48e6caf5c767578e1ac43964214619
(cherry picked from commit 0215cb3d3e)
This commit is contained in:
David Drysdale
2023-08-07 11:53:46 +01:00
committed by Yinchu Chen
parent 653221fa8e
commit 8351f33b2b

View File

@@ -939,7 +939,9 @@ TEST_P(AttestKeyTest, EcdsaAttestationMismatchID) {
.Authorization(TAG_ATTESTATION_ID_MODEL, "malicious-model");
if (isSecondImeiIdAttestationRequired()) {
attestation_id_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, "invalid-second-imei");
// Note: the invalid value here is < 16 bytes long to avoid triggering any implementation
// checks on valid IMEI lengths.
attestation_id_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, "invalid-imei2");
}
vector<uint8_t> key_blob;
vector<KeyCharacteristics> key_characteristics;