fix(settings): wireguard preshared key from toml file
This commit is contained in:
@@ -53,7 +53,7 @@ func parseWireguardInterfaceSection(interfaceSection *ini.Section,
|
|||||||
return err // error is already wrapped correctly
|
return err // error is already wrapped correctly
|
||||||
}
|
}
|
||||||
|
|
||||||
wireguard.PreSharedKey, err = parseINIWireguardKey(interfaceSection, "PreSharedKey")
|
wireguard.PreSharedKey, err = parseINIWireguardKey(interfaceSection, "PresharedKey")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err // error is already wrapped correctly
|
return err // error is already wrapped correctly
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ PrivateKey = x
|
|||||||
fileContent: `
|
fileContent: `
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8=
|
PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8=
|
||||||
PreSharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
|
PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
|
||||||
Address = 10.38.22.35/32
|
Address = 10.38.22.35/32
|
||||||
DNS = 193.138.218.74
|
DNS = 193.138.218.74
|
||||||
|
|
||||||
@@ -121,9 +121,9 @@ PrivateKey = x`,
|
|||||||
},
|
},
|
||||||
"pre shared key error": {
|
"pre shared key error": {
|
||||||
iniData: `[Interface]
|
iniData: `[Interface]
|
||||||
PreSharedKey = x
|
PresharedKey = x
|
||||||
`,
|
`,
|
||||||
errMessage: "parsing PreSharedKey: x: " +
|
errMessage: "parsing PresharedKey: x: " +
|
||||||
"wgtypes: failed to parse base64-encoded key: " +
|
"wgtypes: failed to parse base64-encoded key: " +
|
||||||
"illegal base64 data at input byte 0",
|
"illegal base64 data at input byte 0",
|
||||||
},
|
},
|
||||||
@@ -137,7 +137,7 @@ Address = x
|
|||||||
iniData: `
|
iniData: `
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8=
|
PrivateKey = QOlCgyA/Sn/c/+YNTIEohrjm8IZV+OZ2AUFIoX20sk8=
|
||||||
PreSharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
|
PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
|
||||||
Address = 10.38.22.35/32
|
Address = 10.38.22.35/32
|
||||||
`,
|
`,
|
||||||
wireguard: settings.Wireguard{
|
wireguard: settings.Wireguard{
|
||||||
|
|||||||
Reference in New Issue
Block a user