mirror of
https://github.com/fosrl/olm.git
synced 2026-05-06 10:47:55 -05:00
[PR #98] [MERGED] Fix crash when peer has nil publicKey in site config #99
Reference in New Issue
Block a user
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/fosrl/olm/pull/98
Author: @AndreGilerson
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @oschwartz10612
Base:
dev← Head:dev📝 Commits (1)
99e6357Fix crash when peer has nil publicKey in site config📊 Changes
2 files changed (+11 additions, -0 deletions)
View changed files
📝
olm/connect.go(+6 -0)📝
olm/peer.go(+5 -0)📄 Description
Describe the Bug
The OLM client crashes with a WireGuard IPC error when any site in the server response has a
nilpublicKey. The client does not validate or skip peers with missing keys, causing the entire tunnel setup to fail, even if other sites have valid keys.This happened on my setup, because I had a few unrelated issues with setting up the pangolin server and i was regularly resetting the server. I had two sites setup, and at some point one of the sites was turned off, and never logged back in again to update its key, but was still registered with the server. After i fixed the other issue (which were unrelated and caused by a wrong port config in the firewall where i opened one of the ports only for TCP and not UDP traffic) the cli refused to connect with the error message below until I had reconnected the second site.
I believe this is related to https://github.com/fosrl/olm/issues/32, but not entirely sure, because the issue is not describing the problem in greater detail.
Environment
But the bug has also been observed on the android play store app.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Skip sites with empty/nil publicKey instead of passing them to the WireGuard UAPI layer, which expects a valid 64-char hex string. A nil key occurs when a Newt site has never connected. Previously this caused all sites to fail with "hex string does not fit the slice".
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.