Commit graph

4486 commits

Author SHA1 Message Date
Jiyong Park
1e9141c568 Merge "Remove ndk_platform backend. Use the ndk backend." am: 2624b3c19b am: 84a431d23b
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1779388

Change-Id: I165be325a3fe99b815bffbcbec4ff059ec456643
2021-08-03 12:10:47 +00:00
Jiyong Park
84a431d23b Merge "Remove ndk_platform backend. Use the ndk backend." am: 2624b3c19b
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1779388

Change-Id: I12550f61717bb3b7bc10b3d75fdb7920d1f41035
2021-08-03 11:55:21 +00:00
Jiyong Park
2624b3c19b Merge "Remove ndk_platform backend. Use the ndk backend." 2021-08-03 11:18:25 +00:00
Victor Hsieh
bf246870cb Merge "Handle instance files in odsign." am: cae52dba68 am: fa6659930c
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1782974

Change-Id: Id3517e4f890e74355a4e34c2c6b11a5cc8a836a7
2021-08-02 23:10:28 +00:00
Victor Hsieh
fa6659930c Merge "Handle instance files in odsign." am: cae52dba68
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1782974

Change-Id: Ia15c728799d05a3d103f57c25f1bf0fecb207285
2021-08-02 22:58:53 +00:00
Victor Hsieh
cae52dba68 Merge "Handle instance files in odsign." 2021-08-02 22:44:08 +00:00
Alan Stokes
cd193a9f54 Handle instance files in odsign.
Each CompOS VM (pending or current) will need an instance file.

Add checking/use of these to odsign.

I now believe it never makes sense for odsign to attempt to generate a
new CompOS keypair; CompOS can do that itself when appropriate. So
remove a bunch of code related to that (it's been re-implemented in
CompOS in Rust anyway).

FakeCompOs now takes an instance file parameter, although only the
real CompOS will do anything with it.

Move all the instance & key files to
/data/misc/apexdata/com.android.compos, since CompOS should own them.

More refactoring & general tinkering.

This is all still behind "if (false)", but we're getting closer to
removing that.

Fix: 194654666
Test: Manual: Pending but no current instance; pending and current;
Test: current only with and without cert; no instances but valid cert;
Test: no compos files at all; invalid pending keys;
Test: invalid current keys.
Change-Id: Ie92ba414415b237512621c76c647640508f4b1e6
2021-08-02 08:29:35 -07:00
Treehugger Robot
f6eeafed60 Merge "Fix warnings in preparation for Rust 1.54.0" am: 8125bace85 am: d120d41334
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1780388

Change-Id: I22c41f623581fe49c9db8e8a0c75bfc04146ed90
2021-07-29 18:48:55 +00:00
Treehugger Robot
d120d41334 Merge "Fix warnings in preparation for Rust 1.54.0" am: 8125bace85
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1780388

Change-Id: I4c4a51abcaeeef3b30caffb84ce2a5a92f768c03
2021-07-29 18:34:23 +00:00
Treehugger Robot
8125bace85 Merge "Fix warnings in preparation for Rust 1.54.0" 2021-07-29 18:14:08 +00:00
Martijn Coenen
60f9aab241 [automerger skipped] Merge "Don't mark odsign as oneshot." into sc-dev am: 301d13c4ce -s ours
am skip reason: Merged-In I7015f291888d6b8066e4c526a7e8cf3c9c7ea618 with SHA-1 2e8a9845e3 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/15393113

Change-Id: I3fffd038eeb48d6ac0a895773007ccad16abf7b1
2021-07-28 15:15:19 +00:00
Martijn Coenen
301d13c4ce Merge "Don't mark odsign as oneshot." into sc-dev 2021-07-28 15:06:47 +00:00
Martijn Coenen
d09f0cd7f5 Merge "Don't mark odsign as oneshot." am: 5c19d23b52 am: d5847cf879
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1781067

Change-Id: I1879cf20b97c07307fdf6c718e224b12945a2b68
2021-07-28 12:20:34 +00:00
Martijn Coenen
d5847cf879 Merge "Don't mark odsign as oneshot." am: 5c19d23b52
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1781067

Change-Id: I4a92de924c0e25dc2463099bf04a53a2fcc9c282
2021-07-28 12:05:46 +00:00
Martijn Coenen
22a13c378a Don't mark odsign as oneshot.
If odsign is marked as oneshot, and it crashes (eg due to a coding
error), the device will not boot completely, because init keeps waiting
for the odsign.key.done / odsign.verification.done properties. So
instead, we don't mark it as oneshot, but stop the service manually in
the exit paths of the code. This ensures that if a bad OTA / module
update causes odsign to crash, we will automatically start it again; if
it crashes repeatedly, apexd will detect this, and roll back any module
update.

In the good path, there's no difference - odsign will run just once and
be stopped.

Bug: 194334176
Test: manually make odsign crash; inspect output
Change-Id: I7015f291888d6b8066e4c526a7e8cf3c9c7ea618
Merged-In: I7015f291888d6b8066e4c526a7e8cf3c9c7ea618
2021-07-28 13:51:49 +02:00
Martijn Coenen
5c19d23b52 Merge "Don't mark odsign as oneshot." 2021-07-28 11:50:22 +00:00
Martijn Coenen
2e8a9845e3 Don't mark odsign as oneshot.
If odsign is marked as oneshot, and it crashes (eg due to a coding
error), the device will not boot completely, because init keeps waiting
for the odsign.key.done / odsign.verification.done properties. So
instead, we don't mark it as oneshot, but stop the service manually in
the exit paths of the code. This ensures that if a bad OTA / module
update causes odsign to crash, we will automatically start it again; if
it crashes repeatedly, apexd will detect this, and roll back any module
update.

In the good path, there's no difference - odsign will run just once and
be stopped.

Bug: 194334176
Test: manually make odsign crash; inspect output
Change-Id: I7015f291888d6b8066e4c526a7e8cf3c9c7ea618
2021-07-28 11:06:06 +02:00
Chris Wailes
d5aaaef8df Fix warnings in preparation for Rust 1.54.0
This CL fixes several new warnings generated by rustc 1.54.0.

Bug: 194812675
Test: m rust
Change-Id: I3076313ea51c6f4e74029ad9fb45d6f0b6dea460
2021-07-27 16:10:08 -07:00
Treehugger Robot
fafad035ac Merge "Fix warnings in preparation for Rust 1.53.0" am: 04f835ad2f am: 79165dc176
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1779210

Change-Id: I617d86c1ef18a185e4c660575c5178e0a4ec1cab
2021-07-27 21:16:03 +00:00
Treehugger Robot
79165dc176 Merge "Fix warnings in preparation for Rust 1.53.0" am: 04f835ad2f
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1779210

Change-Id: Iab0bde2abd7fe3959ec47d53893c3a212589276d
2021-07-27 21:01:50 +00:00
Treehugger Robot
04f835ad2f Merge "Fix warnings in preparation for Rust 1.53.0" 2021-07-27 20:35:22 +00:00
Seth Moore
6b44b4b261 Merge "Print device keys in test mode" am: 2cc752164d am: 5ad5319ee8
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1775441

Change-Id: If68dec287201d084adfefc291c059963b405519a
2021-07-27 19:16:31 +00:00
Seth Moore
5ad5319ee8 Merge "Print device keys in test mode" am: 2cc752164d
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1775441

Change-Id: I36835d07d3716fb39048f3ffd8566ec5c5f8149f
2021-07-27 18:37:04 +00:00
Seth Moore
2cc752164d Merge "Print device keys in test mode" 2021-07-27 18:20:14 +00:00
Seth Moore
9a4bc972c0 Print device keys in test mode
When using the rkp_factory_extraction_tool in test mode, a fake device
key is generated on the fly. This makes verifying the output difficult
as the key is permanently lost.

In test mode, print out the generated keys so that we can test if the
output data is good or not.

Test: Manually tested against backend service tooling not in AOSP
Change-Id: Ibc30044c03f5107990da6d3a03b17aa652d4b1bc
2021-07-27 11:19:46 -07:00
Jiyong Park
0d61dd6c3a Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same 'ndk' backend.

Bug: 161456198
Test: m
Change-Id: Ibeb4178f99857be75bb5f83a073a2d679058d921
2021-07-27 12:20:26 +09:00
Chris Wailes
3877f29382 Fix warnings in preparation for Rust 1.53.0
This CL fixes several new warnings generated by rustc 1.53.0.

Bug: 194400612
Test: m rust
Change-Id: I599b7c4ee083085735841c5a739d8af74f52fb4a
2021-07-26 19:24:18 -07:00
TreeHugger Robot
ab262bd05c [automerger skipped] Merge "Fix ill-formed certificate request" into sc-dev am: a9b1547411 -s ours
am skip reason: Merged-In I096bc5ded0b38fc56864e75c5e06dfbef62e9a74 with SHA-1 9ea08f23c2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/15373963

Change-Id: I5ce202d57f56db30be5a9ae2480b570007306555
2021-07-23 21:24:49 +00:00
TreeHugger Robot
a9b1547411 Merge "Fix ill-formed certificate request" into sc-dev 2021-07-23 20:33:29 +00:00
Treehugger Robot
c9520d69eb Merge "Add jbires to system/security OWNERS" am: f2a9f3d234 am: af5cdde6c8
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1776766

Change-Id: I7e7cdfd9349a678ee33858b1d63ebcadcc91c57d
2021-07-23 19:54:22 +00:00
Treehugger Robot
af5cdde6c8 Merge "Add jbires to system/security OWNERS" am: f2a9f3d234
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1776766

Change-Id: If961a206935001da6cee496667adb2699e7d30d5
2021-07-23 19:37:39 +00:00
TreeHugger Robot
306e7e1d5b [automerger skipped] Merge changes from topic "full_spec_upgrade_sc" into sc-dev am: 060ba1e6ec -s ours
am skip reason: Merged-In I416922edad6e0d0245b65fb02983210e790c1221 with SHA-1 d2ce46b5f1 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/15325373

Change-Id: Ic0b0e1cfc4f7e9f430173cad09b8086300e8ddba
2021-07-23 19:23:25 +00:00
Treehugger Robot
f2a9f3d234 Merge "Add jbires to system/security OWNERS" 2021-07-23 19:17:19 +00:00
TreeHugger Robot
060ba1e6ec Merge changes from topic "full_spec_upgrade_sc" into sc-dev
* changes:
  Adding plumbing for supported EC curve on impl
  Always fall back to factory key on any RKP error
2021-07-23 19:09:13 +00:00
TreeHugger Robot
5bc9c33d8d [automerger skipped] Merge "Keystore 2.0: Fix convertStorageKeyToEphemenral" into sc-dev am: 7e9dfba159 -s ours
am skip reason: Merged-In Iad3e9d4c0de2f8c7121147c81590e56663fe596f with SHA-1 84af4d1bf9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/15365713

Change-Id: I7ca074775111354c1a6789226f2ceb77ef3efb46
2021-07-23 18:59:45 +00:00
TreeHugger Robot
7e9dfba159 Merge "Keystore 2.0: Fix convertStorageKeyToEphemenral" into sc-dev 2021-07-23 18:42:57 +00:00
Treehugger Robot
5233c0d9b1 Merge "Fix ill-formed certificate request" am: cf01ebfba6 am: 18c548698e
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1775440

Change-Id: I4ad18b90d96fa0a79b17dc09b3dbf7d715e338fd
2021-07-23 18:37:18 +00:00
Treehugger Robot
18c548698e Merge "Fix ill-formed certificate request" am: cf01ebfba6
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1775440

Change-Id: I97b68fdaf35192d41a233dfd8ed5d490db5dec76
2021-07-23 18:18:12 +00:00
Max Bires
6c8622e916 Add jbires to system/security OWNERS
The number of times I've said "Oh yeah, I'll put a change in later to
add myself to OWNERS" has become embarassing.

Test: I can give OWNERS +2
Change-Id: If24b192fe0f2ca65f6cac58602c0b2b63f2df094
2021-07-23 11:07:13 -07:00
Treehugger Robot
cf01ebfba6 Merge "Fix ill-formed certificate request" 2021-07-23 18:05:21 +00:00
Seth Moore
80ec4ac784 Fix ill-formed certificate request
1. The MAC tag value was not being included in the uploaded data, so
   it was previosly impossible to verify the keys to sign mac.
2. The device info is supposed to be an array with [Verified,
   Unverified] info. It was previously just the verified info.

Ignore-AOSP-First: No merge path from AOSP. This is picked from AOSP.
Test: Manual. Uploaded sample data to device info service.
Change-Id: I096bc5ded0b38fc56864e75c5e06dfbef62e9a74
Merged-In: I096bc5ded0b38fc56864e75c5e06dfbef62e9a74
Fixes: 194492359
2021-07-23 08:49:22 -07:00
Seth Moore
9ea08f23c2 Fix ill-formed certificate request
1. The MAC tag value was not being included in the uploaded data, so
   it was previosly impossible to verify the keys to sign mac.
2. The device info is supposed to be an array with [Verified,
   Unverified] info. It was previously just the verified info.

Test: Manual. Uploaded sample data to device info service.
Change-Id: I096bc5ded0b38fc56864e75c5e06dfbef62e9a74
Bug: 194492359
2021-07-23 15:48:49 +00:00
Joel Galenson
0a30d32e5e Merge "Use fully-qualified names instead of read and write." am: ff936383f8 am: 3a87faf4b7
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773023

Change-Id: Ia003653d9a8fc234d9e7abc05bc3f5cc95ba9df0
2021-07-23 15:22:47 +00:00
Joel Galenson
1a3ff0680d Merge changes from topic "rust-property-bindings" am: 5840ab9829 am: 3138c6e329
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773017

Change-Id: I672ad59654d09c4a196c246b595c0440e37312dd
2021-07-23 15:22:20 +00:00
Joel Galenson
5cc4726b34 Migrate keystore2's Rust system library bindings to bionic. am: f235706b14 am: 3a71c40842
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773016

Change-Id: I61882f934cb216fccb3705b5cd9383ba39c85e5a
2021-07-23 15:22:18 +00:00
Joel Galenson
3a87faf4b7 Merge "Use fully-qualified names instead of read and write." am: ff936383f8
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773023

Change-Id: I1c6281955adec57fbac3cbe244aa10c2fc196364
2021-07-23 15:05:09 +00:00
Joel Galenson
3138c6e329 Merge changes from topic "rust-property-bindings" am: 5840ab9829
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773017

Change-Id: I9cdd90ed5f21cb84f24173470650966c8cb82917
2021-07-23 15:04:55 +00:00
Joel Galenson
3a71c40842 Migrate keystore2's Rust system library bindings to bionic. am: f235706b14
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1773016

Change-Id: Id4f1653f2746d3616374bc22145e6da5a24175f2
2021-07-23 15:04:53 +00:00
Joel Galenson
ff936383f8 Merge "Use fully-qualified names instead of read and write." 2021-07-23 14:47:24 +00:00
Joel Galenson
5840ab9829 Merge changes from topic "rust-property-bindings"
* changes:
  Use the newly-added function to read a property.
  Migrate keystore2's Rust system library bindings to bionic.
2021-07-23 14:46:55 +00:00