Skip to content

awg-quick crashes when i1–i5 parameters are empty (AmneziaWG v2 protocol) #40

Description

@MrWaip

Hi, I'm getting an error when trying to bring up an AmneziaWG v2 interface on Linux using a config exported from Amnezia self-hosted.

The config has Jc, Jmin, Jmax, S1, S2, H1H4 set, but I1I5 come out empty from the export:

[Interface]
PrivateKey = <key>
Address =
DNS = 1.1.1.1
Jc = 4
Jmin = 40
Jmax = 70
S1 = 0
S2 = 0
H1 = 1
H2 = 2
H3 = 3
H4 = 4
I1 = <b 0x084481800001000300000000077469636b...
I2 = 
I3 =
I4 =
I5 =

[Peer]
PublicKey = <key>
AllowedIPs = 0.0.0.0/0
Endpoint = <host>:<port>

Running awg-quick up awg0 fails. After some digging I found the issue in awg-quick — empty I1I5 values are silently dropped and never passed to awg setconf:

I1|I2|I3|I4|I5) [[ -n $value ]] && WG_CONFIG+="$line"$'\n'; continue ;;

So awg setconf gets a config without those fields and chokes on it. No warning is printed, which makes it hard to debug.

This seems to affect anyone exporting configs from Amnezia self-hosted since that's where the empty I1I5 come from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions