public static byte[] readSRPExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); byte[] identity = TlsUtils.readOpaque8(buf); TlsProtocol.assertEmpty(buf); return identity; }
protected void processServerKeyExchange(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); state.keyExchange.processServerKeyExchange(buf); TlsProtocol.assertEmpty(buf); }
public static HeartbeatExtension readHeartbeatExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); HeartbeatExtension heartbeatExtension = HeartbeatExtension.parse(buf); TlsProtocol.assertEmpty(buf); return heartbeatExtension; }
public static CertificateStatusRequest readStatusRequestExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); CertificateStatusRequest statusRequest = CertificateStatusRequest.parse(buf); TlsProtocol.assertEmpty(buf); return statusRequest; }
public static HeartbeatExtension readHeartbeatExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); HeartbeatExtension heartbeatExtension = HeartbeatExtension.parse(buf); TlsProtocol.assertEmpty(buf); return heartbeatExtension; }
protected void processServerKeyExchange(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); state.keyExchange.processServerKeyExchange(buf); TlsProtocol.assertEmpty(buf); }
public static byte[] readSRPExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); byte[] identity = TlsUtils.readOpaque8(buf); TlsProtocol.assertEmpty(buf); return identity; }
public static ServerNameList readServerNameExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); ServerNameList serverNameList = ServerNameList.parse(buf); TlsProtocol.assertEmpty(buf); return serverNameList; }
public static CertificateStatusRequest readStatusRequestExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); CertificateStatusRequest statusRequest = CertificateStatusRequest.parse(buf); TlsProtocol.assertEmpty(buf); return statusRequest; }
protected void processClientKeyExchange(ServerHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); state.keyExchange.processClientKeyExchange(buf); TlsProtocol.assertEmpty(buf); }
public static ServerNameList readServerNameExtension(byte[] extensionData) throws IOException { if (extensionData == null) { throw new IllegalArgumentException("'extensionData' cannot be null"); } ByteArrayInputStream buf = new ByteArrayInputStream(extensionData); ServerNameList serverNameList = ServerNameList.parse(buf); TlsProtocol.assertEmpty(buf); return serverNameList; }
protected void processClientKeyExchange(ServerHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); state.keyExchange.processClientKeyExchange(buf); TlsProtocol.assertEmpty(buf); }
protected void processClientCertificate(ServerHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); Certificate clientCertificate = Certificate.parse(buf); TlsProtocol.assertEmpty(buf); notifyClientCertificate(state, clientCertificate); }
protected void processNewSessionTicket(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); TlsProtocol.assertEmpty(buf); state.client.notifyNewSessionTicket(newSessionTicket); }
protected void processNewSessionTicket(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); TlsProtocol.assertEmpty(buf); state.client.notifyNewSessionTicket(newSessionTicket); }
protected void processClientCertificate(ServerHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); Certificate clientCertificate = Certificate.parse(buf); TlsProtocol.assertEmpty(buf); notifyClientCertificate(state, clientCertificate); }
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); } }
protected Certificate processServerCertificate(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); Certificate serverCertificate = Certificate.parse(buf); TlsProtocol.assertEmpty(buf); state.keyExchange.processServerCertificate(serverCertificate); state.authentication = state.client.getAuthentication(); state.authentication.notifyServerCertificate(serverCertificate); return serverCertificate; }
protected Certificate processServerCertificate(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); Certificate serverCertificate = Certificate.parse(buf); TlsProtocol.assertEmpty(buf); state.keyExchange.processServerCertificate(serverCertificate); state.authentication = state.client.getAuthentication(); state.authentication.notifyServerCertificate(serverCertificate); return serverCertificate; }