Libreswan Documentation

Logo

Libreswan's Online Documentation

View the Project on GitHub libreswan/libreswan.github.io

Support
FAQ Common Error Messages
History
Implemented Standards
Kernel Support
HOWTO Additional ipsec.conf documentation
AWS Mesh
brendans Road Warrior Setup at Home
Configuration examples
Confuse !?@: github wiki
Enterprise cloud encryption
Entropy matters
EoIP shared ethernet LAN using IPsec
High Availability Fallover VPN in AWS
Host to host VPN
Host to host VPN with PSK
Libreswan as client to a Cisco ASA or VPN3000 server
Microsoft Azure configuration
Migrate from IKEv1 DPD to IKEv2 LIVENESS
Opportunistic IPsec
Opportunistic IPsec using LetsEncrypt
Pluto and DNSSEC
Read status output
Route based VPN
SElinux and Labeled IPsec VPN
Subnet extrusion
Subnet to subnet using NAT
Subnet to subnet VPN
Subnet to subnet VPN with PSK
Unauthenticated Opportunistic IPsec
Using Apache to serve PKCS
Using NSS Hardware Tokens
Using NSS with libreswan
VPN server for remote clients using IKEv2
VPN server for remote clients using IKEv2 split VPN
GSoC 2027 Code Project Ideas DRAFT
Contributor Guidance DRAFT
Completed Projects 2026 RFC 9593 Announcing Supported Authentication Methods in IKEv2
2026 Improve the ACQUIRE to IKE policy lookup
2026 Add HOST TO HOST Support on BSD
2021 RFC 8420 Add EdDSA Signature Authentication Support to IKEv2
2020 Session Resumption
2020 IKEv2 Interop testing with OpenBSD
2020 IKE Intermediate Exchange
2019 Libreswan Opportunistic IPsec using LetsEncrypt
2018 RSA PSS Support in compliance with RFC 7427 and RFC 8247
2018 RFC 7427 Add ECDSA Signature Authentication Support to IKEv2
2018 RFC 5685 Redirect Mechanism
2018 Managing Interface
2017 TCP encapsulation of IKE and IPsec
2017 RFC 7427 Add Signature Authentication Support to IKEv2
2017 Postquantum Preshared Keys
Presentations
IRC
Hacking Documentation
Git, GitHub, and Pull Requests
Merging GitHub Pull Requests
Programming Conventions
Testing Docker
KVM 1. Setup The Host
2. Configure Testing
3. Compile Libreswan
4. Test Libreswan
5. Accessing The Console
6. Maintenance and Internals
Bisecting
Debugging Pluto
Logging In Using SSH
Performance
Running A Custom Kernel
Running A Single Test
Running In The Background
Setup a Web Server
Testing Old Branches
Updating Test Results
Namespace Magic
Namespaces
Topology
Internals 3.14 X509
Benchmarking and Performance testing
Cipher suites and algorithm support
Cloud OE ideas
Compiling with AddressSanitizer
Compliance of RFC 7427 Signature Authentication in IKEv2
Coverity
Cryptographic Acceleration
Developer links strongswan android
Discouraged or forbidden C functions
IKEv2 Child SA
IKEv2 CP and EAP support
Introduction
Libreswan xfrm kernel support
Logging cleanup
New OE
Pluto
Pluto packet processing
Proposed ipsec ca command
Retransmit timings
Road Map
SAref code
Setting up system for debug logging
stf status
Testing 2017 Next Generation
Unbound
Uncrustify
Use Cases and Requirements document for ECC ECDSA support
Use Cases and Requirements document
XFRM Interface Development Notes
XFRM pCPU
XFRM pCPU RSS
Security Crypto boundary and certification
Libreswan and Heartbleed
Libreswan and TunnelCrack
Reporting a Vulnerability
Vulnerabilities
Meetups 2013 Helsinki
2014 San Francisco
2014 Toronto
2018 Toronto
Obsolete HOWTOs IKEv1 XAUTH with FreeOTP and FreeIPA
IKEv1 XAUTH with Google Authenticator One Time Passwords
Route based VPN using VTI
Testing Namespace
VPN server for remote clients using IKEv1 with L2TP
VPN server for remote clients using IKEv1 XAUTH with Certificates
VPN server for remote clients using IKEv1 XAUTH with PSK

Libreswan is an Internet Key Exchange (IKE) implementation that runs on Linux, FreeBSD, NetBSD and OpenBSD.

While the original IKE and IPsec protocols were drafted in 1998, the need to deal with an ever changing and increasingly hostile world, drives the continuous evolution of these standards. New features, such as hybrid post-quantum key exchange, are being added; while old features, such as support for weak cryptographic algorithms are been removed. For more background on Libreswan see the History Page.

The Project Ideas listed below have been selected by Libreswan’s core developers with this evolution in mind. They provide both a technical challenge, and a way to participate in The Internet’s development. The mentors also have a personal interest in seeing these projects through to completion.

If you see a project that looks interesting, or you just have questions, then see the Contributor Guidance for next steps.

It isn’t a requirement at you pick one of the ideas below - we also welcome new ideas. For instance, additional draft RFCs that could form the basis of a project can be found here)!

Use all exchanged messages when computing the authentication MAC

Required Skills: C, UNIX programming

Preferred Skills: Network protocols, Cryptographic fundamentals, RFC interpretation, GIT

Libreswan Mentors: Andrew Cagney

Project size: 90 hours

Difficulty: Easy

Draft RFC: Downgrade Prevention for the Internet Key Exchange Protocol Version 2 (IKEv2)

Description

IKEv2, when authenticating a peer, computes the MAC (message authentication code) using only two of the four messages that have been exchanged during the IKE negotiation. This proposed RFC adds an extension so that an authenticated peer uses all four of the exchanged messages in the MAC calculation.

Please note that this is an internet standards draft. Someone implementing this might find issues with the draft protocol for which they would need to communicate with the author of the draft to resolve.

The deliverables are:

The proposal should address each of these areas.

Implementation

Add connection parameter ike-sa-init-full-transcript-auth=... to keywords

This should be boiler plate code adding the field to host_config in connections.h et.al.

Functionality (minimum):

Commits (minimum):

Exension: add additional keywords (no clue what) to specify

Idea: refactor code to use a generic table

Negotiate IKE_SA_INIT_FULL_TRANSCRIPT_AUTH

This should be boiler plate code adding the field state.h.

Commits (minimum):

Idea: follow-up above table so this is also generic

Modify IKE_SA_INIT to compute the new signed octets

Need to search these directions:

One code path contains extract_v2AUTH_blobs(), another contains submit_v2_auth_signature().

PSK and PKI may also have different code paths

The code doing the calculation can already be found in IKE_INTERMEDIATE.

Commits (minimal):

Either impair or extensions to config parameter may help here.

modify IKE_SESSION_RESUME paths to compute the new hash

The trick here is that the decision is determined by the resume blob.

Commits (minimal):

here’s a tentative patch for adding the fields

no clue if it works

diff --git a/programs/pluto/connections.h b/programs/pluto/connections.h
index 6871bb4280..d02b2d3fff 100644
--- a/programs/pluto/connections.h
+++ b/programs/pluto/connections.h
@@ -229,6 +229,8 @@ struct host_config {
                bool nm;                /* Network Manager support */
                bool split;
        } cisco;
+       /* See https://datatracker.ietf.org/doc/draft-ietf-ipsecme-ikev2-downgrade-prevention/ */
+       enum yna_options ike_sa_init_full_transcript_auth;
 };
 
 struct child_config {
diff --git a/programs/pluto/state.h b/programs/pluto/state.h
index b5ce735917..e5a70f2631 100644
--- a/programs/pluto/state.h
+++ b/programs/pluto/state.h
@@ -703,6 +703,7 @@ struct state {
        generalName_t *st_v1_requested_ca;      /* collected certificate requests */
        uint8_t st_reply_xchg;
        bool st_peer_wants_null;                /* We received IDr payload of type ID_NULL (and we allow auth=NULL / authby=NULL */
+       bool st_v2_ike_sa_init_full_transcript_auth_enabled;    /* See https://datatracker.ietf.org/doc/draft-ietf-ipsecme-ikev2-downgrade-prevention/ */
 
        /* IKEv2 IKE SA only */
        struct {

Loosely based on Shahrin Fatima’s proposal.