Commit graph

482 commits

Author SHA1 Message Date
Shawn Willden
e21ce63ba6 Update KM4.1 owners
Change-Id: Ib7e0d3aead2a220c8161d7b4af471116f9ffa93f
2021-01-08 15:57:56 +00:00
Treehugger Robot
1aeea8c95b Merge "Delete keymaster0" am: 02cdce19c1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1515113

Change-Id: I3ed294c69ce86a036110fb5c5a95fb6f5737ac07
2020-12-07 03:22:47 +00:00
Shawn Willden
7751d10d7f Delete keymaster0
Test: Build
Change-Id: I2ffb10978af9add7792faff0675bd013d96b35b8
2020-12-04 11:53:06 -07:00
Xin Li
c026d3a0b6 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: If5afd00334e8b09250df1ae97dec9285e39ad930
Change-Id: Ic66bb1389f1bbecfdaa641e1fcdbf79044f55d23
2020-12-02 00:32:27 -08:00
Steven Moreland
28f2549765 HIDL HALs mark sensitive data
For extra precautious transaction clearing.

Bug: 171501998
Test: hidl_test + inspecting output
Change-Id: I813dc3dd6c85ad0e86c6b8c116b7a207517dd12e
2020-11-20 21:16:16 +00:00
Treehugger Robot
d47c62b62a Merge "identity: Fix attestation and documentation problems." 2020-11-19 15:52:21 +00:00
David Zeuthen
34abaaefcb identity: Fix attestation and documentation problems.
- The docs said that IdentityCredential.createEphemeralKey() returned
  data encoded PKCS#8 which is wrong. It's supposed to be in DER format
  which is also what the VTS tests and credstore expects.

- Clarify that createEphemeralKeyPair(), setReaderEphemeralPublicKey(),
  and createAuthChallenge() are all optional.

- Avoid passing an invalid profile ID in the IdentityCredentialTests.
  verifyOneProfileAndEntryPass test.

- Update requirements for which tags must be present in the attestation
  for CredentialKey as well as the requirements on expiration date and
  the issuer name.  Update default implementation to satisfy these
  requirements. Update VTS tests to carefully verify these requrements
  are met.

- Clarify requirements for X.509 cert for AuthenticationKey. Add VTS
  test to verify.

- Mandate that TAG_IDENTITY_CREDENTIAL_KEY must not be set for test
  credentials. Add VTS test to verify this.

- Make default implementation pretend to be implemented in a trusted
  environment and streamline VTS tests to not special-case for the
  default implementation.

- Switch to using the attestation extension parser from the KM 4.1
  support library instead of the one from system/keymaster. The latter
  one did not support the latest attestation extension and thus would
  fail for pretty much anything that wasn't the default HAL impl.

- Fix a couple of bugs in keymaster::V4_1::parse_attestation_record():
  - Report root_of_trust.security_level
  - Add support for Tag::IDENTITY_CREDENTIAL_KEY

- Fix how EMacKey is calculated.

- Add test vectors to verify how EMacKey and DeviceMac is calculated.

Test: atest VtsHalIdentityTargetTest
Test: atest android.security.identity.cts
Bug: 171745570
Change-Id: I2f8bd772de078556733f769cec2021918d1d7de6
2020-11-17 13:44:00 -05:00
Selene Huang
31ab404a5e Implement keymint V1 aidl interfaces, service module, and vts tests.
Bug: b/160968242
Test: atest VtsHalKeyMintV1_0TargetTest

Change-Id: I5f9d642f96e262dd567d88f4d582e621d168dceb
2020-11-17 01:11:42 -08:00
Treehugger Robot
f65abbd1c8 Merge "Allowing GSI patch level to be greater than vbmeta SPL" am: b22330e065 am: c12559f79e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1256345

Change-Id: If6721904a50f164626d30460a2b13c59ffd2814f
2020-09-02 03:39:52 +00:00
Treehugger Robot
c12559f79e Merge "Allowing GSI patch level to be greater than vbmeta SPL" am: b22330e065
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1256345

Change-Id: Ic3b7ee64244f03625af7cd2aea055f31febdb19d
2020-09-02 02:27:02 +00:00
TreeHugger Robot
484456242d Merge "Keymaster: update the verifyAuthorization call time and delta time in VerificationToken VTS" into stage-aosp-rvc-ts-dev am: 9ade092595 am: 872216fd37
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12430970

Change-Id: I065b9d6122747a55eb4decf0b32b7ff20756e26c
2020-08-31 18:34:09 +00:00
Xin Li
36dcf1a404 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I6502829205ede2de914b27e6c2c5c42916af2b39
Change-Id: I7cb06511e43bd1fffd5f80a11dbdf5b1314cfe8e
2020-08-28 13:05:04 -07:00
Bowgo Tsai
63c0129fa6 Allowing GSI patch level to be greater than vbmeta SPL
The GSI patch level might be greater than the vbmeta SPL, because
GSI system.img might be updated via the DSU flow, where vbmeta.img won't
be updated in this scenario.

  https://developer.android.com/topic/dsu

Allowing GSI patch level to be greater than or equal to the vbmeta SPL,
since Treble allows new system.img works on old vendor images.

Bug: 145377203
Test: atest VtsHalKeymasterV4_0TargetTest
Change-Id: Ib761d80c88695eb2db08b0dc00e30fcdc2788865
2020-08-26 13:16:25 +08:00
Treehugger Robot
1790d8c313 Merge "Disable the test TooManyOperations in keymaster VTS" am: 8a42374ffa am: bf31c055f5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1370458

Change-Id: I438ee9a69722fc6e190a0c5440194dbd29c839ea
2020-08-26 00:37:03 +00:00
kh0705
f5b567afab Keymaster: update the verifyAuthorization call time and delta time in VerificationToken VTS
The keymaster function affects the performance of secure os. When considering the swtiching time of the normal world < - > Secure world and the processing delay of the SecureOS by the scheduling policy of the normal world, it is necessary to increase the time.
Even though Secure world is no problem, Sometimes there is a possibility of that the test will fail because it is a limited resource normal world.
On average, it is performed in a very fast time, but sometimes it takes a lot of time. After many tests, the safe time was measured.

Bug: 162115135

Change-Id: I55862204ef71f69bc88c79fe2259f7cb8365699a
Signed-off-by: kh0705 <kh0705.park@samsung.com>
2020-08-24 15:01:16 +08:00
Treehugger Robot
8a42374ffa Merge "Disable the test TooManyOperations in keymaster VTS" 2020-08-19 19:07:08 +00:00
Eran Messeri
6a1198e166 Merge "Fix Keymaster VTS unique attestation failure" am: 3e4d8d0856 am: b0f932739a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1372156

Change-Id: I0e2ee2609c8fcf82ad31d9c97423b9006862cb97
(cherry picked from commit 4e3c9a1d65)

Bug: 160518399

Exempt-From-Owner-Approval: already approved as aosp/1372156.
Change-Id: I0e2ee2609c8fcf82ad31d9c97423b9006862cb97
2020-08-05 14:54:17 +00:00
Dan Shi
e5c9b5e722 Suppress gtest error for tests without any instance am: ba4d532fee am: 73122cd284
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1374050

Change-Id: Ie5e956d4613f5e947c36ba4f1048f0c3aa8944ba
2020-07-29 05:45:58 +00:00
Dan Shi
ba4d532fee Suppress gtest error for tests without any instance
Bug: 162052785
Test: m -j vts
Change-Id: I8c1a48e6fbd7c8161137902b5332911fa0d7b8b3
2020-07-28 15:12:32 -07:00
Eran Messeri
4e3c9a1d65 Merge "Fix Keymaster VTS unique attestation failure" am: 3e4d8d0856 am: b0f932739a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1372156

Change-Id: I0e2ee2609c8fcf82ad31d9c97423b9006862cb97
2020-07-24 13:34:02 +00:00
allen.zhang
569a61290e Fix Keymaster VTS unique attestation failure
Adding TAG_DEVICE_UNIQUE_ATTESTATION & CheckedDeleteKey()
in TEST_P(DeviceUniqueAttestationTest, NonStrongBoxOnly)
Test procedure:
1.Build APP "VtsHalKeymasterV4_1TargetTest" in android project,
then replace it to VTS testcase(version in 0610).
2. ./vts-tradefed
3.run vts -m VtsHalKeymasterV4_1TargetTest
Result:all testcase pass

Bug: 158724430
Test: m VtsHalKeymasterV4_1TargetTest && echo run vts -m VtsHalKeymasterV4_1TargetTest | ./vts-tradefed

Change-Id: I693c23596a045bf9af9fe6cc483924fd7cfc6ce6
2020-07-23 12:39:13 +01:00
Gaurav Kashyap
48f67e8438 Disable the test TooManyOperations in keymaster VTS
The test fails on devices because an unknown
client starts a keymaster BEGIN operation during
bootup but does not finish it. This affects the
keymaster hardware implementation's capability
to support the maximum possible operations while
running this test.

Bug: 154801042

Change-Id: Ib6adc6c28ebe76ddfdc2c66cd17cf78c04e5b468
2020-07-22 11:14:44 -07:00
Jooyung Han
d610435ac4 update hidl .bp
HIDL libs are not necessarily part of VNDK now. Because some are
used by VNDK libs, they are still VNDK. But rest are now just
vendor-available.

.hidl_for_test files are also removed because they are used to exclude
test-purpose hidl libs from VNDK libs.

Instead, .hidl_for_system_ext files are added to tests/lazy to
distinguish them from others which are installed /system.

Bug: 143933769
Test: update-makefiles.sh && m com.android.vndk.current
Merged-In: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
Change-Id: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
(cherry picked from commit b0907a6bb8)
2020-07-07 16:22:36 +09:00
Joseph Jang
955aa4ecc6 Merge "Keymaster: Fix potential bug in extractUint32()/extractUint64()" am: 991650fd8a am: e9e59bd5d1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1354466

Change-Id: I1bf12c37f39067857ab27f51ed08bbe1bfd73ef3
2020-07-07 03:01:03 +00:00
josephjang
4feb8cd284 Keymaster: Fix potential bug in extractUint32()/extractUint64()
In deserializeVerificationToken(), we use extractUint64() to extract
VerificationToken.challenge. A potential bug was found in
extractUint64() that will cause VerificationToken.challenge()
incorrect.

Bug: 160198696
Merged-In: Ie0d2c0127cc34f1bb90455e4f7869e15e5542173
Change-Id: Ie0d2c0127cc34f1bb90455e4f7869e15e5542173
2020-07-06 07:03:27 +00:00
josephjang
c96b1fab12 Keymaster: Fix potential bug in extractUint32()/extractUint64()
In deserializeVerificationToken(), we use extractUint64() to extract
VerificationToken.challenge. A potential bug was found in
extractUint64() that will cause VerificationToken.challenge()
incorrect.

Bug: 160198696
Change-Id: Ie0d2c0127cc34f1bb90455e4f7869e15e5542173
2020-07-06 14:53:55 +08:00
Jooyung Han
d18cba85fe update hidl .bp
HIDL libs are not necessarily part of VNDK now. Because some are
used by VNDK libs, they are still VNDK. But rest are now just
vendor-available.

.hidl_for_test files are also removed because they are used to exclude
test-purpose hidl libs from VNDK libs.

Instead, .hidl_for_system_ext files are added to tests/lazy to
distinguish them from others which are installed /system.

Bug: 143933769
Test: update-makefiles.sh && m com.android.vndk.current
Merged-In: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
Change-Id: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
(cherry picked from commit b0907a6bb8)
2020-07-02 12:26:37 +09:00
Shawn Willden
a2a6a33ea9 Fix delivery of earlyBootEnded to KM4.1
Bug: 152932559
Test: Boot and observe that Strongbox gets the message
Merged-In: I752b44f5cc20d85bf819188ccaaf0813a5607ba5
Change-Id: I752b44f5cc20d85bf819188ccaaf0813a5607ba5
2020-06-01 14:08:39 -06:00
Bowgo Tsai
307d2bba7d Allow unlocked in VTS
VTS was running on a userdebug build GSI before Android 10.
Starting from Android 10, VTS is switched to running on top of a
user build GSI image, plus the device-specific boot-debug.img to
allow adb root.

   https://source.android.com/compatibility/vts/vts-on-gsi

So 'ro.build.type' will be 'user' because the value comes from
/system/build.prop. Switching to using 'ro.debuggable' to decide
whether we should check the device is locked or not. Note that
'ro.debuggable' will be '1' for userdebug/eng images or when a
boot-debug.img is used.

Bug: 154449286
Test: atest VtsHalKeymasterV4_0TargetTest
Change-Id: If5a90d62f77489aa58f96e908553a052cf6d1e18
Merged-In: If5a90d62f77489aa58f96e908553a052cf6d1e18
(cherry picked from commit 43dd6e34bd)
2020-06-01 13:20:52 +08:00
Bowgo Tsai
40eb1a490b Allow unlocked in VTS am: 43dd6e34bd am: 767b4b3c2a
Change-Id: Ia559b9083b1ac7960b93f710fc5cb2d5390dfac7
2020-06-01 04:25:02 +00:00
Bowgo Tsai
43dd6e34bd Allow unlocked in VTS
VTS was running on a userdebug build GSI before Android 10.
Starting from Android 10, VTS is switched to running on top of a
user build GSI image, plus the device-specific boot-debug.img to
allow adb root.

   https://source.android.com/compatibility/vts/vts-on-gsi

So 'ro.build.type' will be 'user' because the value comes from
/system/build.prop. Switching to using 'ro.debuggable' to decide
whether we should check the device is locked or not. Note that
'ro.debuggable' will be '1' for userdebug/eng images or when a
boot-debug.img is used.

Bug: 154449286
Test: atest VtsHalKeymasterV4_0TargetTest
Change-Id: If5a90d62f77489aa58f96e908553a052cf6d1e18
2020-05-29 07:49:11 +00:00
David Zeuthen
b1e8ff545a Identity Credential: Add method to accept verification token.
This is to facilitate HAL implementations using a TA existing in a
different environment than where auth tokens are minted. This method
will be used by credstore in a companion CL.

This modifies version 2 of the Identity Credential API (which was
never been released) to add a new method and creates version 2 of the
Keymaster types-only AIDL API to include the new VerificationToken
parcelable and SecurityLevel enum.

Bug: 156076333
Test: atest VtsHalIdentityTargetTest
Test: atest android.security.identity.cts
Merged-In: I7d05413a9ec70225ce419079f3cc9daf026cf744
Change-Id: Idd7ab041d87617556ed840403033b642f8c2ab86
2020-05-18 15:55:21 -04:00
Steven Moreland
1fd48bb036 Merge "Reminder to freeze keymaster at version "5"" am: a634e859df am: b9e98012e4
Change-Id: I08e4083e092030aaf16eb81c69783d9b1d24dc84
2020-05-11 19:45:36 +00:00
Treehugger Robot
5f2523d609 Merge "Identity Credential: Add method to accept verification token." am: 1ac087e4d6 am: 40577ac4f9
Change-Id: I232a8c45dd5d94cf8a2a2215fa99dd54425a9789
2020-05-11 19:45:12 +00:00
Steven Moreland
a634e859df Merge "Reminder to freeze keymaster at version "5"" 2020-05-11 17:46:10 +00:00
Steven Moreland
3c1519c550 Reminder to freeze keymaster at version "5"
Fixes: 155808722
Test: freeze-api produces error
Change-Id: I0b6d41a129f1a8cb064c394c73a3a70a6f2abc32
2020-05-08 16:33:55 +00:00
David Zeuthen
a8ed82cbb4 Identity Credential: Add method to accept verification token.
This is to facilitate HAL implementations using a TA existing in a
different environment than where auth tokens are minted. This method
will be used by credstore in a companion CL.

This modifies version 2 of the Identity Credential API (which was
never been released) to add a new method and creates version 2 of the
Keymaster types-only AIDL API to include the new VerificationToken
parcelable and SecurityLevel enum.

Bug: 156076333
Test: atest VtsHalIdentityTargetTest
Test: atest android.security.identity.cts

Change-Id: I7d05413a9ec70225ce419079f3cc9daf026cf744
2020-05-08 11:33:23 -04:00
TreeHugger Robot
830c4875ad Merge "Round off attestation tests." into rvc-dev am: 2023afbe66
Change-Id: I1c83c78bd3ac674a5f4aeb2356d4e127ef2d617c
2020-05-07 16:28:58 +00:00
TreeHugger Robot
d35a504e05 Merge "Fix StrongBoxOnly test" into rvc-dev am: ba1a4c7f6d
Change-Id: Ie7ecb3d434786f3cf4bdb472cfe0c7cbfe673e4d
2020-05-07 16:28:44 +00:00
Treehugger Robot
349af3e40c Merge "Allow device properties tags for attestation" am: 9a2f497439 am: 3fd8b10984
Change-Id: I3b8e79ebf16b60d9236f1ba207255950ade3c701
2020-04-24 08:30:54 +00:00
nagendra modadugu
eb7f3527de Round off attestation tests.
This CL needs some polish.  Changes
herein are somewhat brute-force to
make things work, particularly with
authorization-list parsing and validation.

This CL also copies over support for
dumping attestation records.

Bug: 129282228
Test: VtsHalKeymasterV4_1TargetTest
Change-Id: I4fc0183dc0b8a76e84d14054b38ad7c1540a1897
2020-04-22 04:21:36 +00:00
nagendra modadugu
5d531a26c0 Fix StrongBoxOnly test
This test is expected to be run
on non-StrongBox instances.

Bug: 129282228
Test: StrongBoxOnly passes on TZ
Change-Id: Ia6b274d097b4c698904d1c51daed821188a50510
2020-04-22 02:17:08 +00:00
Dorin Drimus
b20a4e01ef Allow device properties tags for attestation
Test: atest CtsKeystoreTestCases
Bug: 152945378
Change-Id: I9c85283f007535612bf4ebbfbe8b7e86a758286c
2020-04-20 17:44:56 +02:00
TreeHugger Robot
0260d7d1ee Merge "Fix delivery of earlyBootEnded to KM4.1" into rvc-dev 2020-04-15 14:56:34 +00:00
Shawn Willden
08c7e71236 Fix delivery of earlyBootEnded to KM4.1
Bug: 152932559
Test: Boot and observe that Strongbox gets the message
Change-Id: I752b44f5cc20d85bf819188ccaaf0813a5607ba5
2020-04-14 21:48:11 -06:00
TreeHugger Robot
ecd5e55cc1 Merge "Correct UseHmacKey parameter" into rvc-dev 2020-04-15 02:19:58 +00:00
Treehugger Robot
08ea51852b Merge "Remove IOperation and beginOp." 2020-04-10 16:23:49 +00:00
Shawn Willden
ca71a6e839 Merge "Fixed encoding of device_locked field" into rvc-dev 2020-04-10 16:08:07 +00:00
Shawn Willden
994c65e5bc Fixed encoding of device_locked field
The attestation code used boringssl's ASN.1 encoding tools
incorrectly, causing it to encode incorrect values in device_locked.

Bug: b/152503089
Test: Build & boot
Merged-In: I3c5352523b2db37d539ad353ac8c48c1585eb08d
Change-Id: I3c5352523b2db37d539ad353ac8c48c1585eb08d
2020-04-09 15:44:36 -06:00
Jeongik Cha
a73d6bc97e Freeze vintf aidl interfaces
AIDL interfaces which are vintf-stable have to be frozen in release.
But these interfaces have been never frozen, so freeze them.

- android.hardware.power
- android.hardware.identity
- android.hardware.keymaster
- android.hardware.vibrator
- android.hardware.light
- android.hardware.tests.extension.vibrator

Bug: 153500421
Bug: 153500550
Bug: 153511407
Bug: 153500549
Bug: 153501107
Bug: 153501202
Test: m
Change-Id: I643c25fc695f9d1e874dcceb327d465c49e9cab6
Merged-In: I643c25fc695f9d1e874dcceb327d465c49e9cab6
2020-04-09 08:27:34 +00:00