Communicate the port over the signal exchange

This commit is contained in:
riccardom
2026-09-11 14:48:54 +02:00
parent 40b6a554c7
commit 6a42f7da00
5 changed files with 66 additions and 36 deletions
+7 -1
View File
@@ -54,7 +54,9 @@ type CredentialPayload struct {
RosenpassAddr string
// MlkemPayload is the opaque post-quantum KEM handshake message riding this
// OFFER/ANSWER (see Body.mlkemPayload). Nil when not running the PQ exchange.
MlkemPayload []byte
MlkemPayload []byte
// MlkemPort is the sender's ML-KEM PQ service UDP port (0 when not running).
MlkemPort int
RelaySrvAddress string
RelaySrvIP netip.Addr
SessionID []byte
@@ -95,6 +97,10 @@ func MarshalCredential(myKey wgtypes.Key, remoteKey string, p CredentialPayload)
if len(p.MlkemPayload) > 0 {
body.MlkemPayload = p.MlkemPayload
}
if p.MlkemPort > 0 {
port := uint32(p.MlkemPort)
body.MlkemPort = &port
}
return &proto.Message{
Key: myKey.PublicKey().String(),
RemoteKey: remoteKey,