diff options
Diffstat (limited to '')
-rw-r--r-- | conf/config.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/conf/config.go b/conf/config.go index f5f25add..1ce1988d 100644 --- a/conf/config.go +++ b/conf/config.go @@ -84,7 +84,7 @@ func (r *IPCidr) IPNet() net.IPNet { func (r *IPCidr) MaskSelf() { bits := int(r.Bits()) mask := net.CIDRMask(int(r.Cidr), bits) - for i := 0; i < bits / 8; i++ { + for i := 0; i < bits/8; i++ { r.IP[i] &= mask[i] } } @@ -238,3 +238,11 @@ func (conf *Config) DeduplicateNetworkEntries() { peer.AllowedIPs = peer.AllowedIPs[:i] } } + +func (conf *Config) Redact() { + conf.Interface.PrivateKey = Key{} + for i := range conf.Peers { + conf.Peers[i].PublicKey = Key{} + conf.Peers[i].PresharedKey = Key{} + } +} |