Commit graph

176 commits

Author SHA1 Message Date
TreeHugger Robot
af4d761cf5 Merge "Add additional parameters to importWrappedKey" 2018-01-22 20:18:17 +00:00
TreeHugger Robot
e541981ac2 Merge "Add VerificationToken tests." 2018-01-20 03:25:18 +00:00
Shawn Willden
8d28efa9b8 Add additional parameters to importWrappedKey
Bug: 31675676
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I31166d0c562d92bbdcf3357782ac2a076a1bc2d9
2018-01-19 20:09:05 -07:00
Shawn Willden
4fbc1d574b Add VerificationToken tests.
Bug: 70409878
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I5458729ef8c3494f45fe8274b391133b997d43f2
2018-01-20 02:54:23 +00:00
TreeHugger Robot
dec9b4480d Merge "Specify SecurityLevel::SOFTWARE in default keymaster 4.0 service." 2018-01-19 22:49:27 +00:00
Shawn Willden
256929827a Move KeyParameter operator== to support lib.
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I4b71a9fbd986c1bd1001e3ab49de5d360b303b27
2018-01-19 09:44:11 -07:00
Shawn Willden
3d9433268f Add HMAC key sharing tests
Bug: 70409878
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I9da12a70ce04f606980b5c8bec8deaeaa318bf81
2018-01-18 21:35:54 -07:00
Shawn Willden
252233df69 Refactor VTS tests a bit, to enable adding tests in separate files.
Bug: 70409878
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Idd147d20761e7123005b468841a2ddb46cc19576
2018-01-18 21:35:49 -07:00
Shawn Willden
163063e15b Merge "Fix build breakage" 2018-01-19 02:20:37 +00:00
TreeHugger Robot
a7c5a47d64 Merge "ImportWrappedKey: preliminary VTS tests" 2018-01-19 02:14:56 +00:00
Shawn Willden
0555ddd6ba Fix build breakage
Previous CLs to move keymaster wrappers broke the build (but somehow
not in my tree, nor in TreeHugger's build).

Test: Build
Change-Id: I0494e1e38ee7e8806f3758d533b6b1e3a6c576d1
2018-01-18 19:12:53 -07:00
Frank Salim
ad57fa93fb ImportWrappedKey: preliminary VTS tests
• Happy-path import
• Masked
• Wrong mask
• Wrong Purpose

Bug: 63931634

Test: data/nativetest/VtsHalKeymasterV4_0TargetTest/VtsHalKeymasterV4_0TargetTest --hal_service_instance=android.hardware.keymaster@4.0::IKeymasterDevice/strongbox
Change-Id: Ie7948bca25ee4840d179fb879b054755199c96d9
2018-01-18 17:32:35 -07:00
Frank Salim
16350c9efc Specify SecurityLevel::SOFTWARE in default keymaster 4.0 service.
Test: it compiles

Change-Id: I0ae85000c802dd375f0c7d66c7c9c71b143107aa
2018-01-18 14:41:20 -08:00
Shawn Willden
7d339812c9 Move Keymaster wrapper into support library.
This wrapper was used to manage KM3/KM4 compatibility in keystore.
It's also needed in vold, so this CL moves it here, to make it usable
for vold.

Test: keystore CTS tests
Change-Id: I8079b8577f7d4a8fd67f47fbe1f48861e4a0734b
2018-01-18 15:39:50 -07:00
Shawn Willden
8823a4415c Add support for 3DES algorithm to Keymaster.
Test: VtsHalKeymasterV4_0TargetTest
Bug: 31675676
Change-Id: I68a67b78979002a38e92454f79715ed516026889
2018-01-17 14:15:38 -07:00
Shawn Willden
2d6b39d034 Add Trusted User Presence support to Keymaster HAL.
Test: not yet
Change-Id: I99451cb6e21b577281bd7a889e1a44db7b26525f
2018-01-10 22:52:12 -07:00
Shawn Willden
a6eb3faeb5 Remove references to Keymaster::3.0 from Keymaster::4.0
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Idf627a3d7a51d2a464bd1723a32e88f43969bf45
2018-01-04 15:05:36 -07:00
Janis Danisevskis
c0af94ad84 Merge "Fix typos in KM4 interface definition documentation" 2018-01-02 17:36:26 +00:00
Janis Danisevskis
d29fb73c14 Fix typos in KM4 interface definition documentation
Test: N/A
Change-Id: I037ae8bc8cd35479a8e19af2f4651206fb02fda9
2017-12-27 09:09:54 -08:00
Steven Moreland
7d1e04051e Update Keymaster makefiles.
Test: none
Change-Id: Ic7cc31f9cee7ceaa834e48b6de39d4a351aff2b1
2017-12-22 14:59:16 -08:00
Shawn Willden
647357f6cb Remove libkeymaster_staging
Test: Builds
Change-Id: I742a3e36fd96c3a1b37181f48aab7e5faa63b063
2017-12-21 12:49:35 -07:00
TreeHugger Robot
4f7dabb1a9 Merge "Add support for StrongBox implementations to Keymaster HAL" 2017-12-12 18:48:05 +00:00
Shawn Willden
9e0c1fe534 Add support for StrongBox implementations to Keymaster HAL
Also adds secure key import.

Bug: 63931634
Test: not yet
Change-Id: I54f38a8787e2fcb51e01f378228e4a0c576fdfbe
2017-12-12 07:14:45 -07:00
Steven Moreland
4cd5506baa Update makefiles.
Been seeing these in CLs. Some were forgotten.

Test/Bug: none

Change-Id: I678f9ef157a3631586a3d3a9cc503121eed5a703
2017-12-11 20:48:11 +00:00
Shawn Willden
32aa7ecb55 Rename IKeymaster back to IKeymaserDevice
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Ic5e7f936ef75aa64834677f6589822fbedce39cd
2017-11-30 19:37:07 -07:00
Shawn Willden
1e50c676f6 Add Keymaster V4.0
This CL merely duplicates all of the Keymaster V3.0 functionality and
VTS tests, and provides a pure software implementation of the 4.0 HAL,
which passes the VTS tests.  Future CLs will remove some cruft and
unused features, then add new features and accompanying tests.

Note that the reason that this is V4.0 rather than V3.1 is because V4.0
will not be fully backward compatible with V3.0.  Specifically, V4.0
will allow for "StrongBox" implementations, which will only provide a
subset of Keymaster functionality.  StrongBox versions of Keymaster will
be implemented in discrete, special-purpose hardware which will
generally be much less powerful (slower, less RAM, etc.) than is needed
to support a full Keymaster implementation.

So, while the V4.0 interface will be a strict superset of the V3.0
interface, which could normally be best implemented as an extension, it
will allow StrongBox implementations which are unable to pass the V3.0
test suite, which means that it will not be true that a V4.0
impementation IS-A V3.0 implementation, as would be expected of a V3.1
implementation.  The V4.0 test suite will distinguish between StrongBox
and non-StrongBox implementations and enforce appropriately-reduced
requirements on the former.

In addition to the duplication, 4.0 also cleans up some cruft from 3.0:

  - Removes tags and types which were in previous versions but never
    used;
  - Removes support for wrapping pre-Treble keymaster HALs with KM4,
    since they'll only be wrapped by the default KM3 implementation;
  - Renames the ROLLBACK_RESISTANT tag to ROLLBACK_RESISTANCE and
    defines new semantics for it;
  - Changes auth token handling to use the HardwareAuthToken struct
    passed in as an explicit argument to the relevant methods,
    rather than an opaque byte vector provided as a KeyParameter;
  - Updates the VTS tests to use a gtest "environment" for better
    integration with VTS test infrastructure;
  - Adds a test for upgradeKey.
  - Makes comment formatting more consistent, including using the
    correct two-space typographical convention to separate sentences.

Bug: 63931634
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I3f01a4991beaa5c4332f72c91e8878a3bf0dec67
2017-11-28 13:41:52 -07:00
Iris Chang
784e993ef6 Merge "Fix Keymaster VTS for OpenSSL error code change" am: fc23356909 am: f9fceff665
am: 11fab4809b

Change-Id: Ibe60ee37e674ff9622f795b6cce7ae9c255bd5d5
2017-11-22 02:16:25 +00:00
Iris Chang
f9fceff665 Merge "Fix Keymaster VTS for OpenSSL error code change"
am: fc23356909

Change-Id: If832fc5e82618c394fd253215cd5c8e5e0011e39
2017-11-22 02:04:08 +00:00
Treehugger Robot
fc23356909 Merge "Fix Keymaster VTS for OpenSSL error code change" 2017-11-22 01:55:27 +00:00
Ryan Campbell
6f62a49017 Transfer VTS test ownership. am: ae6b2a5f1e am: 8ca98990ab
am: 4596756e1b

Change-Id: I3f889b17ff28d49c120b4ce42f1b79a75441bc0d
2017-11-17 02:17:33 +00:00
Ryan Campbell
8ca98990ab Transfer VTS test ownership.
am: ae6b2a5f1e

Change-Id: I4dd526bbfc6e8fa51495f4298e820e62f2fb62dd
2017-11-17 02:10:09 +00:00
Ryan Campbell
ae6b2a5f1e Transfer VTS test ownership.
Remove self from test ownership and transfer to new owners as agreed.

Test: none
Bug: 69425312
Change-Id: I8b189e6f2d7076b9ee7f3bad91445ccf6c5e1767
Merged-In: I8b189e6f2d7076b9ee7f3bad91445ccf6c5e1767
2017-11-16 14:48:00 -08:00
Iris Chang
890d3dfe27 Fix Keymaster VTS for OpenSSL error code change
OpenSSL changes error code of large RSA data from
KM_ERROR_INVALID_INPUT_LENGTH to KM_ERROR_INVALID_ARGUMENT which causes
HidlHalGTest#EncryptionOperationsTest.RsaOaepTooLarge and 
HidlHalGTest#EncryptionOperationsTest.RsaPkcs1TooLarge tests failed. 
Fix keymaster VTS to accept both the error codes.

Bug: 68289922
Test: HidlHalGTest#EncryptionOperationsTest.RsaOaepTooLarge and
      HidlHalGTest#EncryptionOperationsTest.RsaPkcs1TooLargeHidlHalGTest#EncryptionOperationsTest.RsaOaepTooLarge
      and HidlHalGTest#EncryptionOperationsTest.RsaPkcs1TooLarge are
      passed after applying this modification and other Keymaster 3.0
      VTS test cases are not affected.
Change-Id: I493bfa1c6e4b69560dfae3585a416b5c3d33e215
2017-11-15 08:09:52 +00:00
Xin Li
bb9e38fef9 Merge commit '1a06284b24f5eb7bb9c1fea0817da8898b3b1bff' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: I2a044eb8c9981d0a8198ffe2df55559afbd76341
Merged-In: I4fb9f18884f7ef21162015a0032c4431444f7025
2017-11-14 12:08:38 -08:00
Steven Moreland
8db261bc99 Updating makefiles for hidl_interface.
Bug: 64487114
Test: manual
Merged-In: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
Change-Id: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
2017-11-13 10:00:18 -08:00
Steven Moreland
a1169dd600 Update makefiles for hidl_interface.
Bug: 35570956
Test: manual
Change-Id: I7a220b78ee081240e1dc30ef5672ba39e3e98375
2017-11-10 09:06:55 -08:00
Steven Moreland
1d7374c5e1 Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1 am: 6c811964a1
am: 116161d94e

Change-Id: I33643636e2511de77fdf7de57777eb67edee2e52
2017-10-11 16:39:21 +00:00
Steven Moreland
116161d94e Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1
am: 6c811964a1

Change-Id: I85ccbb4a15cd18938607f5bca4e065b9d7e0182b
2017-10-11 16:31:07 +00:00
Steven Moreland
6c811964a1 Update for Soong java makefiles. am: c3e80fa01e
am: 0fff75dee1

Change-Id: I5b524ccf13233f3696881a2a670b5d2134fd5f15
2017-10-11 16:27:24 +00:00
Steven Moreland
0fff75dee1 Update for Soong java makefiles.
am: c3e80fa01e

Change-Id: Ia8835f9c95bd98a96f5fd3aff11191e7d3726fb9
2017-10-11 16:23:54 +00:00
Steven Moreland
c3e80fa01e Update for Soong java makefiles.
Test: pass
Bug: 33420795
Change-Id: Id9b1919a19b8ff682738cfb0869a479b4dbb4293
2017-10-10 23:07:20 +00:00
Iris Chang
13edc1a4d3 Merge "VTS: fix VtsHalKeymasterV3_0Target issue" am: 1912c73a7f am: b87becf1c2 am: 7fdf8d791f
am: 41df3d9063

Change-Id: I98db06ff0ca957ea35bf0793e1ed8163dc64e2c2
2017-10-06 01:55:09 +00:00
Iris Chang
41df3d9063 Merge "VTS: fix VtsHalKeymasterV3_0Target issue" am: 1912c73a7f am: b87becf1c2
am: 7fdf8d791f

Change-Id: I63b0905fc6091f62b297ed9c85f21e97fe84decd
2017-10-06 01:53:28 +00:00
Iris Chang
7fdf8d791f Merge "VTS: fix VtsHalKeymasterV3_0Target issue" am: 1912c73a7f
am: b87becf1c2

Change-Id: I4674864a39b3f558d30bf63f1b79505c69330867
2017-10-06 01:51:40 +00:00
Iris Chang
b87becf1c2 Merge "VTS: fix VtsHalKeymasterV3_0Target issue"
am: 1912c73a7f

Change-Id: I781812c77d96a0a7beb832298df8d537ce1d55da
2017-10-06 01:49:29 +00:00
Treehugger Robot
1912c73a7f Merge "VTS: fix VtsHalKeymasterV3_0Target issue" 2017-10-06 01:43:54 +00:00
Iris Chang
54ca32a130 VTS: fix VtsHalKeymasterV3_0Target issue
Failed cases:
AttestationTest.RsaAttestation
AttestationTest.EcAttestation

Analysis:
The verify_attestation_record() in Keymaster_hidl_hal_test.cpp calls
parse_attestation_record() to set the value of att_challenge. It fails
to compare att_challenge with challenge by memcmp.
Because setToExternal() method uses buffer pointer to local variable
(record), not use memcpy to copy into itself buffer in
parse_attestation_record(). When it leaves the parse_attestation_record(),
we will get the att_challenge which is null buffer to compare with challenge
incorrectly.

Fix: use memcpy to copy the buffer.

Bug: 65039571
Test: build passed. VtsHalKeymasterV3_0Target -> PASSED: 106, FAILED: 0.

Change-Id: I700a9242cc9a5f4cb196b62860823601e4088531
2017-10-06 00:45:42 +00:00
Steven Moreland
70bfb9d250 Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f am: b53e6ad535
am: 9a17f41f6f

Change-Id: I78d9292068b372238554fd9d35128e69f5b5f9d2
2017-10-04 21:54:11 +00:00
Steven Moreland
9a17f41f6f Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f
am: b53e6ad535

Change-Id: I23269fb7a9bdd352e670a80f390527d9eef31412
2017-10-04 21:51:00 +00:00
Steven Moreland
b53e6ad535 Merge "Update for hidl adapter module defaults." am: 988c977079
am: 861651985f

Change-Id: Ifdb878720d42120e7309dd2a49e5a91059ff4b72
2017-10-04 21:48:04 +00:00