Пример #1
0
 public SshPacket2 createOutboundPacket() {
   data = new SshPacket2(SSHMessages.SSH_MSG_KEXINIT);
   data.putBytes(cookie);
   data.putNameList(kexAlgorithms);
   data.putNameList(serverHostKeyAlgorithms);
   data.putNameList(clientToServerCryptoAlgorithms);
   data.putNameList(serverToClientCryptoAlgorithms);
   data.putNameList(MACClientToServer);
   data.putNameList(MACServerToClient);
   data.putNameList(compressionClientToServer);
   data.putNameList(compressionServerToClient);
   data.putNameList(languagesClientToServer);
   data.putNameList(languagesServerToClient);
   data.putByte(firstKEXPacketFollowing ? (byte) 1 : (byte) 0);
   data.putInt32(0);
   return data;
 }
Пример #2
0
 public static KexInitData createInstanceFromPacket(SshPacket2 packet) {
   KexInitData out = new KexInitData();
   out.cookie = packet.getBytes(16);
   out.kexAlgorithms = packet.getStringList();
   out.serverHostKeyAlgorithms = packet.getStringList();
   out.clientToServerCryptoAlgorithms = packet.getStringList();
   out.serverToClientCryptoAlgorithms = packet.getStringList();
   out.MACClientToServer = packet.getStringList();
   out.MACServerToClient = packet.getStringList();
   out.compressionClientToServer = packet.getStringList();
   out.compressionServerToClient = packet.getStringList();
   out.languagesClientToServer = packet.getStringList();
   out.languagesServerToClient = packet.getStringList();
   out.firstKEXPacketFollowing = packet.getByte() == 1;
   out.reserved = packet.getInt32();
   return out;
 }