wonjsohn / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Android keystore broken for enterprise wifi usage #604

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In Android 4.4.2, there was a bug where keystore would become unusable at a 
certain point. This has been fixed on phones with Android 4.4.4. Glass still 
runs on 4.4.2 (as of XE20.1), so the bug is present. This is important because 
it prevents Glass from connecting to enterprise networks (e.g. EAP-TLS).

Here's the log statement we encountered:
E/WifiConfigStore﹕ "XXXXXXX network": key store is locked

Here's the related snippet from Android source for reference:

if (enterpriseConfig.needsKeyStore()) {
                    /**
                     * Keyguard settings may eventually be controlled by device policy.
                     * We check here if keystore is unlocked before installing
                     * credentials.
                     * TODO: Do we need a dialog here ?
                     */
                    if (mKeyStore.state() != KeyStore.State.UNLOCKED) {
                        loge(config.SSID + ": key store is locked");
                        break setVariables;
                    }

public State state() {
        final int ret;
        try {
            ret = mBinder.test();
        } catch (RemoteException e) {
            Log.w(TAG, "Cannot connect to keystore", e);
            throw new AssertionError(e);
        }

        switch (ret) {
            case NO_ERROR: return State.UNLOCKED;
            case LOCKED: return State.LOCKED;
            case UNINITIALIZED: return State.UNINITIALIZED;
            default: throw new AssertionError(mError);
        }
    }

public interface IKeystoreService extends IInterface {

               public int test() throws RemoteException;
}

Original issue reported on code.google.com by eug...@wearableintelligence.com on 12 Sep 2014 at 7:18