Commit graph

28069 commits

Author SHA1 Message Date
David Drysdale
e3cdcb2410 KeyMaster VTS: improve attestation tests
Check that the various ATTESTATION_ID_* tags are included if they
have the correct value, and that keygen fails if they have an invalid
value.

Also fix the support libraries to add the missing fields to the ASN.1
schema and fix the existing ordering.

Bug: 190757200
Test: VtsHalKeymasterV4_1TargetTest, VtsHalKeymasterV4_0TargetTest
Merged-In: I11d28d71676d44ebdc79b25b2eb70947022bb1cf
Ignore-AOSP-First: to be cross-merged manually
Change-Id: I5e19880bbc9e2e667f1204bdc2247ae53a3dada7
2021-06-17 16:43:48 +01:00
David Drysdale
a676c3b4ef KeyMint VTS: improve attestation tests
Check that the various ATTESTATION_ID_* tags are included if they
have the correct value, and that keygen fails if they have an invalid
value.

Also update attestation tags to include vendor/boot patchlevel if
they're available. (They always should be, but fixing that is a
separate task.)

Bug: 190757200
Test: VtsAidlKeyMintTargetTest
Merged-In: Ibaed7364c6d08c0982e2a9fb6cb864ae42cf39fe
Change-Id: Ibaed7364c6d08c0982e2a9fb6cb864ae42cf39fe
2021-06-17 16:43:37 +01:00
David Drysdale
98949afb70 Merge "VTS tests: check size of byte strings" 2021-06-16 07:17:53 +00:00
David Drysdale
52ce52fb1e Merge "KeyMint VTS: extract full vendor patchlevel" 2021-06-16 07:17:27 +00:00
Michael Butler
12ec862f4a Merge "Simplify NNAPI SharedHandle -- hal" 2021-06-16 02:30:31 +00:00
Eran Messeri
1e6730acec Merge "Use TagType constants" 2021-06-15 15:13:51 +00:00
Eran Messeri
a5047720f0 Use TagType constants
Now that the aidl compiler supports it, use constants from TagType to
indicate the type of each tag, rather than duplicating the values of
the constants.

Test: atest VtsAidlKeyMintTargetTest
Bug: 183737811
Change-Id: Ie8af1f00d04fa05c59cfc72692caecbcf2fae483
2021-06-15 14:26:59 +01:00
David Drysdale
9c7fae7e81 KeyMint VTS: extract full vendor patchlevel
The vendor patchlevel is YYYYMMDD not YYYYMM

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Change-Id: Ia641f8eef84a85aec8f2a0551c192b6874301126
2021-06-15 13:12:07 +01:00
Yomna Nasser
8d1e7b9c7c Merge "Adds VTS test for setAllowedNetworkTypesBitmap" 2021-06-14 22:43:15 +00:00
Marco Nelissen
eecfd6e507 Merge "Increase test coverage" 2021-06-14 22:41:47 +00:00
Marco Nelissen
111feb10ca Increase test coverage
The VTS Gatekeeper tests never triggered a case where
GateKeeper::DoVerify() failed, so add a test that does that.

Bug: 160731903
Test: run test with instrumented build
Change-Id: Ibcc51371e496f893c18ed9e8cdc53dfef8f4e4ad
2021-06-14 11:29:21 -07:00
Eran Messeri
14bb840731 Merge "Test validity of device-unique attestation chain" 2021-06-14 11:14:12 +00:00
David Drysdale
fd1b38dc66 VTS tests: check size of byte strings
Bug: 181883620
Test: VtsAidlSecureClockTargetTest, VtsAidlSharedSecretTargetTest
Change-Id: I9ea8687e0c9e89140bcddfefcc2a6177c99b2e4d
2021-06-14 09:52:48 +01:00
Mikhail Naganov
b9e244dfc7 audio: Fix parsing of arguments in the APM config update script
The regex for finding "-h[elp]" argument wasn't correct.
As a result, a file name containing "-h" would match.
Fix the regex by requiring that "-h" must appear at the
beginning of the line.

Test: h/i/audio/7.0/config/update_audio_policy_config.sh -h
Test: h/i/audio/7.0/config/update_audio_policy_config.sh -help
Test: h/i/audio/7.0/config/update_audio_policy_config.sh test-help.xml
Change-Id: Ibdf191e95baacc8600daa8b2f19ddc8338f182eb
2021-06-11 08:52:39 -07:00
Treehugger Robot
05e6b870a4 Merge "bluetooth.audio@2.1: add handle IsSessionReady for LE offload encoder" 2021-06-10 07:21:19 +00:00
David Drysdale
ba8e44599c Merge "KeyMint: sync all attestation tags" 2021-06-09 05:49:33 +00:00
Michael Butler
e52a77efaa Simplify NNAPI SharedHandle -- hal
Prior to this CL, the NNAPI represented SharedHandle as a collection of
file descriptors and a vector of ints to act as metadata. This struct
mirrored Android's native_handle_t. However, the NNAPI only uses
SharedHandle to hold a single file descriptor to hold a single cache
file.

A sibling CL simplifies the SharedHandle by changing it to be a single
ref-counted file descriptor. This CL makes changes to the HAL utility
code in response to the SharedHandle change.

Bug: N/A
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ib390ad76bcdadffd85f8c2c502189aaa7da483e4
2021-06-08 20:14:52 -07:00
Eran Messeri
cb238ffdad Test validity of device-unique attestation chain
Test the validity of the chain produced when device-unique attestation
is requested.

When the caller requests that the key attestation be signed using the
device-unique attestation key, the chain will look different than
a chain signed by the batch key (common case):
(1) The chain is exactly of length 2.
(2) The root is self-signed and is unique to the device.

Test that the chain is correctly signed in this change. The root is not
currently correctly self-signed, so don't test (2) yet.

Bug: 189425310
Bug: 187803288
Test: atest VtsHalKeymasterV4_1TargetTest:PerInstance/DeviceUniqueAttestationTest
Change-Id: I91578eb2b7588685cc86c467423e9394c3f3c262
2021-06-08 11:42:54 +01:00
Alice Kuo
6f3b351269 bluetooth.audio@2.1: add handle IsSessionReady for LE offload encoder
Bug: 150670922
Tag: #feature
Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Change-Id: I5d5ca0cb63b2801b3ad1351754ebd9f5da73ac1e
2021-06-08 17:47:23 +08:00
Yomna Nasser
079b9233b0 Adds VTS test for setAllowedNetworkTypesBitmap
Adds a VTS test for setAllowedNetworkTypesBitmap, the newly
defined HAL radio API.

Bug: b/190398554
Test: atest VtsHalRadioV1_6TargetTest

Change-Id: I1b7d85ddd70a2d116a3b54a10d168c20804f2524
Merged-In: I1b7d85ddd70a2d116a3b54a10d168c20804f2524
2021-06-07 22:21:54 +00:00
Jakub Pawlowski
c8861ece90 bluetooth.audio@2.1: add internal HW offloading data path routing
Bug: 150670922
Tag: #feature
Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Change-Id: Id18b269a3a6ebcd56ba39158edc336c176cd2c16
2021-06-07 21:29:37 +00:00
Xusong Wang
378a93819b Test readonly request input in AIDL VTS.
This CL modifies the AIDL generated tests to use readonly memory pool
for request inputs.

Bug: 188104713
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I9e62f1cdeb501bf29bcb9c56317a452c9105b272
Merged-In: I9e62f1cdeb501bf29bcb9c56317a452c9105b272
(cherry picked from commit dfc013adaa)
2021-06-07 11:25:54 -07:00
Xusong Wang
5e0459576c Fix a bug in reusable burst execution.
The reusable burst execution incorrectly holds a reference to memory
identifier tokens.

Bug: 188568523
Test: NNT_static and inspect logcat
Change-Id: Ic8fb8be12bf579a316e7df8480ab3ccdc5c0e635
Merged-In: Ic8fb8be12bf579a316e7df8480ab3ccdc5c0e635
(cherry picked from commit 2082b871ab)
2021-06-07 11:25:33 -07:00
David Drysdale
f3374d4237 Merge "KeyMint VTS: better early boot key tests" 2021-06-07 16:05:23 +00:00
David Drysdale
93c72cef92 KeyMint: sync all attestation tags
Get description of ASN.1 schema in HAL and the keymint support library
in sync with each other.  Change code to always list tags in the same
order (by numeric tag).

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Change-Id: I620f54ba4a265ea69d174f6f44765a8508bfe803
2021-06-07 13:46:49 +01:00
Treehugger Robot
0872e42bec Merge "Improve unique attestation docs & tests" 2021-06-07 11:22:48 +00:00
Bruno Demartino
b49e67dca7 Merge "broadcastradio@2.0 VTS uses DAB frequency invalid in some regions" 2021-06-07 10:48:04 +00:00
Jan Kowal
7aa628d4de broadcastradio@2.0 VTS uses DAB frequency invalid in some regions
DAB frequency 178352kHz hardcoded in the test is used in EU region
(channel 5C) but it is not valid in others (e.g. Korea and China).

Therefore DabTune test was modified to use one of supported
frequencies reported via getDabRegionConfig method.

Test: run VtsHalBroadcastradioV2_0TargetTest on hardware units
configured for Europe, China and Korea DAB tuner regions.

Bug: b/190136847

Change-Id: Icd71e42a9242528465ac1358465d8b6d6d4896bf
2021-06-07 06:17:14 +00:00
Sarah Chin
ecb916bae2 Merge "Update test to TEST_P" 2021-06-04 18:38:38 +00:00
David Drysdale
adfe6116d5 KeyMint VTS: better early boot key tests
Add a check that the TAG_EARLY_BOOT_ONLY is included in the returned key
characteristics.

Bug: 188672564
Test: VtsAidlKeyMintTargetTest
Change-Id: I200c61f34888c720c47f6289d79cd21d78436b58
2021-06-04 16:42:23 +01:00
Sarah Chin
9b261e0f77 Update test to TEST_P
VTS tests were moved to parameterized gtests (TEST_F -> TEST_P),
so update the test for getSimPhonebookRecords to prevent compile errors

Test: mm
Fix: 183964306
Change-Id: Ib35c3c06fbe3fa2205bdcd44f70bda805fcb8301
Merged-In: Ib35c3c06fbe3fa2205bdcd44f70bda805fcb8301
2021-06-03 17:09:12 -07:00
Aaron Tsai
ef8351b217 Allow REQUEST_NOT_SUPPORTED for HAL interface updateSimPhonebookRecords
Bug: 188309710
Test: atest VtsHalRadioV1_6TargetTest
Change-Id: I70fec63e495959272b3d95a97050723faee8b1c8
2021-06-03 20:22:21 +00:00
David Drysdale
19c7c575f0 Merge "KeyMint VTS: test getKeyCharacteristics()" 2021-06-03 06:55:24 +00:00
David Anderson
45f16a5705 Merge "Fix typo in IFastboot.hal." 2021-06-03 00:35:41 +00:00
Treehugger Robot
6f87175e16 Merge "Fixing tests to reflect change in CDDL" 2021-06-03 00:25:49 +00:00
David Anderson
9046c8dc8c Fix typo in IFastboot.hal.
Bug: N/A
Test: N/A
Change-Id: I7de7e92c0941607945ce01d5a31bcdec0628512d
2021-06-02 16:01:53 -07:00
David Zeuthen
1b8be7166f identity: Don't pass invalid profileIds in VTS test.
Also add a check in the default implementation to help catch bugs like
this in the future.

Bug: 189865806
Test: atest VtsHalIdentityTargetTest
Test: atest CtsIdentityTestCases
Change-Id: Ief55528af8e14707b5c4d9431a851f9c8ccfae0c
2021-06-01 16:44:06 -04:00
Treehugger Robot
e8d43f7e59 Merge "Correct the description for getKeyCharacteristics" 2021-06-01 19:49:43 +00:00
Przemyslaw Szczepaniak
53bd1cc985 Merge "Modify VTS to allow testing shim caching" 2021-06-01 19:32:47 +00:00
David Zeuthen
f1e4bd1126 Merge "identity: Fix VTS test failure caused by unrelated change to system/keymaster." 2021-06-01 19:01:10 +00:00
Seth Moore
fa3d38d206 Correct the description for getKeyCharacteristics
The description should note that keystore-enforced tags are not to be
returned. This is done so that the keymint implementation doesn't have
to bother keeping track of tags it's not repsonsible for dealing with.

Bug: 186685601
Test: none (it's just a comment change)
Change-Id: I3ff94201c262a5071d271b150dbbf21888d678aa
2021-06-01 11:30:24 -07:00
Treehugger Robot
006bdf3fa9 Merge "Fix for the documentation in TimeStampToken.aidl. HMAC computation will always use 1, which is the value of SecurityLevel.TRUSTED_ENVIRONMENT. This is done for backwards compatibility purpose. Test: N/A Bug: None." 2021-06-01 17:18:21 +00:00
David Zeuthen
a0752ce6de identity: Fix VTS test failure caused by unrelated change to system/keymaster.
Bug: 189447009
Test: atest VtsHalIdentityTargetTest
Test: atest CtsIdentityTestCases
Change-Id: I58426f1551efa920909c759cf5e10f44c6cfc5d4
2021-06-01 09:57:48 -04:00
Slava Shklyaev
2980a7c9fc Modify VTS to allow testing shim caching
Bug: 185777967
Bug: 182877255
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ibaba149715cfd5e655ce4916b75a29473170f013
2021-06-01 12:41:41 +01:00
Eran Messeri
90747ad701 Improve unique attestation docs & tests
Improve the documentation and tests related to device-unique
attestation on StrongBox KeyMint devices:
* Test that the chain produced is exactly of length 2.
* Document how the chain needs to be structured.
* Explain the trust properties of the key used for the
  self-signed root.

Test: atest VtsAidlKeyMintTargetTest
Bug: 187803288
Change-Id: I09bb16d6938b567c114485d2df00bde9d3e1ccf9
2021-05-27 18:19:18 +01:00
Max Bires
8dff0b3584 Fixing tests to reflect change in CDDL
This fixes up the tests to go along with the change to the signature
of the MAC key. Primarily, this adds the MAC tag from the MACing
operation over the public key set to be signed into the AAD of the
signature of said MAC key.

Bug: 189018262
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ibdcf242e0ae73dee1a08fe98d939130055e4492e
Merged-In: Ibdcf242e0ae73dee1a08fe98d939130055e4492e
2021-05-26 21:42:17 +00:00
Treehugger Robot
25e701b915 Merge "Correct documentation for update()" 2021-05-26 12:16:04 +00:00
Jack Yu
cf76f68c92 Merge "Skip tests for single SIM devices" 2021-05-25 22:03:35 +00:00
Treehugger Robot
29159c728f Merge "Generate COSE MAC with a callback, not raw key" 2021-05-25 19:35:37 +00:00
Chirag Pathak
8ac0743508 Fix for the documentation in TimeStampToken.aidl. HMAC computation will always use 1, which is the value of SecurityLevel.TRUSTED_ENVIRONMENT. This is done for backwards compatibility purpose.
Test: N/A
Bug: None.

Change-Id: I1fd979908103f9095cc7c306e0d5036d6b357b30
2021-05-25 19:22:43 +00:00