case KeyExchangeAlgorithm.DH_DSS: case KeyExchangeAlgorithm.DH_RSA: return createDHKeyExchange(keyExchangeAlgorithm); return createDHEKeyExchange(keyExchangeAlgorithm); return createECDHKeyExchange(keyExchangeAlgorithm); return createECDHEKeyExchange(keyExchangeAlgorithm); return createRSAKeyExchange();
public int[] getCipherSuites() { return Arrays.concatenate(super.getCipherSuites(), new int[] { CipherSuite.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1, CipherSuite.TLS_ECDHE_RSA_WITH_SALSA20_SHA1, CipherSuite.TLS_RSA_WITH_ESTREAM_SALSA20_SHA1, CipherSuite.TLS_RSA_WITH_SALSA20_SHA1, }); }
/** * {@inheritDoc} * * Overrides the super implementation as a simple means of detecting that * the security-related negotiations between the local and the remote * enpoints are starting. The detection carried out for the purposes of * <tt>SrtpListener</tt>. */ @Override public void init(TlsClientContext context) { // TODO Auto-generated method stub super.init(context); }
public Hashtable<?, ?> getClientExtensions() throws IOException { Hashtable<?, ?> clientExtensions = TlsExtensionsUtils.ensureExtensionsInitialised(super.getClientExtensions()); TlsExtensionsUtils.addEncryptThenMACExtension(clientExtensions); // TODO[draft-ietf-tls-session-hash-01] Enable once code-point assigned (only for compatible server though) // TlsExtensionsUtils.addExtendedMasterSecretExtension(clientExtensions); TlsExtensionsUtils.addMaxFragmentLengthExtension(clientExtensions, MaxFragmentLength.pow2_9); TlsExtensionsUtils.addTruncatedHMacExtension(clientExtensions); return clientExtensions; }
public void notifyServerVersion(ProtocolVersion serverVersion) throws IOException { super.notifyServerVersion(serverVersion); log.trace("Negotiated " + serverVersion); }
public void notifyHandshakeComplete() throws IOException { super.notifyHandshakeComplete(); TlsSession newSession = context.getResumableSession(); if (newSession != null) { byte[] newSessionID = newSession.getSessionID(); String hex = Hex.toHexString(newSessionID); if (this.session != null && Arrays.areEqual(this.session.getSessionID(), newSessionID)) { log.trace("Resumed session: " + hex); } else { log.trace("Established session: " + hex); } this.session = newSession; } } }
/** * {@inheritDoc} * * Includes the <tt>use_srtp</tt> extension in the DTLS extended client * hello. */ @Override @SuppressWarnings("rawtypes") public Hashtable getClientExtensions() throws IOException { Hashtable clientExtensions = super.getClientExtensions(); if (!isSrtpDisabled() && TlsSRTPUtils.getUseSRTPExtension(clientExtensions) == null) { if (clientExtensions == null) clientExtensions = new Hashtable(); TlsSRTPUtils.addUseSRTPExtension( clientExtensions, new UseSRTPData( DtlsControlImpl.SRTP_PROTECTION_PROFILES, mki)); } return clientExtensions; }
case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: case CipherSuite.TLS_DH_DSS_WITH_SEED_CBC_SHA: return createDHKeyExchange(KeyExchangeAlgorithm.DH_DSS); case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: case CipherSuite.TLS_DH_RSA_WITH_SEED_CBC_SHA: return createDHKeyExchange(KeyExchangeAlgorithm.DH_RSA); case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: case CipherSuite.TLS_DHE_DSS_WITH_SEED_CBC_SHA: return createDHEKeyExchange(KeyExchangeAlgorithm.DHE_DSS); case CipherSuite.TLS_DHE_RSA_WITH_SALSA20_SHA1: case CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA: return createDHEKeyExchange(KeyExchangeAlgorithm.DHE_RSA); case CipherSuite.TLS_ECDH_ECDSA_WITH_NULL_SHA: case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA: return createECDHKeyExchange(KeyExchangeAlgorithm.ECDH_ECDSA); case CipherSuite.TLS_ECDH_RSA_WITH_NULL_SHA: case CipherSuite.TLS_ECDH_RSA_WITH_RC4_128_SHA: return createECDHKeyExchange(KeyExchangeAlgorithm.ECDH_RSA); case CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: case CipherSuite.TLS_ECDHE_ECDSA_WITH_SALSA20_SHA1: return createECDHEKeyExchange(KeyExchangeAlgorithm.ECDHE_ECDSA); case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA: