Developer Documentation
Contributions / License
Before starting development, please read our contribution requirements.
Getting the Source Code
The easiest way to get the source code is checking it out from our Git repository:
git clone https://github.com/strongswan/strongswan.git
Browsing the Source Code
The Git repository can be browsed directly at GitHub.
Source Code Documentation
strongSwan uses extractable inline documentation extensively. This documentation
is extracted with Doxygen for the latest release and uploaded to
strongswan.org/apidoc. Use make apidoc
to generate it from the
sources.
Code style
For our code we heavily use an object oriented programming style for C. Also have a look to our basic programming style guidelines.
Quality Assurance
Unit Tests
Our libraries are tested with an increasing number of unit tests. To run them use
make check
. The following environment variables change the behavior of the
test runner:
Variable | Description | Since Version |
---|---|---|
|
A space-separated list of plugins to load |
5.3.3 |
|
If this is set, test cases that generate keys will do so only for reduced key lengths to avoid blocking on hosts with low entropy |
|
|
Path to a custom |
5.2.0 |
|
A comma-separated list of test runners to run |
5.5.0 |
|
A comma-separated list of test suites to run |
|
|
A comma-separated list of test suites excluded from running |
5.2.1 |
|
A comma-separated list of test cases to run |
5.9.0 |
|
A comma-separated list of test cases excluded from running |
5.9.0 |
|
A comma-separated list of test functions to run (all functions of selected suites/cases are run if this is not specified) |
5.9.0 |
|
A comma-separated list of test functions excluded from running |
5.9.0 |
|
A comma-separated list of iterations of a loop-based test function to run (all iterations are run if this is not specified) |
5.9.8 |
|
Disables IPv6 test cases (e.g. to run the tests in Docker containers that only provide IPv4 networking) |
5.9.6 |
|
The log level used when running the tests ( |
|
|
The log level used for a specific log group ( |
5.9.7 |
|
If our custom memory allocator is enabled with |
Coverage reports can be generated with make coverage
which requires the
--enable-coverage
./configure
option which
is not recommended for production builds as it disables all optimizations.
The unit tests also run automatically for every commit:
Information on the code coverage:
And the code base is automatically analyzed:
Part of the source code is periodicylly fuzzed by Google OSS-Fuzz:
Testing Environment
Our integration and regression testing environment helps us ensure the quality of future releases. The test results for the latest strongSwan release are published online.
Components
The src
directory in the strongSwan distribution contains the following components:
Component | Description |
---|---|
|
Utility to generate an Attestation Identity Key bound to a TPM 1.2 |
Automated certificate enrollment tool |
|
The IKE keying daemon |
|
A command line IKE client |
|
The back end for the NetworkManager D-BUS plugin |
|
The Windows IKE service |
|
An IKE daemon similar to |
|
|
A variant of |
Utility to generate checksums of built executables and libraries |
|
Conformance test tool |
|
VPN client for Android |
|
NetworkManager plugin |
|
|
|
|
The legacy ipsec command line tool wrapping commands and other tools |
|
Contains most of the code and the plugins of the
|
|
A lightweight framework to build native web applications using ClearSilver and FastCGI |
Various Integrity Measurement Collectors (IMCs), Integrity Measuremeent Validators (IMVs) and the library code shared by them |
|
|
A userland IPsec implementation used by
|
|
Contains code for TPM-based Platform Trust Services (PTS) and SWID tag handling |
|
Implements the |
|
RADIUS protocol implementation used by e.g. the
|
|
Contains code shared by several EAP-SIM/AKA plugins |
|
The strongSwan library with basic functions used by the daemons and utilities |
TLS implementation used by the |
|
|
Implements the |
|
Implements the |
|
Provides access to TPM 1.2 and TPM 2.0 |
|
A deprecated graphical management application for
|
|
An experimental management front end for mediation servers based on |
Public Key Infrastructure utility |
|
Utility to manage attributes and IP address pools provided by the
|
|
Integrity measurement client using the |
|
Utility extracting information about security updates and backports of Linux repositories (e.g. Debian or Ubuntu) |
|
|
Legacy daemon that reads |
|
Legacy command line utility to control |
Configuration and control utility that communicates via the
|
|
Utility extracting information about software package installation, update or
removal events from the |
|
|
Tool that extends a digest into a TPM PCR |
|
Default script called by the |
|
Utility to create |