/** * Returns true in case the cipher suite is a CBC cipher suite. * * @return True if the Ciphersuite is cbc */ public boolean isCBC() { return (this.name().contains("_CBC")); }
public boolean isOCB() { return (this.name().contains("_OCB")); }
public boolean usesGOSTR3411() { return this.name().startsWith("TLS_GOSTR3410"); }
public boolean isAnon() { return this.name().contains("anon"); }
public boolean isUsingPadding() { // todo this should be extended return (this.name().contains("_CBC")); }
public boolean isPsk() { return this.name().contains("PSK"); }
public boolean isSteamCipherWithIV() { return this.name().contains("28147_CNT"); }
public boolean isSHA256() { return this.name().contains("SHA256"); }
public boolean isSCSV() { return (this.name().contains("SCSV")); }
public boolean isGCM() { return (this.name().contains("_GCM")); }
public boolean isCCM() { return (this.name().contains("_CCM")); }
public boolean isNull() { return this.name().toLowerCase().contains("null"); }
/** * Returns true in case the cipher suite enforces ephemeral keys. This is * the case for ECDHE and DHE cipher suites. * * @return True if the Ciphersuite is Ephemeral */ public boolean isEphemeral() { return this.name().contains("DHE_") || this.isAnon(); }
private void adjustSelectedCiphersuite(HelloRetryRequestMessage message) { CipherSuite suite = CipherSuite.getCipherSuite(message.getSelectedCipherSuite().getValue()); tlsContext.setSelectedCipherSuite(suite); if (suite != null) { LOGGER.debug("Set SelectedCipherSuite in Context to " + suite.name()); } else { LOGGER.warn("Could not determine selected CipherSuite. Not Adjusting Context"); } }
private void adjustSelectedCiphersuite(ServerHelloMessage message) { CipherSuite suite = null; if (message.getSelectedCipherSuite() != null) { suite = CipherSuite.getCipherSuite(message.getSelectedCipherSuite().getValue()); } if (suite != null) { tlsContext.setSelectedCipherSuite(suite); LOGGER.debug("Set SelectedCipherSuite in Context to " + suite.name()); } else { LOGGER.warn("Unknown CipherSuite, did not adjust Context"); } }
private void writeCipherSuite(StatePlaintext statePlaintext) { appendInt(statePlaintext.getCipherSuite().getValue(), HandshakeByteLength.CIPHER_SUITE); LOGGER.debug("CipherSuite: " + CipherSuite.getCipherSuite(statePlaintext.getCipherSuite().getValue()).name()); }
@Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(getConnectionAlias()); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } oldValue = tlsContext.getSelectedCipherSuite(); tlsContext.setSelectedCipherSuite(newValue); tlsContext.getRecordLayer().updateDecryptionCipher(); tlsContext.getRecordLayer().updateEncryptionCipher(); LOGGER.info("Changed CipherSuite from " + (oldValue == null ? null : oldValue.name()) + " to " + newValue.name()); setExecuted(true); }
private void initCipherAndMac() throws UnsupportedOperationException { try { ConnectionEndType localConEndType = context.getConnection().getLocalConnectionEndType(); encryptCipher = CipherWrapper.getEncryptionCipher(cipherSuite, localConEndType, getKeySet()); decryptCipher = CipherWrapper.getDecryptionCipher(cipherSuite, localConEndType, getKeySet()); readMac = MacWrapper.getMac(version, cipherSuite, getKeySet().getReadMacSecret(localConEndType)); writeMac = MacWrapper.getMac(version, cipherSuite, getKeySet().getWriteMacSecret(localConEndType)); } catch (NoSuchAlgorithmException ex) { throw new UnsupportedOperationException("Cipher not supported: " + cipherSuite.name(), ex); } }