Commit graph

28029 commits

Author SHA1 Message Date
Treehugger Robot
7dc7626822 Merge "Fix bug for none fe test case" 2021-05-10 23:56:36 +00:00
Xusong Wang
b2e8085ce2 Introduce reusable burst to canonical interface -- HAL.
This CL modifies the canonical interface for reusable burst executions:
- Add new method IBurst::createExecution

The reusable burst execution will not fallback to another execution path
if sending request packet fails. The behavior of single-time burst
execution remains unchanged.

Additionally, this CL enables pointer -> shared memory conversion in
1.2/1.3 burst implementation.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Change-Id: Iaac81668d247c2cb76d70e6abbd10f00b397b19f
Merged-In: Iaac81668d247c2cb76d70e6abbd10f00b397b19f
(cherry picked from commit ead6d37ae9)
2021-05-10 15:22:08 -07:00
Xusong Wang
5f6bedb43a Introduce reusable execution to canonical interface -- HAL.
This CL modifies the canonical interface for reusable executions:
- Add new interface: IExecution with compute and computeFenced methods
- Add new method IPreparedModel::createExecution

In NNAPI runtime, the new interface IExecution is used to
memoize request-specific execution resources (e.g. converted HAL
request). The expected usage is that, IPreparedModel::createExecution
will be invoked in the first computation of a reusable NDK ANNExecution
object, and IExecution::compute* will be invoked repeatedly.

The IPreparedModel::execute* methods are preserved to avoid redundant
object creation and memoization overhead for a single-time
(non-reusable) execution.

For a vendor implementing the canonical interfaces, only the
IPreparedModel::execute* methods will be called because there is
currently no reusable execution at HAL interface. A DefaultExecution
implementation is provided to reduce the work needed on the vendor side.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Test: neuralnetworks_utils_hal_aidl_test
Change-Id: I91790bb5ccf5ae648687fe603f88ffda2c9fd2b2
Merged-In: I91790bb5ccf5ae648687fe603f88ffda2c9fd2b2
(cherry picked from commit 727a7b2104)
2021-05-10 15:21:36 -07:00
Henry Fang
dfb386f9f3 Fix bug for none fe test case
Test: atest VtsHalTvTunerV1_0TargetTest

bug: 182519645
Change-Id: I5deca5fe7f4f023cbadaf54f894657c1c6efe38a
Merged-In: I86458142ba4155274594a793eb939567bea24734
2021-05-10 16:09:40 +00:00
David Drysdale
2a73db3d9e KeyMint VTS: fix 3DES key sizes
DES key size is 7/8 of what's provided.

Test: VtsAidlKeyMintTargetTest
Change-Id: I645c1df11646d129a9421630cb6e5ed86edb8899
2021-05-10 10:59:19 +01:00
junyulai
88b237cfb5 [SP37] Change requirement of older event callback.
Currently, vendors are asked to duplicate old events to onEvent()
and onEvent_1_1(). This is not the typically way other modules
would do. Thus, remove the requirement of duplicate events,
and replace it with only firing onEvent_1_1 when feasible.

Note no VTS is added currently, from vendor feedback, there is
no reliable way to guarantee the callbacks will be called in the
test.

Test: hidl-gen -L hash -r android.hardware:hardware/interfaces \
      android.hardware.tetheroffload.control@1.1
Bug: 149467454
Merged-In: I75c1a7788e5d48fb3e2836d54b4fd854c0247214
Change-Id: I75c1a7788e5d48fb3e2836d54b4fd854c0247214
  (cherry-picked from ag/14408065)
2021-05-10 11:37:57 +08:00
David Drysdale
e650667341 KeyMint HAL: cert dates are in milliseconds
Test: None, comment change only
Change-Id: I6251d4a0ba74d111f4c107f9a54a5c45811aa90f
2021-05-06 08:25:33 +01:00
David Drysdale
6d454d5f28 Merge changes I32ad8ad2,I86047955
* changes:
  KeyMint VTS: symmetric import test with bad keylen
  KeyMint HAL: restore getKeyCharacteristics() docs
2021-05-06 05:26:31 +00:00
Shawn Willden
aef2a7562e Merge "Added a new test case to validate AES algorithm with invalid key sizes." 2021-05-05 19:48:28 +00:00
David Drysdale
c9bc2f742d KeyMint VTS: symmetric import test with bad keylen
Test: VtsAidlKeyMintTargetTest
Change-Id: I32ad8ad2ca2b18d3279ebe77ba63b34457ab888d
2021-05-05 15:59:39 +01:00
David Drysdale
d0bc4b9e64 KeyMint HAL: restore getKeyCharacteristics() docs
Commit 40eb8f53ea ("KeyMint AIDL tweaks") removed references to
getKeyCharacteristics() in docs, as it was a KeyMaster entrypoint
that wasn't present on the KeyMint HAL.

Commit dadb18dd29 ("Add getKeyCharacteristics method to KeyMint")
added the getKeyCharacteristics() entrypoint to KeyMint, as it
turned out it was needed after all.

This commit restores references to getKeyCharacteristics() in the
Tag.aidl documentation.

Test: VtsAidlKeyMintTargetTest
Change-Id: I860479554b85f4adfeddd4eee70a09cf5265c938
2021-05-05 15:58:43 +01:00
Tommy Chiu
384c82dd14 Merge "vts: Correct the parameters on strongbox" 2021-05-05 14:08:48 +00:00
Andy Hung
66ffc5b99a Merge "StreamOut: Fix STREAM_EVENT_CBK_TYPE_CODEC_FORMAT_CHANGED" 2021-05-04 20:49:44 +00:00
Shawn Willden
da2b9ae9f8 Merge changes Ic8949e22,Ia3a6363d
* changes:
  Update DeviceUniqueAttestationTest to match spec
  Make AttestKeyTest not crash if no cert is returned.
2021-05-04 19:50:41 +00:00
Tommy Chiu
3950b45a44 vts: Correct the parameters on strongbox
If GenerateKey() with user-provide key_blob, it needs to be specified in
the following begin() operations as well. Update the test case just to
take key_blob from private member instead of creating a local one.

Note:
- Remove redudent TAG_NO_AUTH_REQUIRED in DeviceUniqueAttestationTest

Change-Id: I81860294e1e7e01a57e66e08e75507a8292ec0c3
2021-05-04 23:09:56 +08:00
David Drysdale
3368b3c6b0 Merge "More KeyMint VTS testcases" 2021-05-04 08:00:41 +00:00
Shawn Willden
ced5c2c23a Update DeviceUniqueAttestationTest to match spec
Test: VtsAidlKeyMintTargetTest
Change-Id: Ic8949e223eb7ba2445d4738dcd9b31a1d244bb46
2021-05-03 16:36:49 -06:00
Shawn Willden
c410f6fb44 Make AttestKeyTest not crash if no cert is returned.
Test: VtsAidlKeyMintTargetTest
Change-Id: Ia3a6363d854742681f684ff989b98b7cfda30746
2021-05-03 16:36:33 -06:00
Marco Nelissen
a3645d38e9 Merge "Expand Gatekeeper test" 2021-05-03 21:32:08 +00:00
Shawn Willden
cc68516bd2 Make keymaster optional.
Keymaster is now optional because KeyMint can be used instead.  This
CL makes this change retroactively back to compatibility matrix v3,
per discussion with the Treble team.

Test: Replace Keymaster with KeyMint & build
Change-Id: Id26d5bac326c494e1810516582fdd56a42c04e0d
2021-05-03 09:08:12 -06:00
Shawn Willden
c46f9da49f Merge "AttestationKey documentation" 2021-05-03 15:07:38 +00:00
Andy Hung
e6e3a17126 StreamOut: Fix STREAM_EVENT_CBK_TYPE_CODEC_FORMAT_CHANGED
Use audio_metadata_byte_string_len method in asyncEventCallback.

Test: atest metadata_tests
Bug: 186894288
Change-Id: I04914bc5b2c778002b53b8f8da5bf29fff5c80f8
2021-04-30 21:07:33 -07:00
Paul Crowley
8b25958b75 Merge "Add getKeyCharacteristics method to KeyMint" 2021-04-30 21:06:14 +00:00
Andy Hung
b76d8e27fb Merge changes from topics "dra", "dts_uhd", "earc"
* changes:
  Audio: Add AUDIO_FORMAT_DRA
  audio: Add device constants for HDMI EARC
  Audio: Add AUDIO_FORMAT_DTS_UHD
2021-04-30 20:29:48 +00:00
David Drysdale
d2cc8c2c5e More KeyMint VTS testcases
Tests for:
 - non-prime RSA exponent (fails with CF KeyMint)
 - RSA exponent value of 3
 - key size > 512 for `STRONGBOX`
 - unknown tag inclusion
 - CBC input size not block size multiple
 - challenge omitted for attestation (fails with CF KeyMint)
 - import RSA key with implicit params
 - vestigial upgradeKey test
 - importWrappedKey errors
 - importWrappedKey sids ignored
 - duplicate/missing params on begin()
 - more tests for incompatible params on begin()
 - HMAC size not multiple of 8 (fails with CF KeyMint)
 - wrong size caller IV for 3DES rejected
 - too large MIN_MAC_LENGTH for HMAC
 - invalid AES-GCM minimum MAC length values
 - check failed updateAad() cancels operation
 - check that auto-generated nonces are distinct
 - (DISABLED_) invoke destroyAttestationIds()
 - omitting optional RSA keygen tags

Also add commenting to illustrate the ASN.1 structure of hex data.

Test: VtsKeyMintAidlTargetTest
Change-Id: I4663c42671cbb094ffe8d603e0352ffa9f1dbf2e
2021-04-30 19:15:39 +01:00
Paul Crowley
dadb18dd29 Add getKeyCharacteristics method to KeyMint
(cherry picked from commit 402d62f7be)

Bug: 186685601
Test: Treehugger
Merged-In: Ie72d865a37e2b6834fe6a86bf843d30286384aa5
Change-Id: Ie72d865a37e2b6834fe6a86bf843d30286384aa5
2021-04-30 10:58:31 -07:00
David Drysdale
b5ee70f125 Merge "Test for patchlevels and too much entropy" 2021-04-30 16:38:38 +00:00
Treehugger Robot
3b2b180a29 Merge "Add more symmetric KeyMint tests" 2021-04-30 16:30:49 +00:00
Amy Zhang
ddafbe597c Merge "Allow users to switch between FE source and DVR source when testing record/descrambling/broadcast" 2021-04-30 16:21:57 +00:00
David Drysdale
07045b7e83 Merge "KeyMint AIDL tweaks" 2021-04-30 14:44:35 +00:00
David Drysdale
bb3d85eaa4 Test for patchlevels and too much entropy
Add tests for:
 - Too much entropy should be rejected with INVALID_INPUT_LENGTH
 - All authorization lists should include a vendor and boot patchlevel.

These requirements are in both the KeyMint and the KeyMaster 4.0 AIDL
specificications, but have never been policed before.

Currently disabled with a command-line flag because CF does not have
the patchlevels and so fails lots of tests.

Test: VtsKeyMintAidlTargetTest
Change-Id: Ic9622ef3f1b80e013a34059218e3e029f392eb72
2021-04-30 14:50:14 +01:00
David Drysdale
7de9febd17 Add more symmetric KeyMint tests
Also fix some test name comments along the way.

Test: VtsKeyMintAidlTargetTest
Change-Id: I828acfaa676e1b9fa2e3c6f184f9dafb936b0e82
2021-04-30 14:50:12 +01:00
David Drysdale
40eb8f53ea KeyMint AIDL tweaks
- Describe 3DES requirements
- Remove references to non-existent getKeyCharacteristics() entrypoint
- Remove references to non-existent attestKey() entrypoint
- Remove mention of asymmetric verification operations
- Remove text describing incomplete update()
- Remove text discussing padding for ECDSA
- EC keys can't encrypt/decrypt
- Force use of curve not key size for EC keys
- Drop TODO re: CBOR encoding of wrapped key
- Indicate caller-provided nonces must have correct size
- Add more reference to IKeyMintOperation
- Align parameter names with signatures
- Correct MIN_MAC_LENGTH error code
- Make CREATION_DATETIME consistently optional
- Describe use of MGF1 digest option
- Fix typos

Test: VtsKeyMintAidlTargetTest (CF)
Change-Id: Ie01b99d33be7336e872bf24a7761a3ac5b1d584c
2021-04-30 14:19:31 +01:00
Andy Hung
6ce19700eb Audio: Add AUDIO_FORMAT_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Merged-In: I941c4991e598e864babfb888a8827d1625d95990
Change-Id: I941c4991e598e864babfb888a8827d1625d95990
2021-04-29 19:07:10 -07:00
Andy Hung
1f90e1fbf8 audio: Add device constants for HDMI EARC
Implementation check by grep -E -r  "HDMI_ARC|HDMI_EARC" .

Test: atest AudioDeviceInfoTest
Bug: 131385398
Bug: 151781316
Merged-In: Idfe27b468a9f09770a31b6b58d83de77bebc6c80
Change-Id: Idfe27b468a9f09770a31b6b58d83de77bebc6c80
2021-04-29 18:49:43 -07:00
Andy Hung
3c5fcc51f5 Audio: Add AUDIO_FORMAT_DTS_UHD
See ETSI TS 103 491 V1.2.1 (2019-05)
DTS-UHD Audio Format; Delivery of Channels,
Objects and Ambisonic Sound Fields

Test: atest AudioFormatTest
Bug: 184538197
Merged-In: I4123efb29a95a599982af85068f8e4468ff15159
Change-Id: I4123efb29a95a599982af85068f8e4468ff15159
2021-04-29 17:55:16 -07:00
Amy Zhang
63f4175b6e Allow users to switch between FE source and DVR source when testing
record/descrambling/broadcast

Test: atest VtsHalTvTunerV1_0TargetTest
Test: atest VtsHalTvTunerV1_1TargetTest
Bug: 182519645
CTS-Coverage-Bug: 184077478
Change-Id: I6c57657ac3539d6a6fb3f63d2ecc9af7f6b9e2dc
Merged-In: I6c57657ac3539d6a6fb3f63d2ecc9af7f6b9e2dc
2021-04-28 20:25:36 -07:00
Steven Moreland
2668e4bc46 Merge "Freeze HALs for Android S" 2021-04-28 17:28:42 +00:00
Jooyung Han
b4be35f854 Merge "aidl: Suppress warnings on out-array" 2021-04-27 22:47:15 +00:00
Jooyung Han
a886a5c4be Merge changes from topic "fix-aidl-warnings"
* changes:
  aidl: Set explicit default values
  aidl: Set explicit default values
  aidl: Set explicit default values for enum-type fields
  aidl: Set explicit defaults to enum-type fields
2021-04-27 22:46:40 +00:00
Treehugger Robot
af3b58e35a Merge "Add attestation format documentation" 2021-04-27 20:40:50 +00:00
Steven Moreland
d116916ba2 Freeze HALs for Android S
Bug: 178221726
Test: none
Change-Id: If18355915c40e8d47c721c1e373efb95db4dcdfa
Merged-In: I77ee02664242827d9aa96c985764cfc109c52b84
2021-04-27 18:18:03 +00:00
David Drysdale
5cde787c9f Merge "Align KeyMint AIDL with usage" 2021-04-27 16:43:01 +00:00
Shawn Willden
8691e58bd1 AttestationKey documentation
Test: N/A, only added documentation
Change-Id: I41ed99c385c99511e8a9a19a5aa7aec180ee41ac
2021-04-27 09:22:25 -06:00
Shawn Willden
3cb64a6822 Add attestation format documentation
Somehow the attestation format docs got dropped from KeyMint in the
transition from Keymaster.  This replaces them, and also clarifies
that KeyMint StrongBox should not support device attestation.

Test: VtsAidlKeyMintTargetTest
Change-Id: I2334e99b4797c7a0e2e59727ffa730cf7504df31
2021-04-27 09:22:25 -06:00
Jooyung Han
386e55b616 aidl: Set explicit default values
Fixes: 179853698
Test: mma in hardware/interfaces/vibrator
Change-Id: I231c3cfb17f812944bcc6a88e618d96d7068f6c2
2021-04-27 20:11:54 +09:00
Jooyung Han
9c3ebfc83f aidl: Set explicit default values
This fixes warnings in AIDL files(-Wenum-explicit-default).

No semantic changes. (Explicit values are all zero enumerators.)

Fixes: 179853367
Test: mma in hardware/interfaces/keymaster
Change-Id: If5a70da3efd05a344c39ef1d2e73b7ec2b894f33
2021-04-27 18:33:17 +09:00
Jooyung Han
3a966323ef aidl: Set explicit default values for enum-type fields
Fixes: 179853674
Test: mma in hardware/interfaces/neuralnetworks
Change-Id: I9fdc7089eaf1202299da098220875ef8398667fe
2021-04-27 13:58:46 +09:00
Jooyung Han
695ef7acfe aidl: Set explicit defaults to enum-type fields
Fixes: 179853398
Test: mma in hardware/interfaces/graphics
Change-Id: I6f93bca4ba3c8d538765fc9a811b9050c6142cc3
2021-04-27 12:17:39 +09:00
Jooyung Han
d63cd3fff6 aidl: Suppress warnings on out-array
out-param arrays are considered harmful since the Java backend requires
them to be correctly allocated at caller site. But the only user of
android.hardware.identity is in C++, we can just ignore them.

Fixes: 179853403
Test: mma in hardware/interfaces/identity
Change-Id: Ib9b7ad895b3827c0888869a5b154696e3aff5624
2021-04-27 10:51:57 +09:00