mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-08-03 10:12:51 +02:00
feat: allow empty junk packets
This commit is contained in:
parent
3c2aaf43b4
commit
5680162c72
3 changed files with 20 additions and 7 deletions
18
Dockerfile
18
Dockerfile
|
@ -7,10 +7,24 @@ RUN go mod download && \
|
|||
|
||||
FROM alpine:3.19
|
||||
ARG AWGTOOLS_RELEASE="1.0.20241018"
|
||||
|
||||
RUN apk add linux-headers build-base
|
||||
COPY awg-tools /awg-tools
|
||||
RUN pwd && ls -la / && ls -la /awg-tools
|
||||
WORKDIR /awg-tools/src
|
||||
# RUN ls -la && pwd && ls awg-tools
|
||||
RUN make
|
||||
RUN mkdir -p build && \
|
||||
cp wg ./build/awg && \
|
||||
cp wg-quick/linux.bash ./build/awg-quick
|
||||
|
||||
RUN cp build/awg /usr/bin/awg
|
||||
RUN cp build/awg-quick /usr/bin/awg-quick
|
||||
|
||||
RUN apk --no-cache add iproute2 iptables bash && \
|
||||
cd /usr/bin/ && \
|
||||
wget https://github.com/amnezia-vpn/amneziawg-tools/releases/download/v${AWGTOOLS_RELEASE}/alpine-3.19-amneziawg-tools.zip && \
|
||||
unzip -j alpine-3.19-amneziawg-tools.zip && \
|
||||
# wget https://github.com/amnezia-vpn/amneziawg-tools/releases/download/v${AWGTOOLS_RELEASE}/alpine-3.19-amneziawg-tools.zip && \
|
||||
# unzip -j alpine-3.19-amneziawg-tools.zip && \
|
||||
chmod +x /usr/bin/awg /usr/bin/awg-quick && \
|
||||
ln -s /usr/bin/awg /usr/bin/wg && \
|
||||
ln -s /usr/bin/awg-quick /usr/bin/wg-quick
|
||||
|
|
|
@ -50,9 +50,6 @@ func (handler *SpecialHandshakeHandler) GenerateSpecialJunk() [][]byte {
|
|||
// TODO: create tests
|
||||
if !handler.isFirstDone {
|
||||
handler.isFirstDone = true
|
||||
handler.nextItime = time.Now().Add(handler.ITimeout)
|
||||
|
||||
return handler.SpecialJunk.GeneratePackets()
|
||||
} else if !handler.isTimeToSendSpecial() {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -378,7 +378,8 @@ func (device *Device) handleDeviceLine(key, value string, tempAwg *awg.Protocol)
|
|||
tempAwg.ASecCfg.IsSet = true
|
||||
case "i1", "i2", "i3", "i4", "i5":
|
||||
if len(value) == 0 {
|
||||
return ipcErrorf(ipc.IpcErrorInvalid, "%s should be non null", key)
|
||||
device.log.Verbosef("UAPI: received empty %s", key)
|
||||
return nil
|
||||
}
|
||||
|
||||
generators, err := awg.Parse(key, value)
|
||||
|
@ -390,7 +391,8 @@ func (device *Device) handleDeviceLine(key, value string, tempAwg *awg.Protocol)
|
|||
tempAwg.HandshakeHandler.IsSet = true
|
||||
case "j1", "j2", "j3":
|
||||
if len(value) == 0 {
|
||||
return ipcErrorf(ipc.IpcErrorInvalid, "%s should be non null", key)
|
||||
device.log.Verbosef("UAPI: received empty %s", key)
|
||||
return nil
|
||||
}
|
||||
|
||||
generators, err := awg.Parse(key, value)
|
||||
|
|
Loading…
Add table
Reference in a new issue