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

Commit 4d6cd821 authored by Alex Klyubin's avatar Alex Klyubin Committed by Android Git Automerger
Browse files

am df6c6702: Merge "Streamline Android Keystore delete entry operation." into mnc-dev

* commit 'df6c6702':
  Streamline Android Keystore delete entry operation.
parents e30ce2da df6c6702
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -674,12 +674,13 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {

    @Override
    public void engineDeleteEntry(String alias) throws KeyStoreException {
        if (!isKeyEntry(alias) && !isCertificateEntry(alias)) {
        if (!engineContainsAlias(alias)) {
            return;
        }
        // At least one entry corresponding to this alias exists in keystore

        if (!Credentials.deleteAllTypesForAlias(mKeyStore, alias)) {
            throw new KeyStoreException("No such entry " + alias);
            throw new KeyStoreException("Failed to delete entry: " + alias);
        }
    }

@@ -849,9 +850,7 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {
            throw new KeyStoreException("entry == null");
        }

        if (engineContainsAlias(alias)) {
            engineDeleteEntry(alias);
        }
        Credentials.deleteAllTypesForAlias(mKeyStore, alias);

        if (entry instanceof KeyStore.TrustedCertificateEntry) {
            KeyStore.TrustedCertificateEntry trE = (KeyStore.TrustedCertificateEntry) entry;