private boolean receivedFatalAlert(List<ProtocolMessage> messages) { for (ProtocolMessage message : messages) { if (message instanceof AlertMessage) { AlertMessage alert = (AlertMessage) message; if (alert.getLevel().getValue() == AlertLevel.FATAL.getValue()) { return true; } } } return false; }
@Override public boolean equals(Object obj) { if (!(obj instanceof AlertMessage)) { return false; } if (obj == this) { return true; } AlertMessage alert = (AlertMessage) obj; return (Objects.equals(alert.getLevel().getValue(), this.getLevel().getValue())) && (Objects.equals(alert.getDescription().getValue(), this.getDescription().getValue())); }
/** * Reads the next bytes as the Level and writes them in the message * * @param msg * Message to write in */ private void parseLevel(AlertMessage msg) { msg.setLevel(parseByteField(AlertByteLength.LEVEL_LENGTH)); LOGGER.debug("Level: " + msg.getLevel().getValue()); }
@Override public void adjustTLSContext(AlertMessage message) { if (tlsContext.getTalkingConnectionEndType() == tlsContext.getChooser().getMyConnectionPeer() && AlertLevel.FATAL.getValue() == message.getLevel().getValue()) { LOGGER.debug("Setting received Fatal Alert in Context"); tlsContext.setReceivedFatalAlert(true); } } }
private void prepareLevel(AlertMessage msg) { if (msg.getConfig() != null && msg.getConfig().length > 0) { msg.setLevel(msg.getConfig()[0]); } else { msg.setLevel(chooser.getConfig().getDefaultAlertLevel()); } LOGGER.debug("Level: " + msg.getLevel().getValue()); }
if (lm.getProtocolMessageType() == ProtocolMessageType.ALERT) { AlertMessage am = ((AlertMessage) lm); LOGGER.info(" Last protocol message: Alert ({},{}) [{},{}]", AlertLevel.getAlertLevel(am.getLevel() .getValue()), AlertDescription.getAlertDescription(am.getDescription().getValue()), am.getLevel() .getValue(), am.getDescription().getValue()); } else {