diff --git a/docs/MIDDLE-END-KDF.de.md b/docs/MIDDLE-END-KDF.de.md new file mode 100644 index 0000000..6483f7f --- /dev/null +++ b/docs/MIDDLE-END-KDF.de.md @@ -0,0 +1,40 @@ +# Middle-End Proxy + +## KDF-Adressierung — Implementierungs-FAQ + +### Benötigt die C-Referenzimplementierung sowohl externe IP-Adresse als auch Port für die KDF? + +Ja. + +In der C-Referenzimplementierung werden **sowohl IP-Adresse als auch Port in die KDF einbezogen** — auf beiden Seiten der Verbindung. + +In `aes_create_keys()` enthält der KDF-Input: + +- `server_ip + client_port` +- `client_ip + server_port` +- sowie Secret / Nonces + +Für IPv6: + +- IPv4-Felder werden auf 0 gesetzt +- IPv6-Adressen werden ergänzt + +Die **Ports bleiben weiterhin Bestandteil der KDF**. + +> Wenn sich externe IP oder Port (z. B. durch NAT, SOCKS oder Proxy) von den erwarteten Werten unterscheiden, entstehen unterschiedliche Schlüssel — der Handshake schlägt fehl. + +--- + +### Kann der Port aus der KDF ausgeschlossen werden (z. B. durch Port = 0)? + +**Nein!** + +Die C-Referenzimplementierung enthält **keine Möglichkeit, den Port zu ignorieren**: +- `client_port` und `server_port` sind fester Bestandteil der KDF +- Es werden immer reale Socket-Ports übergeben: + - `c->our_port` + - `c->remote_port` + +Falls ein Port den Wert `0` hat, wird er dennoch als `0` in die KDF übernommen. + +Eine „Port-Ignore“-Logik existiert nicht. diff --git a/docs/MIDDLE-END-KDF.en.md b/docs/MIDDLE-END-KDF.en.md new file mode 100644 index 0000000..e793a8a --- /dev/null +++ b/docs/MIDDLE-END-KDF.en.md @@ -0,0 +1,41 @@ +# Middle-End Proxy + +## KDF Addressing — Implementation FAQ + +### Does the C-implementation require both external IP address and port for the KDF? + +**Yes!** + +In the C reference implementation, **both IP address and port are included in the KDF input** from both sides of the connection. + +Inside `aes_create_keys()`, the KDF input explicitly contains: + +- `server_ip + client_port` +- `client_ip + server_port` +- followed by shared secret / nonces + +For IPv6: + +- IPv4 fields are zeroed +- IPv6 addresses are inserted + +However, **client_port and server_port remain part of the KDF regardless of IP version**. + +> If externally observed IP or port (e.g. due to NAT, SOCKS, or proxy traversal) differs from what the peer expects, the derived keys will not match and the handshake will fail. + +--- + +### Can port be excluded from KDF (e.g. by using port = 0)? + +**No!** + +The C-implementation provides **no mechanism to ignore the port**: + +- `client_port` and `server_port` are explicitly included in the KDF input +- Real socket ports are always passed: + - `c->our_port` + - `c->remote_port` + +If a port is `0`, it is still incorporated into the KDF as `0`. + +There is **no conditional logic to exclude ports** diff --git a/docs/MIDDLE-END-KDF.ru.md b/docs/MIDDLE-END-KDF.ru.md new file mode 100644 index 0000000..7a71b93 --- /dev/null +++ b/docs/MIDDLE-END-KDF.ru.md @@ -0,0 +1,41 @@ +# Middle-End Proxy + +## KDF Addressing — FAQ по реализации + +### Требует ли C-референсная реализация KDF внешний IP и порт? + +**Да** + +В C-референсе **в KDF участвуют и IP-адрес, и порт** — с обеих сторон соединения. + +В `aes_create_keys()` в строку KDF входят: + +- `server_ip + client_port` +- `client_ip + server_port` +- далее secret / nonces + +Для IPv6: + +- IPv4-поля заполняются нулями +- добавляются IPv6-адреса + +Однако **порты client_port и server_port всё равно участвуют в KDF**. + +> Если внешний IP или порт (например, из-за NAT, SOCKS или прокси) не совпадает с ожидаемым другой стороной — ключи расходятся и handshake ломается. + +--- + +### Можно ли исключить порт из KDF (например, установив порт = 0)? + +**Нет.** + +В C-референсе **нет механики отключения порта**. + +- `client_port` и `server_port` явно включены в KDF +- Передаются реальные порты сокета: + - `c->our_port` + - `c->remote_port` + +Если порт равен `0`, он всё равно попадёт в KDF как `0`. + +Отдельной логики «игнорировать порт» не предусмотрено. diff --git a/docs/QUICK_START_GUIDE.ru.md b/docs/QUICK_START_GUIDE.ru.md index 4bd0ae8..e6aca19 100644 --- a/docs/QUICK_START_GUIDE.ru.md +++ b/docs/QUICK_START_GUIDE.ru.md @@ -114,7 +114,7 @@ WantedBy=multi-user.target **5.** Для автоматического запуска при запуске системы в введите `systemctl enable telemt` -**6.** Для получите ссылки введите `journalctl -u telemt -n -g "links" --no-pager -o cat | tac` +**6.** Для получения ссылки введите `journalctl -u telemt -n -g "links" --no-pager -o cat | tac` ---