correct distribution of PSKs

This commit is contained in:
Callan Bryant 2020-03-05 22:18:21 +00:00
parent b697afc2ee
commit 78b28be231
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
3 changed files with 2 additions and 8 deletions

3
add.go
View File

@ -51,12 +51,11 @@ func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) {
const peerConf = `[Interface]
Address = {{ .Peer.IP }}
PrivateKey={{ .Peer.PrivateKey.Key }}
PresharedKey={{ .Peer.PresharedKey.Key }}
DNS = {{ .DsnetConfig.DNS }}
[Peer]
PublicKey={{ .DsnetConfig.PrivateKey.PublicKey.Key }}
PresharedKey={{ .DsnetConfig.PresharedKey.Key }}
PresharedKey={{ .Peer.PresharedKey.Key }}
Endpoint={{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}
#AllowedIPs=0.0.0.0/0
AllowedIPs={{ .DsnetConfig.Network }}

View File

@ -44,7 +44,6 @@ type DsnetConfig struct {
// TODO Default subnets to route via VPN
ReportFile string `validate:"required"`
PrivateKey JSONKey `validate:"required,len=44"`
PresharedKey JSONKey `validate:"required,len=44"`
Peers []PeerConfig `validate:"dive"`
}

View File

@ -18,12 +18,8 @@ func Init() {
ExitFail("Refusing to overwrite existing %s", CONFIG_FILE)
}
privateKey := GenerateJSONPrivateKey()
presharedKey := GenerateJSONKey()
conf := DsnetConfig{
PrivateKey: privateKey,
PresharedKey: presharedKey,
PrivateKey: GenerateJSONPrivateKey()
ListenPort: DEFAULT_LISTEN_PORT,
Network: getRandomNetwork(),
Peers: []PeerConfig{},