@@ -248,6 +248,14 @@ in {
248248 </itemizedlist>
249249 '';
250250
251+ ppk_id = mkOptionalStrParam ''
252+ String identifying the Postquantum Preshared Key (PPK) to be used.
253+ '';
254+
255+ ppk_required = mkYesNoParam no ''
256+ Whether a Postquantum Preshared Key (PPK) is required for this connection.
257+ '';
258+
251259 keyingtries = mkIntParam 1 ''
252260 Number of retransmission sequences to perform during initial
253261 connect. Instead of giving up initiation after the first retransmission
@@ -922,6 +930,36 @@ in {
922930 <literal>0xffffffff</literal>.
923931 '';
924932
933+ set_mark_in = mkStrParam "0/0x00000000" ''
934+ Netfilter mark applied to packets after the inbound IPsec SA processed
935+ them. This way it's not necessary to mark packets via Netfilter before
936+ decryption or right afterwards to match policies or process them
937+ differently (e.g. via policy routing).
938+
939+ An additional mask may be appended to the mark, separated by
940+ <literal>/</literal>. The default mask if omitted is 0xffffffff. The
941+ special value <literal>%same</literal> uses the value (but not the mask)
942+ from <option>mark_in</option> as mark value, which can be fixed,
943+ <literal>%unique</literal> or <literal>%unique-dir</literal>.
944+
945+ Setting marks in XFRM input requires Linux 4.19 or higher.
946+ '';
947+
948+ set_mark_out = mkStrParam "0/0x00000000" ''
949+ Netfilter mark applied to packets after the outbound IPsec SA processed
950+ them. This allows processing ESP packets differently than the original
951+ traffic (e.g. via policy routing).
952+
953+ An additional mask may be appended to the mark, separated by
954+ <literal>/</literal>. The default mask if omitted is 0xffffffff. The
955+ special value <literal>%same</literal> uses the value (but not the mask)
956+ from <option>mark_out</option> as mark value, which can be fixed,
957+ <literal>%unique_</literal> or <literal>%unique-dir</literal>.
958+
959+ Setting marks in XFRM output is supported since Linux 4.14. Setting a
960+ mask requires at least Linux 4.19.
961+ '';
962+
925963 tfc_padding = mkParamOfType (with lib.types; either int (enum ["mtu"])) 0 ''
926964 Pads ESP packets with additional data to have a consistent ESP packet
927965 size for improved Traffic Flow Confidentiality. The padding defines the
@@ -946,6 +984,33 @@ in {
946984 supported, but the installation does not fail otherwise.
947985 '';
948986
987+ copy_df = mkYesNoParam yes ''
988+ Whether to copy the DF bit to the outer IPv4 header in tunnel mode. This
989+ effectively disables Path MTU discovery (PMTUD). Controlling this
990+ behavior is not supported by all kernel interfaces.
991+ '';
992+
993+ copy_ecn = mkYesNoParam yes ''
994+ Whether to copy the ECN (Explicit Congestion Notification) header field
995+ to/from the outer IP header in tunnel mode. Controlling this behavior is
996+ not supported by all kernel interfaces.
997+ '';
998+
999+ copy_dscp = mkEnumParam [ "out" "in" "yes" "no" ] "out" ''
1000+ Whether to copy the DSCP (Differentiated Services Field Codepoint)
1001+ header field to/from the outer IP header in tunnel mode. The value
1002+ <literal>out</literal> only copies the field from the inner to the outer
1003+ header, the value <literal>in</literal> does the opposite and only
1004+ copies the field from the outer to the inner header when decapsulating,
1005+ the value <literal>yes</literal> copies the field in both directions,
1006+ and the value <literal>no</literal> disables copying the field
1007+ altogether. Setting this to <literal>yes</literal> or
1008+ <literal>in</literal> could allow an attacker to adversely affect other
1009+ traffic at the receiver, which is why the default is
1010+ <literal>out</literal>. Controlling this behavior is not supported by
1011+ all kernel interfaces.
1012+ '';
1013+
9491014 start_action = mkEnumParam ["none" "trap" "start"] "none" ''
9501015 Action to perform after loading the configuration.
9511016 <itemizedlist>
@@ -1060,6 +1125,24 @@ in {
10601125 defined in a unique section having the <literal>ike</literal> prefix.
10611126 '';
10621127
1128+ ppk = mkPrefixedAttrsOfParams {
1129+ secret = mkOptionalStrParam ''
1130+ Value of the PPK. It may either be an ASCII string, a hex encoded string
1131+ if it has a <literal>0x</literal> prefix or a Base64 encoded string if
1132+ it has a <literal>0s</literal> prefix in its value. Should have at least
1133+ 256 bits of entropy for 128-bit security.
1134+ '';
1135+
1136+ id = mkPrefixedAttrsOfParam (mkOptionalStrParam "") ''
1137+ PPK identity the PPK belongs to. Multiple unique identities may be
1138+ specified, each having an <literal>id</literal> prefix, if a secret is
1139+ shared between multiple peers.
1140+ '';
1141+ } ''
1142+ Postquantum Preshared Key (PPK) section for a specific secret. Each PPK is
1143+ defined in a unique section having the <literal>ppk</literal> prefix.
1144+ '';
1145+
10631146 private = mkPrefixedAttrsOfParams {
10641147 file = mkOptionalStrParam ''
10651148 File name in the private folder for which this passphrase should be used.