Commit graph

553 commits

Author SHA1 Message Date
David Drysdale
3c4fa6f8d5 Merge "Turn off CFI for other Keymaster VTS versions" am: 4daee77052 am: 23040264d1 am: c810dae469 am: 7fbaeac5be
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1954816

Change-Id: I6e820809f9a3c9b94545ff60201c3f86c87104d0
2022-01-21 09:00:45 +00:00
David Drysdale
4daee77052 Merge "Turn off CFI for other Keymaster VTS versions" 2022-01-21 07:58:28 +00:00
David Drysdale
f3e239fc36 Turn off CFI for other Keymaster VTS versions
Repeat the change for the 4.0 KeyMaster VTS tests in 3.0 and 4.1.

See previous change: I12b145dad5535846d68c97954d31a93123bb95e7

Bug: 206498742
Test: VtsHalKeymasterV4_1TargetTest, VtsHalKeymasterV3_0TargetTest
Change-Id: I3b4f9bc13e155ff451d03318d114a01abbbf138e
2022-01-19 19:23:12 +00:00
David Drysdale
ab1851e9f2 Alter spec text for RSA-PSS to match reality
The Key{Mint,Master} spec previously said that RSA-PSS mode should use
SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets
specified as the main digest.

However, both the reference implementation and the VTS/CTS tests
use BoringSSL's defaults, which is to re-use the main digest as the MGF1
digest if none is separately specified.

Given that this behaviour is embedded in many implementations over
several years (and given that there isn't a security implication),
change the spec to match this behaviour.  Also update the VTS test
code to make this clear/obvious.

Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Bug: 210424594
Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
Ignore-AOSP-First: target internal master first due to merge conflict
2022-01-13 09:13:39 +00:00
David Drysdale
c6b8907a32 Alter spec text for RSA-PSS to match reality
The Key{Mint,Master} spec previously said that RSA-PSS mode should use
SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets
specified as the main digest.

However, both the reference implementation and the VTS/CTS tests
use BoringSSL's defaults, which is to re-use the main digest as the MGF1
digest if none is separately specified.

Given that this behaviour is embedded in many implementations over
several years (and given that there isn't a security implication),
change the spec to match this behaviour.  Also update the VTS test
code to make this clear/obvious.

Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Bug: 210424594
Merged-In: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
2022-01-13 09:13:08 +00:00
David Drysdale
6c687127fa Merge "Turn off CFI for the Keymaster VTS" am: 1ff635ab2d am: ab78c4b682 am: 2a20554f45 am: fe9a70a53e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1906291

Change-Id: I9730d389cf119e539f9f4a85916065fc40656577
2021-12-07 07:32:38 +00:00
David Drysdale
ab78c4b682 Merge "Turn off CFI for the Keymaster VTS" am: 1ff635ab2d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1906291

Change-Id: Idf81c498e1b5ef26b8d5ade160217556a81340a3
2021-12-07 06:39:35 +00:00
David Drysdale
1ff635ab2d Merge "Turn off CFI for the Keymaster VTS" 2021-12-07 06:22:35 +00:00
David Drysdale
2bd0d43b24 Turn off CFI for the Keymaster VTS
On a bramble device, observed a crash in the VTS binary itself when
executing BoringSSL signature verification code locally (i.e. with no
KeyMaster interaction involved).

The crash call stack involves CFI checks, and seems to occur at the
point when some BoringSSL digest calculation code invokes a function
pointer.

 - SHA1_Update passes &sha1_block_data_order to (inlined)...
 - crypto_md32_update() which invokes the function pointer
   via its block_func parameter.

Moving the BoringSSL dependency from static_libs: libcrypto_static to
shared_libs: libcrypto makes the crash go away, but a smaller change
that also fixes the problem is to disable CFI checks for the test
binary.

This approach was inspired by:
ab65cd0e89%5E%21/#F0

The same problem looks to be relevant for the bugs listed below.

Bug: 206496340
Bug: 206498742
Test: VtsHalKeymasterV4_0TargetTest --gtest_filter="*VerificationOperationsTest.RsaAllPaddingsAndDigests*"
Change-Id: I12b145dad5535846d68c97954d31a93123bb95e7
2021-11-30 15:27:32 +00:00
David Drysdale
f60d8c4535 Merge "Fix flaky corrupted padding tests" am: a33f46bc2a am: 61cf943208 am: 02951d1167 am: d1c5ed5bec
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1903312

Change-Id: I803c4549b635d900934403c775886b1153b91a12
2021-11-30 07:41:54 +00:00
David Drysdale
61cf943208 Merge "Fix flaky corrupted padding tests" am: a33f46bc2a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1903312

Change-Id: I5e5b1e62c017e2e1db8ce099e1cabda6501ce44c
2021-11-30 07:00:16 +00:00
David Drysdale
4c1f6ac496 Fix flaky corrupted padding tests
Transfer the fix in http://aosp/1745035 from the KeyMint VTS test back
into the keymaster VTS test.

Bug: 189261752
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I5f0a69255cfe980dd6e71fa29ff06a84cb668f6d
2021-11-29 16:17:11 +00:00
Xin Li
8f6d361f15 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I96a417467346a57b13c2efae12a183d78506afc3
Change-Id: I570a3b599281f519af7a440562c83f8484684fd5
2021-11-10 08:05:55 +00:00
Jim Blackler
6872cf4c1d Merge "Revert "Delete KM1"" am: 0531c94771 am: 7e0f50f4fe am: cb8a6b42d2 am: 1977dffb15 am: a47931ad1f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1853098

Change-Id: I9e8aadf21c1f372458caf5e006a0ec714f449f2b
2021-10-11 15:27:29 +00:00
Jim Blackler
cb8a6b42d2 Merge "Revert "Delete KM1"" am: 0531c94771 am: 7e0f50f4fe
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1853098

Change-Id: I2bc88903556a42984553014cdbd3010939dded25
2021-10-11 14:39:01 +00:00
Jim Blackler
0531c94771 Merge "Revert "Delete KM1"" 2021-10-11 14:04:30 +00:00
Jim Blackler
a08ea2d23f Revert "Delete KM1"
Revert "Delete KM1"

Revert "Delete KM1"

Revert "Delete KM1"

Revert submission 1844016-delkm1

Reason for revert: b/202675261
Reverted Changes:
Iba996962b:Delete KM1
Ia4c5359cd:Delete KM1
Iee6ec9816:Delete KM1
I6058e4d86:Delete KM1
I8abb9c570:Delete KM1
I9c4dc5c9e:Delete KM1

Change-Id: I2a2d4b737a90f8ce31cd14b68f64564d8d245ab3
2021-10-11 13:38:59 +00:00
Shawn Willden
56534c3412 Merge "Delete KM1" am: 13274fa22d am: 9c379e224f am: bb661ea978 am: b98e256589 am: 7cbfeb37c3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1849793

Change-Id: I498a9212fdec4b3852c737bd18c9dd102774851a
2021-10-09 02:03:15 +00:00
Shawn Willden
bb661ea978 Merge "Delete KM1" am: 13274fa22d am: 9c379e224f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1849793

Change-Id: I6d7acf78da1a57e078ffd21378d2021740633960
2021-10-09 01:19:59 +00:00
Shawn Willden
13274fa22d Merge "Delete KM1" 2021-10-09 00:46:52 +00:00
Shawn Willden
50f70d73da Delete KM1
Test: Build
Change-Id: Iee6ec98163dff3a969debd9f4343c7b06ebe8d4f
2021-10-07 09:43:32 -06:00
TreeHugger Robot
718b3bd4de Merge "Add EncryptionOperationsTest.AesCbcZeroInputSuccess" 2021-10-05 02:53:40 +00:00
Tommy Chiu
e6f9ff6c19 Add EncryptionOperationsTest.AesCbcZeroInputSuccess
Check if the zero input data with AES-CBC-[NONE|PKCS7] padding mode
generates correct output data and length.

Bug: 200553873
Test: VtsHalKeymasterV4_0TargetTest, VtsAidlKeyMintTargetTest
Change-Id: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
2021-09-29 21:08:58 +08:00
Yiming Pan
02aa333117 Merge "Backfill owner information for VTS module VtsHalKeymasterV4_0TargetTest." am: ea60a110ab am: e988b0f6c7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1813761

Change-Id: Ie1be063bc1c976404fdb285c5653bb3c14c851e2
2021-09-28 16:02:04 +00:00
Yiming Pan
d6bc599f1d Merge "Backfill owner information for VTS module VtsHalKeymasterV3_0TargetTest." am: 1a1b23ecf4 am: 5f27f901cd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1813760

Change-Id: I5679e4c8702c53952ac6c8f7106273c94d324dfd
2021-09-28 16:01:58 +00:00
Yiming Pan
709ace51dd Merge "Backfill owner information for VTS module VtsHalKeymasterV4_1TargetTest." am: 9b6eea2479 am: 4d0ca281d7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1814138

Change-Id: I4dd19edd2db979533021a2754b4463b480e2c7b4
2021-09-28 16:01:47 +00:00
Yiming Pan
e988b0f6c7 Merge "Backfill owner information for VTS module VtsHalKeymasterV4_0TargetTest." am: ea60a110ab
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1813761

Change-Id: I65bd9c3bde86a4d297419bda45c2ea5ab1ad08d7
2021-09-28 15:50:15 +00:00
Yiming Pan
5f27f901cd Merge "Backfill owner information for VTS module VtsHalKeymasterV3_0TargetTest." am: 1a1b23ecf4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1813760

Change-Id: I749ee3fb64eb5997a11492856d24f44f06da4261
2021-09-28 15:50:09 +00:00
Yiming Pan
4d0ca281d7 Merge "Backfill owner information for VTS module VtsHalKeymasterV4_1TargetTest." am: 9b6eea2479
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1814138

Change-Id: If028a781f9476e35551844687e8ce3fa64fc6537
2021-09-28 15:49:58 +00:00
Yiming Pan
ea60a110ab Merge "Backfill owner information for VTS module VtsHalKeymasterV4_0TargetTest." 2021-09-28 01:24:22 +00:00
Yiming Pan
1a1b23ecf4 Merge "Backfill owner information for VTS module VtsHalKeymasterV3_0TargetTest." 2021-09-28 01:24:09 +00:00
Yiming Pan
9b6eea2479 Merge "Backfill owner information for VTS module VtsHalKeymasterV4_1TargetTest." 2021-09-28 01:23:31 +00:00
Bob Badour
e180b3db5c [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces am: b8995451aa
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1826012

Change-Id: I010e5711d6ab29aadb262799de8f04df08145453
2021-09-14 19:28:50 +00:00
Bob Badour
b8995451aa [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  bluetooth/1.0/default/test/fuzzer/Android.bp
  keymaster/4.0/support/fuzzer/Android.bp
  radio/aidl/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Id9c8b253a2402a07637f96281bcdaffbf3afc3c3
2021-09-13 17:50:14 -07:00
Bob Badour
bf387481b9 [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  bluetooth/1.0/default/test/fuzzer/Android.bp
  keymaster/4.0/support/fuzzer/Android.bp
  radio/aidl/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: If766e3abcdff8263e2cb2eb707d4743bfb395db6
2021-09-10 11:01:15 -07:00
Treehugger Robot
4134175657 Merge "Added fuzzers for libkeymaster4support" am: 03c30ca9a8 am: 52607dea82
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1729193

Change-Id: I79584356828bed8e4b40641cf615478c1e0f0822
2021-09-09 03:48:55 +00:00
Treehugger Robot
52607dea82 Merge "Added fuzzers for libkeymaster4support" am: 03c30ca9a8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1729193

Change-Id: Iecd2b69c3cbf5a21cadbd9768b27f5df24786d48
2021-09-09 03:33:55 +00:00
Treehugger Robot
03c30ca9a8 Merge "Added fuzzers for libkeymaster4support" 2021-09-09 03:25:49 +00:00
Max Bires
7db2454972 Merge "Revert "AesInvalidKeySize skip 192 on SB devices"" am: f970abe674
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1803229

Change-Id: Iba41af9658e056e59331fbf5799f21365d13723b
2021-09-01 08:34:29 +00:00
Yiming Pan
4300e62ef8 Backfill owner information for VTS module VtsHalKeymasterV4_1TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: Ifdf098e6bd86abfbe4917beb20c3aff3abc9f150
2021-08-30 12:59:29 -07:00
Yiming Pan
7f3a1bf518 Backfill owner information for VTS module VtsHalKeymasterV4_0TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: I4328efc697dafa313fd685f12d867006b8b332ee
2021-08-30 12:52:20 -07:00
Yiming Pan
066eaa58de Backfill owner information for VTS module VtsHalKeymasterV3_0TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: Iba4f8145d1d525f262a3c0634a5bbf7d4e499059
2021-08-30 12:52:10 -07:00
Max Bires
f0394173a4 Merge "AesInvalidKeySize skip 192 on SB devices" into sc-dev 2021-08-20 16:15:29 +00:00
Max Bires
d067e790ab Revert "AesInvalidKeySize skip 192 on SB devices"
This reverts commit eb8b0577e8.

Reason for revert: Broke a different TEE implementation

Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
Merged-In: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
2021-08-20 07:30:36 +00:00
Max Bires
5b7f78d43b AesInvalidKeySize skip 192 on SB devices
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.

Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: Ic0ff19d2d19d6e18dfbc0fad4b8182264f36b2f6
2021-08-19 03:28:15 -07:00
Bill Richardson
f332d02bc6 Merge "Revert "AesInvalidKeySize skip 192 on SB devices"" into sc-dev 2021-08-18 16:54:06 +00:00
Ayushi Khopkar
20bf5e70bc Added fuzzers for libkeymaster4support
This patch adds following fuzz targets: keymaster4_attestation_fuzzer, keymaster4_authSet_fuzzer and keymaster4_utils_fuzzer

Test: ./keymaster4_attestation_fuzzer
Test: ./keymaster4_authSet_fuzzer
Test: ./keymaster4_utils_fuzzer
Bug: 189053968

Change-Id: Ieca5ba012f395a25cca9e37856d197031daf7dd9
2021-08-18 12:23:03 +05:30
Max Bires
0224cfe3e0 Revert "AesInvalidKeySize skip 192 on SB devices"
This reverts commit eb8b0577e8.

Reason for revert: Broke a different TEE implementation

Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
2021-08-17 14:41:49 +00:00
Xin Li
e287df40b9 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: Ifa71accba7ecf2ab15980227a4413831cfceb187
Change-Id: I7fb44c6c578a51c8ad36649d20a46233fd9609ca
2021-08-14 06:30:57 +00:00
Max Bires
3828fb2214 Merge "AesInvalidKeySize skip 192 on SB devices" 2021-08-13 21:45:14 +00:00