Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/transport/ServerTransportManager.java @ 273:91a31873c42a ganymed
start conversion from trilead to ganymed
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 18 Jul 2014 11:21:46 -0700 |
parents | |
children | beaccc9df37b |
comparison
equal
deleted
inserted
replaced
272:ce2f4e397703 | 273:91a31873c42a |
---|---|
1 package ch.ethz.ssh2.transport; | |
2 | |
3 import java.io.IOException; | |
4 import java.net.Socket; | |
5 | |
6 import ch.ethz.ssh2.server.ServerConnectionState; | |
7 | |
8 /** | |
9 * @version $Id: ServerTransportManager.java 151 2014-04-28 10:03:39Z dkocher@sudo.ch $ | |
10 */ | |
11 public class ServerTransportManager extends TransportManager | |
12 { | |
13 | |
14 private final Socket sock; | |
15 | |
16 public ServerTransportManager(final Socket socket) | |
17 { | |
18 super(socket); | |
19 // TCP connection is already established | |
20 this.sock = socket; | |
21 } | |
22 | |
23 public void connect(ServerConnectionState state) throws IOException | |
24 { | |
25 /* Parse the client lin | |
26 e and say hello - important: this information is later needed for the | |
27 * key exchange (to stop man-in-the-middle attacks) - that is why we wrap it into an object | |
28 * for later use. | |
29 */ | |
30 | |
31 state.csh = ClientServerHello.serverHello(state.softwareversion, sock.getInputStream(), sock.getOutputStream()); | |
32 | |
33 TransportConnection tc = new TransportConnection(sock.getInputStream(), sock.getOutputStream(), state.generator); | |
34 KexManager km = new ServerKexManager(state); | |
35 | |
36 super.init(tc, km); | |
37 | |
38 km.initiateKEX(state.next_cryptoWishList, null, state.next_dsa_key, state.next_rsa_key); | |
39 | |
40 this.startReceiver(); | |
41 } | |
42 } |