3.4 Source tree
This section gives an overview of the source code organization. It is of interest for those writing new modules and playing with the library internals.
The source tree is organized as follows:
src/ : The source code of the library core and modules.
src/assh/ : The library public headers. See the headers list section for details.
tests/ : The test suite.
doc/ : This manual.
examples/ : Some example applications.
extra/ : development tools used to generate some tables and code.
The library core and service modules contain the state machines and protocol related stuff:
src/assh_*.c : The library core functions. This includes code related to management of contexts, sessions, events, as well as support code for key-exchange, services, packets, keys and algorithms.
src/assh_transport.c : The transport layer implementation.
src/assh_userauth_client*.c : The client side user authentication service module.
src/assh_userauth_server*.c : The server side user authentication service module.
src/assh_connection.c : The connection protocol service module.
Then come the algorithms negotiated during the key-exchange process. Some of these pluggable modules are standalone and others are linked to an external libraries:
src/kex*.c : The ssh key-exchange algorithm modules.
src/sign*.c : The ssh signature algorithm modules.
src/cipher*.c : The ssh cipher algorithm modules.
src/mac*.c : The ssh MAC algorithm modules.
src/compress*.c : The ssh compression algorithm modules.
Some additional pluggable utility components are used by the library core and modules:
src/key*.c : SSH keys management modules.
src/prng*.c : Random number generation modules.
src/hash*.c : Hash functions modules.
src/bignum*.c : A constant time big number engine.
Some helper functions are provided for convenience. Unlike other parts of the library, these files contains system calls and platform specific stuff. It is not used by the other parts of the library and are only provided for use by the application. They don't rely on the private APIs of the library:
src/helper_client.c : This provides event handlers for common ssh client behavior.
src/helper_server.c : This provides event handlers for common ssh server behavior.
src/helper_key.c : This provides SSH key file loading and saving functions.
src/helper_base64.c : This implements a base64 encoder and decoder for use by SSH key helpers.
src/helper_bcrypt.c : This provides the encryption algorithm used for passphrase protected keys in OpenSSH formats.
src/helper_io.c : This provides IO events handler relying on POSIX file descriptors.
src/helper_interactive.c : This implements interactive session related features.
src/helper_portfwd.c : This implements port forwarding related features.
See associated header files for details of the helpers API.