RenegotiationInfoExtensionParser extends ExtensionParser<RenegotiationInfoExtensionMessage> { @Override public void parseExtensionMessageContent(RenegotiationInfoExtensionMessage msg) { msg.setRenegotiationInfoLength(parseIntField(ExtensionByteLength.RENEGOTIATION_INFO)); if (msg.getRenegotiationInfoLength().getValue() > 255) { LOGGER.warn("The renegotiation info length shouldn't exceed 1 byte as defined in RFC 5246. " + "Length was " + msg.getExtensionLength().getValue()); } msg.setRenegotiationInfo(parseByteArrayField(msg.getRenegotiationInfoLength().getValue())); LOGGER.debug("The RenegotiationInfoExtensionParser parsed the value " + bytesToHexString(msg.getRenegotiationInfo())); } RenegotiationInfoExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(RenegotiationInfoExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { message = parser.parse(); assertEquals(extensionType, message.getExtensionTypeConstant()); assertEquals(extensionLength, (long) message.getExtensionLength().getValue()); assertEquals(extensionPayloadLength, (long) message.getRenegotiationInfoLength().getValue()); assertArrayEquals(extensionPayload, message.getRenegotiationInfo().getValue()); }