Commit graph

1182 commits

Author SHA1 Message Date
Shawn Willden
f62a22e735 Add PREUPLOAD to require clang-format.
Also move .clang-format to top of repo.

Test: N/A
Change-Id: I1d25c570bd4975a63fff88ef0b79057fe88f8848
2017-12-04 17:06:49 -07:00
Max Bires
0e69ef0c0f Merge "Fixing security vuln by tightening race condition window." 2017-12-01 22:11:44 +00:00
Dmitry Dementyev
36825119a0 Merge "Make libkeystore_aidl shared and export to PDK." 2017-11-30 01:05:35 +00:00
Max Bires
ef4f067c03 Fixing security vuln by tightening race condition window.
A proper fix for this feature requires reworking binder permission
checking to take the selinux context and not the pid. This is feature
work that should be done for P to properly fix these race conditions
that occur elsewhere in the code.

Bug: 68217699
Test: KeyStore keygen permissions cannot be bypassed through PID cycling
Change-Id: I1ba5210010d6c413c9b1dbde3df0cc566400bfac
2017-11-29 23:13:24 +00:00
Dmitry Dementyev
ab8aa1c0a6 Make libkeystore_aidl shared and export to PDK.
Bug: 69539820
Test: manual

Change-Id: I6b8e8543b89245062790443f1e8b759418f7c162
2017-11-29 14:07:22 -08:00
Janis Danisevskis
9a390a7dc7 Fixed bug in auth token formatting.
This patch also adds test for the functions hidlVec2AuthToken
and authToken2HidlVec.

Test: /data/nativetest64/keystore_unit_tests/keystore_unit_tests
Change-Id: I823939a62ca94efa45509c89d1013ec87f51d04c
2017-11-29 13:29:30 -08:00
TreeHugger Robot
3ad103c523 Merge "Fixed auth_token_table tests" 2017-11-27 19:40:46 +00:00
Janis Danisevskis
8f737ad2c4 Fixed auth_token_table tests
auth_token_table tests did not make the transition to hidle types and
were broken.
Noww they use the hidle types as well.

Also this patch fixes an awkward ownership transfer of an object
referred to by a const pointer and reduses the use of the type hw_auth_token.

Test: Ran all keystore CTS test as well as the fixed auth_token_table
      tests
Bug: 68149839

Change-Id: Ia69a80fad12edc134646a7b340f8e27ea4da2210
2017-11-22 13:59:40 -08:00
Dmitry Dementyev
af2968c922 Add static dependency between key_store_service and IKeyStoreService.aidl
Test: manual
Bug: 69539820
Change-Id: Ie49cb6023213c1b91fb85d12b934b961c3703cc9
2017-11-22 05:30:01 +00:00
Dmitry Dementyev
4a182800b1 Merge "Get rid of manually created IKeystoreService." 2017-11-17 22:32:12 +00:00
Dmitry Dementyev
a447b3c9af Get rid of manually created IKeystoreService.
Generated IKeystoreService has different signature, which required lots
of refactoring.
After update methods relevant data using last parameter.
Test: cts-tradefed run cts -m CtsKeystoreTestCases
Bug: 68389643

Change-Id: I0ca36a2e9e007143a3b403b306a8f979ee98b232
2017-11-16 18:35:51 -08:00
Xin Li
acd1892cc6 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
am: a18ca90b02

Change-Id: I77b02bbd1748e9f04feb51456567e0f509d32d77
2017-11-15 02:31:44 +00:00
Xin Li
a18ca90b02 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
Change-Id: Ia64f0605c81305f106bfeb298a03b5bdf7735feb
2017-11-14 16:38:31 -08:00
Xin Li
f380c40827 Merge commit '320717adfab49735d0f5c330edda33a38540fcdb' into HEAD
Change-Id: I57d58be603c4706f8dbe50e2aa861b2c1456971f
2017-11-13 14:36:04 -08:00
TreeHugger Robot
1cb37a7681 Merge "Remove softkeymaster" 2017-11-08 19:10:41 +00:00
Shawn Willden
b0604b6df1 Remove softkeymaster
This is ancient code that isn't used.  In addition, it's a keymaster0
implementation, and we're removing support for keymaster0.

Test: N/A
Change-Id: I4b473af04d77ccb4c9aa64a964a855ef0977c570
2017-11-07 08:01:45 -07:00
Rubin Xu
2d481888ef [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours am: 0d3e006ed8 -s ours am: 383607b113 -s ours am: 62990b5484 -s ours am: efcaf661e7 -s ours am: 240fea4f73 -s ours
am: 0d53d0072c  -s ours

Change-Id: Ia67c230c83439d8559c6bf5609a2051f4bc199ed
2017-11-06 23:32:12 +00:00
Rubin Xu
abcc03e458 [DO NOT MERGE] Fix keychain key upgrade issue am: 58291e0ff3 am: aa1474b3e9 -s ours am: 5b60e7659c -s ours am: 25f39e9fb0 -s ours am: 8bb6666acd -s ours
am: f247e0703f  -s ours

Change-Id: I32b3e55a04e5f486c9d31886ff0085e37f805977
2017-11-06 23:31:41 +00:00
Rubin Xu
2bb1868740 resolve merge conflicts of 2b93ec4 to oc-dr1-dev am: 0010dae9ff -s ours am: 26d17119a5 -s ours
am: 70148def02  -s ours

Change-Id: Ic38137141e1e636ecebc8e87a107fd5e75978fba
2017-11-06 23:31:19 +00:00
Rubin Xu
0d53d0072c [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours am: 0d3e006ed8 -s ours am: 383607b113 -s ours am: 62990b5484 -s ours am: efcaf661e7 -s ours
am: 240fea4f73  -s ours

Change-Id: I3db0a8860ed14376e5da88c137e70f4544e681c6
2017-11-06 23:24:20 +00:00
Rubin Xu
f247e0703f [DO NOT MERGE] Fix keychain key upgrade issue am: 58291e0ff3 am: aa1474b3e9 -s ours am: 5b60e7659c -s ours am: 25f39e9fb0 -s ours
am: 8bb6666acd  -s ours

Change-Id: I44872ebc1f97d7557a5d304d6de6c5cf306724f6
2017-11-06 23:24:02 +00:00
Rubin Xu
70148def02 resolve merge conflicts of 2b93ec4 to oc-dr1-dev am: 0010dae9ff -s ours
am: 26d17119a5  -s ours

Change-Id: I722c862f0980af8d457e431499a95ee5ca15a643
2017-11-06 23:23:48 +00:00
Rubin Xu
240fea4f73 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours am: 0d3e006ed8 -s ours am: 383607b113 -s ours am: 62990b5484 -s ours
am: efcaf661e7  -s ours

Change-Id: I4e32b64b1a28439d6bc817e0f58fdc43b3fc2951
2017-11-06 23:19:29 +00:00
Rubin Xu
8bb6666acd [DO NOT MERGE] Fix keychain key upgrade issue am: 58291e0ff3 am: aa1474b3e9 -s ours am: 5b60e7659c -s ours
am: 25f39e9fb0  -s ours

Change-Id: Id4d11d780e9d48269a44b712b394046e86faf360
2017-11-06 23:19:17 +00:00
Rubin Xu
efcaf661e7 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours am: 0d3e006ed8 -s ours am: 383607b113 -s ours
am: 62990b5484  -s ours

Change-Id: Ie628d3bc340778d7f7f0411c3b355d5084eb3d7d
2017-11-06 23:17:18 +00:00
Rubin Xu
25f39e9fb0 [DO NOT MERGE] Fix keychain key upgrade issue am: 58291e0ff3 am: aa1474b3e9 -s ours
am: 5b60e7659c  -s ours

Change-Id: I2d6daaa53c62cb6c52d6fe809589b7e802fe1d63
2017-11-06 23:16:48 +00:00
Rubin Xu
26d17119a5 resolve merge conflicts of 2b93ec4 to oc-dr1-dev
am: 0010dae9ff  -s ours

Change-Id: Ie076c74cbed08183383210d36b4761842ec37c49
2017-11-06 23:14:16 +00:00
Rubin Xu
0010dae9ff resolve merge conflicts of 2b93ec4 to oc-dr1-dev
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ie605cbb7f90eca6d17c2c5f6a50ec1ee21edf633
Merged-In: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
2017-11-03 23:23:43 +00:00
Rubin Xu
62990b5484 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours am: 0d3e006ed8 -s ours
am: 383607b113  -s ours

Change-Id: I8e8d6b72df138917006264c71b1417931d1a17a4
2017-11-03 16:58:54 +00:00
Rubin Xu
383607b113 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a am: 1ed3e156c3 -s ours
am: 0d3e006ed8  -s ours

Change-Id: I77ee7a76670bee6284c473c5c152491094d06483
2017-11-03 16:57:26 +00:00
Rubin Xu
0d3e006ed8 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a am: c06ec2348a
am: 1ed3e156c3  -s ours

Change-Id: I8c0536ffb8dc6c524f538db2a718febf033e06ce
2017-11-03 16:55:28 +00:00
Rubin Xu
1ed3e156c3 [DO NOT MERGE] Fix keychain key upgrade issue am: 7593bbf15a
am: c06ec2348a

Change-Id: Ie39fee6399eb1445ad439da1703d97d709860859
2017-11-03 16:53:59 +00:00
Rubin Xu
c06ec2348a [DO NOT MERGE] Fix keychain key upgrade issue
am: 7593bbf15a

Change-Id: Id3cf379aad3fc6475a737bf5ebc92549075d18fa
2017-11-03 16:50:57 +00:00
Rubin Xu
5b60e7659c [DO NOT MERGE] Fix keychain key upgrade issue am: 58291e0ff3
am: aa1474b3e9  -s ours

Change-Id: I6881bad273783b5e4de6ad4985f41259394d6677
2017-11-03 16:12:51 +00:00
Rubin Xu
aa1474b3e9 [DO NOT MERGE] Fix keychain key upgrade issue
am: 58291e0ff3

Change-Id: Ib1f3f0cea8c13b83b8918e38f7dbdd4d4afd9d7b
2017-11-03 16:10:53 +00:00
Rubin Xu
7593bbf15a [DO NOT MERGE] Fix keychain key upgrade issue
Fix issues in keystore where it didn't handle key upgrade for granted keys
or keys with effective uid (keys under WiFi uid)  correctly.

Test: manual
Bug: 66094261
Change-Id: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
Merged-In: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
2017-11-01 23:29:56 +00:00
Rubin Xu
58291e0ff3 [DO NOT MERGE] Fix keychain key upgrade issue
Fix issues in keystore where it didn't handle key upgrade for granted keys
or keys with effective uid (keys under WiFi uid)  correctly.

Test: manual
Bug: 66094261
Change-Id: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
Merged-In: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
2017-11-01 23:25:37 +00:00
Rubin Xu
2b93ec41b1 [DO NOT MERGE] Fix keychain key upgrade issue
Fix issues in keystore where it didn't handle key upgrade for granted keys
or keys with effective uid (keys under WiFi uid)  correctly.

Test: manual
Bug: 66094261
Change-Id: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
Merged-In: I6709b7562d47ad6156bee88a9e2d961f8a4a797d
2017-11-01 23:23:09 +00:00
Colin Cross
014253ec0d Merge "Move keystore to Android.bp." am: 96b00c572e am: eeec1dd470
am: 6807442953  -s ours

Change-Id: Ib656e15a8c7d3ec8b88b97435a0f13532724a2fa
2017-10-25 05:57:42 +00:00
Colin Cross
6807442953 Merge "Move keystore to Android.bp." am: 96b00c572e
am: eeec1dd470

Change-Id: Id7de391cb1d74861d8e2d9a818a800e0f7c9f8fc
2017-10-25 05:39:13 +00:00
Colin Cross
eeec1dd470 Merge "Move keystore to Android.bp."
am: 96b00c572e

Change-Id: I5a82d97d5c94f0cc5f6535bf20df8db77e54238a
2017-10-25 05:07:31 +00:00
Colin Cross
96b00c572e Merge "Move keystore to Android.bp." 2017-10-25 04:43:08 +00:00
Jeff Sharkey
817ec0e18c Move keystore to Android.bp.
Test: builds, boots
Bug: 67041047
Change-Id: I4ec9ddc69552d853e7d1c2296dcd8de8cb3f5942
Merged-In: I4ec9ddc69552d853e7d1c2296dcd8de8cb3f5942
(cherry picked from commit c493cf9586)
2017-10-24 16:07:19 -07:00
Jeff Sharkey
43e192b2a1 Merge "Move keystore to Android.bp." 2017-10-23 23:50:45 +00:00
Jeff Sharkey
c493cf9586 Move keystore to Android.bp.
Test: builds, boots
Bug: 67041047
Change-Id: I4ec9ddc69552d853e7d1c2296dcd8de8cb3f5942
2017-10-23 16:03:59 -06:00
Rubin Xu
a64af24888 Handle auth token with same timestamp am: bfb01d904d
am: d169e1dc0e

Change-Id: I4286a52a62ac9a96a188a874ef6df11e36a741f7
2017-10-23 20:15:34 +00:00
Rubin Xu
d169e1dc0e Handle auth token with same timestamp
am: bfb01d904d

Change-Id: I0f7da1e8ff3f4696ae2889ae3ab58f9d5c58ec61
2017-10-23 20:13:04 +00:00
Rubin Xu
bfb01d904d Handle auth token with same timestamp
We observed on some Pixel C that they sometimes generate auth token with
a stuck timestamp value. Since the timestamp value does not increase,
newer auth token is not considered "superceding" old auth tokens and keystore
end up retrieving older auth tokens which are then treated as expired due to
its time_received value being too old.

We workaround this issue by comparing both the timestamp (which is part of
auth token) and the time_received (which is a monotonic clock value at the
time auth token is sent to keystore). So a new auth token with stuck timestamp
value but newer time_received still supercedes older auth tokens.

This is actually sufficient to workaround the issue on Pixel C, since the stuck
timestamp value is returned by the secure RTC, whose value is also used by
keymaster TA to check key authorization. In other words, the auth token is
still good to authorize auth-bound keys, even with a stuck timestamp value.
This does mean that on the affected Pixel C, auth-bound keys are not enforced
at TrustZone leve, but merely a logical check in keystore daemon.

Bug: 65283496
Test: boot device, unlock successfully
Change-Id: I0b9d5463e94241bfaf552dcb31fea04ee966596c
2017-10-23 17:06:04 +01:00
Jae Shin
79099783a0 Merge changes from topic "keymaster_stl_none" am: b1de50e9b0 -s ours am: 9fe270641d -s ours am: 74d54102cc -s ours
am: 320717adfa  -s ours

Change-Id: Icc8fade3ff63b1fa16c14f5710966a5c1379fded
2017-10-16 01:45:40 +00:00
Jae Shin
320717adfa Merge changes from topic "keymaster_stl_none" am: b1de50e9b0 -s ours am: 9fe270641d -s ours
am: 74d54102cc  -s ours

Change-Id: I387139332afb450dae7f81c76f45cb9d491f2efa
2017-10-16 01:41:08 +00:00