mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-15 15:20:44 -08:00
don't allow a useless handshake with yourself (#402)
* don't allow a useless handshake with yourself * remove helper
This commit is contained in:
parent
5506da3de9
commit
3aaaea6309
1 changed files with 8 additions and 0 deletions
|
|
@ -107,6 +107,14 @@ func ixHandshakeStage1(f *Interface, addr *udpAddr, packet []byte, h *Header) {
|
|||
certName := remoteCert.Details.Name
|
||||
fingerprint, _ := remoteCert.Sha256Sum()
|
||||
|
||||
if vpnIP == ip2int(f.certState.certificate.Details.Ips[0].IP) {
|
||||
l.WithField("vpnIp", IntIp(vpnIP)).WithField("udpAddr", addr).
|
||||
WithField("certName", certName).
|
||||
WithField("fingerprint", fingerprint).
|
||||
WithField("handshake", m{"stage": 1, "style": "ix_psk0"}).Error("Refusing to handshake with myself")
|
||||
return
|
||||
}
|
||||
|
||||
myIndex, err := generateIndex()
|
||||
if err != nil {
|
||||
l.WithError(err).WithField("vpnIp", IntIp(vpnIP)).WithField("udpAddr", addr).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue