Commit graph

3712 commits

Author SHA1 Message Date
Seth Moore
4fce5e7d8b Add prod GEEK to rkp_factory_extraction_tool am: 01688560f9
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1748446

Change-Id: I7baa1c4624591664d9cc5212ca5ced7ebf4d5777
2021-06-30 20:57:33 +00:00
Seth Moore
6654f0255c Remove duplicate generateEekChain routine am: 6dfb02a3f9
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1748445

Change-Id: Ice2673060fbe9646901d96fd28e931ec6e540baa
2021-06-30 20:57:28 +00:00
Martijn Coenen
36ef057910 Merge "On-device signing: reject everything that's not a regular file/dir." am: 30257fa908
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1751220

Change-Id: If41aba7810a4ff4deecd9161d013ed8b7a984bef
2021-06-29 14:52:48 +00:00
Martijn Coenen
30257fa908 Merge "On-device signing: reject everything that's not a regular file/dir." 2021-06-29 14:37:29 +00:00
Martijn Coenen
0f760d7d54 On-device signing: reject everything that's not a regular file/dir.
We shouldn't allow anything else in the artifacts output directory.

Bug: 192061595
Test: TEST_MAPPING
Change-Id: I1be9dfd7982d543a8979ac3a34551bd5449004f7
2021-06-29 14:51:46 +02:00
Martijn Coenen
61872e9245 Merge "On-device signing: Use correct deleteKey() instance." am: d2dede4e7b
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1748471

Change-Id: I8b39c59d5720f1558614b546f165e1e6bc7174c9
2021-06-29 12:00:12 +00:00
Martijn Coenen
d2dede4e7b Merge "On-device signing: Use correct deleteKey() instance." 2021-06-29 11:29:24 +00:00
Martijn Coenen
16e25c5140 On-device signing: Use correct deleteKey() instance.
Use the one that isn't for blobs.

Bug: 190711210
Test: TEST_MAPPING
Change-Id: Ia77cbb8a94cfe96d4dc511e60b9e0b5da384eae6
2021-06-29 11:03:07 +02:00
Seth Moore
01688560f9 Add prod GEEK to rkp_factory_extraction_tool
The production Google Endpoint Encryption Key has been generated, so
include it in the tooling that is used at the factory to encrypt the
Boot Certificate Chain.

Keep test mode support around, gating it behind a flag.

Test: librkp_factory_extraction_test
Bug: 191301285
Change-Id: I62d6251610aab10b91661eda3ae801f1bb6ff5dc
Merged-In: I62d6251610aab10b91661eda3ae801f1bb6ff5dc
2021-06-25 10:47:18 -07:00
Seth Moore
6dfb02a3f9 Remove duplicate generateEekChain routine
Reduce duplicated code, hooray. Also, we'll be adding the real EEK to
the support library, so prepare for that by linking it now.

Bug: 191301285
Test: Manually run rkp_factory_extraction_tool
Change-Id: I7e1695e3a512be01e24f681aa0a369d3482ad383
Merged-In: I7e1695e3a512be01e24f681aa0a369d3482ad383
2021-06-25 10:46:56 -07:00
Alan Stokes
c1fb01c8dd Merge "On-device signing: Delete the HMAC key when failing to use it." am: 890f115606
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1740993

Change-Id: I80c6efb375f87acd5891bed6b01bef6c5bcbf80a
2021-06-24 08:32:31 +00:00
Alan Stokes
890f115606 Merge "On-device signing: Delete the HMAC key when failing to use it." 2021-06-24 08:19:00 +00:00
Max Bires
db70e65fca Merge "Fixing CBOR parsing/serialization for prod keys." am: 1b8aac34d3
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1741360

Change-Id: I08d51896b66d9b5015a6d780af6de717502c0bf6
2021-06-23 22:07:57 +00:00
Max Bires
1b8aac34d3 Merge "Fixing CBOR parsing/serialization for prod keys." 2021-06-23 21:54:34 +00:00
Max Bires
67e9512b81 Fixing CBOR parsing/serialization for prod keys.
Production keys are 6 bytes smaller than test keys due to the absence of
an entry in the COSE_Key map which would denote that key as a test key.
(-70000, nil). This patch properly adjusts for the size difference
between the two keys.

Bug: 189018262
Test: Let the provisioner run.
Change-Id: I9ff0c99e58a1691c8e7bdedb0cbeafb683b39722
Merged-In: I9ff0c99e58a1691c8e7bdedb0cbeafb683b39722
2021-06-22 19:30:11 -07:00
Treehugger Robot
b5a729015d Merge "Fix VPN profile store test" am: f2fa29c555
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1743116

Change-Id: I223db42d26bfb6a899d28c8797e086bf9e0bf217
2021-06-22 18:52:05 +00:00
Treehugger Robot
f2fa29c555 Merge "Fix VPN profile store test" 2021-06-22 18:39:12 +00:00
Seth Moore
9ebec5fe6e Fix VPN profile store test
WAL mode was disabled, but one of the VPN profile store tests was
still checking to ensure WAL mode was enabled.

Fixes: 191099248
Test: keystore2_test
Test: vpnprofilestore_test
Change-Id: Ib02057e01bbc73ac3b744a4298fc388487fb61a8
Merged-In: Ib02057e01bbc73ac3b744a4298fc388487fb61a8
2021-06-22 10:20:28 -07:00
Martijn Coenen
efbb567893 On-device signing: Delete the HMAC key when failing to use it.
This may allow us to recover in certain bad situations. Also, add some
more clear error logs when failing to create/delete a key, to make it
easier to debug failures.

Bug: 190711210
Test: TEST_MAPPING
Change-Id: Ib9a9ce0c0d0e99ce44d124af85775780f448a854
2021-06-22 10:36:43 +02:00
Treehugger Robot
88f0421811 Merge "Keystore2: fix test_large_number_of_concurrent_db_manipulations" am: bd5edbc517
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1736167

Change-Id: I5522264f64ef12c9ba245d9d895699f3a93d0a74
2021-06-21 23:22:10 +00:00
Treehugger Robot
e3b386822c Merge "Keystore2: Stop using WAL mode" am: 82beab1d29
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1736166

Change-Id: Ib25c27837b22ed2a362caef1f857e5633f593112
2021-06-21 22:58:21 +00:00
Treehugger Robot
bd5edbc517 Merge "Keystore2: fix test_large_number_of_concurrent_db_manipulations" 2021-06-21 20:21:41 +00:00
Treehugger Robot
82beab1d29 Merge "Keystore2: Stop using WAL mode" 2021-06-21 20:17:02 +00:00
Kris Alder
8fa1f1e619 Merge changes Ifba05b57,Idd0f35fc am: 9c9ff707e3
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1724731

Change-Id: I63a22b480abf4a2b18bf6549a1dd640ea67552e8
2021-06-18 23:47:48 +00:00
Kris Alder
9c9ff707e3 Merge changes Ifba05b57,Idd0f35fc
* changes:
  libkeystore-wifi-hidl: Updated to vendor_available:true
  libkeystore-wifi-hidl: Updated Android.bp
2021-06-18 23:31:13 +00:00
Janis Danisevskis
bf16a2b2e3 Merge "To initialize StrongBox KM with TEE KM" am: 8f6fb01eaf
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1740354

Change-Id: If95259582fe40421b31f287defc277aeb8e85883
2021-06-18 18:52:24 +00:00
Janis Danisevskis
8f6fb01eaf Merge "To initialize StrongBox KM with TEE KM" 2021-06-18 18:40:47 +00:00
Treehugger Robot
c2d11c39bf Merge "Use fsverity_formatted_digest from <linux/fsverity.h>" am: f557951af1
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1731926

Change-Id: I3fe92b73781abfa54d2f46c99fa5b06caa128a1b
2021-06-18 03:18:43 +00:00
Treehugger Robot
f557951af1 Merge "Use fsverity_formatted_digest from <linux/fsverity.h>" 2021-06-18 03:06:23 +00:00
Eric Biggers
37708580d9 Use fsverity_formatted_digest from <linux/fsverity.h>
struct fsverity_formatted_digest (previously called
fsverity_signed_digest) is now in <linux/fsverity.h>, so there is no
longer any need to have a local definition of it.

Test: build
Change-Id: Ie3623a56fe6415d686a51ddfde8a1ebab83b8364
2021-06-18 02:00:55 +00:00
Manish Dwivedi
ddae34a825 To initialize StrongBox KM with TEE KM
Test: Run Keystore CTS tests
Bug: b/191171542
Change-Id: I0f2c6d4e1d7a3fda973bcf65fd967119cbd52337
2021-06-17 20:44:05 +00:00
Treehugger Robot
eadab2cd2d Merge "Remove provisioner_cli tool" am: e47093b55c
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1738081

Change-Id: I657e0f5a8e5c05f2aa72b6b6f53e7a949cdaf11f
2021-06-17 12:16:21 +00:00
Treehugger Robot
e47093b55c Merge "Remove provisioner_cli tool" 2021-06-17 12:01:19 +00:00
Alan Stokes
f3489a8dc0 Merge changes I1bcb7f89,I2f2f0434 am: 24fed161df
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1736867

Change-Id: I43ac8c907f5e449302643f0a2515bd101e6bf0d5
2021-06-17 08:15:17 +00:00
Alan Stokes
24fed161df Merge changes I1bcb7f89,I2f2f0434
* changes:
  Add (fake) CompOS key verification.
  Add (fake) CompOS key generation.
2021-06-17 08:06:11 +00:00
Seth Moore
7c05fd841e Remove provisioner_cli tool
This tool has been made obsolete by rkp_factory_extraction_tool

Test: n/a -- nothing uses this tool
Change-Id: Ic15ff9e526809dd7dae0d9f17b79fd7ff87f61c7
2021-06-16 15:13:00 -07:00
Alan Stokes
4ead5ec4ca Merge "Improved error checking for fsverity_init/odsign." am: 5cfce6fda6
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1733276

Change-Id: Ia37dcd49dcbc543b9eeffc989544ce0ec9428cb7
2021-06-15 08:25:55 +00:00
Alan Stokes
5cfce6fda6 Merge "Improved error checking for fsverity_init/odsign." 2021-06-15 08:16:13 +00:00
Seth Moore
444b51aea7 Keystore2: fix test_large_number_of_concurrent_db_manipulations
The test was disabled and got stale. Fix the test so it uses the GC,
as it's useful for checking perf-related code changes. Will investigate
fully re-enabling the test on T.

Bug: 190142197
Test: keystore2_test
Change-Id: Ifc0a4a5b3c8c301c42d068ee46754d877eeb10bc
Merged-In: Ifc0a4a5b3c8c301c42d068ee46754d877eeb10bc
2021-06-14 14:28:41 -07:00
Seth Moore
fbe5cf545c Keystore2: Stop using WAL mode
WAL mode attempts to open an additional file for use as a shared memory
mechanism. If storage is too full, then the database fails to open.
Remove the use of WAL mode so that keystore can perform read-only
transactions on the database and startup even on a full disk.

Disabling WAL mode shows about a 5% performance drop on a synthetic test
that creates and destroys 5000 AES keys.

Bug: 190142197
Test: keystore2_test
Change-Id: I9b1cb7e6398e07fa9f02f0ba4e9eb48313c06472
Merged-In: I9b1cb7e6398e07fa9f02f0ba4e9eb48313c06472
2021-06-14 14:28:32 -07:00
Alan Stokes
314845dc8f Add (fake) CompOS key verification.
If we have a persisted key blob and public key for CompOS, but no
cert, then get CompOS to verify that they are genuine. If so, we can
generate a new cert for the public key. Otherwise we fall back to
generating a new keypair.

Once again I have made a few unrelated changes as I understand things
better.

Bug: 190166662
Test: Presubmit
Test: Manual - various valid & missing/invalid files.
Change-Id: I1bcb7f89698c103f413bdb899026bfd2578447db
2021-06-14 18:02:52 +01:00
Alan Stokes
bfd2ec0404 Add (fake) CompOS key generation.
Note: the CompOS work here is all still behind an if (false).

Added a new class, FakeCompOs, to allow prototyping of the interface
and implementation of the key management work that will be in CompOS.

Extensive refactoring of the certificate generation code to support
both a self-signed cert and our certificate for the CompOS key.

Bug: 190166662
Test: presubmits
Test: manual - certificate gets generated on first boot
Test: manual - certificate verifies ok on second boot
Test: manual inspection of the generated certs' text form
Change-Id: I2f2f043427774c0805e963dfe582feb8d3eac3a4
2021-06-14 09:15:39 +01:00
Xin Li
06d1b48561 Merge "DO NOT MERGE - Merge ab/7272582" am: ee5c643f54
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1735953

Change-Id: I4c281f211463cf0143fdc1c20c48e23c19f3a111
2021-06-14 03:14:01 +00:00
Xin Li
28bf846900 DO NOT MERGE - Merge ab/7272582 am: 9c0a7e2b65
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1735953

Change-Id: I3d1b2d96eba9b3dfceaabb89f673c6be1c9a8aad
2021-06-14 03:13:54 +00:00
Xin Li
ee5c643f54 Merge "DO NOT MERGE - Merge ab/7272582" 2021-06-14 03:02:54 +00:00
Xin Li
9c0a7e2b65 DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Change-Id: I477816eed7b78ae7768be4eafec685d44f24f4cc
2021-06-11 17:34:04 -07:00
Alan Stokes
246a7f13ac Improved error checking for fsverity_init/odsign.
When attempting to load a non-existent cert I got:
  06-10 12:48:11.939   662   662 E fsverity_init: Failed to add key: Invalid argument
  06-10 12:48:11.940   662   662 E fsverity_init: Failed to load key from stdin
  06-10 12:48:11.941   648   648 I odsign  : Added CompOs key to fs-verity keyring
Which looks like everything worked when nothing did.

Added more error checks on both sides.

Test: Presubmits
Test: Manual
Change-Id: Ib2b17ce75e58dafb0ad6905106e35b11b55e91d0
2021-06-11 10:01:33 +01:00
Aditya Wazir
64ce92520d libkeystore-wifi-hidl: Updated to vendor_available:true
Updated libkeystore-wifi-hidl from 'vendor: true' to 'vendor_available: true'

Test: Build libkeystore-wifi-hidl
Bug: 187130384

Change-Id: Ifba05b57248f52ac33e297acd5d0b7811e3524ee
2021-06-11 11:06:26 +05:30
Aditya Wazir
f6c3bfc428 libkeystore-wifi-hidl: Updated Android.bp
Updated Android.bp to build both static and shared library

Test: Build libkeystore-wifi-hidl
Bug: 187130384

Change-Id: Idd0f35fc33a224c598fc3e96f11f88cacf5c9aba
2021-06-11 11:06:10 +05:30
Treehugger Robot
3542845824 Merge "Keystore 2.0: Don't panic key negotiation checksum failure." am: 21f7f98fe8
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1733716

Change-Id: I24c829347ad9a0d7ca62edaaae6ab3768b203653
2021-06-10 23:59:46 +00:00