Commit graph

445 commits

Author SHA1 Message Date
Shawn Willden
9411d1b2d1 Remove jdanis@ from OWNERS
Test: N/A
Change-Id: Ia9dbeacc91e19afbbd6cacb7df834115ef25e350
2022-06-09 06:40:42 -06:00
Shawn Willden
460ef388c7 Specify correct assignee for bugs.
Test: N/A, comment-only change
Change-Id: I78b32693531180f7377651edd0dab93cd2cfd870
2022-06-09 06:36:54 -06:00
Treehugger Robot
f1a7cc01ea Merge "Implement alternate SE RoT provisioning" 2022-06-01 08:47:51 +00:00
Shawn Willden
4315e135c6 Implement alternate SE RoT provisioning
Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: Ia696d7765f316d35eba1b4e65acae6c1072987b1
2022-05-31 14:14:54 -06:00
Tommy Chiu
ee70569078 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
Merged-In: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
Change-Id: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
2022-05-31 13:37:55 +01:00
David Drysdale
7fc26b99d3 KeyMint VTS: abandon tests when Begin fails
Test: VtsAidlKeyMintTargetTest
Change-Id: Id8bb29b3e2c3771d6033fe85c58c9cbd34e024fb
2022-05-25 15:34:05 +01:00
Seth Moore
97f58ffff5 Clean up description of IRemotelyProvisionedComponent uniqueId
The identifier is to be used in telemetry to identify problematic
implementations. Thus, it needs to be globally consistent, at least
within a given device type.

Test: None -- doc only changes
Bug: 231495834
Change-Id: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329
Merged-In: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329
2022-05-16 15:59:37 -07:00
Treehugger Robot
cff8c9fb9e Merge "KeyMint: Test Ecdsa key generation without curve" 2022-05-13 09:56:16 +00:00
Treehugger Robot
a172a2309c Merge "Specify EcCurve when generating keys" 2022-05-11 09:08:22 +00:00
David Drysdale
53cf63d1fd Merge "KeyMint VTS: x25519 pubkey as SubjectPublicKeyInfo" 2022-05-10 10:19:56 +00:00
Tommy Chiu
ec83644fab Specify EcCurve when generating keys
EC_CURVE is a mandatory tag which is specified in the keymint HAL when
generating EC keys.

Bug: 232056693
Change-Id: Ibe2b85744d7e555b7c7b48aa9e57ce45bb19ef89
2022-05-10 16:31:22 +08:00
David Drysdale
a410b770e9 KeyMint VTS: x25519 pubkey as SubjectPublicKeyInfo
The data for a key agreement operation should always send in the
SubjectPublicKeyInfo structure, not a raw key for X25519.

Test: VtsAidlKeyMintTargetTest
Bug: 231959070
Change-Id: Ib5157da6a986d957162fab60dbe927017cfdd703
2022-05-09 17:38:35 +01:00
Treehugger Robot
0ba8531279 Merge "Updated the description on Root of Trust Binding." 2022-05-09 16:36:54 +00:00
Seth Moore
2c6790fe53 Update ProtectedData DKCertChain to use X.509
This matches against what we're shipping in tm-dev.

Bug: 227350250
Test: N/A -- doc changes only
Change-Id: I3771c0fd45999e4204ba3964ed421641f02d6e7c
2022-05-06 10:04:15 -07:00
David Drysdale
072c0b3ab6 Merge "KeyMint VTS: skip device ID checks on GSI" 2022-05-05 05:27:34 +00:00
David Drysdale
d347852bcc Merge "Run SecureElementProvision tests for KeyMint version >= 2." 2022-05-04 09:48:48 +00:00
David Drysdale
6cd7c6295b Merge "Updated the description for APPLICATION_ID and APPLICATION_DATA" 2022-05-04 06:03:50 +00:00
David Drysdale
555ba00c0f KeyMint VTS: skip device ID checks on GSI
Bug: 229356841
Test: VtsAidlKeyMintTargetTest
Change-Id: I3182bad5584c35df7b1eeb476dabb39d19fdf12c
2022-05-03 18:50:58 +01:00
Subrahmanyaman
5083a85141 Updated the description for APPLICATION_ID and APPLICATION_DATA
As the signature of the getKeyCharacteristics() does not
use Tag Mechanism for app_id and app_data, there is no way
to distinguish between appId / appData  values that are
absent, vs values that are present but of zero length. Due to
this limitation a key with a zero-length app_id / app_data
cannot have its key characteristics retrieved using
getKeyCharacteristics()

Test: VtsAidlKeyMintTarget
Change-Id: I145dcba878171c174d48ad42fadeb49e045b5c55
2022-05-02 23:28:12 +00:00
Subrahmanyaman
0f5953556c Updated the description on Root of Trust Binding.
The root of trust consists of a bitstring that must be derived
from the public key used by Verified Boot, from the lock state
and from the Verified Boot state of the device.

Test: VtsAidlKeyMintTarget

Change-Id: Ib20bf17066f087c6fc050a498cc7ed4a4cb08ae6
2022-04-29 02:39:11 +00:00
Seth Moore
1d389acec8 Clean up keymint ProtectedData documentation
- Fix up some minor CDDL formatting issues.
- Add more definition around the BCC, hopefully clearing up partner
  confusion around how to implement it.
- Explain when BccPayload entries may be omitted in the case of a
  "Degenerate BCC"
- Add a bit more description to the DKSignature format

Bug: 227350250
Test: N/A -- doc changes only
Change-Id: I28337a80e2b49661cc37876400d7ac3b8759ba01
2022-04-28 12:41:18 -07:00
Subrahmanyaman
4418984ab6 Run SecureElementProvision tests for KeyMint version >= 2.
Test: run vts -m VtsAidlKeyMintTarget
Change-Id: Icd2565170a473b539a1959042bbfa93e66947a69
2022-04-25 22:40:14 +00:00
Max Bires
89c7488370 Increase challenge size in tests.
VTS tests were currently passing a challenge size of 32 in all cases.
However, the server currently sends a challenge of length 40, which may
or may not change in the future. A 64 byte upper limit provides a
standard size along with flexibility in case the challenge format
changes in the future.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I678bb915f139e4c23354180870a66ce33a9cfd8c
2022-04-20 12:23:19 +00:00
David Drysdale
b809329dc7 Fix AES corrupt padding test
The AesEcbPkcs7PaddingCorrupted test has been incorrect since it was
originally introduced -- it was feeding the original message as input to
the decryption operation, rather than the corrupted ciphertext.  As a
result, the expected error code was also wrong -- INVALID_INPUT_LENGTH
is appropriate for a too-short cipher text (length 1 in this case),
whereas a corrupt-but-correct-length cipher text should give
INVALID_ARGUMENT.

Fix the test, and add a separate test to cover what was inadvertently
being tested before. Add a sentence to the HAL spec to describe what
expected and tested by CTS/VTS.

Bug: 194126736
Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Change-Id: Iaa5e42768814197f373797831093cf344d342b77
2022-04-11 08:35:11 +01:00
Prashant Patil
60f8d4d5b2 KeyMint: Test Ecdsa key generation without curve
Added new VTS EcdsaMissingCurve to test if EC_CURVE not specified while
generating new EC Key, keyGeneration should fail.

Bug: 225135360
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: I32bbba05ed5203690292f7150d14f9644c4be6df
2022-03-31 10:26:51 +00:00
Prashant Patil
88ad189036 KeyMint: Device IDs attestation based on verion.
Updated VTS testcases where Device IDs Attestation expected as optional
and made it mandatory if KeyMint version >= 2 or device first shipped
with api_level 33.

Bug: 221190197
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: I8870a9301d36abdc4fa6585b9f8d62cc1cfd3d96
2022-03-25 12:16:11 +00:00
Treehugger Robot
950b7b8026 Merge "Updated the vts attestation tests for strongbox implementations which do not support factory attestation." 2022-03-24 16:35:47 +00:00
subrahmanyaman
7d9bc46f6f Updated the vts attestation tests for strongbox implementations which
do not support factory attestation.

Bug: b/219962281
Test: Run vts tests.
Change-Id: Ie3f3f33f773227d879e11f11e2ef0eaee33db648
2022-03-23 22:27:05 +00:00
Treehugger Robot
1edd38d6ee Merge "Fix CDDL for signatures." 2022-03-22 16:50:39 +00:00
Alan Stokes
ba9f55ee69 Fix CDDL for signatures.
The signature is not CBOR-encoded, it's the raw bytes of the signature
encoded as specified for the specific algorithm.

I've made the references to PureEd25519() / ECDSA() into comments,
since I believe they're not actually legal CDDL but are aimed at
humans. And I've made the two occurrences consistent with each other.

Test: N/A
Change-Id: Ia42362ff3d0ce5458322663256cbd34d258afe76
2022-03-22 15:23:13 +00:00
David Drysdale
d057fc0cb6 Merge "KeyMint VTS: strict test only for v2+" 2022-03-22 09:28:52 +00:00
David Drysdale
afa73442b7 Merge "KeyMint HAL: clarify ATTEST_KEY is like SIGN" 2022-03-22 09:26:41 +00:00
David Drysdale
bcb2f73475 KeyMint HAL: clarify ATTEST_KEY is like SIGN
Bug: 221280929
Test: None, comment change only (already assumed by VTS tests)
Change-Id: Ifc077c6ce1a89164b0d7c70c6e3353d941eee670
2022-03-21 17:14:59 +00:00
Max Bires
cf02e97946 Merge "More canonicalization checks and canonicalize before signing" 2022-03-21 16:33:20 +00:00
David Drysdale
50a66b8f79 KeyMint VTS: strict test only for v2+
Bug: 223537775
Bug: 197096139
Test: VtsAidlKeyMintTargetTest
Change-Id: Ib77d52e4a91233c936b3a44f5eac71f53b2af450
2022-03-21 15:29:00 +00:00
Max Bires
e74f0bc950 More canonicalization checks and canonicalize before signing
This change makes sure the DeviceInfo CBOR map is canonicalized before
the signature check instead of just separately checking the
canonicalization in a separate call. Additionally, some ASSERTs have
been changed to EXPECTs in validation of the DeviceInfo map more
generally, where it makes sense to avoid failing immediately.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I69806c887656772ea6b5e2e3f0af50957e6b05e3
2022-03-21 05:19:15 +00:00
Tri Vo
a26f8cb316 Merge "KeyMint VTS: Expect empty key if boot state unverfied" 2022-03-18 18:14:31 +00:00
Janis Danisevskis
49a1688f5e Merge changes from topic "default_dice_hal"
* changes:
  Dice HAL: Add VTS Test.
  Dice HAL: Added default implementation.
2022-03-16 20:16:15 +00:00
David Drysdale
83e3bffe66 Merge "Revert "KeyMint VTS: add TEST_MAPPING"" 2022-03-16 11:43:55 +00:00
David Drysdale
6288f4bbb9 Revert "KeyMint VTS: add TEST_MAPPING"
This reverts commit 7e71fcf852.

Reason for revert: failing tests on git_master on aosp_x86_64-userdebug

Bug: 224951152
Bug: 224951969
Bug: 224950581
Change-Id: I86ae5e8d73cefd6d9d923138384cf98ec80a42df
2022-03-16 11:34:44 +00:00
David Drysdale
7f366ab5dd Merge "KeyMint VTS: add TEST_MAPPING" 2022-03-16 06:49:19 +00:00
Janis Danisevskis
21244fc192 Dice HAL: Add VTS Test.
This CL adds a VTS test for the DICE HAL, and a test specific for
demotion testing. Demotion testing leaves the device in a permanently
modified state untill the next reboot, which is why it needs a special
test config. The current test config restarts the device before testing,
in a followup the device also has to reboot after the test.

Bug: 198197213
Test: atest VtsAidlDiceTargetTest
      atest VtsAidlDiceDemoteTargetTest
Change-Id: I4278a1352df749da50dc8e5d118fc37336026061
2022-03-15 12:39:22 -07:00
David Drysdale
ceedbb0d1a Merge "Prevent test crashes if device sets invalid curve" 2022-03-15 07:35:02 +00:00
David Drysdale
e5c2bf01fc Merge "Key{Mint,Master} VTS: fix incremental AES tags" 2022-03-14 15:45:28 +00:00
David Drysdale
1a637199e4 Key{Mint,Master} VTS: fix incremental AES tags
Change Id62fdce65131ee00c88e5849955a937f1c171748 split up the AES
incremental encryption tests into individual tests for each encryption
mode.  This meant that each generated key is only valid for a single
mode, which in turn means that for non-GCM mode keys it is not valid
to specify MIN_MAC_LENGTH.

Bug: 223934835
Test: VtsAidlKeyMintTargetTest
Change-Id: I38f34f60116bde3d23f203365d62e5b25d7b254b
2022-03-14 09:23:29 +00:00
Treehugger Robot
3192a09b11 Merge "remote_prov_utils: Add instance name in the JSON output" 2022-03-11 12:48:19 +00:00
Janis Danisevskis
86124738cd Dice HAL: Added default implementation.
Test: ... one ...
Bug: 198197213
Change-Id: If855e2a4a0150d80e7cecce0a078cdeca00bdb50
2022-03-10 12:23:59 -08:00
Eran Messeri
bf89c797d0 Update the default KeyMint version
As the current KeyMint version is 2 (200), reflect that in the default
XML.

Devices that ship with older KeyMint/KeyMaster version should override
the default android.hardware.hardware_keystore.xml file with the
version they support.

Test: android.keystore.cts.KeyAttestationTest#testAttestationKmVersionMatchesFeatureVersion
Bug: 222406513
Bug: 216543583
Change-Id: I6f2229019929cff747cec3907fc2a9b8ebebdcf4
2022-03-10 19:16:39 +00:00
David Drysdale
08696a7543 Prevent test crashes if device sets invalid curve
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ib623b3dcdd5a496b34314c1e0d1a310c8beeb18d
2022-03-10 10:54:37 +00:00
Tommy Chiu
cb7d3d0759 remote_prov_utils: Add instance name in the JSON output
Bug: 223509807
Test: libkeymint_remote_prov_support_test
Change-Id: I45d2ee46f6fe3c8a7da55c7cc0b04fc007ddea43
2022-03-10 12:17:39 +08:00