mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Merge branch 'master' into kcp-udp
This commit is contained in:
commit
3b73c6d731
2 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ package hkexnet
|
||||||
//
|
//
|
||||||
// Specified (in string form) as the extensions parameter
|
// Specified (in string form) as the extensions parameter
|
||||||
// to hkexnet.Dial()
|
// to hkexnet.Dial()
|
||||||
|
// Alg is sent in a uint8 so there are up to 256 possible
|
||||||
const (
|
const (
|
||||||
KEX_HERRADURA256 = iota // this MUST be first for default if omitted in ctor
|
KEX_HERRADURA256 = iota // this MUST be first for default if omitted in ctor
|
||||||
KEX_HERRADURA512
|
KEX_HERRADURA512
|
||||||
|
|
|
@ -213,7 +213,7 @@ func _new(kexAlg KEXAlg, conn *net.Conn) (hc *Conn, e error) {
|
||||||
log.Printf("[KEx alg %d accepted]\n", kexAlg)
|
log.Printf("[KEx alg %d accepted]\n", kexAlg)
|
||||||
default:
|
default:
|
||||||
// UNREACHABLE: _getkexalgnum() guarantees a valid KEX value
|
// 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)
|
log.Printf("[KEx alg %d ?? defaults to %d]\n", kexAlg, hc.kex)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -273,7 +273,7 @@ func (hc *Conn) applyConnExtensions(extensions ...string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getkexalgnum(extensions ...string) (k KEXAlg) {
|
func getkexalgnum(extensions ...string) (k KEXAlg) {
|
||||||
k = KEX_HERRADURA256 // default
|
k = KEX_HERRADURA512 // default
|
||||||
for _, s := range extensions {
|
for _, s := range extensions {
|
||||||
switch s {
|
switch s {
|
||||||
case "KEX_HERRADURA256":
|
case "KEX_HERRADURA256":
|
||||||
|
|
Loading…
Reference in a new issue