[PR #142] [CLOSED] feat: restore AmneziaWG 1.5 keys (j1..j3, itime, <c> tag) on top of 2.0 #162

Closed
opened 2026-10-13 21:04:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/142
Author: @belomaxorka
Created: 5/29/2026
Status: ❌ Closed

Base: master ← Head: feature/awg-1.5-compat


📝 Commits (1)

  • 81a7715 feat: restore AmneziaWG 1.5 keys (j1..j3, itime, tag) on top of 2.0

📊 Changes

6 files changed (+283 additions, -2 deletions)

View changed files

➕ device/awg_legacy_test.go (+134 -0)
📝 device/device.go (+44 -0)
📝 device/obf.go (+1 -0)
➕ device/obf_counter.go (+38 -0)
📝 device/send.go (+20 -2)
📝 device/uapi.go (+46 -0)

📄 Description

The 2.0 refactor (#103) dropped the legacy 1.5 obfuscation parameters entirely: the controlled-junk packets (j1..j3), the imitation interval (itime), and the counter tag. This restores them on top of the current 2.0 obf engine so a single build accepts both the 1.5 and 2.0 UAPI key sets; the version is selected by which keys are sent, with no version flag in the library.

  • device.go: add jpackets [3]*obfChain (controlled junk) and an imitation schedule; dueSpecialJunk() gates the special junk (i1..i5) by itime. A zero interval means "always due", so the controlled junk is never sent and the behaviour reduces exactly to AWG 2.0.
  • uapi.go: parse j1..j3 and itime in handleDeviceLine; emit them in IpcGetOperation.
  • send.go: in SendHandshakeInitiation, send the special junk when it is due, otherwise the controlled junk (mirrors AWG 1.5).
  • obf_counter.go: re-add the tag (8-byte big-endian packet counter).
  • awg_legacy_test.go: cover UAPI round-trip, the itime schedule, and the tag.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amneziawg-go/pull/142 **Author:** [@belomaxorka](https://github.com/belomaxorka) **Created:** 5/29/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/awg-1.5-compat` --- ### 📝 Commits (1) - [`81a7715`](https://github.com/amnezia-vpn/amneziawg-go/commit/81a77157b846a483a972887a5f9ae6a49b10c5ff) feat: restore AmneziaWG 1.5 keys (j1..j3, itime, <c> tag) on top of 2.0 ### 📊 Changes **6 files changed** (+283 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `device/awg_legacy_test.go` (+134 -0) 📝 `device/device.go` (+44 -0) 📝 `device/obf.go` (+1 -0) ➕ `device/obf_counter.go` (+38 -0) 📝 `device/send.go` (+20 -2) 📝 `device/uapi.go` (+46 -0) </details> ### 📄 Description The 2.0 refactor (#103) dropped the legacy 1.5 obfuscation parameters entirely: the controlled-junk packets (j1..j3), the imitation interval (itime), and the <c> counter tag. This restores them on top of the current 2.0 obf engine so a single build accepts both the 1.5 and 2.0 UAPI key sets; the version is selected by which keys are sent, with no version flag in the library. - device.go: add jpackets [3]*obfChain (controlled junk) and an imitation schedule; dueSpecialJunk() gates the special junk (i1..i5) by itime. A zero interval means "always due", so the controlled junk is never sent and the behaviour reduces exactly to AWG 2.0. - uapi.go: parse j1..j3 and itime in handleDeviceLine; emit them in IpcGetOperation. - send.go: in SendHandshakeInitiation, send the special junk when it is due, otherwise the controlled junk (mirrors AWG 1.5). - obf_counter.go: re-add the <c> tag (8-byte big-endian packet counter). - awg_legacy_test.go: cover UAPI round-trip, the itime schedule, and the <c> tag. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 21:04:11 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-go#162
No description provided.