Commit graph

59348 commits

Author SHA1 Message Date
David Drysdale
30196cf77c KeyMint: default to Rust reference implementation
Copy code that can be re-used from the Cuttlefish KeyMint
implementation, specifically from the following directories
under device/google/cuttlefish:

- HAL-side code from guest/hals/keymint/rust/
- TA-side code from host/commands/secure_env/rust/

Create a corresponding pair of libkmr_{hal,ta}_nonsecure libraries here.
The only changes to the copied code are:

- Convert `pub(crate)` to `pub` in `attest.rs`.
- Add some missing doc comments.
- Add comment noting need for SELinux permission to read ro.serialno.
- Add comment noting need for clock to be in sync with Gatekeeper.

(A subsequent CL aosp/2852598 adjusts Cuttlefish so that it uses the
copied modules here, and can remove the original copies.)

In addition to the moved code, the default implementation also needs
a new implementation of a monotonic clock, added here in clock.rs
using `std::time::Instant`.

With the new nonsecure HAL and TA libraries in place, implement the
default KeyMint HAL service using the former, and spin up a single
thread running a nonsecure TA using the latter.  Communicate between
the two via a pair of mpsc::channel()s.

Test: VtsAidlKeyMintTargetTest with normal Cuttlefish (all pass)
Test: VtsAidlKeyMintTargetTest with default/nonsecure impl (auth
      tests fail, but this is expected as Gatekeeper hasn't moved)
Bug: 314513765
Change-Id: Ia450e9a8f2dc530f79e8d74d7ce65f7d67ea129f
2024-03-01 07:20:57 +00:00
David Drysdale
e61433d1e0 KeyMint: use a smaller invalid IMEI value am: 8351f33b2b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2977372

Change-Id: Ifa35dcefaf6d68c229dca79e02a9b2d24bd95287
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-28 06:25:11 +00:00
Shikha Panwar
d7f594dc4d Merge "Sk VTS: Identity of Secretkeeper is same as in DT" into main 2024-02-27 14:31:59 +00:00
David Drysdale
8351f33b2b 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)
2024-02-27 10:13:15 +00:00
Treehugger Robot
5c7dd08f12 Merge "Fixed issue converting Asn1 time to posix on 32-bit systems." into main 2024-02-27 06:38:05 +00:00
Shunkai Yao
759c9cb28b Spatializer: return supportedChannelLayout as part of parameter
Bug: 307368176
Test: atest EffectsFactoryHalInterfaceTest
Change-Id: I1a2a445b5c94cbd02acb4160c7f54d6733bff6aa
2024-02-26 21:49:09 +00:00
Subrahmanya Manikanta Venkateswarlu Bhamidipati Kameswara Sri
b66a37a8e2 Fixed issue converting Asn1 time to posix on 32-bit systems.
Used ASN1_TIME_to_posix API instead of ASN1_TIME_to_time_t
to avoid integer overflow on 32-bit systems.

Bug: 325853206
Test: vts -m VtsAidlKeyMintTarget
Change-Id: I7a01a521d389482a61ad9974b7e40eaa099c3571
2024-02-26 19:23:44 +00:00
Mikhail Naganov
e00f10e0a5 Merge "audio: Remove audio effects config from audio HAL VAPEX" into main 2024-02-23 18:18:39 +00:00
Yu-Han Yang
7bff0ebe01 Allow multiple registered GNSS HALs am: 3344506a78 am: 653221fa8e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2962603

Change-Id: I4279f2bd795a31deb55a1ff68a8242be480518e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 22:10:33 +00:00
Shikha Panwar
0d286b3867 Sk VTS: Identity of Secretkeeper is same as in DT
Secretkeeper is expected to advertize its public key to Android via
Device tree node at /avf/reference/avf/ Check that the identity used
during AutGraph key exchange protocol with client is indeed this.

Test: #secretkeeper_check_identity on device with Sk/default instance
enabled
Bug: 291213394

Change-Id: I08815d75410fdd0c76d675c7cc9521abe0cda98b
2024-02-22 22:06:20 +00:00
Yu-Han Yang
653221fa8e Allow multiple registered GNSS HALs am: 3344506a78
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2962603

Change-Id: Ib6d0d5bd134ac5b2f7992637fb1495544853db1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 21:47:19 +00:00
Mikhail Naganov
4fbb997e17 Merge "Volume Control: Add tests to validate Volume Control Effect" into main 2024-02-22 02:17:54 +00:00
Mikhail Naganov
07bbadb3e3 audio: Remove audio effects config from audio HAL VAPEX
The audio effects HAL config can vary between different
CF "flavors" and thus must not belong to VAPEX. This is
consistent with handling of audio policy configuration files.

Bug: 318423731
Test: run `atest audioeffect_tests` on cf_x86_64_auto-trunk_staging-userdebug
Change-Id: I0f4ee9a44a3426934f6a055fc8c9ce74a8db78fc
2024-02-21 16:28:35 -08:00
Weston Carvalho
7f20fbe400 Merge "Create Secure Storage AIDL interface" into main 2024-02-21 21:28:27 +00:00
Sneha Patil
93e4eb5487 Volume Control: Add tests to validate Volume Control Effect
Added test to apply level, mute and unmute input.
Added test to verify decreasing volume levels.

Bug: 305866207
Test: atest VtsHalVolumeTargetTest
Change-Id: Ie105a3bb77255da61719d042cbd5abc23c405d93
2024-02-21 18:11:29 +05:30
Yuyang Huang
cc7c85168d [automerger skipped] Update VTS to exempt low-power TVs from APF am: 1abfda2def -s ours
am skip reason: Merged-In Ifec617520db20d1ef61f1eca63b7160d9191f446 with SHA-1 9f215110bf is already in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2968162

Change-Id: Iff89de6cef5511d27b32ca4a3431c387721d13b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-21 00:49:46 +00:00
Eric Biggers
8c7558625f Merge "keymint: document deprecation of UNLOCKED_DEVICE_REQUIRED enforcement" into main 2024-02-20 18:42:20 +00:00
Treehugger Robot
74d99edac1 Merge "Fix test run for GSI" into main 2024-02-19 05:29:23 +00:00
Yuyang Huang
1abfda2def Update VTS to exempt low-power TVs from APF
This change updates the VTS to exempt TV devices that consume <= 2W of
standby power from APF requirements. This update aligns with latest GTVS
policy.

Bug: 306587099
Test: TH
(cherry picked from https://android-review.googlesource.com/q/commit:9f215110bf524e3bf1d2fb591a724623e11423bc)
Merged-In: Ifec617520db20d1ef61f1eca63b7160d9191f446
Change-Id: Ifec617520db20d1ef61f1eca63b7160d9191f446
2024-02-18 01:19:56 +00:00
Yuyang Huang
37ad71f3ce Merge "Update VTS to exempt low-power TVs from APF" into main 2024-02-17 00:33:43 +00:00
Eric Biggers
df32f52a47 keymint: document deprecation of UNLOCKED_DEVICE_REQUIRED enforcement
KeyMint enforcement of UNLOCKED_DEVICE_REQUIRED is broken, has never
been used, and cannot be fixed.  So, document that it does not need to
be implemented.  Also remove the VTS test for it, which was disabled.

UNLOCKED_DEVICE_REQUIRED remains supported in Keystore.

Bug: 321100166
Test: Build
Change-Id: If4d47ee49c9d4a595820cfceb0f5f3027f99ee9f
2024-02-16 20:28:17 +00:00
Jooyung Han
f6b4016c32 Merge "Use new API to load mapper" into main 2024-02-14 22:20:35 +00:00
Yu-Han Yang
3344506a78 Allow multiple registered GNSS HALs
Bug: 325210998
Change-Id: I1c5e4e37059b6159ffaff310d2d0dd588d35fd7c
Test: atest VtsHalGnssV1_1TargetTest
2024-02-14 22:11:23 +00:00
Weston Carvalho
b8d8740cdf Create Secure Storage AIDL interface
Test: mmm hardware/interfaces/staging/security/see/storage/aidl/
Bug: 278779487
Change-Id: I1aceb7fffcd9e8b60228d232cf1b610a07754ac0
2024-02-14 11:38:58 -06:00
Jooyung Han
4784c0b0b3 Use new API to load mapper
AServiceManager_getDeclaredPassthroughHal() can replace
android_load_sphal_library().

Bug: 316051788
Test: VtsHalGraphicsAllocatorAidl_TargetTest
Change-Id: I50021790693c3ec2bce8cb4af96b0d6ee276b2e7
2024-02-14 09:48:00 +09:00
Treehugger Robot
6a5da15033 Merge "Use new API to load mapper" into main 2024-02-14 00:46:11 +00:00
Yuyang Huang
9f215110bf Update VTS to exempt low-power TVs from APF
This change updates the VTS to exempt TV devices that consume <= 2W of
standby power from APF requirements. This update aligns with latest GTVS
policy.

Bug: 306587099
Test: TH
Change-Id: Ifec617520db20d1ef61f1eca63b7160d9191f446
2024-02-14 08:58:53 +09:00
Ryan Prichard
600b93a0c2 Merge changes Ic373e0a3,Icb3937d8 into main
* changes:
  Replace std::basic_string_view<uint8_t> with std::span
  Replace std::basic_string<uint8_t> with std::vector
2024-02-13 17:32:52 +00:00
Shunkai Yao
ac270bcbe2 Merge "Effect AIDL: add Spatializer default implementation to Cuttlefish" into main 2024-02-13 17:06:18 +00:00
Jooyung Han
0425704133 Use new API to load mapper
AServiceManager_getDeclaredPassthroughHal() can replace
android_load_sphal_library().

Bug: 325018681
Test: VtsHalGraphicsMapperStableC_TargetTest
Change-Id: I004355a9df8bd1ba4f9fb00149d7fddb9ac9f499
2024-02-13 21:37:47 +09:00
Ryan Prichard
01cf20d711 Replace std::basic_string_view<uint8_t> with std::span
In newer versions of libc++, std::char_traits<T> is no longer defined
for non-character types, and a result, std::basic_string_view<uint8_t>
is also no longer defined. See
https://discourse.llvm.org/t/deprecating-std-string-t-for-non-character-t/66779.

Bug: 175635923
Test: libkeymint_remote_prov_support_test
Change-Id: Ic373e0a3c081b996d4c81a9783103ae6406833f7
2024-02-12 20:34:20 -08:00
Ryan Prichard
aecb0333b0 Replace std::basic_string<uint8_t> with std::vector
In newer versions of libc++, std::char_traits<T> is no longer defined
for non-character types, and a result, std::basic_string<uint8_t> is
also no longer defined. See
https://discourse.llvm.org/t/deprecating-std-string-t-for-non-character-t/66779.

Bug: 175635923
Test: make checkbuild
Change-Id: Icb3937d8b1ff6dbe7e35e62f2e6cc1e2eb789121
2024-02-12 20:15:47 -08:00
Shunkai Yao
c7f5c2dd83 Effect AIDL: add Spatializer default implementation to Cuttlefish
Bug: 273373363
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ib49d62c61de831c8147c935799d22be78950488f
2024-02-13 02:11:12 +00:00
Henri Chataing
7f9c47a388 blueooth/audio/aidl/default: Disable GetProviderInfo
This implementation of the HAL is used by pixel devices.
The implementation of GetProviderInfo is test only

Bug: 324570010
Test: TreeHugger
Change-Id: I67d17fb07c1288317290a0b1c4b07cd3be1e48c6
2024-02-12 18:24:51 +00:00
Subrahmanyaman
e1560216fe Test to validate a range of certificate validity times.
Bug: 280624515
Test: run VtsAidlKeyMintTarget
Change-Id: Id315c28e2ea114c5c39e235d3ee6be2a0d8bfa71
2024-02-12 15:25:53 +00:00
Devin Moore
e2955b27df Merge "Remove HIDL media.c2 from the 202404 FCM" into main 2024-02-09 19:55:42 +00:00
Devin Moore
275fc31337 Merge changes If8f281ec,Id711ba79 into main
* changes:
  bump.py remove Level.h dependency
  Update bump.py for Trunk Stable
2024-02-09 16:23:44 +00:00
Devin Moore
f094d4e363 Remove HIDL media.c2 from the 202404 FCM
HIDL is no longer supported in devices targeting 202404 vendor
interface.

This removes the tmp FCM fragment that was being used to declare the
media.c2 HIDL dependency.

Test: m && launch_cvd
Bug: 218588089
Change-Id: I40973f5cdc9f4c9ca891929c8e8f865119322c17
2024-02-09 00:29:25 +00:00
Devin Moore
0425916b68 bump.py remove Level.h dependency
We want to run bump.py during finalization. We don't want to have to
update Level.h and the VTS tests that early.
So this CL removes the dependency on Level.h and requires the
current/next letters of the API levels for the kernerl configs to be
passed as arguments.

Test: bump.py 202404 202505 v w
Bug: 279809333
Change-Id: If8f281eccf62d380949a5ea9f5d0d3bb2d7f19ab
2024-02-09 00:27:32 +00:00
Devin Moore
4be20f792a Update bump.py for Trunk Stable
The next year's compatbility matrix is added to a conditional statement
so it's only available on in-development release configurations.

The curent year's compatibility matrix is moved from the conditional
statement to always be added to all release configs.

The next year's compatibility matrix level is set to the next year's
level after copying the current matrix file.

Test: ./bump.py
Bug: 279809333

Change-Id: Id711ba79110c8775f715eddf37a9bf51b073ec91
2024-02-09 00:27:29 +00:00
Yu Shan
1652bf307c Merge "Create EmuMetadataGenerator to check meta.json." into main 2024-02-07 23:10:54 +00:00
Yu Shan
e6fd48d078 Create EmuMetadataGenerator to check meta.json.
Create EmuMetadataGenerator to convert AIDL generated java files
to meta.json that can be used by emulator to populate the available
vhal props list.

Added build rules to generate the Java files from AIDL files and
check whether the meta.json file needs to be updated.

Test: make sdk_car_x86_64-trunk_staging-userdebug target
Bug: 318747444
Change-Id: Ib3bc7b68a1312152617fdab4598ed389447c20cd
Merged-In: Ib3bc7b68a1312152617fdab4598ed389447c20cd
2024-02-07 22:06:58 +00:00
Jeffrey Vander Stoep
919723a5bd Merge "Replace use of deprecated logging functions" into main 2024-02-07 17:57:53 +00:00
Jeff Vander Stoep
116a4d893c Replace use of deprecated logging functions
This is needed to upgrade the android_logger crate from 0.12.0
to 0.13.3.

with_max_level provides the same functionality as with_min_level.
The renaming is admittedly confusing, but the new name is accurate
and it makes sense that they deprecated and then removed the
previously poorly named with_min_level.

See crate documentation [1] and code [2].

[1]: https://docs.rs/android_logger/0.12.0/android_logger/struct.Config.html#method.with_min_level
[2]: https://docs.rs/android_logger/0.12.0/src/android_logger/lib.rs.html#227

Bug: 322718401
Test: build and run CF with the change.
Test: m aosp_cf_x86_64_phone
Change-Id: Ie410d871ccc2a083eec5bcb7e805f52b985b9385
2024-02-07 12:55:53 +01:00
Yahav Nussbaum
e2f62e73f4 Merge "Test that the Bluetooth Finder property is set." into main 2024-02-07 06:45:05 +00:00
Treehugger Robot
27e97308c4 Merge "[DON'T BLOCK] Test ownership migration rules" into main 2024-02-07 00:55:34 +00:00
Shunkai Yao
3ed9b6bbce Merge "Add backward compatibility in effect hal default implementation" into main 2024-02-06 18:23:57 +00:00
Treehugger Robot
f30ab93e89 [automerger skipped] Merge "[DO NOT MERGE] vts: Fix for setProp in VtsHalAutomotiveVehicleV2_0TargetTest" into android12L-tests-dev am: 1f3bee1191 -s ours am: 85e1f5e409 -s ours am: 1d95f15155 -s ours
am skip reason: contains skip directive

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2904808

Change-Id: If601756ff9631c6a3afad0bc2a5056ffa244ba0e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-06 07:02:48 +00:00
Kevin Karl
f61348cffb [automerger skipped] [DO NOT MERGE] vts: Fix for setProp in VtsHalAutomotiveVehicleV2_0TargetTest am: 29a9a9ccfd -s ours am: 8824d06406 -s ours am: 145c1fbd21 -s ours
am skip reason: contains skip directive

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2904808

Change-Id: I5c3b64d5f640a52ab7b9d133bbf3b818c31e7181
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-06 07:02:43 +00:00
Treehugger Robot
1d95f15155 [automerger skipped] Merge "[DO NOT MERGE] vts: Fix for setProp in VtsHalAutomotiveVehicleV2_0TargetTest" into android12L-tests-dev am: 1f3bee1191 -s ours am: 85e1f5e409 -s ours
am skip reason: contains skip directive

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2904808

Change-Id: I1d971445353976b1b49757b89a0067646c67b9dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-06 06:18:15 +00:00