]> git.99rst.org Git - openwrt-packages.git/commitdiff
strongswan: write local_key to swanctl.conf
authorFlorian Eckert <redacted>
Mon, 27 Jul 2026 13:47:59 +0000 (15:47 +0200)
committerFlorian Eckert <redacted>
Mon, 3 Aug 2026 09:07:41 +0000 (11:07 +0200)
The 'local_key' UCI option was validated (checked for existence
under /etc/swanctl/private/) but never written to the generated
'swanctl.conf'. As a result, setting 'local_key' had no actual effect
on which private key was used for local authentication.

Add the corresponding "privkeys" line to the local{} section,
mirroring how local_cert is already written as "certs", so that
swanctl explicitly uses the configured private key.

Signed-off-by: Florian Eckert <redacted>
net/strongswan/files/swanctl.init

index 92916c962510ce945b5531542e8516d2eed56fed..a7b1e11d84c92d2fc484ea6065a54c14259abd0b 100644 (file)
@@ -553,6 +553,8 @@ config_remote() {
        [ -n "$local_identifier" ] && swanctl_xappend3 "id = \"$local_identifier\""
        [ "$local_auth_method" = pubkey ] && [ -n "$local_cert" ] && \
                swanctl_xappend3 "certs = $local_cert"
+       [ "$local_auth_method" = pubkey ] && [ -n "$local_key" ] && \
+               swanctl_xappend3 "privkeys = $local_key"
        swanctl_xappend2 "}"
 
        swanctl_xappend2 "remote {"
git clone https://git.99rst.org/PROJECT