Commit graph

343 commits

Author SHA1 Message Date
Max Bires
c806e75033 Merge "Adding testing functionality for TAG_ROLLBACK_RESISTANCE" am: 28a7fed681 am: dddf75c01b am: 28446e0722 am: 9031031e47
am: eb651fa35d

Change-Id: Ic920d776365bbd94d2cb9031760ee4a3eec417c2
2019-08-23 06:05:10 -07:00
Max Bires
dddf75c01b Merge "Adding testing functionality for TAG_ROLLBACK_RESISTANCE"
am: 28a7fed681

Change-Id: I48327bcf5effe56e5f57fa53092cde6c10c62ecd
2019-08-23 05:28:49 -07:00
Max Bires
b1b45ff81c Adding testing functionality for TAG_ROLLBACK_RESISTANCE
Due to changes in implementation between keymaster 3.0 and 4.0, rollback
resistance is now specified by the caller. This patch addresses that
inconsistency to make sure rollback resistance is properly tested. If
rollback resistance is supported by the hardware, then it will now be
tested.

Test: atest VtsHalKeymasterV4_0TargetTest
Change-Id: I21e8d1e66932ddfad2d42ce8a43591431f3ff284
2019-08-15 12:46:56 -07:00
Felix
84af4f6e7e Merge "Add interface info to .rc files" am: 98d0f4d52c am: 37298a7616 am: 3531ec0183
am: bf481c99ed

Change-Id: Ie44e2aa87f7407a9820dc6f1ad6298b61bae34f3
2019-07-08 12:57:01 -07:00
Felix
37298a7616 Merge "Add interface info to .rc files"
am: 98d0f4d52c

Change-Id: Ie6cfbacd523c4b09f77bee3369ec8e88b3fa0419
2019-07-08 12:22:23 -07:00
nagendra modadugu
ff3170c48a Merge "keymaster: Relax testing under GSI" into qt-dev am: d10841a83d am: eec090610b
am: 7ad0166631

Change-Id: I03ecf5d514221673891486bcc06e6b512e6c6a3e
2019-06-29 12:46:49 -07:00
nagendra modadugu
eec090610b Merge "keymaster: Relax testing under GSI" into qt-dev
am: d10841a83d

Change-Id: If435ebd75ee04f1f6ea6324437683713b85a613a
2019-06-29 12:03:43 -07:00
nagendra modadugu
f18a8328a1 keymaster: Relax testing under GSI
GSI images do not have AVB verification enabled and therefore lack
several properties the keymaster HAL test depended on.  Selectively
disable those parts of the test that would fail with AVB verification
disabled.  Also disable date format checks under GSI.  When invoked from
GSI the TEE-backed keymaster doesn't use the correct date format.

Bug: 130843899
Test: VtsHalKeymasterV4_0TargetTest
Exempt-From-Owner-Approval: change only affects VTS-on-GSI behavior
Change-Id: Idaafb7b515c41290c766a8132f35d498ca15f48a
2019-06-29 18:27:38 +00:00
Garret Kelly
f947777ec0 Merge "Increase leniency of attestation record timestamps" into qt-dev am: 6c4e33d079 am: 89fda5c7f9
am: 4684c6f469

Change-Id: I6a10db36c762a589cc04ac7bac7f01cec603f7d8
2019-06-25 23:36:37 -07:00
Garret Kelly
4684c6f469 Merge "Increase leniency of attestation record timestamps" into qt-dev am: 6c4e33d079
am: 89fda5c7f9

Change-Id: I063e8cd6e53da1af4a50df9273a5ada4b9e7ea87
2019-06-25 23:28:39 -07:00
Garret Kelly
72c4746cda Merge "Increase leniency of attestation record timestamps" into qt-dev
am: 6c4e33d079

Change-Id: I741568f862d553a92344618406f0fb2f7a3d46f5
2019-06-25 23:19:49 -07:00
Felix
551b8d15ce Add interface info to .rc files
Signed-off-by: Felix <google@ix5.org>
Change-Id: I6d70bbdb66c3dce280bf6908c3750316a6f6cf70
2019-06-25 20:00:07 +02:00
Garret Kelly
9c0a45795f Increase leniency of attestation record timestamps
The TEE keymaster has been seen to be almost a minute out of sync with
the host clock during attestation.  Increase the leniency window to two
minutes.

Bug: 134408892
Bug: 134408367
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Ic256a939dcd7e7b108099cfcf237cacde8dde059
2019-06-24 23:28:52 +00:00
Max Bires
90cda58d54 Merge "Removing an extraneous test" into qt-dev
am: 16b2c77456

Change-Id: I2bd55543991178bf313996841e51aff838986a5c
2019-06-17 14:44:44 -07:00
Max Bires
cf9daece29 Removing an extraneous test
Test: VTS passes
Bug: 133316458
Change-Id: I98d73ff025515a89e2743ed20950c840aedb5114
(cherry picked from commit b28e69f37e)
2019-06-17 15:32:05 +00:00
Janis Danisevskis
f69d8bc9c5 Keymaster memory management is inconsistent
Object derived from RefBase must be owned by sp rather then other smart
pointer implementations.

Bug: 79474587
Change-Id: I866f67e1cb091efb3026450d50a410b5985539b6
2019-06-14 14:26:55 -07:00
TreeHugger Robot
aefd16ace9 Merge "Removing an extraneous test" 2019-05-30 20:13:31 +00:00
Max Bires
b28e69f37e Removing an extraneous test
Test: VTS passes
Bug: 133316458
Change-Id: I98d73ff025515a89e2743ed20950c840aedb5114
2019-05-22 19:22:45 +00:00
Steven Moreland
10363938d7 Merge "listByInterface -> listManifestByInterface" am: 877c7f5ce1
am: 5427525c6b

Change-Id: I780f4cdd4c01b89af28d81c21111053ffdde99df
2019-05-16 18:18:41 -07:00
Xin Li
4b6ac97b7d Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190505.001) into master." 2019-05-17 00:58:07 +00:00
Steven Moreland
5427525c6b Merge "listByInterface -> listManifestByInterface"
am: 877c7f5ce1

Change-Id: I0cc69469c3804fd189e4f021a835c7c4f46879ab
2019-05-16 17:08:19 -07:00
Treehugger Robot
877c7f5ce1 Merge "listByInterface -> listManifestByInterface" 2019-05-16 23:25:19 +00:00
Matthew Maurer
d65e81b1fb Merge "Allow INVALID_INPUT_LENGTH for oversized messages" am: b397fc8e88
am: 6194c02c64

Change-Id: I24a72716540258f6e790464b2951537d5bbc92c4
2019-05-16 14:49:45 -07:00
Matthew Maurer
6194c02c64 Merge "Allow INVALID_INPUT_LENGTH for oversized messages"
am: b397fc8e88

Change-Id: Ia3e4641b9fa4936655da6db1d8def5f31cee6e06
2019-05-16 13:36:35 -07:00
Matthew Maurer
b397fc8e88 Merge "Allow INVALID_INPUT_LENGTH for oversized messages" 2019-05-16 19:06:39 +00:00
Matthew Maurer
0690156c0d Merge "Use SHA_2_256 for importWrappedKey" am: 0ce3156f97
am: b2a847aea7

Change-Id: Ib382c184dc01505819f16c86007ab5578f0574f4
2019-05-16 10:09:01 -07:00
Matthew Maurer
b2a847aea7 Merge "Use SHA_2_256 for importWrappedKey"
am: 0ce3156f97

Change-Id: I4ff814128ad16f62c47b0e19b9adb0a296afa178
2019-05-16 09:57:22 -07:00
Matthew Maurer
0ce3156f97 Merge "Use SHA_2_256 for importWrappedKey" 2019-05-16 16:43:54 +00:00
Xin Li
fef0cab5e9 DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: Ie2af73fae9852849b11796bb1e77f0fc62c28ce2
2019-05-13 15:39:13 -07:00
Steven Moreland
6106299c4f listByInterface -> listManifestByInterface
This does two things:
- makes sure that HALs configured as lazy HALs will be retrieved
- will detect bad manifest entries earlier

Bug: 131703193
Test: boot
Change-Id: I82e10f49367b097023eb31797c877c15eedb5e00
2019-05-13 13:01:08 -07:00
Matthew Maurer
66f842ceec Allow INVALID_INPUT_LENGTH for oversized messages
In Keymaster 3, both INVALID_INPUT_LENGTH and INVALID_ARGUMENT were
acceptable for oversized messages. Keymaster 4 VTS requires that
INVALID_ARGUMENT be returned, but the spec has no such restriction. This
loosens VTS to allow either INVALID_INPUT_LENGTH or INVALID_ARGUMENT in
this case.

Bug: 129297054
Test: atest VtsHalKeymasterV4_0TargetTest Pixel 3, Trusty tests
2019-05-13 09:52:12 -07:00
Matthew Maurer
41cb84029a Use SHA_2_256 for importWrappedKey
The spec requires that SHA1 not be allowed for wrapped keys and that
only SHA_2_256 be used. Unfortunately, the previous VTS required SHA1
support. This patch takes the middle ground by requiring SHA_2_256 be
supported for importWrappedKey, but not disallowing it from supporting
SHA1.

This makes it possible for a spec compliant keymaster to pass VTS
while not disqualifying shipped devices.

Bug: 129291873
Test: atest VtsHalKeymasterV4_0TargetTest:ImportWrappedKeyTest, Trusty
Change-Id: I6c3a9182b51f2e7a46173d5bfc34d3c3264d954f
2019-05-10 14:27:53 -07:00
Janis Danisevskis
e08ba7a9fd Verify mac change on time stamp change am: 33d75d090b
am: 3b8bae3554

Change-Id: I26af43007c28b1b251ce5e2d22dc0975711ad8a3
2019-05-09 15:50:26 -07:00
Janis Danisevskis
33d75d090b Verify mac change on time stamp change
This test verifies that verification tokens with different time stamps do
not have the same MAC. This may not guarantee that the MAC is computed
correctly but it catches implementation that do not include the time
stamp in the mac.

It also checks that the MAC changes when both time stamp and challenge
changes.

Test: yes it is
Bug: 131859731
Bug: 132288466
Bug: 132287277
Change-Id: I85aa1d873eff46df7a66fc69bd61a031e6e6fbe0
2019-05-09 12:50:11 -07:00
Janis Danisevskis
3414222e3a Keymaster support: Verbose vendor errors
Added function for verbosely logging Keymaster vendor errors.

Bug: 123562864
Test: atest android.keystore.cts
Merged-In: Ida093941d3b76b3d2e953439229081345909c16b
Change-Id: Ida093941d3b76b3d2e953439229081345909c16b
2019-05-03 16:04:02 -07:00
Garret Kelly
5b6d16c9dd Merge "Make test expectation match comment" into qt-dev
am: 282c8d0694

Change-Id: I47b9aeff0fcf7798ebcc900040771d95bdc91b5b
2019-05-03 15:41:31 -07:00
Garret Kelly
d47288dde5 Make test expectation match comment
The BOOT_PATCHLEVEL value is allowed to have 00 in the days position
according to the keymaster specification.  This test's comment already
suggests that it's allowed, so update the expectation to match.

Test: VtsHalKeymasterV4_0TargetTest
Bug: 130843899
Change-Id: Ib43da43b2e0398b48fb59710bf4066f2641de2eb
2019-05-01 15:18:38 -04:00
Garret Kelly
0c098a4af0 Merge "Fix comparison between hex and binary values" into qt-dev
am: a8a23aa389

Change-Id: I2974a3c02139d31038e759d65383ce4a91530b75
2019-04-26 16:57:36 -07:00
Garret Kelly
ebfdba67d2 Fix comparison between hex and binary values
The verified boot hash in the attestation record is a binary blob, while
the property read from the system is a hex-encoded value.  Convert the
boot hash from the attestation record into hex before comparing.

Test: VtsHalKeymasterV4_0TargetTest
Bug: 130843899
Change-Id: I6f6e0da71501d741dd8b27d0778e1854af17ace6
2019-04-24 17:39:57 -04:00
Shawn Willden
ca9e5b3caa Correct IKeymasterDevice documentation. am: 744a37115a
am: dff8dd72a3

Change-Id: I476e9dc8d644339e05a92d7815f0fc5ee08c3923
2019-04-23 11:43:42 -07:00
Shawn Willden
744a37115a Correct IKeymasterDevice documentation.
Bug: 129931913
Bug: 130144003
Test: ./update-makefiles.sh (checks hashes)
Change-Id: Ia8101f8410a728b28653416300c1a3eb480eb469
2019-04-19 00:59:01 +00:00
Steven Moreland
6d494b2346 Merge "Update hidl makefiles for bpfmt" am: ff0bd741ca
am: 96f40f7b02

Change-Id: Idbf030e4993067bdb8181321bca2de00c9b6f7ef
2019-04-18 14:34:45 -07:00
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Max Bires
873d889730 Expanding VTS test coverage
Keymaster VTS test coverage on 4.0 was incomplete. This significantly
expands the coverage of the spec. The bugs listed are errors found that
these tests will cover, but are not indicative of the complete set of
things tested.

Test: atest VtsHalKeymasterV4_0TargetTest
Bug: 79953279
Bug: 119553313
Bug: 119541233
Bug: 119396995
Bug: 119542230
Bug: 119549128
Bug: 119549677
Bug: 122184852
Bug: 122261372
Change-Id: I42d78091b48398597bbebe1d9c91b806494ddf4c
(cherry picked from commit 8c0edf6c84)
2019-04-11 15:17:19 +00:00
Max Bires
8c0edf6c84 Expanding VTS test coverage
Keymaster VTS test coverage on 4.0 was incomplete. This significantly
expands the coverage of the spec. The bugs listed are errors found that
these tests will cover, but are not indicative of the complete set of
things tested.

Test: atest VtsHalKeymasterV4_0TargetTest
Bug: 79953279
Bug: 119553313
Bug: 119541233
Bug: 119396995
Bug: 119542230
Bug: 119549128
Bug: 119549677
Bug: 122184852
Bug: 122261372
Change-Id: I42d78091b48398597bbebe1d9c91b806494ddf4c
2019-04-08 10:18:32 -07:00
Eran Messeri
04a7045117 Test importing EC P-256 keys with multiple encodings
Test importing of an Elliptic Curve P-256 key, encoded using the RFC5915
specification (which requires the curve OID in key in addition to the
wrapper) and the same key encoded using SEC1 (which allows omitting the
OID if it's known from the wrapper).

Test: atest VtsHalKeymasterV4_0TargetTest ImportKeyTest
Bug: 124437839
Bug: 127799174
Bug: 129398850
Change-Id: I5f5df86e55a758ed739403d830baa5c7308813a3
Merged-In: I5f5df86e55a758ed739403d830baa5c7308813a3
2019-04-01 14:54:00 +01:00
TreeHugger Robot
300fc770e9 Merge "Test importing EC P-256 keys with multiple encodings" 2019-03-27 18:29:46 +00:00
Janis Danisevskis
f6f522c525 Merge "Fix strict weak ordering requirement of less than operation" am: e82263dd74 am: 36b364abfb
am: 22368369f7

Change-Id: I2301e7fec1c5c28516dafff483a8a0f2a2e00b0a
2019-03-26 09:34:44 -07:00
Janis Danisevskis
22368369f7 Merge "Fix strict weak ordering requirement of less than operation" am: e82263dd74
am: 36b364abfb

Change-Id: I7a97aaecd25f3a78a3f9508388a88ace9c97642e
2019-03-26 09:30:01 -07:00
Eran Messeri
68289f76f2 Test importing EC P-256 keys with multiple encodings
Test importing of an Elliptic Curve P-256 key, encoded using the RFC5915
specification (which requires the curve OID in key in addition to the
wrapper) and the same key encoded using SEC1 (which allows omitting the
OID if it's known from the wrapper).

Test: atest VtsHalKeymasterV4_0TargetTest ImportKeyTest
Bug: 124437839
Bug: 127799174
Change-Id: I5f5df86e55a758ed739403d830baa5c7308813a3
2019-03-26 12:01:03 +00:00