comparison src/ch/ethz/ssh2/transport/ClientKexManager.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 c3019725b123
children 486df527ddc5
comparison
equal deleted inserted replaced
283:3855f58ffd2b 284:4ec87de11e71
53 this.port = port; 53 this.port = port;
54 this.verifier = keyVerifier; 54 this.verifier = keyVerifier;
55 } 55 }
56 56
57 protected boolean verifySignature(byte[] sig, byte[] hostkey) throws IOException { 57 protected boolean verifySignature(byte[] sig, byte[] hostkey) throws IOException {
58 if(kxs.np.server_host_key_algo.equals("ssh-rsa")) { 58 if (kxs.np.server_host_key_algo.startsWith("ecdsa-sha2-")) {
59 RSASignature rs = RSASHA1Verify.decodeSSHRSASignature(sig); 59 byte[] rs = ECDSASHA2Verify.decodeSSHECDSASignature(sig);
60 ECPublicKey epk = ECDSASHA2Verify.decodeSSHECDSAPublicKey(hostkey);
61 log.log(50, "Verifying ecdsa signature");
62 return ECDSASHA2Verify.verifySignature(kxs.H, rs, epk);
63 }
64 if (kxs.np.server_host_key_algo.equals("ssh-rsa")) {
65 byte[] rs = RSASHA1Verify.decodeSSHRSASignature(sig);
60 RSAPublicKey rpk = RSASHA1Verify.decodeSSHRSAPublicKey(hostkey); 66 RSAPublicKey rpk = RSASHA1Verify.decodeSSHRSAPublicKey(hostkey);
61 67
62 log.debug("Verifying ssh-rsa signature"); 68 log.debug("Verifying ssh-rsa signature");
63 69
64 return RSASHA1Verify.verifySignature(kxs.H, rs, rpk); 70 return RSASHA1Verify.verifySignature(kxs.H, rs, rpk);
65 } 71 }
66 72
67 if(kxs.np.server_host_key_algo.equals("ssh-dss")) { 73 if (kxs.np.server_host_key_algo.equals("ssh-dss")) {
68 DSASignature ds = DSASHA1Verify.decodeSSHDSASignature(sig); 74 byte[] ds = DSASHA1Verify.decodeSSHDSASignature(sig);
69 DSAPublicKey dpk = DSASHA1Verify.decodeSSHDSAPublicKey(hostkey); 75 DSAPublicKey dpk = DSASHA1Verify.decodeSSHDSAPublicKey(hostkey);
70 76
71 log.debug("Verifying ssh-dss signature"); 77 log.debug("Verifying ssh-dss signature");
72 78
73 return DSASHA1Verify.verifySignature(kxs.H, ds, dpk); 79 return DSASHA1Verify.verifySignature(kxs.H, ds, dpk);