Package ch.ethz.ssh2.transport

Examples of ch.ethz.ssh2.transport.ClientServerHello


   */
  public String readLink(String path) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_READLINK...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_READLINK, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    if (debug != null)
    {
View Full Code Here


   */
  public void setstat(String path, SFTPv3FileAttributes attr) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);
    tw.writeBytes(createAttrs(attr));

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_SETSTAT...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_SETSTAT, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

  {
    checkHandleValidAndOpen(handle);

    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(handle.fileHandle, 0, handle.fileHandle.length);
    tw.writeBytes(createAttrs(attr));

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_FSETSTAT...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_FSETSTAT, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

    /* Either I am too stupid to understand the SFTP draft
     * or the OpenSSH guys changed the semantics of src and target.
     */

    TypesWriter tw = new TypesWriter();
    tw.writeString(target, charsetName);
    tw.writeString(src, charsetName);

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_SYMLINK...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_SYMLINK, req_id, tw.getBytes());

    expectStatusOKMessage(req_id);
  }
View Full Code Here

   */
  public String canonicalPath(String path) throws IOException
  {
    int req_id = generateNextRequestID();

    TypesWriter tw = new TypesWriter();
    tw.writeString(path, charsetName);

    if (debug != null)
    {
      debug.println("Sending SSH_FXP_REALPATH...");
      debug.flush();
    }

    sendMessage(Packet.SSH_FXP_REALPATH, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    if (debug != null)
    {
View Full Code Here

    }

    if (kxs.np.server_host_key_algo.equals("ssh-dss"))
    {
      DSASignature ds = DSASHA1Verify.decodeSSHDSASignature(sig);
      DSAPublicKey dpk = DSASHA1Verify.decodeSSHDSAPublicKey(hostkey);

      log.log(50, "Verifying ssh-dss signature");

      return DSASHA1Verify.verifySignature(kxs.H, ds, dpk);
    }
View Full Code Here

      return RSASHA1Verify.verifySignature(kxs.H, rs, rpk);
    }

    if (kxs.np.server_host_key_algo.equals("ssh-dss"))
    {
      DSASignature ds = DSASHA1Verify.decodeSSHDSASignature(sig);
      DSAPublicKey dpk = DSASHA1Verify.decodeSSHDSAPublicKey(hostkey);

      log.log(50, "Verifying ssh-dss signature");

      return DSASHA1Verify.verifySignature(kxs.H, ds, dpk);
View Full Code Here

            lock(Thread.currentThread());
            if (myConnection == null) {
                return false;
            }
            try {
                ClientServerHello csh = null;
                try {
                    Method getVersionInfoMethod = myConnection.getClass().getMethod("getVersionInfo", new Class[0]);
                    if (getVersionInfoMethod != null) {
                        Object result = getVersionInfoMethod.invoke(myConnection, new Object[0]);
                        if (result instanceof ClientServerHello) {
                            csh = (ClientServerHello) result;
                        }
                    }
                } catch (SecurityException e1) {
                } catch (NoSuchMethodException e1) {
                } catch (IllegalArgumentException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                }
                String version = null;
                if (csh != null && csh.getServerString() != null) {
                    version = new String(csh.getServerString());
                } else {
                    return false;
                }
                if (version != null && version.indexOf("OpenSSH") >= 0) {
                    return true;
View Full Code Here

            lock(Thread.currentThread());
            if (myConnection == null) {
                return false;
            }
            try {
                ClientServerHello csh = null;
                try {
                    Method getVersionInfoMethod = myConnection.getClass().getMethod("getVersionInfo", new Class[0]);
                    if (getVersionInfoMethod != null) {
                        Object result = getVersionInfoMethod.invoke(myConnection, new Object[0]);
                        if (result instanceof ClientServerHello) {
                            csh = (ClientServerHello) result;
                        }
                    }
                } catch (SecurityException e1) {
                } catch (NoSuchMethodException e1) {
                } catch (IllegalArgumentException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                }
                String version = null;
                if (csh != null && csh.getServerString() != null) {
                    version = new String(csh.getServerString());
                } else {
                    return false;
                }
                if (version != null && version.indexOf("OpenSSH") >= 0) {
                    return true;
View Full Code Here

        }
       
        public boolean isSessionPingSupported() {
            lock(Thread.currentThread());
            try {
                ClientServerHello csh = null;
                try {
                    Method getVersionInfoMethod = myConnection.getClass().getMethod("getVersionInfo", new Class[0]);
                    if (getVersionInfoMethod != null) {
                        Object result = getVersionInfoMethod.invoke(myConnection, new Object[0]);
                        if (result instanceof ClientServerHello) {
                            csh = (ClientServerHello) result;
                        }
                    }
                } catch (SecurityException e1) {
                } catch (NoSuchMethodException e1) {
                } catch (IllegalArgumentException e) {
                } catch (IllegalAccessException e) {
                } catch (InvocationTargetException e) {
                }
                String version = null;
                if (csh != null && csh.getServerString() != null) {
                    version = new String(csh.getServerString());
                } else {
                    return false;
                }
                if (version != null && version.indexOf("OpenSSH") >= 0) {
                    return true;
View Full Code Here

TOP

Related Classes of ch.ethz.ssh2.transport.ClientServerHello

Copyright © 2018 www.massapicom. 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.