mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-12-03 18:42:09 +07:00
[PR #207] fix: name the real S1-S4 parameter in the header protection padding error #205
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-go#205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/207
Author: @Dv2Corn
Created: 11/5/2026
Status: 🔄 Open
Base:
master← Head:fix/header-protection-padding-error📝 Commits (1)
4706820fix: name the real S1-S4 parameter in the header protection padding error📊 Changes
2 files changed (+83 additions, -1 deletions)
View changed files
📝
device/uapi.go(+1 -1)➕
device/uapi_test.go(+82 -0)📄 Description
header_protection_keyset, the padding check inmergeWithDevice(device/uapi.go#L852-L858) printed the zero-based slice index, so a too small S1 was reported as "S0", S2 as "S1" and so on, and S4 was never named. The text also said "more then 12" although 12 is accepted. The error now names the real parameter, says "at least", and includes the configured value, e.g.S4 must be at least 12 to use header protection, got 0.crypt[:HeaderCipherNonceSize]reaches into the message header that is encrypted right afterwards, so the receiver would derive a different keystream and drop the packet. This matches the README (README.md#L81).device/uapi_test.gowithTestHeaderProtectionPaddingValidation: no key with zero paddings is accepted, all paddings at exactly 12 are accepted, and S1, S2, S3 or S4 below 12 is rejected with an error naming that parameter. The four rejection cases fail before this change and pass after it.Fixes #201
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.