Examples of PacketKexDHReply


Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.hostkey = dhr.getHostKey();

        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.hostkey);
          }
          catch (Exception e)
          {
            throw (IOException) new IOException(
                "The server hostkey was not accepted by the verifier callback.").initCause(e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw (IOException) new IOException("KEX error.").initCause(e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.hostkey = dhr.getHostKey();
       
        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.hostkey);
          }
          catch (Exception e)
          {
            throw (IOException) new IOException(
                "The server hostkey was not accepted by the verifier callback.").initCause(e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw (IOException) new IOException("KEX error.").initCause(e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.hostkey = dhr.getHostKey();

        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.hostkey);
          }
          catch (Exception e)
          {
            throw (IOException) new IOException(
                "The server hostkey was not accepted by the verifier callback.").initCause(e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw (IOException) new IOException("KEX error.").initCause(e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.remote_hostkey = dhr.getHostKey();

        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.remote_hostkey);
          }
          catch (Exception e)
          {
            throw new IOException(
                "The server hostkey was not accepted by the verifier callback.", e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw new IOException("KEX error.", e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.remote_hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        {
          DSASignature ds = DSASHA1Verify.generateSignature(kxs.H, kxs.local_dsa_key, rnd);
          signature = DSASHA1Verify.encodeSSHDSASignature(ds);
        }

        PacketKexDHReply dhr = new PacketKexDHReply(hostKey, kxs.dhx.getF(), signature);
        tm.sendKexMessage(dhr.getPayload());

        finishKex(false);
        kxs.state = -1;

        if (authenticationStarted == false)
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.remote_hostkey = dhr.getHostKey();

        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.remote_hostkey);
          }
          catch (Exception e)
          {
            throw (IOException) new IOException(
                "The server hostkey was not accepted by the verifier callback.").initCause(e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw (IOException) new IOException("KEX error.").initCause(e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.remote_hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here

Examples of ch.ethz.ssh2.packets.PacketKexDHReply

        {
          DSASignature ds = DSASHA1Verify.generateSignature(kxs.H, kxs.local_dsa_key, rnd);
          signature = DSASHA1Verify.encodeSSHDSASignature(ds);
        }

        PacketKexDHReply dhr = new PacketKexDHReply(hostKey, kxs.dhx.getF(), signature);
        tm.sendKexMessage(dhr.getPayload());

        finishKex(false);
        kxs.state = -1;

        if (authenticationStarted == false)
View Full Code Here

Examples of com.trilead.ssh2.packets.PacketKexDHReply

        || kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
    {
      if (kxs.state == 1)
      {

        PacketKexDHReply dhr = new PacketKexDHReply(msg, 0, msglen);

        kxs.hostkey = dhr.getHostKey();

        if (verifier != null)
        {
          boolean vres = false;

          try
          {
            vres = verifier.verifyServerHostKey(hostname, port, kxs.np.server_host_key_algo, kxs.hostkey);
          }
          catch (Exception e)
          {
            throw (IOException) new IOException(
                "The server hostkey was not accepted by the verifier callback.").initCause(e);
          }

          if (vres == false)
            throw new IOException("The server hostkey was not accepted by the verifier callback");
        }

        kxs.dhx.setF(dhr.getF());

        try
        {
          kxs.H = kxs.dhx.calculateH(csh.getClientString(), csh.getServerString(), kxs.localKEX.getPayload(),
              kxs.remoteKEX.getPayload(), dhr.getHostKey());
        }
        catch (IllegalArgumentException e)
        {
          throw (IOException) new IOException("KEX error.").initCause(e);
        }

        boolean res = verifySignature(dhr.getSignature(), kxs.hostkey);

        if (res == false)
          throw new IOException("Hostkey signature sent by remote is wrong!");

        kxs.K = kxs.dhx.getK();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.