Package ch.ethz.ssh2.packets

Examples of ch.ethz.ssh2.packets.TypesReader.remain()


      if (wantReply != false)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message, 'want reply' is true");

      int exit_status = tr.readUINT32();

      if (tr.remain() != 0)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message");

      synchronized (c)
      {
        c.exit_status = new Integer(exit_status);
View Full Code Here


      String signame = tr.readString("US-ASCII");
      tr.readBoolean();
      tr.readString();
      tr.readString();

      if (tr.remain() != 0)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message");

      synchronized (c)
      {
        c.exit_signal = signame;
View Full Code Here

    if (protocol_version != 3)
      throw new IOException("Server version " + protocol_version + " is currently not supported");

    /* Read and save extensions (if any) for later use */

    while (tr.remain() != 0)
    {
      String name = tr.readString();
      byte[] value = tr.readByteString();
      server_extensions.put(name, value);

View Full Code Here

    BigInteger p = tr.readMPINT();
    BigInteger q = tr.readMPINT();
    BigInteger g = tr.readMPINT();
    BigInteger y = tr.readMPINT();

    if (tr.remain() != 0)
      throw new IOException("Padding in DSA public key!");

    return new DSAPublicKey(p, q, g, y);
  }
View Full Code Here

    byte[] rsArray = tr.readByteString();

    if (rsArray.length != 40)
      throw new IOException("Peer sent corrupt signature");

    if (tr.remain() != 0)
      throw new IOException("Padding in DSA signature!");

    /* Remember, s and r are unsigned ints. */

    byte[] tmp = new byte[20];
View Full Code Here

      throw new IllegalArgumentException("This is not a ssh-rsa public key");

    BigInteger e = tr.readMPINT();
    BigInteger n = tr.readMPINT();

    if (tr.remain() != 0)
      throw new IOException("Padding in RSA public key!");

    return new RSAPublicKey(e, n);
  }
View Full Code Here

    if (log.isEnabled())
    {
      log.log(80, "Decoding ssh-rsa signature string (length: " + s.length + ")");
    }

    if (tr.remain() != 0)
      throw new IOException("Padding in RSA signature!");

    return new RSASignature(new BigInteger(1, s));
  }
View Full Code Here

      if (wantReply != false)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message, 'want reply' is true");

      int exit_status = tr.readUINT32();

      if (tr.remain() != 0)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message");

      synchronized (c)
      {
        c.exit_status = new Integer(exit_status);
View Full Code Here

      String signame = tr.readString("US-ASCII");
      tr.readBoolean();
      tr.readString();
      tr.readString();

      if (tr.remain() != 0)
        throw new IOException("Badly formatted SSH_MSG_CHANNEL_REQUEST message");

      synchronized (c)
      {
        c.exit_signal = signame;
View Full Code Here

      throw new IllegalArgumentException("This is not a ssh-rsa public key");

    BigInteger e = tr.readMPINT();
    BigInteger n = tr.readMPINT();

    if (tr.remain() != 0)
      throw new IOException("Padding in RSA public key!");

    return new RSAPublicKey(e, n);
  }
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.