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{