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

Commit 3d076afc authored by Robin Lee's avatar Robin Lee
Browse files

Choose CA certificate storage according to userId

Sets the default CA certificate directory at first instantiation so
that only certificates for the current user are searched.

This means that if one user decides to trust a CA no other user of the
device will be forced into trusting that CA as well.

Change-Id: Iaca14a94dd14c598e49a598290e1a80917269eac
parent 97f7f24c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import com.android.internal.os.RuntimeInit;
import com.android.internal.os.SamplingProfilerIntegration;
import com.android.internal.util.FastPrintWriter;
import com.android.org.conscrypt.OpenSSLSocketImpl;
import com.android.org.conscrypt.TrustedCertificateStore;
import com.google.android.collect.Lists;

import dalvik.system.VMRuntime;
@@ -5040,6 +5041,10 @@ public final class ActivityThread {

        Security.addProvider(new AndroidKeyStoreProvider());

        // Make sure TrustedCertificateStore looks in the right place for CA certificates
        final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());
        TrustedCertificateStore.setDefaultUserDirectory(configDir);

        Process.setArgV0("<pre-initialized>");

        Looper.prepareMainLooper();