cloudflare / cloudflare/boringtun

The wireguard_write encryption result is different from the official one

Open
#353 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
7.2k
Forks
532
PR merge metrics
No merged PRs in 30d

Description

Hi!

client: windows 10
server : centos 9

I used wireguard.exe and the allowed IP is 8.8.8.8.When I ping 8.8.8.8, I find that the original ICMP packet size is 60bit. 64bit after being encrypted by wireguard.

![企业微信截图_16899020368439](https://github.com/cloudflare/boringtun/assets/42455603/334b09fc-2496-40bf-a285-7859900a8016)
![企业微信截图_16899018169422](https://github.com/cloudflare/boringtun/assets/42455603/8d4e2c1f-b6a2-443f-8909-9fa36b56e970)
When I use wireguard_write, I find that it is still 60bit after encryption, and my server is not responding to the package.
![企业微信截图_16899037372229](https://github.com/cloudflare/boringtun/assets/42455603/25a1da75-2727-45aa-9af6-b60d22a927ad)

My IP packet processing flow:
1.use windivert to get the IP package (60bit)
2. changed the sending address of the IP packet to 10.66.66.2 and recalculated the checksum
3. use wireguard_write to encrypt
4. udp socket send the result of step 3.
Is there anything else I need to do?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.