wgengine/magicsock: change API to not permit disco key changes

Generate the disco key ourselves and give out the public half instead.

Fixes #525
This commit is contained in:
Brad Fitzpatrick
2020-07-06 12:10:39 -07:00
parent 32156330a8
commit 6196b7e658
6 changed files with 20 additions and 25 deletions

View File

@ -361,9 +361,7 @@ func (b *LocalBackend) Start(opts Options) error {
var discoPublic tailcfg.DiscoKey
if controlclient.Debug.Disco {
discoPrivate := key.NewPrivate()
b.e.SetDiscoPrivateKey(discoPrivate)
discoPublic = tailcfg.DiscoKey(discoPrivate.Public())
discoPublic = b.e.DiscoPublicKey()
}
var err error