public static byte[] readOpaque16(InputStream input) throws IOException { int length = readUint16(input); return readFully(length, input); }
public static byte[] readOpaque24(InputStream input) throws IOException { int length = readUint24(input); return readFully(length, input); }
public static byte[] readOpaque24(InputStream input) throws IOException { int length = readUint24(input); return readFully(length, input); }
public static byte[] readOpaque16(InputStream input) throws IOException { int length = readUint16(input); return readFully(length, input); }
public static byte[] readOpaque8(InputStream input) throws IOException { short length = readUint8(input); return readFully(length, input); }
public static byte[] readOpaque8(InputStream input) throws IOException { short length = readUint8(input); return readFully(length, input); }
protected void processFinished(byte[] body, byte[] expected_verify_data) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); byte[] verify_data = TlsUtils.readFully(expected_verify_data.length, buf); TlsProtocol.assertEmpty(buf); if (!Arrays.constantTimeAreEqual(expected_verify_data, verify_data)) { throw new TlsFatalAlert(AlertDescription.handshake_failure); } }
protected void processFinished(byte[] body, byte[] expected_verify_data) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); byte[] verify_data = TlsUtils.readFully(expected_verify_data.length, buf); TlsProtocol.assertEmpty(buf); if (!Arrays.constantTimeAreEqual(expected_verify_data, verify_data)) { throw new TlsFatalAlert(AlertDescription.handshake_failure); } }
/** * Parse a {@link ServerNameList} from an {@link InputStream}. * * @param input * the {@link InputStream} to parse from. * @return a {@link ServerNameList} object. * @throws IOException */ public static ServerNameList parse(InputStream input) throws IOException { int length = TlsUtils.readUint16(input); if (length < 1) { throw new TlsFatalAlert(AlertDescription.decode_error); } byte[] data = TlsUtils.readFully(length, input); ByteArrayInputStream buf = new ByteArrayInputStream(data); Vector server_name_list = new Vector(); while (buf.available() > 0) { ServerName entry = ServerName.parse(buf); server_name_list.addElement(entry); } return new ServerNameList(server_name_list); } }
byte[] certListData = TlsUtils.readFully(totalLength, input);
byte[] certListData = TlsUtils.readFully(totalLength, input);
protected void processFinishedMessage(ByteArrayInputStream buf) throws IOException { byte[] verify_data = TlsUtils.readFully(expected_verify_data.length, buf); assertEmpty(buf); /* * Compare both checksums. */ if (!Arrays.constantTimeAreEqual(expected_verify_data, verify_data)) { /* * Wrong checksum in the finished message. */ throw new TlsFatalAlert(AlertDescription.decrypt_error); } }
byte[] urlAndHashListData = TlsUtils.readFully(totalLength, input);
byte[] data = TlsUtils.readFully(length, input);
byte[] urlAndHashListData = TlsUtils.readFully(totalLength, input);
protected void processFinishedMessage(ByteArrayInputStream buf) throws IOException { if (expected_verify_data == null) { throw new TlsFatalAlert(AlertDescription.internal_error); } byte[] verify_data = TlsUtils.readFully(expected_verify_data.length, buf); assertEmpty(buf); /* * Compare both checksums. */ if (!Arrays.constantTimeAreEqual(expected_verify_data, verify_data)) { /* * Wrong checksum in the finished message. */ throw new TlsFatalAlert(AlertDescription.decrypt_error); } }
byte[] buf = TlsUtils.readFully(len, input); byte[] decoded = readCipher.decodeCiphertext(readSeqNo++, type, buf, 0, buf.length);
byte[] decodeAndVerify(short type, InputStream input, int len) throws IOException byte[] buf = TlsUtils.readFully(len, input);
sha1Hash = TlsUtils.readFully(20, input); break; default: