From ba52356e6c477d51c3bfd2dea948c822760be89c Mon Sep 17 00:00:00 2001 From: Russ Magee Date: Sat, 14 Sep 2019 22:56:03 -0700 Subject: [PATCH] Made default deeper in init funcs HERRADURAKEX512 Signed-off-by: Russ Magee --- hkexnet/consts.go | 1 + hkexnet/hkexnet.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hkexnet/consts.go b/hkexnet/consts.go index 0916090..cd90130 100644 --- a/hkexnet/consts.go +++ b/hkexnet/consts.go @@ -11,6 +11,7 @@ package hkexnet // // Specified (in string form) as the extensions parameter // to hkexnet.Dial() +// Alg is sent in a uint8 so there are up to 256 possible const ( KEX_HERRADURA256 = iota // this MUST be first for default if omitted in ctor KEX_HERRADURA512 diff --git a/hkexnet/hkexnet.go b/hkexnet/hkexnet.go index a085a12..a4e4a65 100644 --- a/hkexnet/hkexnet.go +++ b/hkexnet/hkexnet.go @@ -213,7 +213,7 @@ func _new(kexAlg KEXAlg, conn *net.Conn) (hc *Conn, e error) { log.Printf("[KEx alg %d accepted]\n", kexAlg) default: // UNREACHABLE: _getkexalgnum() guarantees a valid KEX value - hc.kex = KEX_HERRADURA256 + hc.kex = KEX_HERRADURA512 log.Printf("[KEx alg %d ?? defaults to %d]\n", kexAlg, hc.kex) } return @@ -273,7 +273,7 @@ func (hc *Conn) applyConnExtensions(extensions ...string) { } func getkexalgnum(extensions ...string) (k KEXAlg) { - k = KEX_HERRADURA256 // default + k = KEX_HERRADURA512 // default for _, s := range extensions { switch s { case "KEX_HERRADURA256":