6 Test programs
This section gives a brief overview of the test programs provided with libassh.
The test/algo_list.c program displays the list of algorithms supported by the current build of the library.
The test/bignum.c program contains various unit tests and stress tests of the built-in big number engine.
The test/buffer.c program tests the buffer and blob parsing related code.
The test/cipher.c program tests the cipher algorithms against known ssh2 binary packet contents.
The test/cipher_bench.c program measures the performance of the cipher algorithms.
The test/connection.c runs a stress test of the connection protocol service by randomly performing many channel and request operations between a pair of client and server sessions. The program maintains its own state of alive channels and requests so that it can check the consistency of the behavior on both sides.
The test/connection2.c program runs a similar connection protocol stress test. It does not maintain a local state but is able to inject corrupted packets and memory allocation failures.
The test/fail.c test program is expected to fail.
The test/gex_primes.c program checks the list of safe prime numbers used by the diffie-hellman-group-exchange-* class of algorithms. A fast and distributed safe prime generator tool is provided in extra/.
The test/hash.c program tests the hash functions used internally by the library.
The test/kex.c program generates many combinations of algorithms provided by the library and runs a key-exchange process between two sessions for each generated set. It is also able to inject corrupted packets and memory allocation failures.
The test/kex_bench.c program measures the performance of the key-exchange algorithms.
The test/key_io.c program tests loading and storing SSH keys of various types in all supported formats.
The test/libfuzzer.c program relies on the LLVM libfuzzer library to provide coverage-guided fuzz testing.
The test/mac.c program tests the message authentication algorithms.
The test/mac_bench.c program measures the performance of the message authentication algorithms.
The test/prng.c program dumps some random data from the prng module.
The test/replay.c program is able to record ssh2 sessions against other client and server implementations and replay them as part of the test suite.
The test/sign_bench.c program measures the performance of the signature algorithms.
The test/signature.c program tests the signature algorithms provided with the library against known inputs and outputs.
The test/signature2.c program tests the signature algorithms provided with the library by generating signature of random data. It checks that the verification fails when either the signature or the data is modified.
The test/userauth.c program runs a stress test of the user authentication services by performing many user authentication attempts between a pair of client and server sessions. The authentication requests and replies are generated randomly in this test. The program checks consistency of behavior on both sides. Corrupted packets and memory allocation failures can be injected during the test.
The test/userauth_server.c program provides unit tests of the server user authentication service. It checks that the server behaves well on common cases and that it properly rejects authentication on wrong behavior of the client that do not occur normally.