Commit graph

1026 commits

Author SHA1 Message Date
Ryan Prichard
53d58a2c92 Merge changes Ic373e0a3,Icb3937d8 into main am: 600b93a0c2 am: 9705248d2a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2960244

Change-Id: I793cf4325820cd8680887b8716f39d8e89c699fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-13 18:31:25 +00: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
Subrahmanyaman
3c4d434513 Test to validate a range of certificate validity times. am: e1560216fe am: 649c660d2b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2583372

Change-Id: I7bc6e9796f0107dea8f7f76872be567b84822ea3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-12 16:57:58 +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
Treehugger Robot
c78f9f21f6 Merge "[DON'T BLOCK] Test ownership migration rules" into main am: 27e97308c4 am: 74dc4cc5d7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2950589

Change-Id: I9a26bb26763d77e109f1d911d0ea7c95f632703f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-07 02:26:27 +00:00
Aditya Choudhary
ad2ba1b851 [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
Change-Id: Ic8c4bd6ac246e7efa98bbdaf822d12ae8e1230a5
2024-02-05 15:45:22 +00:00
Treehugger Robot
d99d31ff73 Merge "Replace use of deprecated logging functions" into main am: 17aa36a60d am: 213e8375d4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2939519

Change-Id: Ib59bc363c6905fe876b8413bf1d9321f18d1de5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 22:25:50 +00:00
Shikha Panwar
d9db8bfe7e Merge "Expand DICE chain in VTS/test to contain arrays" into main am: 36e66b72fe am: ed58fe2f58
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2927630

Change-Id: Ice925eaef907edee8bc06b977828cd7a8d025ddf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 22:23:44 +00:00
Treehugger Robot
17aa36a60d Merge "Replace use of deprecated logging functions" into main 2024-02-01 17:36:36 +00:00
Shikha Panwar
36e66b72fe Merge "Expand DICE chain in VTS/test to contain arrays" into main 2024-02-01 16:06:36 +00:00
Shikha Panwar
9e15e5e01e Expand DICE chain in VTS/test to contain arrays
Include a list of subcomponents in AVB DiceChainEntry in the sample DICE
chain and include constraints on that in the sealing_policy.

Bug: 291238565
Test: VTS#secret_management_policy_gate
Change-Id: Id36ddf137bacf99c273b61c3136691426f2d5b34
2024-02-01 13:15:36 +00:00
Jeff Vander Stoep
e8934d0991 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: I0ca9596433967be70e9d55acb6cfbf9322741bf8
2024-01-31 10:49:31 +01:00
David Drysdale
2e49089f61 Merge "Secretkeeper: test sealing policy update" into main am: c97055b9b6 am: 4c9290c911
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2932990

Change-Id: I1cf6b74b7b3ea2274b6c0f9abac9f3f27e1756b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 09:07:19 +00:00
David Drysdale
c97055b9b6 Merge "Secretkeeper: test sealing policy update" into main 2024-01-30 07:46:46 +00:00
David Drysdale
5498cfa85a Secretkeeper: test sealing policy update
Test: VtsSecretkeeperTargetTest
Change-Id: Ib1d60dc2f80aa8b02011506af7e5c310ad92573a
2024-01-29 17:29:04 +00:00
Treehugger Robot
57d1c45933 Merge "Sk VTS: Use libdice_policy_builder" into main am: 9ef5917d40 am: 4800ac0ad8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2918646

Change-Id: I67dedda9b08cd350faa5636ea02170ceb70477ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-27 19:12:39 +00:00
Treehugger Robot
9ef5917d40 Merge "Sk VTS: Use libdice_policy_builder" into main 2024-01-27 17:52:53 +00:00
David Drysdale
da1791272f Merge "KeyMint: show vbmeta digest values on mismatch" into main am: 88da778d2a am: 34ea1a81cd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2927217

Change-Id: Ia65a586313f852e2530a3b15f48a470c6d1f985d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 14:26:16 +00:00
David Drysdale
88da778d2a Merge "KeyMint: show vbmeta digest values on mismatch" into main 2024-01-25 13:01:53 +00:00
David Drysdale
0ab3d97350 KeyMint: show vbmeta digest values on mismatch
Bug: 314044749
Test: VtsAidlKeyMintTargetTest
Change-Id: I0db1af44445fd5c73517a82eec9f3208fd305b21
2024-01-25 11:32:17 +00:00
David Drysdale
50d605f8a1 Merge "KeyMint: test HAL version matches feature" into main am: 922a49f278 am: 87e3ce175c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2923274

Change-Id: Iaba22e15a8318c4a28a38de93dd9d9c8226461f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 13:07:57 +00:00
David Drysdale
922a49f278 Merge "KeyMint: test HAL version matches feature" into main 2024-01-24 11:54:13 +00:00
Shikha Panwar
9eab79b8c9 Sk VTS: Use libdice_policy_builder
With libdice_policy being refactored, get VTS to use the builder
library.

Test: Built the test-suite
Bug: 291238565
Change-Id: I149ec1ba9ee66fd19cbf0d0a6f3baa12ea2474ed
2024-01-24 11:24:05 +00:00
Seth Moore
655a0654f3 Fix incorrect code comment about keymint version am: ec10c484b7 am: 1ab8951974
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2925130

Change-Id: I6db7fe4d7168927706656f681df60b047cb5c20b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-23 23:20:05 +00:00
Seth Moore
ec10c484b7 Fix incorrect code comment about keymint version
Test: No test, just a comment change
Bug: 321632558
Change-Id: I7f5db4959dd9e3bc598fa2939121f37b3f0abb04
2024-01-23 20:37:52 +00:00
David Drysdale
6c9bdb839f KeyMint: test HAL version matches feature
Test: VtsAidlKeyMintTargetTest
Bug: 304309651
Change-Id: I7e38c2ab3ff4f6b5f9035af865ca5ebe6ff24cc1
2024-01-23 10:05:55 +00:00
David Drysdale
45724c24fb Secretkeeper: add test CLI am: b95093d640 am: bf5f86baba
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2906876

Change-Id: Id32a621805667942f821a48ff769d785c884a67e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 13:03:40 +00:00
Andrew Walbran
a2ac0cc88f Merge "Import macros via rdroidtest for consistency." into main am: 787be21ae8 am: 22e75cd42a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2910957

Change-Id: If2ca7366767f10f72be4fc41843b98e678771ba3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 11:57:26 +00:00
David Drysdale
b95093d640 Secretkeeper: add test CLI
Allows testing of secret persistence across reboot (and non-persistence
across factory reset).

Move some test code into a library for re-use.

Test: Manual
Change-Id: I23772692d2de652f6d4a8e5659186bd9c1c06b72
2024-01-17 10:44:19 +00:00
Shikha Panwar
206a12d04e VTS to use enum for MissingAction am: 84187967cb am: 37813dbd44
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2909582

Change-Id: I11ab91c91378f51c837723df1250db8ab6604b44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-16 19:24:20 +00:00
Andrew Walbran
48391231a2 Import macros via rdroidtest for consistency.
This is what we recommend in the documentation.

Test: atest VtsSecretkeeperTargetTest
Change-Id: I9155e8b0f8c58547cb63dd40cdbf9e2e39648d9c
2024-01-16 16:48:31 +00:00
Shikha Panwar
84187967cb VTS to use enum for MissingAction
ConstraintSpec constructor will take enum instead of boolean for missing
action.

Test: atest VtsSecretkeeperTargetTest
Bug: 291213394
Change-Id: I55fb0d8ef1fccca5feedf1fd368854ffb7eafaaf
2024-01-15 13:04:35 +00:00
Shikha Panwar
1a06e22081 Merge "Sk VTS: Policy gating & Out of Seq req rejection" into main am: c6cf62d113 am: d3ae4e4258 am: 958b0e4038
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2904307

Change-Id: Ibef4a996a37777b3f15747fa5aaf6cf3f14477b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 19:02:48 +00:00
Shikha Panwar
1bfbe74dda Merge "Secretkeeper: VTS to use dice_chain as identity" into main am: 6d5bb1eeaf am: 6710a7b129 am: 56dd940b20
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2896100

Change-Id: Ifde5cea18769c29fcf74daf6993bdead46941c0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 19:01:58 +00:00
Shikha Panwar
c6cf62d113 Merge "Sk VTS: Policy gating & Out of Seq req rejection" into main 2024-01-12 16:49:49 +00:00
Shikha Panwar
6d5bb1eeaf Merge "Secretkeeper: VTS to use dice_chain as identity" into main 2024-01-12 16:49:09 +00:00
Shikha Panwar
9770cae664 Merge "InitialPayload of ExplicitKeyDiceCertChain" into main am: 62b6504c33 am: 8a262b2975 am: e490437a14
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2906515

Change-Id: Ic07de65fcc4d6e9d4f28b4c2774275e10725b519
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 13:54:20 +00:00
Shikha Panwar
62b6504c33 Merge "InitialPayload of ExplicitKeyDiceCertChain" into main 2024-01-12 10:46:21 +00:00
Shikha Panwar
bf77b25594 Merge "VTS: Use encoding of policy on explicit key dice" into main am: 91fd13d579 am: 67755270ad am: 00a303d351
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2890552

Change-Id: I0ccbb70e110f3407f2ae04a686dd53949a160815
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 10:25:47 +00:00
Shikha Panwar
8a3a29dd5a Sk VTS: Policy gating & Out of Seq req rejection
1. Add a test to check Access control in Secretkeeper HAL: Construct
   dice chains with different security version and check that the secret
   is accessible with upgraded dice chain && DicePolicyError is thrown
   when the access is requested using a dice chain with lower security
   version.

2. Re-enable test #replay_protection_out_of_seq_req_not_accepted - This
   was disabled because the method would not panic when run on
   devices without Sk HAL, causing test failure. Refactor the test to
   check the error instead of unwrapping.

Many methods of SkClient struct are refactored to return Error (also
introduced in this patch) instead of panicking on error.

Test: atest VtsSecretkeeperTargetTest
Bug: 291224769
Bug: 317416663
Change-Id: I646783e034064f81625a978a2bcacf143ff60c87
2024-01-12 09:51:08 +00:00
Shikha Panwar
fc0dbfee70 InitialPayload of ExplicitKeyDiceCertChain
Change the spec for DiceCertChainInitialPayload, removing the map &
directly equating it to bstr .cbor PubKey. Also mandate it to stick to
Core Deterministic Encoding Requirements. The deterministic encoding is
essential to ensure DicePolicies can be applied on the root key.

Test: Builds
Bug: 319613231
Change-Id: I5e12ecbcbae84ae608d784a12f8ae4afc49b5a9d
2024-01-12 06:32:08 +00:00
Treehugger Robot
cadbe176ec Merge "Baseline NewApi issues" into main 2024-01-11 18:54:37 +00:00
Shikha Panwar
7c53bb3144 Secretkeeper: VTS to use dice_chain as identity
VTS (being the client of Sk) will use dice_chain as the identity.
Consequently we can use the sealing policy constructed out of this
identity & no more need to use HYPOTHETICAL_DICE_POLICY hack.

For sample identity, we create dice_sample module which constructs an
example dice chain (in Explicit key chain format), along with secrets.

Test: Secretkeeper VTS
Bug: 291224769
Change-Id: Ia1d1a92391d3ee455bf9fe254770b4a9bd08cb12
2024-01-11 09:01:51 +00:00
Cole Faust
2424cc007d Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
Change-Id: I3e4bcd76bad422513d48712303ce5c857511d9be
2024-01-10 12:30:37 -08:00
Shikha Panwar
1eae7abfaa VTS: Use encoding of policy on explicit key dice
As we make Dice policy work with explicit key format of dice chain, the
hard coded policy needs to change to be compatible with hard coded
explicit key chain in the TA.

Test: VTS
Bug: 291213394
Change-Id: Ib3740d8f12f0a5f4e680bd215170bc96596fbe06
2024-01-10 15:59:42 +00:00
David Drysdale
388597703e Secretkeeper: use Ed25519 identity key
Test: VtsSecretkeeperTargetTest
Change-Id: I27aebb8913c34f043b7ccc7b6e23969377313e1e
2024-01-09 17:52:15 +00:00
David Drysdale
099c876e9c Secretkeeper: move VTS to rdroidtest
Use rdroidtest for running tests as it now supports parameterized
tests (aosp/2885268) and has an attribute macro (aosp/2890086).

Also rustfmt.

Test: VtsSecretkeeperTargetTest
Change-Id: I9570a7f33a6ff7dbf7cb7238fa3770dedb990e8c
2024-01-08 15:17:48 +00:00
David Drysdale
77a86d8dae KeyMint VTS: fix flipped error messages
Also make main() shorter by `using`.

Bug: 317693523
Test: VtsAidlKeyMintTargetTest
Change-Id: Ife6048001a003e387927338dfcf7a4b2293576c7
2024-01-03 11:30:22 +00:00
Treehugger Robot
78b266ba5a Merge "Secretkeeper: Disable a replay protection VTS" into main 2023-12-22 11:46:34 +00:00
Shikha Panwar
ebeaa36f43 Secretkeeper: Disable a replay protection VTS
This test does not account for potentially missing Sk HAL. Ideally, the
test should pass on those devices too (since Sk is an optional HAL at
the moment).

This test uses should_panic expecting the client code to panic on
processing the message, but that code is never executed because the
backend is not present & the method doesn't panic & the test fails.

As a mitigation, #ignore the test.

Bug: 317416663
Test: VTS show "IGNORED"

Change-Id: I2f1bb45361943f22d8cadc929059c65cb3120f3f
2023-12-22 10:51:08 +00:00