Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/transport/ServerKexManager.java @ 284:4ec87de11e71 ganymed
start conversion from trilead to ganymed
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 18 Jul 2014 18:08:56 -0700 |
parents | 3855f58ffd2b |
children | 486df527ddc5 |
comparison
equal
deleted
inserted
replaced
283:3855f58ffd2b | 284:4ec87de11e71 |
---|---|
165 kxs.dhx.setE(dhi.getE()); | 165 kxs.dhx.setE(dhi.getE()); |
166 | 166 |
167 byte[] hostKey = null; | 167 byte[] hostKey = null; |
168 | 168 |
169 if(kxs.np.server_host_key_algo.equals("ssh-rsa")) { | 169 if(kxs.np.server_host_key_algo.equals("ssh-rsa")) { |
170 hostKey = RSASHA1Verify.encodeSSHRSAPublicKey(kxs.local_rsa_key.getPublicKey()); | 170 hostKey = RSASHA1Verify.encodeSSHRSAPublicKey(kxs.local_rsa_key.getPublic()); |
171 } | 171 } |
172 | 172 |
173 if(kxs.np.server_host_key_algo.equals("ssh-dss")) { | 173 if(kxs.np.server_host_key_algo.equals("ssh-dss")) { |
174 hostKey = DSASHA1Verify.encodeSSHDSAPublicKey(kxs.local_dsa_key.getPublicKey()); | 174 hostKey = DSASHA1Verify.encodeSSHDSAPublicKey(kxs.local_dsa_key.getPublic()); |
175 } | 175 } |
176 | 176 |
177 try { | 177 try { |
178 kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), | 178 kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), |
179 kxs.remoteKEX.getPayload(), kxs.localKEX.getPayload(), hostKey); | 179 kxs.remoteKEX.getPayload(), kxs.localKEX.getPayload(), hostKey); |
185 kxs.K = kxs.dhx.getK(); | 185 kxs.K = kxs.dhx.getK(); |
186 | 186 |
187 byte[] signature = null; | 187 byte[] signature = null; |
188 | 188 |
189 if(kxs.np.server_host_key_algo.equals("ssh-rsa")) { | 189 if(kxs.np.server_host_key_algo.equals("ssh-rsa")) { |
190 RSASignature rs = RSASHA1Verify.generateSignature(kxs.H, kxs.local_rsa_key); | 190 byte[] rs = RSASHA1Verify.generateSignature(kxs.H, kxs.local_rsa_key); |
191 signature = RSASHA1Verify.encodeSSHRSASignature(rs); | 191 signature = RSASHA1Verify.encodeSSHRSASignature(rs); |
192 } | 192 } |
193 | 193 |
194 if(kxs.np.server_host_key_algo.equals("ssh-dss")) { | 194 if(kxs.np.server_host_key_algo.equals("ssh-dss")) { |
195 DSASignature ds = DSASHA1Verify.generateSignature(kxs.H, kxs.local_dsa_key, rnd); | 195 byte[] ds = DSASHA1Verify.generateSignature(kxs.H, kxs.local_dsa_key, rnd); |
196 signature = DSASHA1Verify.encodeSSHDSASignature(ds); | 196 signature = DSASHA1Verify.encodeSSHDSASignature(ds); |
197 } | 197 } |
198 | 198 |
199 PacketKexDHReply dhr = new PacketKexDHReply(hostKey, kxs.dhx.getF(), signature); | 199 PacketKexDHReply dhr = new PacketKexDHReply(hostKey, kxs.dhx.getF(), signature); |
200 tm.sendKexMessage(dhr.getPayload()); | 200 tm.sendKexMessage(dhr.getPayload()); |