3.2.1 Core and modules
Extensibility advertised in the ssh2 standard is transposed in libassh by allowing dynamic registration of external ssh2 algorithms and services.
The core of the library implements the transport layer, dispatches packets and events, handles registration of algorithm modules and performs management of struct assh_context_s and struct assh_session_s objects.
Interface descriptor structures are used in order to declare modules. The following descriptors are used for ssh2 algorithms negotiated during the key-exchange process:
The struct assh_algo_kex_s interface descriptor is used to declare the key-exchange algorithms.
The struct assh_algo_sign_s interface descriptor is used to declare the signature algorithms that are involved in server host authentication and user public key authentication.
The struct assh_algo_cipher_s interface descriptor is used to declare the cipher algorithms.
The struct assh_algo_mac_s interface descriptor is used to declare the message authentication algorithms.
The struct assh_algo_compress_s interface descriptor is used to declare the data compression methods.
Those descriptor structures inherit from the struct assh_algo_s structure.
Additional pluggable interface descriptors are used by the library:
The struct assh_service_s interface descriptor is used to declare implementations of ssh2 services.
The struct assh_prng_s interface descriptor is used to declare random generators used by the core and modules.
The assh_allocator_t function pointer type is used by the core and modules in order to allocate and free memory.
The struct assh_key_algo_s interface descriptor used to declare modules able to create and manage storage of SSH keys.