From e7997a3ea7c5dea839220ae832ea5ff7a7dc7742 Mon Sep 17 00:00:00 2001 From: Bo Zhu Date: Wed, 21 Mar 2018 19:50:50 -0700 Subject: [PATCH] Unhide the new RecoverySession#start with the alias for root cert Bug: 76033708 Test: none, it's just unhiding APIs Change-Id: Iec1e44d24bb1704da082404566233ada83b8eb81 --- api/system-current.txt | 3 ++- .../keystore/recovery/RecoverySession.java | 24 +++---------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 6d43d27355d64..4c03142db0d86 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4390,7 +4390,8 @@ package android.security.keystore.recovery { method public void close(); method public java.util.Map recoverKeys(byte[], java.util.List) throws android.security.keystore.recovery.DecryptionFailedException, android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.SessionExpiredException; method public deprecated byte[] start(byte[], byte[], byte[], java.util.List) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; - method public byte[] start(java.security.cert.CertPath, byte[], byte[], java.util.List) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; + method public deprecated byte[] start(java.security.cert.CertPath, byte[], byte[], java.util.List) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; + method public byte[] start(java.lang.String, java.security.cert.CertPath, byte[], byte[], java.util.List) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; } public class SessionExpiredException extends java.security.GeneralSecurityException { diff --git a/core/java/android/security/keystore/recovery/RecoverySession.java b/core/java/android/security/keystore/recovery/RecoverySession.java index 744bfa3029be8..f61569e68a7d6 100644 --- a/core/java/android/security/keystore/recovery/RecoverySession.java +++ b/core/java/android/security/keystore/recovery/RecoverySession.java @@ -77,7 +77,7 @@ public class RecoverySession implements AutoCloseable { } /** - * @deprecated Use {@link #start(CertPath, byte[], byte[], List)} instead. + * @deprecated Use {@link #start(String, CertPath, byte[], byte[], List)} instead. */ @Deprecated @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @@ -108,25 +108,9 @@ public class RecoverySession implements AutoCloseable { } /** - * Starts a recovery session and returns a blob with proof of recovery secret possession. - * The method generates a symmetric key for a session, which trusted remote device can use to - * return recovery key. - * - * @param verifierCertPath The certificate path used to create the recovery blob on the source - * device. Keystore will verify the certificate path by using the root of trust. - * @param vaultParams Must match the parameters in the corresponding field in the recovery blob. - * Used to limit number of guesses. - * @param vaultChallenge Data passed from server for this recovery session and used to prevent - * replay attacks. - * @param secrets Secrets provided by user, the method only uses type and secret fields. - * @return The recovery claim. Claim provides a b binary blob with recovery claim. It is - * encrypted with verifierPublicKey and contains a proof of user secrets, session symmetric - * key and parameters necessary to identify the counter with the number of failed recovery - * attempts. - * @throws CertificateException if the {@code verifierCertPath} is invalid. - * @throws InternalRecoveryServiceException if an unexpected error occurred in the recovery - * service. + * @deprecated Use {@link #start(String, CertPath, byte[], byte[], List)} instead. */ + @Deprecated @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public byte[] start( @NonNull CertPath verifierCertPath, @@ -179,8 +163,6 @@ public class RecoverySession implements AutoCloseable { * @throws CertificateException if the {@code verifierCertPath} is invalid. * @throws InternalRecoveryServiceException if an unexpected error occurred in the recovery * service. - * - * @hide */ @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public byte[] start(