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 Original line Diff line number Diff line
@@ -211,7 +211,8 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory {
    private SSLSocketFactory makeSocketFactory(TrustManager[] trustManagers) {
    private SSLSocketFactory makeSocketFactory(TrustManager[] trustManagers) {
        try {
        try {
            OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
            OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
            sslContext.engineInit(null, trustManagers, null, mSessionCache, null);
            sslContext.engineInit(null, trustManagers, null);
            sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
            return sslContext.engineGetSocketFactory();
            return sslContext.engineGetSocketFactory();
        } catch (KeyManagementException e) {
        } catch (KeyManagementException e) {
            Log.wtf(TAG, e);
            Log.wtf(TAG, e);
+2 −1
Original line number Original line 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) {
            synchronized (HttpsConnection.class) {
                mSslSocketFactory = sslContext.engineGetSocketFactory();
                mSslSocketFactory = sslContext.engineGetSocketFactory();
+6 −6
Original line number Original line Diff line number Diff line
@@ -211,17 +211,17 @@ public class SSLPerformanceTest extends AndroidTestCase {
        deleteDirectory();
        deleteDirectory();


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


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


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


        Stopwatch stopwatch = new Stopwatch();
        Stopwatch stopwatch = new Stopwatch();


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


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


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


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