From de196490dbf4a1a977ef9bdaf2c80e921081ddf3 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 8 Nov 2023 09:38:10 +0000 Subject: [PATCH] fix(settings): wireguard preshared key from toml file --- internal/configuration/sources/files/wireguard.go | 2 +- internal/configuration/sources/files/wireguard_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/configuration/sources/files/wireguard.go b/internal/configuration/sources/files/wireguard.go index 658cb895..95adcf4f 100644 --- a/internal/configuration/sources/files/wireguard.go +++ b/internal/configuration/sources/files/wireguard.go @@ -53,7 +53,7 @@ func parseWireguardInterfaceSection(interfaceSection *ini.Section, return err // error is already wrapped correctly } - wireguard.PreSharedKey, err = parseINIWireguardKey(interfaceSection, "PreSharedKey") + wireguard.PreSharedKey, err = parseINIWireguardKey(interfaceSection, "PresharedKey") if err != nil { return err // error is already wrapped correctly } diff --git a/internal/configuration/sources/files/wireguard_test.go b/internal/configuration/sources/files/wireguard_test.go index a93102eb..352ba059 100644 --- a/internal/configuration/sources/files/wireguard_test.go +++ b/internal/configuration/sources/files/wireguard_test.go @@ -63,7 +63,7 @@ PrivateKey = x fileContent: ` [Interface] PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8= -PreSharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g= +PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g= Address = 10.38.22.35/32 DNS = 193.138.218.74 @@ -121,9 +121,9 @@ PrivateKey = x`, }, "pre shared key error": { iniData: `[Interface] -PreSharedKey = x +PresharedKey = x `, - errMessage: "parsing PreSharedKey: x: " + + errMessage: "parsing PresharedKey: x: " + "wgtypes: failed to parse base64-encoded key: " + "illegal base64 data at input byte 0", }, @@ -137,7 +137,7 @@ Address = x iniData: ` [Interface] PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8= -PreSharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g= +PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g= Address = 10.38.22.35/32 `, wireguard: settings.Wireguard{