├── .clang-format ├── .github └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .lgtm.yml ├── .travis.yml ├── BUILDING.md ├── CAPABILITIES.md ├── CONTRIBUTING.md ├── CPPLINT.cfg ├── IMPLEMENTATION_NOTES.md ├── LICENSE ├── MODULE_LICENSE_APACHE2 ├── NOTICE ├── PREUPLOAD.cfg ├── README.md ├── android-stub ├── build.gradle └── src │ └── main │ └── java │ ├── android │ └── util │ │ └── StatsEvent.java │ ├── com │ └── android │ │ └── org │ │ └── conscrypt │ │ ├── NativeCrypto.java │ │ ├── OpenSSLSocketImpl.java │ │ └── SSLParametersImpl.java │ └── dalvik │ └── system │ ├── BlockGuard.java │ └── CloseGuard.java ├── android ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── lint.xml ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── org │ │ └── conscrypt │ │ ├── BaseOpenSSLSocketAdapterFactory.java │ │ ├── KitKatPlatformOpenSSLSocketAdapterFactory.java │ │ ├── KitKatPlatformOpenSSLSocketImplAdapter.java │ │ ├── NativeCryptoJni.java │ │ ├── Platform.java │ │ ├── PreKitKatPlatformOpenSSLSocketAdapterFactory.java │ │ └── PreKitKatPlatformOpenSSLSocketImplAdapter.java │ └── res │ └── values │ └── strings.xml ├── benchmark-android ├── build.gradle ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── org │ │ └── conscrypt │ │ ├── AndroidEndpointFactory.java │ │ ├── AndroidEngineFactory.java │ │ ├── CaliperAlpnBenchmark.java │ │ ├── CaliperClientSocketBenchmark.java │ │ ├── CaliperEngineHandshakeBenchmark.java │ │ └── CaliperEngineWrapBenchmark.java └── vogar.jar ├── benchmark-base ├── build.gradle └── src │ └── main │ └── java │ └── org │ └── conscrypt │ ├── BenchmarkProtocol.java │ ├── BufferType.java │ ├── CipherEncryptBenchmark.java │ ├── CipherFactory.java │ ├── ClientEndpoint.java │ ├── ClientSocketBenchmark.java │ ├── EndpointFactory.java │ ├── EngineFactory.java │ ├── EngineHandshakeBenchmark.java │ ├── EngineWrapBenchmark.java │ ├── ServerEndpoint.java │ ├── ServerSocketBenchmark.java │ └── Transformation.java ├── benchmark-graphs ├── build.gradle └── src │ └── main │ ├── java │ └── org │ │ └── conscrypt │ │ └── graphgen │ │ └── Main.java │ └── resources │ ├── html │ ├── footer.html │ └── header.html │ └── json │ └── templates │ └── SslEngineBenchmark.json ├── benchmark-jmh ├── build.gradle └── src │ └── jmh │ └── java │ └── org │ └── conscrypt │ ├── JmhAlpnBenchmark.java │ ├── JmhCipherEncryptBenchmark.java │ ├── JmhClientSocketBenchmark.java │ ├── JmhEngineHandshakeBenchmark.java │ ├── JmhEngineWrapBenchmark.java │ ├── JmhServerSocketBenchmark.java │ ├── NettyBufferAllocator.java │ ├── OpenJdkCipherFactory.java │ ├── OpenJdkEndpointFactory.java │ └── OpenJdkEngineFactory.java ├── build.gradle ├── common └── src │ ├── jni │ ├── main │ │ ├── cpp │ │ │ └── conscrypt │ │ │ │ ├── compatibility_close_monitor.cc │ │ │ │ ├── jniload.cc │ │ │ │ ├── jniutil.cc │ │ │ │ ├── native_crypto.cc │ │ │ │ └── netutil.cc │ │ └── include │ │ │ └── conscrypt │ │ │ ├── NetFd.h │ │ │ ├── app_data.h │ │ │ ├── bio_input_stream.h │ │ │ ├── bio_output_stream.h │ │ │ ├── bio_stream.h │ │ │ ├── compat.h │ │ │ ├── compatibility_close_monitor.h │ │ │ ├── jniutil.h │ │ │ ├── logging.h │ │ │ ├── macros.h │ │ │ ├── native_crypto.h │ │ │ ├── netutil.h │ │ │ ├── scoped_ssl_bio.h │ │ │ ├── ssl_error.h │ │ │ └── trace.h │ └── unbundled │ │ └── include │ │ └── nativehelper │ │ ├── scoped_local_ref.h │ │ ├── scoped_primitive_array.h │ │ └── scoped_utf_chars.h │ ├── main │ └── java │ │ └── org │ │ └── conscrypt │ │ ├── AbstractConscryptEngine.java │ │ ├── AbstractConscryptSocket.java │ │ ├── AbstractSessionContext.java │ │ ├── ActiveSession.java │ │ ├── AddressUtils.java │ │ ├── AllocatedBuffer.java │ │ ├── ApplicationProtocolSelector.java │ │ ├── ApplicationProtocolSelectorAdapter.java │ │ ├── ArrayUtils.java │ │ ├── BufferAllocator.java │ │ ├── BufferUtils.java │ │ ├── ByteArray.java │ │ ├── CCMParameterSpec.java │ │ ├── CCMParameters.java │ │ ├── CertBlocklist.java │ │ ├── CertPinManager.java │ │ ├── CertificatePriorityComparator.java │ │ ├── ChainStrengthAnalyzer.java │ │ ├── ClientSessionContext.java │ │ ├── Conscrypt.java │ │ ├── ConscryptCertStore.java │ │ ├── ConscryptEngine.java │ │ ├── ConscryptEngineSocket.java │ │ ├── ConscryptFileDescriptorSocket.java │ │ ├── ConscryptHostnameVerifier.java │ │ ├── ConscryptServerSocket.java │ │ ├── ConscryptSession.java │ │ ├── CryptoUpcalls.java │ │ ├── DESEDESecretKeyFactory.java │ │ ├── DefaultSSLContextImpl.java │ │ ├── DuckTypedPSKKeyManager.java │ │ ├── ECParameters.java │ │ ├── EmptyArray.java │ │ ├── EvpMdRef.java │ │ ├── ExperimentalApi.java │ │ ├── ExternalSession.java │ │ ├── FileClientSessionCache.java │ │ ├── GCMParameters.java │ │ ├── HandshakeListener.java │ │ ├── Internal.java │ │ ├── IvParameters.java │ │ ├── Java7ExtendedSSLSession.java │ │ ├── Java8EngineSocket.java │ │ ├── Java8EngineWrapper.java │ │ ├── Java8ExtendedSSLSession.java │ │ ├── Java8FileDescriptorSocket.java │ │ ├── KeyGeneratorImpl.java │ │ ├── KeyManagerFactoryImpl.java │ │ ├── KeyManagerImpl.java │ │ ├── NativeCrypto.java │ │ ├── NativeRef.java │ │ ├── NativeSsl.java │ │ ├── NativeSslSession.java │ │ ├── OAEPParameters.java │ │ ├── OidData.java │ │ ├── OkHostnameVerifier.java │ │ ├── OpenSSLAeadCipher.java │ │ ├── OpenSSLAeadCipherAES.java │ │ ├── OpenSSLAeadCipherChaCha20.java │ │ ├── OpenSSLAeadCipherSM4.java │ │ ├── OpenSSLBIOInputStream.java │ │ ├── OpenSSLBaseDHKeyAgreement.java │ │ ├── OpenSSLCipher.java │ │ ├── OpenSSLCipherRSA.java │ │ ├── OpenSSLContextImpl.java │ │ ├── OpenSSLECDHKeyAgreement.java │ │ ├── OpenSSLECGroupContext.java │ │ ├── OpenSSLECKeyFactory.java │ │ ├── OpenSSLECKeyPairGenerator.java │ │ ├── OpenSSLECPointContext.java │ │ ├── OpenSSLECPrivateKey.java │ │ ├── OpenSSLECPublicKey.java │ │ ├── OpenSSLEvpCipher.java │ │ ├── OpenSSLEvpCipherAES.java │ │ ├── OpenSSLEvpCipherARC4.java │ │ ├── OpenSSLEvpCipherChaCha20.java │ │ ├── OpenSSLEvpCipherDESEDE.java │ │ ├── OpenSSLKey.java │ │ ├── OpenSSLKeyHolder.java │ │ ├── OpenSSLMac.java │ │ ├── OpenSSLMessageDigestJDK.java │ │ ├── OpenSSLProvider.java │ │ ├── OpenSSLRSAKeyFactory.java │ │ ├── OpenSSLRSAKeyPairGenerator.java │ │ ├── OpenSSLRSAPrivateCrtKey.java │ │ ├── OpenSSLRSAPrivateKey.java │ │ ├── OpenSSLRSAPublicKey.java │ │ ├── OpenSSLRandom.java │ │ ├── OpenSSLServerSocketFactoryImpl.java │ │ ├── OpenSSLSignature.java │ │ ├── OpenSSLSignatureRawECDSA.java │ │ ├── OpenSSLSignatureRawRSA.java │ │ ├── OpenSSLSocketFactoryImpl.java │ │ ├── OpenSSLSocketImpl.java │ │ ├── OpenSSLX25519Key.java │ │ ├── OpenSSLX25519PrivateKey.java │ │ ├── OpenSSLX25519PublicKey.java │ │ ├── OpenSSLX509CRL.java │ │ ├── OpenSSLX509CRLEntry.java │ │ ├── OpenSSLX509CertPath.java │ │ ├── OpenSSLX509Certificate.java │ │ ├── OpenSSLX509CertificateFactory.java │ │ ├── OpenSSLXDHKeyAgreement.java │ │ ├── OpenSSLXDHKeyFactory.java │ │ ├── OpenSSLXDHKeyPairGenerator.java │ │ ├── OpenSSLXECParameterSpec.java │ │ ├── PSKKeyManager.java │ │ ├── PSSParameters.java │ │ ├── PeerInfoProvider.java │ │ ├── Preconditions.java │ │ ├── SM2Cipher.java │ │ ├── SM2KeyFactory.java │ │ ├── SM2KeyPairGenerator.java │ │ ├── SM2ParameterSpec.java │ │ ├── SM2PrivateKey.java │ │ ├── SM2PrivateKeySpec.java │ │ ├── SM2PublicKey.java │ │ ├── SM2PublicKeySpec.java │ │ ├── SM4Cipher.java │ │ ├── SSLClientSessionCache.java │ │ ├── SSLNullSession.java │ │ ├── SSLParametersImpl.java │ │ ├── SSLServerSessionCache.java │ │ ├── SSLUtils.java │ │ ├── ScryptKeySpec.java │ │ ├── ScryptSecretKeyFactory.java │ │ ├── ServerSessionContext.java │ │ ├── SessionSnapshot.java │ │ ├── ShortBufferWithoutStackTraceException.java │ │ ├── TrustManagerFactoryImpl.java │ │ ├── TrustManagerImpl.java │ │ ├── TrustedCertificateIndex.java │ │ ├── X509PublicKey.java │ │ ├── ct │ │ ├── CTConstants.java │ │ ├── CTLogInfo.java │ │ ├── CTLogStore.java │ │ ├── CTPolicy.java │ │ ├── CTVerificationResult.java │ │ ├── CTVerifier.java │ │ ├── CertificateEntry.java │ │ ├── DigitallySigned.java │ │ ├── Serialization.java │ │ ├── SerializationException.java │ │ ├── SignedCertificateTimestamp.java │ │ └── VerifiedSCT.java │ │ ├── io │ │ └── IoUtils.java │ │ └── metrics │ │ ├── CipherSuite.java │ │ ├── ConscryptStatsLog.java │ │ ├── OptionalMethod.java │ │ ├── Protocol.java │ │ ├── ReflexiveStatsEvent.java │ │ ├── ReflexiveStatsLog.java │ │ └── Source.java │ └── test │ ├── java │ └── org │ │ └── conscrypt │ │ ├── BufferUtilsTest.java │ │ ├── CertPinManagerTest.java │ │ ├── ChainStrengthAnalyzerTest.java │ │ ├── ConscryptJava7Suite.java │ │ ├── ConscryptSuite.java │ │ ├── HostnameVerifierTest.java │ │ ├── MacTest.java │ │ ├── NativeCryptoArgTest.java │ │ ├── TrustManagerImplTest.java │ │ ├── ct │ │ ├── CTVerifierTest.java │ │ └── SerializationTest.java │ │ ├── java │ │ └── security │ │ │ ├── AlgorithmParameterGeneratorTestDH.java │ │ │ ├── AlgorithmParameterGeneratorTestDSA.java │ │ │ ├── AlgorithmParametersPSSTest.java │ │ │ ├── AlgorithmParametersTestAES.java │ │ │ ├── AlgorithmParametersTestDES.java │ │ │ ├── AlgorithmParametersTestDESede.java │ │ │ ├── AlgorithmParametersTestDH.java │ │ │ ├── AlgorithmParametersTestDSA.java │ │ │ ├── AlgorithmParametersTestEC.java │ │ │ ├── AlgorithmParametersTestGCM.java │ │ │ ├── AlgorithmParametersTestOAEP.java │ │ │ ├── KeyFactoryTestDH.java │ │ │ ├── KeyFactoryTestDSA.java │ │ │ ├── KeyFactoryTestEC.java │ │ │ ├── KeyFactoryTestRSA.java │ │ │ ├── KeyFactoryTestRSACrt.java │ │ │ ├── KeyFactoryTestRSACustom.java │ │ │ ├── KeyFactoryTestSM2.java │ │ │ ├── KeyFactoryTestXDH.java │ │ │ ├── KeyPairGeneratorTest.java │ │ │ ├── KeyPairGeneratorTestDH.java │ │ │ ├── KeyPairGeneratorTestDSA.java │ │ │ ├── KeyPairGeneratorTestRSA.java │ │ │ ├── KeyPairGeneratorTestXDH.java │ │ │ ├── MessageDigestTest.java │ │ │ ├── README.ASN1 │ │ │ ├── SignatureTest.java │ │ │ ├── TestECPrivateKey.java │ │ │ ├── TestECPublicKey.java │ │ │ ├── TestPrivateKey.java │ │ │ ├── TestPublicKey.java │ │ │ └── cert │ │ │ ├── CertificateFactoryTest.java │ │ │ ├── X509CRLTest.java │ │ │ └── X509CertificateTest.java │ │ ├── javax │ │ ├── crypto │ │ │ ├── AeadCipherTest.java │ │ │ ├── CipherBasicsTest.java │ │ │ ├── CipherTest.java │ │ │ ├── ECDHKeyAgreementTest.java │ │ │ ├── KeyGeneratorTest.java │ │ │ ├── ScryptTest.java │ │ │ └── XDHKeyAgreementTest.java │ │ └── net │ │ │ └── ssl │ │ │ ├── HttpsURLConnectionTest.java │ │ │ ├── KeyManagerFactoryTest.java │ │ │ ├── KeyStoreBuilderParametersTest.java │ │ │ ├── SNIHostNameTest.java │ │ │ ├── SSLContextTest.java │ │ │ ├── SSLEngineTest.java │ │ │ ├── SSLEngineVersionCompatibilityTest.java │ │ │ ├── SSLParametersTest.java │ │ │ ├── SSLServerSocketFactoryTest.java │ │ │ ├── SSLServerSocketTest.java │ │ │ ├── SSLSessionContextTest.java │ │ │ ├── SSLSessionTest.java │ │ │ ├── SSLSocketFactoryTest.java │ │ │ ├── SSLSocketTest.java │ │ │ ├── SSLSocketVersionCompatibilityTest.java │ │ │ ├── TrustManagerFactoryTest.java │ │ │ └── X509KeyManagerTest.java │ │ └── metrics │ │ ├── CipherSuiteTest.java │ │ ├── OptionalMethodTest.java │ │ └── ProtocolTest.java │ └── resources │ └── crypto │ ├── aes-cbc.csv │ ├── aes-ccm.csv │ ├── aes-cfb128.csv │ ├── aes-cfb8.csv │ ├── aes-ecb.csv │ ├── aes-gcm-siv.csv │ ├── aes-gcm.csv │ ├── aes-ofb.csv │ ├── build_test_files.sh │ ├── chacha20-poly1305.csv │ ├── chacha20.csv │ ├── desede-cbc.csv │ ├── desede-cfb64.csv │ ├── desede-cfb8.csv │ ├── desede-ecb.csv │ ├── desede-ofb.csv │ ├── macs.csv │ ├── parse_records.py │ ├── scrypt.csv │ ├── sm4-cbc.csv │ ├── sm4-ccm.csv │ ├── sm4-cfb.csv │ ├── sm4-ctr.csv │ ├── sm4-ecb.csv │ ├── sm4-gcm.csv │ └── sm4-ofb.csv ├── constants ├── build.gradle └── src │ └── gen │ └── cpp │ └── generate_constants.cc ├── examples └── jce │ ├── README.md │ ├── SM2CipherExample.java │ ├── SM2SignatureExample.java │ ├── SM2WithEngine.java │ ├── SM3MessageDigestExample.java │ ├── SM3WithEngine.java │ ├── SM4CipherExample.java │ ├── SM4WithEngine.java │ ├── TLCPClient.java │ ├── TLCPServer.java │ ├── TLS13Client.java │ ├── TLS13Server.java │ ├── ca.crt │ ├── chain.crt │ ├── server_enc.crt │ ├── server_enc.key │ ├── server_sign.crt │ ├── server_sign.key │ ├── sm2.crt │ ├── sm2.key │ └── subca.crt ├── gradle.properties ├── gradle ├── publishing.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libcore-stub ├── build.gradle └── src │ └── main │ └── java │ ├── android │ └── system │ │ └── StructTimeval.java │ └── libcore │ ├── net │ └── NetworkSecurityPolicy.java │ └── util │ └── Objects.java ├── licenses ├── LICENSE.harmony.txt └── LICENSE.netty.txt ├── openjdk ├── build.gradle └── src │ ├── main │ └── java │ │ ├── net │ │ └── tongsuo │ │ │ ├── TlcpKeyManagerFactoryImpl.java │ │ │ ├── TlcpKeyManagerImpl.java │ │ │ ├── TongsuoProvider.java │ │ │ └── TongsuoX509Certificate.java │ │ └── org │ │ └── conscrypt │ │ ├── HostProperties.java │ │ ├── Java8PlatformUtil.java │ │ ├── Java9PlatformUtil.java │ │ ├── NativeCryptoJni.java │ │ ├── NativeLibraryLoader.java │ │ ├── NativeLibraryUtil.java │ │ └── Platform.java │ └── test │ ├── java │ ├── net │ │ └── tongsuo │ │ │ ├── TongsuoOpenJdkSuite.java │ │ │ └── TongsuoProviderEndToEndTest.java │ └── org │ │ └── conscrypt │ │ ├── AbstractSessionContextTest.java │ │ ├── AddressUtilsTest.java │ │ ├── ApplicationProtocolSelectorAdapterTest.java │ │ ├── ClientSessionContextTest.java │ │ ├── ConscryptEngineTest.java │ │ ├── ConscryptOpenJdkSuite.java │ │ ├── ConscryptSocketTest.java │ │ ├── ConscryptTest.java │ │ ├── DuckTypedPSKKeyManagerTest.java │ │ ├── FileClientSessionCacheTest.java │ │ ├── MockSessionBuilder.java │ │ ├── NativeCryptoTest.java │ │ ├── NativeRefTest.java │ │ ├── NativeSslSessionTest.java │ │ ├── OpenSSLKeyTest.java │ │ ├── OpenSSLX509CertificateTest.java │ │ ├── PlatformTest.java │ │ ├── RenegotiationTest.java │ │ ├── SSLUtilsTest.java │ │ ├── ServerSessionContextTest.java │ │ ├── TestSessionBuilder.java │ │ ├── TestSessionBuilderTest.java │ │ ├── TlcpDoubleCertTest.java │ │ └── ZpenSSLX509Certificate.java │ └── resources │ ├── README │ ├── blocklist_test_chain.pem │ ├── blocklist_test_valid_ca.pem │ ├── blocklist_test_valid_chain.pem │ ├── ca-cert.pem │ ├── cert-ct-embedded.pem │ ├── cert-ct-poisoned.pem │ ├── cert-key.pem │ ├── cert.pem │ ├── cert │ ├── sm2-root.crt │ └── sm2-root.key │ ├── ct-server-key-public.pem │ ├── ct-signed-timestamp-list │ ├── ct-signed-timestamp-list-invalid │ ├── ct-signed-timestamp-list-unknown │ ├── ocsp-response-sct-extension.der │ ├── ocsp-response.der │ ├── sm2-ca.crt │ ├── sm2-cert.crt │ ├── sm2-leaf-ca.crt │ ├── sm2-leaf-cert.crt │ ├── sm2-leaf-private.key │ ├── sm2-private.key │ ├── test_blocklist_ca.pem │ ├── test_blocklist_ca_key.pem │ └── tlcp_cert │ ├── ca.crt │ ├── ca.key │ ├── client_enc.crt │ ├── client_enc.key │ ├── client_sign.crt │ ├── client_sign.key │ ├── server_enc.crt │ ├── server_enc.key │ ├── server_sign.crt │ ├── server_sign.key │ ├── sub_ca.crt │ └── sub_ca.key ├── platform ├── build.gradle ├── lint.xml ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── org │ │ │ └── conscrypt │ │ │ ├── CertBlocklistImpl.java │ │ │ ├── Hex.java │ │ │ ├── InternalUtil.java │ │ │ ├── JSSEProvider.java │ │ │ ├── NativeCryptoJni.java │ │ │ ├── Platform.java │ │ │ ├── TrustedCertificateKeyStoreSpi.java │ │ │ ├── TrustedCertificateStore.java │ │ │ └── ct │ │ │ ├── CTLogStoreImpl.java │ │ │ ├── CTPolicyImpl.java │ │ │ └── KnownLogs.java │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── org │ └── conscrypt │ ├── CertBlocklistTest.java │ ├── TrustedCertificateStoreTest.java │ ├── ct │ └── CTLogStoreImplTest.java │ └── metrics │ └── MetricsTest.java ├── release ├── Dockerfile ├── README.md ├── docker ├── linux ├── macos └── windows.bat ├── settings.gradle ├── test_logging.properties └── testing ├── build.gradle └── src └── main └── java ├── org └── conscrypt │ ├── ChannelType.java │ ├── MethodFilter.java │ ├── TestUtils.java │ ├── java │ └── security │ │ ├── AbstractAlgorithmParameterGeneratorTest.java │ │ ├── AbstractAlgorithmParametersTest.java │ │ ├── AbstractKeyFactoryTest.java │ │ ├── AbstractKeyPairGeneratorTest.java │ │ ├── AlgorithmParameterAsymmetricHelper.java │ │ ├── AlgorithmParameterKeyAgreementHelper.java │ │ ├── AlgorithmParameterSignatureHelper.java │ │ ├── AlgorithmParameterSymmetricHelper.java │ │ ├── CipherAsymmetricCryptHelper.java │ │ ├── CipherHelper.java │ │ ├── CpuFeatures.java │ │ ├── DefaultKeys.java │ │ ├── KeyAgreementHelper.java │ │ ├── SignatureHelper.java │ │ ├── StandardNames.java │ │ ├── TestHelper.java │ │ └── TestKeyStore.java │ ├── javax │ └── net │ │ └── ssl │ │ ├── FakeSSLSession.java │ │ ├── ForwardingX509ExtendedKeyManager.java │ │ ├── PSKKeyManagerProxy.java │ │ ├── RandomPrivateKeyX509ExtendedKeyManager.java │ │ ├── SSLConfigurationAsserts.java │ │ ├── TestHostnameVerifier.java │ │ ├── TestKeyManager.java │ │ ├── TestSSLContext.java │ │ ├── TestSSLEnginePair.java │ │ ├── TestSSLSessions.java │ │ ├── TestSSLSocketPair.java │ │ └── TestTrustManager.java │ ├── testing │ ├── BrokenProvider.java │ ├── FailingSniMatcher.java │ ├── NullPrintStream.java │ ├── OpaqueProvider.java │ ├── RestrictedAlgorithmConstraints.java │ └── Streams.java │ └── tlswire │ ├── TlsTester.java │ ├── handshake │ ├── AlpnHelloExtension.java │ ├── CipherSuite.java │ ├── ClientHello.java │ ├── CompressionMethod.java │ ├── EllipticCurve.java │ ├── EllipticCurvesHelloExtension.java │ ├── HandshakeMessage.java │ ├── HelloExtension.java │ └── ServerNameHelloExtension.java │ ├── record │ ├── TlsProtocols.java │ └── TlsRecord.java │ └── util │ ├── IoUtils.java │ └── TlsProtocolVersion.java └── tests ├── net ├── DelegatingSSLSocketFactory.java └── DelegatingSocketFactory.java └── util ├── ForEachRunner.java ├── Pair.java └── ServiceTester.java /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | AccessModifierOffset: -4 5 | AllowShortFunctionsOnASingleLine: Empty 6 | ColumnLimit: 100 7 | IndentWidth: 4 8 | ContinuationIndentWidth: 8 9 | --- 10 | Language: Java 11 | BasedOnStyle: Google 12 | ColumnLimit: 100 13 | IndentWidth: 4 14 | ContinuationIndentWidth: 8 15 | ... 16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle 2 | build 3 | .gradle 4 | local.properties 5 | 6 | # Maven (examples) 7 | target 8 | 9 | # IntelliJ IDEA 10 | .idea 11 | *.iml 12 | 13 | # Eclipse 14 | .classpath 15 | .project 16 | .settings 17 | bin 18 | 19 | # OS X 20 | .DS_Store 21 | 22 | # Emacs 23 | *~ 24 | \#*\# 25 | 26 | # Vim 27 | .*.sw[nop] 28 | 29 | # Vogar benchmarks 30 | vogar-results/* 31 | 32 | # java 33 | *.class 34 | -------------------------------------------------------------------------------- /.lgtm.yml: -------------------------------------------------------------------------------- 1 | # This configuration file is for https://lgtm.com/ code analysis using Semmle. 2 | 3 | extraction: 4 | java: 5 | prepare: 6 | packages: 7 | - cmake 8 | - golang-go 9 | - ninja-build 10 | after_prepare: 11 | - export BORINGSSL_HOME="$LGTM_WORKSPACE/boringssl" 12 | - export CXXFLAGS="-std=c++11" 13 | - mkdir -p $BORINGSSL_HOME 14 | - curl -Lo - https://boringssl.googlesource.com/boringssl/+archive/refs/heads/master.tar.gz | tar zxvfC - $BORINGSSL_HOME 15 | - git config --global user.email "semmle-builder@example.com" 16 | - git config --global user.name "Semmle Builder" 17 | - ( cd $BORINGSSL_HOME ; git init ; git commit --allow-empty -m "Fake repo" ) 18 | - mkdir $BORINGSSL_HOME/build64 && pushd $BORINGSSL_HOME/build64 19 | - cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja .. 20 | - ninja 21 | - popd 22 | -------------------------------------------------------------------------------- /BUILDING.md: -------------------------------------------------------------------------------- 1 | Building Tongsuo-Java-SDK 2 | ================== 3 | 4 | Before you begin, you'll first need to properly configure the [Prerequisites](#Prerequisites) as 5 | described below. 6 | 7 | Then to build, run: 8 | 9 | ```bash 10 | $ ./gradlew build -PtongsuoHome=/opt/tongsuo 11 | ``` 12 | 13 | To publish the artifacts to your Maven local repository for use in your own project, run: 14 | 15 | ```bash 16 | $ ./gradlew publishToMavenLocal -PtongsuoHome=/opt/tongsuo 17 | ``` 18 | 19 | Prerequisites 20 | ------------- 21 | Tongsuo-Java-SDK requires that you have __Java__, __Tongsuo__ configured as described 22 | below. 23 | 24 | #### Java 25 | The build requires that you have the `JAVA_HOME` environment variable pointing to a valid JDK. 26 | 27 | 28 | #### Tongsuo 29 | Download Tongsuo and then build as follows: 30 | 31 | ```bash 32 | git clone https://github.com/Tongsuo-Project/Tongsuo.git 33 | cd Tongsuo 34 | git checkout 8.4-stable 35 | 36 | ./config no-shared enable-ntls enable-weak-ssl-ciphers --release --prefix=/opt/tongsuo --libdir=/opt/tongsuo/lib 37 | make -j 38 | make install 39 | ``` 40 | 41 | Running tests 42 | ------------------------- 43 | 44 | ```bash 45 | ./gradlew test -PtongsuoHome=/opt/tongsuo 46 | ``` 47 | 48 | Coverage 49 | -------- 50 | To see coverage numbers, run the tests and then execute the jacocoTestReport rule 51 | 52 | ```bash 53 | ./gradlew check jacocoTestReport -PtongsuoHome=/opt/tongsuo 54 | ``` 55 | 56 | The report will be placed in `openjdk/build/reports/jacoco/test/html/index.html` 57 | -------------------------------------------------------------------------------- /CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | set noparent 2 | filter=-build/header_guard 3 | filter=-build/include_order 4 | linelength=100 5 | -------------------------------------------------------------------------------- /MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tongsuo-Project/tongsuo-java-sdk/0c974453072061301f217366e242fe1f8a63f926/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2016 The Android Open Source Project 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | ----------------------------------------------------------------------- 16 | This product contains a modified portion of `Netty`, a configurable network 17 | stack in Java, which can be obtained at: 18 | 19 | * LICENSE: 20 | * licenses/LICENSE.netty.txt (Apache License 2.0) 21 | * HOMEPAGE: 22 | * http://netty.io/ 23 | 24 | This product contains a modified portion of `Apache Harmony`, modular Java runtime, 25 | which can be obtained at: 26 | 27 | * LICENSE: 28 | * licenses/LICENSE.harmony.txt (Apache License 2.0) 29 | * HOMEPAGE: 30 | * https://harmony.apache.org/ 31 | -------------------------------------------------------------------------------- /PREUPLOAD.cfg: -------------------------------------------------------------------------------- 1 | [Builtin Hooks] 2 | commit_msg_test_field = true 3 | clang_format = true 4 | -------------------------------------------------------------------------------- /android-stub/build.gradle: -------------------------------------------------------------------------------- 1 | description = 'Conscrypt: Android-Stub' 2 | 3 | dependencies { 4 | compileOnly project(':conscrypt-libcore-stub') 5 | } 6 | 7 | // Disable the javadoc task. 8 | tasks.withType(Javadoc).configureEach { enabled = false } 9 | -------------------------------------------------------------------------------- /android-stub/src/main/java/com/android/org/conscrypt/SSLParametersImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.org.conscrypt; 18 | 19 | final class SSLParametersImpl { 20 | public static SSLParametersImpl getDefault() { 21 | throw new RuntimeException("Stub!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android-stub/src/main/java/dalvik/system/BlockGuard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package dalvik.system; 18 | 19 | public class BlockGuard { 20 | private BlockGuard() {} 21 | 22 | public static Policy getThreadPolicy() { 23 | throw new UnsupportedOperationException("Stub!"); 24 | } 25 | 26 | public interface Policy { void onNetwork(); } 27 | 28 | public static class PolicyWrapper implements Policy { 29 | private PolicyWrapper() {} 30 | 31 | @Override 32 | public void onNetwork() { 33 | throw new UnsupportedOperationException("Stub!"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android-stub/src/main/java/dalvik/system/CloseGuard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package dalvik.system; 18 | 19 | public class CloseGuard { 20 | private CloseGuard() {} 21 | 22 | public static CloseGuard get() { 23 | throw new UnsupportedOperationException("Stub!"); 24 | } 25 | 26 | public void open(String message) { 27 | throw new UnsupportedOperationException("Stub!"); 28 | } 29 | 30 | public void close() { 31 | throw new UnsupportedOperationException("Stub!"); 32 | } 33 | 34 | public void warnIfOpen() { 35 | throw new UnsupportedOperationException("Stub!"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | \.externalNativeBuild/ 2 | \.cxx/ 3 | -------------------------------------------------------------------------------- /android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | link_directories(BEFORE ${TONGSUO_HOME}/lib/) 4 | 5 | add_library(conscrypt_jni 6 | SHARED 7 | ../common/src/jni/main/cpp/conscrypt/compatibility_close_monitor.cc 8 | ../common/src/jni/main/cpp/conscrypt/jniload.cc 9 | ../common/src/jni/main/cpp/conscrypt/jniutil.cc 10 | ../common/src/jni/main/cpp/conscrypt/native_crypto.cc 11 | ../common/src/jni/main/cpp/conscrypt/netutil.cc 12 | ) 13 | include_directories(../common/src/jni/main/include/ 14 | ../common/src/jni/unbundled/include/ 15 | ${TONGSUO_HOME}/include/) 16 | 17 | find_library(android-log-lib log) 18 | target_link_libraries(conscrypt_jni ${android-log-lib} ssl crypto) 19 | 20 | add_definitions(-DANDROID 21 | -fvisibility=hidden 22 | -DOPENSSL_SMALL 23 | -D_XOPEN_SOURCE=700 24 | -Wno-unused-parameter 25 | # The following two lines are taken from BoringSSL's build file. As written there: 26 | # 27 | # Clang's -Wtautological-constant-compare is far too aggressive and does not 28 | # account for, say, wanting the same code to work on both 32-bit and 64-bit 29 | # platforms. 30 | # 31 | # TODO: Remove these when the NDK no longer includes a version that has 32 | # -Wtautological-constant-compare enabled as part of -Wall 33 | -Wno-tautological-constant-compare 34 | -Wtautological-constant-out-of-range-compare 35 | -Wno-deprecated-declarations) 36 | 37 | if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") 38 | set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -march=armv8-a+crypto") 39 | endif() 40 | 41 | add_subdirectory(${BORINGSSL_HOME} ${CMAKE_CURRENT_BINARY_DIR}/boringssl) 42 | -------------------------------------------------------------------------------- /android/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |   4 |      5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |      15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can edit the include path and order by changing the proguardFiles 3 | # directive in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # Many of the Conscrypt classes are referenced indirectly via JNI or 9 | # reflection. 10 | # This could probably be tightened up, but this will get it building for now. 11 | # TODO(kroot): Need anything special to prevent obfuscation? 12 | -keep class org.conscrypt.** { *; } 13 | 14 | # Backward compatibility code. 15 | -dontnote libcore.io.Libcore 16 | -dontnote org.apache.harmony.xnet.provider.jsse.OpenSSLRSAPrivateKey 17 | -dontnote org.apache.harmony.security.utils.AlgNameMapper 18 | -dontnote sun.security.x509.AlgorithmId 19 | 20 | -dontwarn android.util.StatsEvent 21 | -dontwarn dalvik.system.BlockGuard 22 | -dontwarn dalvik.system.BlockGuard$Policy 23 | -dontwarn dalvik.system.CloseGuard 24 | -dontwarn com.android.org.conscrypt.AbstractConscryptSocket 25 | -dontwarn com.android.org.conscrypt.ConscryptFileDescriptorSocket 26 | -dontwarn com.android.org.conscrypt.OpenSSLSocketImpl 27 | -dontwarn com.android.org.conscrypt.SSLParametersImpl 28 | -dontwarn org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl 29 | -dontwarn org.apache.harmony.xnet.provider.jsse.SSLParametersImpl 30 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/java/org/conscrypt/KitKatPlatformOpenSSLSocketAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.conscrypt; 18 | 19 | import java.io.IOException; 20 | import java.net.Socket; 21 | 22 | /** 23 | * A {@link javax.net.ssl.SSLSocketFactory} which creates unbundled conscrypt SSLSockets and wraps 24 | * them into KitKat (and newer) platform SSLSockets. 25 | */ 26 | public class KitKatPlatformOpenSSLSocketAdapterFactory extends BaseOpenSSLSocketAdapterFactory { 27 | 28 | public KitKatPlatformOpenSSLSocketAdapterFactory(OpenSSLSocketFactoryImpl delegate) { 29 | super(delegate); 30 | } 31 | 32 | @Override 33 | protected Socket wrap(OpenSSLSocketImpl socket) throws IOException { 34 | return new KitKatPlatformOpenSSLSocketImplAdapter(socket); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/src/main/java/org/conscrypt/NativeCryptoJni.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.conscrypt; 18 | 19 | /** 20 | * Helper to initialize the JNI libraries. This version runs when compiled 21 | * as part of an app distribution (or GmsCore). 22 | */ 23 | class NativeCryptoJni { 24 | public static void init() { 25 | if ("com.google.android.gms.org.conscrypt".equals(NativeCrypto.class.getPackage().getName())) { 26 | System.loadLibrary("conscrypt_gmscore_jni"); 27 | } else { 28 | System.loadLibrary("conscrypt_jni"); 29 | } 30 | } 31 | 32 | private NativeCryptoJni() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/org/conscrypt/PreKitKatPlatformOpenSSLSocketAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.conscrypt; 18 | 19 | import java.io.IOException; 20 | import java.net.Socket; 21 | 22 | /** 23 | * A {@link javax.net.ssl.SSLSocketFactory} which creates unbundled conscrypt SSLSockets and wraps 24 | * them into pre-KitKat platform SSLSockets. 25 | */ 26 | public class PreKitKatPlatformOpenSSLSocketAdapterFactory extends BaseOpenSSLSocketAdapterFactory { 27 | public PreKitKatPlatformOpenSSLSocketAdapterFactory(OpenSSLSocketFactoryImpl delegate) { 28 | super(delegate); 29 | } 30 | 31 | @Override 32 | protected Socket wrap(OpenSSLSocketImpl socket) throws IOException { 33 | return new PreKitKatPlatformOpenSSLSocketImplAdapter(socket); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /benchmark-android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /benchmark-android/vogar.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tongsuo-Project/tongsuo-java-sdk/0c974453072061301f217366e242fe1f8a63f926/benchmark-android/vogar.jar -------------------------------------------------------------------------------- /benchmark-base/build.gradle: -------------------------------------------------------------------------------- 1 | description = 'Conscrypt: Base library for benchmarks' 2 | 3 | dependencies { 4 | implementation project(path: ":conscrypt-testing", configuration: "shadow"), 5 | libraries.junit 6 | } 7 | -------------------------------------------------------------------------------- /benchmark-base/src/main/java/org/conscrypt/BenchmarkProtocol.java: -------------------------------------------------------------------------------- 1 | package org.conscrypt; 2 | 3 | @SuppressWarnings("ImmutableEnumChecker") 4 | public enum BenchmarkProtocol { 5 | 6 | TLSv13("TLSv1.3"), 7 | TLSv12("TLSv1.2"); 8 | 9 | private final String[] protocols; 10 | 11 | BenchmarkProtocol(String... protocols) { 12 | this.protocols = protocols; 13 | } 14 | 15 | public String[] getProtocols() { 16 | return protocols.clone(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /benchmark-base/src/main/java/org/conscrypt/BufferType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.conscrypt; 17 | 18 | import java.nio.ByteBuffer; 19 | import javax.net.ssl.SSLEngine; 20 | 21 | /** 22 | * Enumeration that provides allocation of direct or heap buffers. 23 | */ 24 | @SuppressWarnings("unused") 25 | public enum BufferType { 26 | HEAP { 27 | @Override 28 | ByteBuffer newBuffer(int size) { 29 | return ByteBuffer.allocate(size); 30 | } 31 | }, 32 | DIRECT { 33 | @Override 34 | ByteBuffer newBuffer(int size) { 35 | return ByteBuffer.allocateDirect(size); 36 | } 37 | }; 38 | 39 | abstract ByteBuffer newBuffer(int size); 40 | 41 | ByteBuffer newApplicationBuffer(SSLEngine engine) { 42 | return newBuffer(engine.getSession().getApplicationBufferSize()); 43 | } 44 | 45 | ByteBuffer newPacketBuffer(SSLEngine engine) { 46 | return newBuffer(engine.getSession().getPacketBufferSize()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /benchmark-base/src/main/java/org/conscrypt/CipherFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.conscrypt; 17 | 18 | import java.security.NoSuchAlgorithmException; 19 | import javax.crypto.Cipher; 20 | import javax.crypto.NoSuchPaddingException; 21 | 22 | /** 23 | * Factory for {@link Cipher} instances. 24 | */ 25 | public interface CipherFactory { 26 | Cipher newCipher(String transformation) throws NoSuchPaddingException, NoSuchAlgorithmException; 27 | } 28 | -------------------------------------------------------------------------------- /benchmark-base/src/main/java/org/conscrypt/EndpointFactory.java: -------------------------------------------------------------------------------- 1 | package org.conscrypt; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * Utility for creating test client and server endpoints. 7 | */ 8 | interface EndpointFactory { 9 | ClientEndpoint newClient(ChannelType channelType, int port, String[] protocols, 10 | String[] ciphers) throws IOException; 11 | 12 | ServerEndpoint newServer(ChannelType channelType, int messageSize, 13 | String[] protocols, String[] ciphers) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /benchmark-base/src/main/java/org/conscrypt/EngineFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.conscrypt; 17 | 18 | import javax.net.ssl.SSLEngine; 19 | 20 | /** 21 | * Factory for {@link SSLEngine} instances. 22 | */ 23 | interface EngineFactory { 24 | 25 | SSLEngine newClientEngine(String cipher, boolean useAlpn); 26 | 27 | SSLEngine newServerEngine(String cipher, boolean useAlpn); 28 | 29 | void dispose(SSLEngine engine); 30 | } 31 | -------------------------------------------------------------------------------- /benchmark-graphs/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | dependencies { 4 | implementation 'com.bazaarvoice.jolt:jolt-core:0.1.1' 5 | implementation 'com.bazaarvoice.jolt:json-utils:0.1.1' 6 | } 7 | 8 | mainClassName = 'org.conscrypt.graphgen.Main' 9 | -------------------------------------------------------------------------------- /benchmark-graphs/src/main/resources/html/footer.html: -------------------------------------------------------------------------------- 1 | ; 2 | 3 | var d3 = Plotly.d3; 4 | 5 | var WIDTH_IN_PERCENT_OF_PARENT = 60, 6 | HEIGHT_IN_PERCENT_OF_PARENT = 80; 7 | 8 | var gd3 = d3.select('body') 9 | .append('div') 10 | .style({ 11 | width: WIDTH_IN_PERCENT_OF_PARENT + '%', 12 | 'margin-left': (100 - WIDTH_IN_PERCENT_OF_PARENT) / 2 + '%', 13 | 14 | height: HEIGHT_IN_PERCENT_OF_PARENT + 'vh', 15 | 'margin-top': (100 - HEIGHT_IN_PERCENT_OF_PARENT) / 2 + 'vh' 16 | }); 17 | 18 | var gd = gd3.node(); 19 | 20 | Plotly.plot(gd, plotlydata['data'], plotlydata['layout']); 21 | 22 | window.onresize = function() { 23 | Plotly.Plots.resize(gd); 24 | }; 25 | 26 | }; 27 | 28 | window.onload = onload; 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /benchmark-graphs/src/main/resources/html/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |