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

Commit 2c42c8fb authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

Remove SSLContextImpl.engineInit(..) that takes persistent cache arguments

Bug: 2672817

Change-Id: If5f10fa16eaf5676a0c1540463759cd4e0e837de
parent 5251c800
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -211,7 +211,8 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory {
    private SSLSocketFactory makeSocketFactory(TrustManager[] trustManagers) {
        try {
            OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
            sslContext.engineInit(null, trustManagers, null, mSessionCache, null);
            sslContext.engineInit(null, trustManagers, null);
            sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
            return sslContext.engineGetSocketFactory();
        } catch (KeyManagementException e) {
            Log.wtf(TAG, e);
+2 −1
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@ public class HttpsConnection extends Connection {
                }
            };

            sslContext.engineInit(null, trustManagers, null, cache, null);
            sslContext.engineInit(null, trustManagers, null);
            sslContext.engineGetClientSessionContext().setPersistentCache(cache);

            synchronized (HttpsConnection.class) {
                mSslSocketFactory = sslContext.engineGetSocketFactory();
+6 −6
Original line number Diff line number Diff line
@@ -211,17 +211,17 @@ public class SSLPerformanceTest extends AndroidTestCase {
        deleteDirectory();

        OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
        sslContext.engineInit(null, null, null,
                FileClientSessionCache.usingDirectory(getCacheDirectory()),
                null);
        sslContext.engineInit(null, null, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(
                FileClientSessionCache.usingDirectory(getCacheDirectory()));

        // Make sure www.google.com is in the cache.
        getVerisignDotCom(sslContext);

        // Re-initialize so we hit the file cache.
        sslContext.engineInit(null, null, null,
                FileClientSessionCache.usingDirectory(getCacheDirectory()),
                null);
        sslContext.engineInit(null, null, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(
                FileClientSessionCache.usingDirectory(getCacheDirectory()));

        Stopwatch stopwatch = new Stopwatch();

+10 −5
Original line number Diff line number Diff line
@@ -911,7 +911,8 @@ public class SSLSocketTest extends TestCase {

        // Cache size = 2.
        FakeClientSessionCache fakeCache = new FakeClientSessionCache();
        context.engineInit(null, null, null, fakeCache, null);
        context.engineInit(null, null, null);
        context.engineGetClientSessionContext().setPersistentCache(fakeCache);
        SSLSocketFactory socketFactory = context.engineGetSocketFactory();
        context.engineGetClientSessionContext().setSessionCacheSize(2);
        makeRequests(socketFactory);
@@ -933,7 +934,8 @@ public class SSLSocketTest extends TestCase {

        // Cache size = 3.
        fakeCache = new FakeClientSessionCache();
        context.engineInit(null, null, null, fakeCache, null);
        context.engineInit(null, null, null);
        context.engineGetClientSessionContext().setPersistentCache(fakeCache);
        socketFactory = context.engineGetSocketFactory();
        context.engineGetClientSessionContext().setSessionCacheSize(3);
        makeRequests(socketFactory);
@@ -952,7 +954,8 @@ public class SSLSocketTest extends TestCase {

        // Cache size = 4.
        fakeCache = new FakeClientSessionCache();
        context.engineInit(null, null, null, fakeCache, null);
        context.engineInit(null, null, null);
        context.engineGetClientSessionContext().setPersistentCache(fakeCache);
        socketFactory = context.engineGetSocketFactory();
        context.engineGetClientSessionContext().setSessionCacheSize(4);
        makeRequests(socketFactory);
@@ -1010,7 +1013,8 @@ public class SSLSocketTest extends TestCase {
        try {
            ClientSessionCacheProxy cacheProxy
                    = new ClientSessionCacheProxy(fileCache);
            context.engineInit(null, null, null, cacheProxy, null);
            context.engineInit(null, null, null);
            context.engineGetClientSessionContext().setPersistentCache(cacheProxy);
            SSLSocketFactory socketFactory = context.engineGetSocketFactory();
            context.engineGetClientSessionContext().setSessionCacheSize(1);
            makeRequests(socketFactory);
@@ -1033,7 +1037,8 @@ public class SSLSocketTest extends TestCase {
            // Try again now that file-based cache is populated.
            fileCache = FileClientSessionCache.usingDirectory(cacheDir);
            cacheProxy = new ClientSessionCacheProxy(fileCache);
            context.engineInit(null, null, null, cacheProxy, null);
            context.engineInit(null, null, null);
            context.engineGetClientSessionContext().setPersistentCache(cacheProxy);
            socketFactory = context.engineGetSocketFactory();
            context.engineGetClientSessionContext().setSessionCacheSize(1);
            makeRequests(socketFactory);