Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 654598b5 authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Android (Google) Code Review
Browse files

Merge "Remove deprecated recoverable keystore classes." into pi-dev

parents ce70473a 80def873
Loading
Loading
Loading
Loading
+0 −37
Original line number Original line Diff line number Diff line
@@ -1820,43 +1820,6 @@ Landroid/R$styleable;->Window_windowBackground:I
Landroid/R$styleable;->Window_windowFrame:I
Landroid/R$styleable;->Window_windowFrame:I
Landroid/security/keystore/AndroidKeyStoreProvider;->getKeyStoreOperationHandle(Ljava/lang/Object;)J
Landroid/security/keystore/AndroidKeyStoreProvider;->getKeyStoreOperationHandle(Ljava/lang/Object;)J
Landroid/security/KeyStore;->getInstance()Landroid/security/KeyStore;
Landroid/security/KeyStore;->getInstance()Landroid/security/KeyStore;
Landroid/security/keystore/KeychainProtectionParams;->clearSecret()V
Landroid/security/keystore/KeychainProtectionParams;->getKeyDerivationParams()Landroid/security/keystore/KeyDerivationParams;
Landroid/security/keystore/KeychainProtectionParams;->getLockScreenUiFormat()I
Landroid/security/keystore/KeychainProtectionParams;->getSecret()[B
Landroid/security/keystore/KeychainProtectionParams;->getUserSecretType()I
Landroid/security/keystore/KeychainProtectionParams;-><init>(IILandroid/security/keystore/KeyDerivationParams;[B)V
Landroid/security/keystore/KeychainProtectionParams;-><init>(Landroid/os/Parcel;)V
Landroid/security/keystore/KeychainProtectionParams;-><init>()V
Landroid/security/keystore/KeychainSnapshot;->getCounterId()J
Landroid/security/keystore/KeychainSnapshot;->getEncryptedRecoveryKeyBlob()[B
Landroid/security/keystore/KeychainSnapshot;->getKeychainProtectionParams()Ljava/util/List;
Landroid/security/keystore/KeychainSnapshot;->getMaxAttempts()I
Landroid/security/keystore/KeychainSnapshot;->getServerParams()[B
Landroid/security/keystore/KeychainSnapshot;->getSnapshotVersion()I
Landroid/security/keystore/KeychainSnapshot;->getTrustedHardwarePublicKey()[B
Landroid/security/keystore/KeychainSnapshot;->getWrappedApplicationKeys()Ljava/util/List;
Landroid/security/keystore/KeyDerivationParams;->ALGORITHM_ARGON2ID:I
Landroid/security/keystore/KeyDerivationParams;->ALGORITHM_SHA256:I
Landroid/security/keystore/KeyDerivationParams;->createSha256Params([B)Landroid/security/keystore/KeyDerivationParams;
Landroid/security/keystore/KeyDerivationParams;->getAlgorithm()I
Landroid/security/keystore/KeyDerivationParams;->getSalt()[B
Landroid/security/keystore/KeyDerivationParams;-><init>(I[B)V
Landroid/security/keystore/KeyDerivationParams;-><init>(Landroid/os/Parcel;)V
Landroid/security/keystore/RecoveryClaim;->getClaimBytes()[B
Landroid/security/keystore/RecoveryClaim;->getRecoverySession()Landroid/security/keystore/RecoverySession;
Landroid/security/keystore/RecoveryController;->getInstance()Landroid/security/keystore/RecoveryController;
Landroid/security/keystore/RecoveryController;->getRecoveryData([B)Landroid/security/keystore/KeychainSnapshot;
Landroid/security/keystore/RecoveryController;->initRecoveryService(Ljava/lang/String;[B)V
Landroid/security/keystore/RecoveryController;->recoverKeys(Landroid/security/keystore/RecoverySession;[BLjava/util/List;)Ljava/util/Map;
Landroid/security/keystore/RecoveryController;->setRecoverySecretTypes([I)V
Landroid/security/keystore/RecoveryController;->setRecoveryStatus(Ljava/lang/String;[Ljava/lang/String;I)V
Landroid/security/keystore/RecoveryController;->setServerParams([B)V
Landroid/security/keystore/RecoveryController;->setSnapshotCreatedPendingIntent(Landroid/app/PendingIntent;)V
Landroid/security/keystore/RecoveryController;->startRecoverySession([B[B[BLjava/util/List;)Landroid/security/keystore/RecoveryClaim;
Landroid/security/keystore/WrappedApplicationKey;->getAlias()Ljava/lang/String;
Landroid/security/keystore/WrappedApplicationKey;->getEncryptedKeyMaterial()[B
Landroid/security/keystore/WrappedApplicationKey;-><init>(Ljava/lang/String;[B)V
Landroid/security/net/config/RootTrustManager;->checkServerTrusted([Ljava/security/cert/X509Certificate;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
Landroid/security/net/config/RootTrustManager;->checkServerTrusted([Ljava/security/cert/X509Certificate;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnectFailed()V
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnectFailed()V
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnect(Ljava/lang/String;Landroid/media/session/MediaSession$Token;Landroid/os/Bundle;)V
Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnect(Ljava/lang/String;Landroid/media/session/MediaSession$Token;Landroid/os/Bundle;)V
+0 −127
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.security.keystore;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

/**
 * Helpers for converting classes between old and new API, so we can preserve backwards
 * compatibility while teamfooding. This will be removed soon.
 *
 * @hide
 */
class BackwardsCompat {


    static KeychainProtectionParams toLegacyKeychainProtectionParams(
            android.security.keystore.recovery.KeyChainProtectionParams keychainProtectionParams
    ) {
        return new KeychainProtectionParams.Builder()
                .setUserSecretType(keychainProtectionParams.getUserSecretType())
                .setSecret(keychainProtectionParams.getSecret())
                .setLockScreenUiFormat(keychainProtectionParams.getLockScreenUiFormat())
                .setKeyDerivationParams(
                        toLegacyKeyDerivationParams(
                                keychainProtectionParams.getKeyDerivationParams()))
                .build();
    }

    static KeyDerivationParams toLegacyKeyDerivationParams(
            android.security.keystore.recovery.KeyDerivationParams keyDerivationParams
    ) {
        return new KeyDerivationParams(
                keyDerivationParams.getAlgorithm(), keyDerivationParams.getSalt());
    }

    static WrappedApplicationKey toLegacyWrappedApplicationKey(
            android.security.keystore.recovery.WrappedApplicationKey wrappedApplicationKey
    ) {
        return new WrappedApplicationKey.Builder()
                .setAlias(wrappedApplicationKey.getAlias())
                .setEncryptedKeyMaterial(wrappedApplicationKey.getEncryptedKeyMaterial())
                .build();
    }

    static android.security.keystore.recovery.KeyDerivationParams fromLegacyKeyDerivationParams(
            KeyDerivationParams keyDerivationParams
    ) {
        return android.security.keystore.recovery.KeyDerivationParams.createSha256Params(
                keyDerivationParams.getSalt());
    }

    static android.security.keystore.recovery.WrappedApplicationKey fromLegacyWrappedApplicationKey(
            WrappedApplicationKey wrappedApplicationKey
    ) {
        return new android.security.keystore.recovery.WrappedApplicationKey.Builder()
                .setAlias(wrappedApplicationKey.getAlias())
                .setEncryptedKeyMaterial(wrappedApplicationKey.getEncryptedKeyMaterial())
                .build();
    }

    static List<android.security.keystore.recovery.WrappedApplicationKey>
            fromLegacyWrappedApplicationKeys(List<WrappedApplicationKey> wrappedApplicationKeys
    ) {
        return map(wrappedApplicationKeys, BackwardsCompat::fromLegacyWrappedApplicationKey);
    }

    static List<android.security.keystore.recovery.KeyChainProtectionParams>
            fromLegacyKeychainProtectionParams(
                    List<KeychainProtectionParams> keychainProtectionParams) {
        return map(keychainProtectionParams, BackwardsCompat::fromLegacyKeychainProtectionParam);
    }

    static android.security.keystore.recovery.KeyChainProtectionParams
            fromLegacyKeychainProtectionParam(KeychainProtectionParams keychainProtectionParams) {
        return new android.security.keystore.recovery.KeyChainProtectionParams.Builder()
                .setUserSecretType(keychainProtectionParams.getUserSecretType())
                .setSecret(keychainProtectionParams.getSecret())
                .setLockScreenUiFormat(keychainProtectionParams.getLockScreenUiFormat())
                .setKeyDerivationParams(
                        fromLegacyKeyDerivationParams(
                                keychainProtectionParams.getKeyDerivationParams()))
                .build();
    }

    static KeychainSnapshot toLegacyKeychainSnapshot(
            android.security.keystore.recovery.KeyChainSnapshot keychainSnapshot
    ) {
        return new KeychainSnapshot.Builder()
                .setCounterId(keychainSnapshot.getCounterId())
                .setEncryptedRecoveryKeyBlob(keychainSnapshot.getEncryptedRecoveryKeyBlob())
                .setTrustedHardwarePublicKey(keychainSnapshot.getTrustedHardwarePublicKey())
                .setSnapshotVersion(keychainSnapshot.getSnapshotVersion())
                .setMaxAttempts(keychainSnapshot.getMaxAttempts())
                .setServerParams(keychainSnapshot.getServerParams())
                .setKeychainProtectionParams(
                        map(keychainSnapshot.getKeyChainProtectionParams(),
                                BackwardsCompat::toLegacyKeychainProtectionParams))
                .setWrappedApplicationKeys(
                        map(keychainSnapshot.getWrappedApplicationKeys(),
                                BackwardsCompat::toLegacyWrappedApplicationKey))
                .build();
    }

    static <A, B> List<B> map(List<A> as, Function<A, B> f) {
        ArrayList<B> bs = new ArrayList<>(as.size());
        for (A a : as) {
            bs.add(f.apply(a));
        }
        return bs;
    }
}
+0 −27
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.security.keystore;

/**
 * @deprecated Use {@link android.security.keystore.recovery.BadCertificateFormatException}.
 * @hide
 */
public class BadCertificateFormatException extends RecoveryControllerException {
    public BadCertificateFormatException(String msg) {
        super(msg);
    }
}
+0 −28
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.security.keystore;

/**
 * @deprecated Use {@link android.security.keystore.recovery.DecryptionFailedException}.
 * @hide
 */
public class DecryptionFailedException extends RecoveryControllerException {

    public DecryptionFailedException(String msg) {
        super(msg);
    }
}
+0 −31
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.security.keystore;

/**
 * @deprecated Use {@link android.security.keystore.recovery.InternalRecoveryServiceException}.
 * @hide
 */
public class InternalRecoveryServiceException extends RecoveryControllerException {
    public InternalRecoveryServiceException(String msg) {
        super(msg);
    }

    public InternalRecoveryServiceException(String message, Throwable cause) {
        super(message, cause);
    }
}
Loading