Package ch.ethz.ssh2.packets

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


    int packet_type = tr.readByte();

    if (packet_type == Packets.SSH_MSG_USERAUTH_REQUEST)
    {
      String username = tr.readString("UTF-8");
      String service = tr.readString();
      String method = tr.readString();

      if (!"ssh-connection".equals(service))
      {
        sendresult(AuthenticationResult.FAILURE);
View Full Code Here


    if (packet_type == Packets.SSH_MSG_USERAUTH_REQUEST)
    {
      String username = tr.readString("UTF-8");
      String service = tr.readString();
      String method = tr.readString();

      if (!"ssh-connection".equals(service))
      {
        sendresult(AuthenticationResult.FAILURE);
        return;
View Full Code Here

        {
          sendresult(AuthenticationResult.FAILURE);
          return;
        }

        String password = tr.readString("UTF-8");

        if (cb != null)
        {
          sendresult(cb.authenticateWithPassword(state.conn, username, password));
          return;
View Full Code Here

  public static DSAPublicKey decodeSSHDSAPublicKey(byte[] key) throws IOException
  {
    TypesReader tr = new TypesReader(key);

    String key_format = tr.readString();

    if (key_format.equals("ssh-dss") == false)
      throw new IllegalArgumentException("This is not a ssh-dss public key!");

    BigInteger p = tr.readMPINT();
View Full Code Here

    }
    else
    {
      TypesReader tr = new TypesReader(sig);

      String sig_format = tr.readString();

      if (sig_format.equals("ssh-dss") == false)
        throw new IOException("Peer sent wrong signature format");

      rsArray = tr.readByteString();
View Full Code Here

  public static RSAPublicKey decodeSSHRSAPublicKey(byte[] key) throws IOException
  {
    TypesReader tr = new TypesReader(key);

    String key_format = tr.readString();

    if (key_format.equals("ssh-rsa") == false)
      throw new IllegalArgumentException("This is not a ssh-rsa public key");

    BigInteger e = tr.readMPINT();
View Full Code Here

  public static RSASignature decodeSSHRSASignature(byte[] sig) throws IOException
  {
    TypesReader tr = new TypesReader(sig);

    String sig_format = tr.readString();

    if (sig_format.equals("ssh-rsa") == false)
      throw new IOException("Peer sent wrong signature format");

    /* S is NOT an MPINT. "The value for 'rsa_signature_blob' is encoded as a string
View Full Code Here

                if(log.isDebugEnabled()) {
                    TypesReader tr = new TypesReader(msg, 0, msglen);
                    tr.readByte();
                    tr.readBoolean();
                    StringBuilder debugMessageBuffer = new StringBuilder();
                    debugMessageBuffer.append(tr.readString("UTF-8"));

                    for(int i = 0; i < debugMessageBuffer.length(); i++) {
                        char c = debugMessageBuffer.charAt(i);

                        if((c >= 32) && (c <= 126)) {
View Full Code Here

            if(type == Packets.SSH_MSG_DISCONNECT) {
                TypesReader tr = new TypesReader(msg, 0, msglen);
                tr.readByte();
                int reason_code = tr.readUINT32();
                StringBuilder reasonBuffer = new StringBuilder();
                reasonBuffer.append(tr.readString("UTF-8"));

        /*
         * Do not get fooled by servers that send abnormal long error
         * messages
         */
 
View Full Code Here

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

    while (tr.remain() != 0)
    {
      String name = tr.readString();
      listener.read(name);
      byte[] value = tr.readByteString();
      log.debug("SSH_FXP_VERSION: extension: " + name + " = '" + expandString(value, 0, value.length) + "'");
    }
  }
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.