annotate app/src/main/java/ch/ethz/ssh2/transport/ServerTransportManager.java @ 474:e5f8d879543f

add fg/bg color setting to global:// section of deployment.connections file
author Carl Byington <carl@five-ten-sg.com>
date Sun, 20 Oct 2019 14:08:00 -0700
parents d29cce60f393
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 package ch.ethz.ssh2.transport;
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3 import java.io.IOException;
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 import java.net.Socket;
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6 import ch.ethz.ssh2.server.ServerConnectionState;
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 /**
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 * @version $Id: ServerTransportManager.java 151 2014-04-28 10:03:39Z dkocher@sudo.ch $
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 */
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
11 public class ServerTransportManager extends TransportManager {
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
12
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
13 private final Socket sock;
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
14
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
15 public ServerTransportManager(final Socket socket) {
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
16 super(socket);
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
17 // TCP connection is already established
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
18 this.sock = socket;
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
19 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
21 public void connect(ServerConnectionState state) throws IOException {
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
22 /* Parse the client lin
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
23 e and say hello - important: this information is later needed for the
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
24 * key exchange (to stop man-in-the-middle attacks) - that is why we wrap it into an object
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
25 * for later use.
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
26 */
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
27 state.csh = ClientServerHello.serverHello(state.softwareversion, sock.getInputStream(), sock.getOutputStream());
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
28 TransportConnection tc = new TransportConnection(sock.getInputStream(), sock.getOutputStream(), state.generator);
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
29 KexManager km = new ServerKexManager(state);
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
30 super.init(tc, km);
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
31 km.initiateKEX(state.next_cryptoWishList, null, state.next_dsa_key, state.next_rsa_key, state.next_ec_key);
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
32 this.startReceiver();
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 302
diff changeset
33 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
34 }