nassh: Implement an extensible SSH agent

The Agent class takes requests from the SSH client and passes them on to
a set of dynamically registered backends. The responses from the
backends are aggregated and reported back to the client. In the
connection dialog, the user can choose the backends used by Agent by
providing a list of backend IDs separated by commas as the value of the
--ssh-agent relay option.

So far, only the requests SSH_AGENTC_REQUEST_IDENTITIES and
SSH_AGENTC_SIGN_REQUEST are supported, together with their respective
responses.

This change is backwards-compatible: If the value of --ssh-agent is just
an extension ID, the old SSHAgentRelay is used instead of the new
SSHAgent.

The implementation introduces the following new classes:

 * nassh.agent.Agent: Initializes the backends, relays the requests to
    them and bundles up the responses.
 * nassh.agent.Agent.UserIO: Provides backends with uniform access to
    terminal IO.
 * nassh.agent.Backend: A minimal implementation of a backend which all
    other backends should derive from. It provides a backend under the
    ID 'stub' which can be used for testing purposes.
 * nassh.agent.Message: Parses and writes messages used in the SSH agent
    protocol.
 * nassh.Stream.SSHAgent: Inherits from nassh.Stream and relays raw SSH
    agent requests to the Agent class.

BUG=chromium:712699
Change-Id: I0a4dfc6681839518f98d9ed461479fd5a461d6bd
Reviewed-on: https://chromium-review.googlesource.com/550115
Tested-by: Fabian Henneke <fabian.henneke@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
16 files changed
tree: b78dd7c8f5791f286a732961f7ec30723fbc0722
  1. hterm/
  2. libdot/
  3. nassh/
  4. saltpig/
  5. ssh_client/
  6. wam/
  7. wash/
  8. .gitignore
  9. HACK.md
  10. LICENSE
  11. package.json
  12. README.md
README.md

Hello

This repository contains the libdot JavaScript library and some web applications that make use of it.

The official copy of this repository is hosted at https://chromium.googlesource.com/apps/libapps.

There is also a mirror on github at https://github.com/libapps/libapps-mirror. Keep in mind that this mirror may occasionally be behind the official repository.

All changes must go through the Gerrit code review server on https://chromium-review.googlesource.com. Github pull requests cannot be accepted. Please see the HACK.md document in this directory for the details.

Top level directories

  • libdot/ is a small set of JS libraries initially developed as part of hterm, now available as shared code. It provides a base layer for web applications. The code is intended to work in any modern browser, in either a plain web page or a “privileged” environment such as a Chrome platform application or Firefox extension. In practice, it's only been put to use in Chrome platform applications so far.

  • hterm/ is a JS library that provides a terminal emulator. It is reasonably fast, reasonably correct, and reasonably portable across browsers.

  • nassh/ is the Secure Shell Chrome App (currently a “v1.5” app, soon to become a “v2” or platform app) that combines hterm with a NaCl build of OpenSSH to provide a PuTTY-like app for Chrome users.

  • ssh_client/ is the NaCl port of OpenSSH. It is used by nassh to create the Secure Shell App.

  • wash/ is a library for cross-origin virtual filesystems, similar to the Plan 9 filesystem. This directory also contains a simple bash-like shell environment for exploring these filesystems. The code in this directory is a work-in-progress.