Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIXED] KeyStore exception android.os.ServiceSpecificException: (code 7) #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajdevy
Copy link

@ajdevy ajdevy commented Nov 15, 2018

Fixed secure preferences initialization with Android KeyStore, as described in https://stackoverflow.com/questions/52024752/android-p-keystore-exception-android-os-servicespecificexception?rq=1

Copy link

@EdgarJan EdgarJan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still getting same Exception on Android P caused by entryInstanceOf.

@ajdevy
Copy link
Author

ajdevy commented Dec 16, 2018

@EdgarJan can you give a bit more details?

@EdgarJan
Copy link

@EdgarJan can you give a bit more details?

W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:144)
        at java.security.KeyStoreSpi.engineEntryInstanceOf(KeyStoreSpi.java:583)
        at java.security.KeyStore.entryInstanceOf(KeyStore.java:1631)
        at devliving.online.securedpreferencestore.EncryptionManager.loadKey(EncryptionManager.java:690)
        at devliving.online.securedpreferencestore.EncryptionManager.setup(EncryptionManager.java:228)
        at devliving.online.securedpreferencestore.EncryptionManager.<init>(EncryptionManager.java:201)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.<init>(SecuredPreferenceStore.java:79)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:134)

I suggest remove check for mStore.entryInstanceOf(AES_KEY_ALIAS, KeyStore.SecretKeyEntry.class).

Copy link

@alexpwf alexpwf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems correct to me.

@BlueHeisenberg
Copy link

Why is this not merged already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants