Commit Graph

495 Commits

Author SHA1 Message Date
Steven Moreland
a8af1af744 Merge "ManifestConfigSource: disable debug mode" am: f4df7dd3e1 am: 53fb1fb333 am: 517eea253d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2520995

Change-Id: If124ee473c854a53f513b32606719e5d75fe5483
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-13 20:42:23 +00:00
Steven Moreland
de964904f3 ManifestConfigSource: disable debug mode
Due to many 'No Network Security Config' logs on cf.

Bug: N/A
Test: N/A
Change-Id: I2f7dfab94cb5522931c44ed9cffc9aa541f15707
2023-04-03 19:59:52 +00:00
Miguel Aranda
4161060b46 Merge "Add systemProperty checking for updatable certs and modify tests." am: 042dc5fb98 am: 5fefe4bad4 am: 6fcae3260a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2423168

Change-Id: I1d3bcdf07f042c1b2c27ac41b56537a3b3861354
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 19:42:53 +00:00
Miguel
86dc3f7afb Add systemProperty checking for updatable certs and modify tests.
Allows us to test bothe certificateStores within tests.

Test: atest NetworkSecurityConfigTests
Change-Id: Ie004d2158286b3035d08a381f06abb74c7f2a9f4
2023-03-01 17:28:11 +00:00
Seth Moore
9f31bddde1 Merge "Map RkpProxyException error codes into get key errors" am: 5cd5d98eb7 am: edb504ebf5 am: 071a5cc334
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2415815

Change-Id: I2ecab136b8295a4c8cac8f3c72c7f4e5e2886ffd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 00:05:22 +00:00
Seth Moore
89c91ae699 Map RkpProxyException error codes into get key errors
This allows clients of the system service to handle specific errors
returned up the stack from rkpd.

Test: RemoteProvisioningServiceTests
Test: keystore2_test
Change-Id: I4b8399c0c8693533631c3a816e494bd1a2ab3239
2023-02-02 15:03:50 -08:00
Andrew Solovay
cff4643d23 docs: Fixing typo in class summary
The commontypos linter complained about the "the the" typo.
No change to source code.

Per go/fix-refdocs, master is now the preferred branch for doc fixes until the U dev branch is open. Since this CL hasn't been reviewed yet, I'm CPing it over here and abandoning the original CL.

Bug: 263824202
Change-Id: If03bfc1f3e1a42b26019c039595c7bf8c0010ad4
Test: [go/abtd docs build]
2023-01-30 22:11:31 +00:00
Miguel Aranda
137190a03b Merge "Only use concscrypt certs if directory is nonempty" am: cefc5a13e9 am: d74c5ab44f am: 837db55aec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2384453

Change-Id: I20f0db887122e8d7a9205f84a7d1ae69042212c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-12 12:05:07 +00:00
Miguel Aranda
cefc5a13e9 Merge "Only use concscrypt certs if directory is nonempty" 2023-01-12 10:16:03 +00:00
Miguel
81f532c9a0 Only use concscrypt certs if directory is nonempty
Test: atest TrustedCertificateStoreTest
Bug: 264540110
Change-Id: I5ac47315d3e9cfacb53d27080046a3fd8cfb7878
2023-01-11 20:46:50 +00:00
Seth Moore
a24388cd8f Merge "Add support for storing upgraded RKP key blobs" am: 6580c85488 am: 927ec5a6d0 am: 85c1718f17
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2364066

Change-Id: I7cd20650442bbfd7210f7eff8ef423de41386d74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-11 20:10:49 +00:00
Seth Moore
6580c85488 Merge "Add support for storing upgraded RKP key blobs" 2023-01-11 18:17:36 +00:00
Seth Moore
7bd325925d Add support for storing upgraded RKP key blobs
This requires a minor interface update to return an async result,
since failing open means we might leave keys vulnerable to system
software rollback attacks.

Bug: 262748535
Test: RemoteProvisioningRegistrationTest
Change-Id: If2b28dae285631b70d93910a8cc2196f808cb5be
2023-01-04 18:56:31 +00:00
Miguel Aranda
d65df22f70 Merge "Add conscrypt updatable certificates." am: 0b62dccbbc am: cd3609306d am: 077372e2e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2323439

Change-Id: I44f90d852f56f39538f826dea4fe72d52bf24164
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-22 01:17:23 +00:00
Miguel Aranda
0b62dccbbc Merge "Add conscrypt updatable certificates." 2022-12-21 23:20:38 +00:00
Miguel
8b192b19f2 Add conscrypt updatable certificates.
This cl contains changes for SystemCertificateSource so that certificates are taken from conscrypt apex files by default and if that fails, we fallback to the usual system location.

Test: atest TrustedCertificateStoreTest
Change-Id: I1ec6d29a52c07531a6a0c85b2e2405f63470bd5f
2022-12-21 04:38:45 +00:00
Seth Moore
f4b56045db Merge "Implement IRegistration interface for RKP" am: 119c1d9099 am: 36672bd017 am: 3d3420b66e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2359448

Change-Id: I4befcce19594c0ab2e29a6fdbe8efe1621f96130
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-19 18:35:14 +00:00
Seth Moore
7ceb8aab0f Implement IRegistration interface for RKP
Bug: 261888917
Test: RemoteProvisioningRegistrationTest
Change-Id: Ide9eee760efade9603346c2144490c20c4e0dd8a
2022-12-16 22:14:02 +00:00
Seth Moore
690554e0d6 Merge "Add remote_provisioning system service" am: 222a476ac5 am: 9430c5fed0 am: d6405bf424
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263722

Change-Id: I09e0681e2c980a148dc265e15f58beda67515214
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 16:39:21 +00:00
Seth Moore
0277b66f9e Add remote_provisioning system service
This service is callable by system components like keystore2. This
service calls into a mainline module API to do all the work for remote
provisioning.

Also include new OWNERS for the RemoteProvisioning implementation.

Bug: 254112668
Test: Locally modify keystore to call the new service
Change-Id: I6708d0b415798c78a4d66f279589d9def552ae78
2022-12-06 17:30:26 -08:00
Eran Messeri
ecbadfbfe4 Merge "ID attestation: Pass second IMEIs to Keystore" am: bfbf069ee5 am: 19b6eea501 am: 250413b0ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2277393

Change-Id: I15b612f0701a2e35474df1a5d0e2061656929224
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 18:52:53 +00:00
Eran Messeri
4594638a48 ID attestation: Pass second IMEIs to Keystore
To support attestation of a second IMEI, when ID attestation (with IMEI)
is requested, pass in the 2nd IMEI as a SECOND_IMEI KeyMint tag.

Bug: 244732345
Test: atest android.keystore.cts.DeviceOwnerKeyManagementTest
Change-Id: I19a3733746fa6a35c6225f0c60fd9f4b51a62ab1
2022-12-01 11:00:08 +00:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Treehugger Robot
6ee781740a Merge "Keystore:Expected exception for invalid Keys" am: 4fe1ed8e51 am: d3472b9eed am: 90969f2230 am: 1e6ff36751 am: 34a5947082
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2175743

Change-Id: Ifacca68b9dd4f594f9720c027ff3bdf9e5b6a04c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-04 18:37:31 +00:00
Prashant Patil
0ee5912b75 Keystore:Expected exception for invalid Keys
If EC curves of Public and Private keys are different, an
InvalidKeyException is expected.

But the current implementation does not throw exception from doPhase method
and fails in generateSecret method.

The fix is in AndroidKeyStoreECPublicKey to provide
correct ECParameterSpec while creating a PrivateKey object.

Bug: 215175472
Test: run cts -m CtsKeystoreWycheproofTestCases -t com.google.security.wycheproof.JsonEcdhTest#testSecp224r1
Test: run cts -m CtsKeystoreWycheproofTestCases -t com.google.security.wycheproof.JsonEcdhTest#testSecp256r1
Test: run cts -m CtsKeystoreWycheproofTestCases -t com.google.security.wycheproof.JsonEcdhTest#testSecp384r1
Test: run cts -m CtsKeystoreWycheproofTestCases -t com.google.security.wycheproof.JsonEcdhTest#testSecp521r1
Test: run cts -m CtsKeystoreTestCases -t android.keystore.cts.KeyAgreementTest#testDoPhase_withDifferentCurveKey_fails
Change-Id: Ie221926d8a3be3fe6679e723575c5021cafba98e
2022-09-22 11:40:59 +01:00
Treehugger Robot
4eb3e94812 Merge "Keystore: Included KM_TAG_RSA_OAEP_MGF_DIGEST tag" am: eea63d6aa4 am: f42d5e8847 am: 72b1cc3e49 am: 3f20176ddf am: 074bff50de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2167462

Change-Id: I6479a9d91248581cadf7cf4acab02b9e01cc6ad2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-20 16:02:16 +00:00
Treehugger Robot
eea63d6aa4 Merge "Keystore: Included KM_TAG_RSA_OAEP_MGF_DIGEST tag" 2022-09-16 16:18:09 +00:00
Treehugger Robot
2f7001b514 Merge "Update OWNERS for keymaster Java code" am: 99aeb82ccf am: 3315c55f7a am: 3b1ed51fdd am: 6e389891ed am: 407e5ba532
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2217301

Change-Id: I07e295d4e854588ff3f22d5cfc218dfcc90756e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 02:02:05 +00:00
Prashant Patil
0443f760d0 Keystore: Included KM_TAG_RSA_OAEP_MGF_DIGEST tag
Included KM_TAG_RSA_OAEP_MGF_DIGEST for RSA keys generation and import
if supported padding is defined as OAEP. All supported digest are added
as KM_TAG_RSA_OAEP_MGF_DIGEST and also default MGF1-SHA1 digest is added
because crypto operations could fail is MGF1ParameterSpec is not provided.

Note this includes additional Attestation parameter in returned
certificate and need to handle accordingly.

Bug: 203688354
Test: run cts -m CtsKeystoreTestCases -t android.keystore.cts.CipherTest#testKatBasicWithDifferentProviders
Change-Id: I2086f2520667ccac9116e04de39f6328a0d3fc5b
2022-09-14 15:26:12 +01:00
Eran Messeri
4ed34d785e Update OWNERS for keymaster Java code
Since Janis has left, it makes no sense to have him on the OWNERS file.
Add myself as a reviewer in an EMEA-friendly timezone.

Test: N/A, owners change only.
BYPASS_INCLUSIVE_LANGUAGE_REASON=Janis used a he/him pronoun.

Change-Id: Ieab9ab74c1d11013ffa915999bf37773659cdad0
2022-09-14 12:58:01 +01:00
Dmitry Dementyev
69583729ab Throw UnrecoverableKeyException if key is missing.
During migration to KeyStore2 exception was converted to
InternalRecoveryServiceException.

Test: manual
Bug: 207316987
Change-Id: I90a4c6745f2e3c1446c4c0fbac64035d582bb5a8
2022-05-31 17:42:30 -07:00
TreeHugger Robot
40b0c3ee7f Merge "Add helper untility methods to AVF" 2022-03-28 18:04:42 +00:00
Treehugger Robot
4ac55ec672 Merge "WrappedApplicationKey: Remove superfluous branch in deserialization." am: 2e6b40a883 am: 2efefc72f6 am: f464e50dab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2043164

Change-Id: I4ebdf4b33b738f5078a55b870a6f2ee5fc67e682
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 01:17:29 +00:00
Janis Danisevskis
ffba3e7ac9 WrappedApplicationKey: Remove superfluous branch in deserialization.
The metadata field is written unconditionally and will be represented at
least by a -1 if it is null.

Bug: 210655898
Test: N/A
Change-Id: Iad85dbec916a2d51523b81b594b66b9518811d27
2022-03-24 15:28:15 -07:00
Sergey Nikolaienkov
d12f2e5f81 Add helper untility methods to AVF
Add helper @hide methods for converting @LocalBindingType and
@VerificationResult integer values to String - localBindingTypeToString
and verificationResultCodeToString

Test: m && flash
Change-Id: I5b2bb3872e231b76b54ec8c3fad120cfac653306
2022-03-24 13:48:33 +01:00
Eran Messeri
a31689bc37 KeyStore: Verbose error reporting
Report KeyStore/KeyMint error messages via public API.

This lets developers find out:
* Whether an error is transient or not.
* Whether a failure is due to a system error
(system configuration/state/capabilities), or a key-related error.
* Whether user authentication is required to use the key.

Test: atest CtsKeystorePerformanceTestCases CtsKeystoreTestCases
Bug: 197890905
Merged-In: I776d9e9cc01a9dc3542a63000ee0709847760963
Change-Id: Ica0c93fdd4b89255ee0a03a9b9b948202777d4d4
2022-02-02 22:11:44 +00:00
Eran Messeri
5da05ee3ed KeyStore: Verbose error reporting
Report KeyStore/KeyMint error messages via public API.

This lets developers find out:
* Whether an error is transient or not.
* Whether a failure is due to a system error
(system configuration/state/capabilities), or a key-related error.
* Whether user authentication is required to use the key.

Test: atest CtsKeystorePerformanceTestCases CtsKeystoreTestCases
Bug: 197890905
Change-Id: I776d9e9cc01a9dc3542a63000ee0709847760963
2021-12-14 15:22:35 +00:00
Dave McCloskey
2a548a596a Create the system service for AVF & hook the manager to it.
Bug: 201696614
Change-Id: I4a7a830ba809ed59a030a87c4f479199685d8a42
Test: atest AttestationVerificationTest
2021-11-29 14:55:24 -08:00
Dave McCloskey
b9b25ef742 Adds the basic API of the attestation verification framework.
Bug: 201696614
Change-Id: I59d90091106db6e6343f3a6fb698f01559841137
Test: N/A (non-functional API definition)
CTS-Coverage-Bug: 201337503
2021-11-29 10:08:41 -08:00
Dave McCloskey
8c168ff244 Adds OWNERS files for files related to Attestation Verification
Framework.

Bug: 201696614
Test: N/A
Change-Id: Id1758282963875de5c4909ab6ffff92df4e0d30f
2021-10-20 14:46:53 -07:00
Eran Messeri
71d57d976e Remove ASSOCIATED_DATA tag
Remove the ASSOCIATED_DATA tag since it is unused.

Bug: 183737811
Test: That it compiles.
Change-Id: If0d051c36f9f7ba6fa8578b6c99256c71f1f03df
2021-06-22 13:15:01 +01:00
David Drysdale
390dbd728a Merge "Align KeyMint AIDL with usage" am: 6b8f292b17 am: eb393d45f0 am: 3a19c2f0fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682041

Change-Id: I49b837ec97c427131c40fe9a4b88d5383cceb65b
2021-04-27 18:06:44 +00:00
David Drysdale
5e4e97fc06 Align KeyMint AIDL with usage
- Drop unused Tag::BLOB_USAGE_REQUIREMENTS

Test: TreeHugger, VtsKeyMintAidlTargetTest (CF)
Change-Id: I2550e941afd06cf24896b77b644f8a56f20727c7
2021-04-22 15:55:30 +01:00
Janis Danisevskis
9ba0f37f8a Merge "Keystore 2.0: Remove Keystore 1.0 SPI with all remaining references" am: a8b1b1a2e6 am: 08945c21ef am: 66ead4fb0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624872

Change-Id: I08fcf329e59c309d9292edc846653b02e7a60f21
2021-04-03 02:02:03 +00:00
Janis Danisevskis
a6dcf091f5 Keystore 2.0: Remove Keystore 1.0 SPI with all remaining references
Bug: 171305684
Test: CtsKeystoreTestCases
Change-Id: I337515dadc9e45b909bff058d4e13371b4fa843c
2021-04-01 17:06:41 -07:00
Dmitry Dementyev
7d21d719a5 Merge "Migrate recoverablekeystore to KeyStore V2." am: dbf8a7c1bd am: 26085ee2ff am: 25de7c49b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1603470

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4c23d408e34d6305784e54b7ef00a258b4ea6fab
2021-03-01 08:07:59 +00:00
Dmitry Dementyev
16491e1316 Migrate recoverablekeystore to KeyStore V2.
Test: manual
Bug: 171305545
Change-Id: Id415be48cab6852df155b5b2dbaf941ef54cd5a4
2021-02-25 16:42:15 -08:00
Shawn Willden
c418d4ef15 Merge "Add support for app-generated attestation keys." am: 50a66e39cd am: 2da3a280d2 am: bbdb4d9ee5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584474

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0e4b2bcfa54953e37452a7533a89b49586596502
2021-02-17 20:49:09 +00:00
Shawn Willden
bffded442a Add support for app-generated attestation keys.
This allows apps to request that AndroidKeyStore generate attestation
keys that can be used to sign attestations of other keys that the app
generates or imports.

Bug: 163606833
Test: atest CtsKeystoreTests
Change-Id: I943a6922271cbe909cb3a9d67021663b5646aa70
2021-02-17 06:46:13 -07:00