41 Commits

Author SHA1 Message Date
Daulet Zhanguzin
74eafaa6fe Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: I920fce3eba271c8621861df6788e68abf3e5f7c4
2020-01-07 11:43:54 +00:00
Ruslan Tkhakokhov
004e85f798 Route EncryptedLocalTransport KV backup/restore through encryption code
Bug: 142227548
Test: Verify the device boots successfully
      Verify EncryptedLocalTransport APK is present
      Verify manual backup/restore using bmgr for LocalTransport and EncryptedLocalTransport
      For LocalTransport (unencrypted) and EncryptedLocalTransport:
        atest CtsBackupTestCases
        atest CtsBackupHostTestCases
        atest GtsBackupTestCases
        atest GtsBackupHostTestCases


Change-Id: Iac3a8a50d7f761442a4b784cfba3a980e900dd7f
2019-10-16 08:58:01 +00:00
Al Sutton
80e48cfc44 Merge "Import ClearCryptoStateTask" 2019-10-10 11:20:58 +00:00
Al Sutton
7b35bfebd7 Import ClearCryptoStateTask
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: Ie8a6ed4a0fc7cf015e39170f24c6924430d69619
2019-10-10 10:02:37 +01:00
Al Sutton
178a50249e Import EncryptedFullBackupDataProcessor
Bug: 111386661
Test: make RunBackupEncryptionRoboIntegTests
Change-Id: I5b9f828663157df13e55f7ed7c8eceef99fa5899
2019-10-09 15:29:18 +01:00
Ruslan Tkhakokhov
a8382e9b95 Add integration test for encrypted KV B&R
Bug: 11386661
Test: RoundTripTest
Change-Id: Ifd18961347d8ebaf00ddc12196f2ee6ec543b457
2019-10-02 18:54:37 +01:00
Ruslan Tkhakokhov
7058c19587 Import EncryptedKvRestoreTask
Bug: 111386661
Test: atest EncryptedKvRestoreTaskTest
Change-Id: Id603dabce098ef05471a76095d0cd25e95a681a5
2019-10-02 14:10:24 +01:00
Ruslan Tkhakokhov
f45db5e35a Import EncryptedKvBackupTask
Bug: 111386661
Test: atest EncryptedKvBackupTaskTest
Change-Id: Id9cd0a57c3ed33f18d68e7fad60035e8a956a1de
2019-10-02 12:57:50 +01:00
Ruslan Tkhakokhov
6763853544 Import InitializeRecoverableSecondaryKeyTask
Bug: 111386661
Test: atest InitializeRecoverableSecondaryKeyTaskTest
Change-Id: I95a3acddfc1e28f6addd71af312815d9c3cb1ed6
2019-09-30 21:26:34 +00:00
Ruslan Tkhakokhov
736d858a5f Merge "Import RotateSecondaryKeyTask" 2019-09-30 07:19:32 +00:00
Ruslan Tkhakokhov
16857a0936 Import RotateSecondaryKeyTask
Bug: 111386661
Test: atest RotateSecondaryKeyTaskTest
      atest FakeCryptoBackupServerTest

Change-Id: I7f3c2c901c710863033e397af0b1cd4f76ee03be
2019-09-27 19:28:19 +00:00
Al Sutton
fde3621d31 Add backup data round trip test
Bug: 111386661
Test: make RunBackupEncryptionRoboIntegTests
Change-Id: Idbfec4ff7bcb0d0b44931884d1c11af7a937bd30
2019-09-27 14:01:32 +01:00
Al Sutton
836548b7b9 Import EncryptedFull???Task
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I135f561a2590206f7131eb14df3f91211fef3daa
2019-09-27 13:03:19 +01:00
Al Sutton
ea5c362d63 Merge "Import FullRestoreToFileTask" 2019-09-27 07:58:40 +00:00
Al Sutton
8611f1471a Import FullRestoreToFileTask
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I4778357b9de9aab219c46b0f588012a8213e428c
2019-09-26 16:05:09 +00:00
Al Sutton
cf327cddf9 Import BackupFileDecryptorTask
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I411ab1055203b6963726c9ca171b47b52cac83c8
2019-09-26 12:46:30 +01:00
TreeHugger Robot
4ec9aa4b4e Merge "Import ProtoStore" 2019-09-26 09:58:23 +00:00
Chandan Nath
c4303bdabd Merge "Route backup data through IntermediateEncryptingTransport" 2019-09-25 18:18:28 +00:00
Chandan Nath
04df96b1f6 Merge "Add BackupEncryptionService which provides an IntermediateEncryptingTransport" 2019-09-25 16:55:19 +00:00
Al Sutton
75eda03703 Import EncryptedBackupTask
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: If45ef931006dc264726065dd9e06dcf230a8fbfc
2019-09-25 16:42:57 +01:00
Al Sutton
7d54d6aa6f Import ProtoStore
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I9cbaf2c1f1e933b08ac578e4243e8555e552ef1d
2019-09-25 16:39:33 +01:00
nathch
e778ed3a3a Route backup data through IntermediateEncryptingTransport
The main change is in TransportManager which now uses
TransportClientManager.createEncryptingClientManager

We do this so that IntermediateEncryptingTransport can encrypt (decrypt) the
data when sending it (receiving it) from the real transport.

Test: atest -v BackupEncryptionUnitTests
Test: atest -v RunBackupFrameworksServicesRoboTests
Test: atest -v $(find frameworks/base/services/tests/servicestests/src/com/android/server/backup -name '\''*Test.java'\'')'
Test: atest -v CtsBackupTestCases CtsBackupHostTestCases
Change-Id: I01a0108da6b1f868ac6cb4591445ecc62316452f
2019-09-25 15:54:36 +01:00
nathch
52eba65fbc Add BackupEncryptionService which provides an IntermediateEncryptingTransport
BackupEncryptionService (which is in a separate APK) provides a IntermediateTransport
which binds to the real transport.

We do this so that IntermediateEncryptingTransport can encrypt (decrypt) the
data when sending it (receiving it) from the real transport.
In this CL, IntermediateTransport does not do any encryption. It simply forwards
the data on. We will add the actual encryption in the next CL.

Bug: 139269919

Test: atest -v BackupEncryptionUnitTests
Test: atest -v RunBackupFrameworksServicesRoboTests
Test: atest -v $(find frameworks/base/services/tests/servicestests/src/com/android/server/backup -name '\''*Test.java'\'')'
Test: atest -v CtsBackupTestCases CtsBackupHostTestCases
Change-Id: I83a84ed3e638eb1dd165fffe406495f80ff930aa
2019-09-25 13:58:40 +01:00
Al Sutton
295aaad6a6 Merge "Import BackupFileBuilder" 2019-09-25 07:49:13 +00:00
Al Sutton
73bec2fc2b Import BackupFileBuilder
From original source; b/77188289

Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: Ie32aa6b329778ea470ac45338b8380917ec17011
2019-09-24 13:55:38 +01:00
Al Sutton
e5dc5a74ab Import KvBackupEncrypter
We're now at a place where need to stop using the core services
Robolectric shadows because we have shadow collision.

Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I8aa4486eb1bb42767939ef3bd2a0e5dd083e309d
2019-09-24 12:49:05 +00:00
Al Sutton
644c2bb97f Merge "Import the code related to Key/Value backup encryption" 2019-09-23 11:05:49 +00:00
Al Sutton
668c05eb92 Import the code related to Key/Value backup encryption
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I6adaedf05034b6706a31a071f9ae0f04abc7b300
2019-09-23 10:26:27 +01:00
Al Sutton
9ce011908a Import ChunkListingMap
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: Ieb9f11c18cef02e94ec8b5d849ae1cd005069086
2019-09-20 15:30:25 +01:00
TreeHugger Robot
755f72686b Merge "Move chunk proto definitions into the BackupEncrypter APK" 2019-09-18 13:55:12 +00:00
Al Sutton
572df9fff3 Move chunk proto definitions into the BackupEncrypter APK
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I3032210e6eec52b0c925baab770a4578ac7ecbf7
2019-09-17 14:50:44 +01:00
Al Sutton
96b5925f59 Import SecondaryKeyRotationScheduler
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I53b54baaac744dea77d9e3c30fd0171430c2887f
2019-09-17 10:29:50 +01:00
Al Sutton
7426665b57 Import TertiaryKeyManager
Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: If98ca03147512058470b806e50c3b2ca1ad6e3ed
2019-09-16 11:09:31 +01:00
TreeHugger Robot
272b953b96 Merge "Move TertiaryKeyRotationScheduler and TertiaryKeyRotationWindowedCount" 2019-09-13 14:45:32 +00:00
Al Sutton
a114884108 Merge "Migrate CryptoSettings" 2019-09-13 10:20:40 +00:00
Al Sutton
bb45da74cd Move TertiaryKeyRotationScheduler and TertiaryKeyRotationWindowedCount
Migrate these classes into the framework to support encryption in the
framework for backups. There's a modification to the RotationTracker
class to re-introduce a test supporting constructor.

The modification to the blueprint is needed to provide Truthy which
is used in the tests of the migrated classes.

Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: Ibe96a9a52f638d5e87e1be46af5803672288f482
2019-09-13 11:09:49 +01:00
Al Sutton
53b1c12eef Migrate CryptoSettings
Bug: 111386661
Test: atest BackupEncryptionRoboTests
Change-Id: I67df369594cebfa8f7a67076c990f5493c0e2189
2019-09-12 15:46:50 +01:00
Al Sutton
bf257cbe23 Import TertiaryKeyStore
Bring the TertiaryKeyStore class and its test class into the main repo.

Bug: 111386661
Test: make RunBackupEncryptionRoboTests
Change-Id: I4718ddde737c19836e415af6ca1fd597e79a0a4a
2019-09-12 13:41:06 +01:00
Al Sutton
282b406941 Import RestoreKeyFetcher
Bug: 111386661
Test: atest BackupEncryptionRoboTests
Change-Id: I4163ebda82f588c624255f2a090e4ddab55e998f
2019-09-11 08:15:40 +00:00
Al Sutton
c949517f4d Migrate KeyWrapUtils
Bring KeyWrapUtils in from GMSCore. This class relies heavily on a set
of protobufs, so this CL includes the creation of the protobuf target
support it and the inclusion of that target in the tests.

Bug: 111386661
Test: atest BackupFrameworksServicesRoboTests
Change-Id: I89e0c68a449f784b132780410d9de32824bb674a
2019-09-06 11:12:23 +01:00
Al Sutton
ad52c6bc3a Move backup encryption to separate APK
Test: atest -c --rebuild-module-info BackupEncryptionRoboTests
Change-Id: I5a8ac3a9c010bd3c516464dee333cef406c5dcfa
2019-09-06 10:22:33 +01:00