Changed Dial opt from "-R" to "OPT_REMOD"

This commit is contained in:
Russ Magee 2023-11-20 20:52:03 -08:00
parent aac48496f0
commit eef71dd59c
3 changed files with 4 additions and 4 deletions

View File

@ -972,7 +972,7 @@ func main() { //nolint: funlen, gocyclo
remodExtArg := "" remodExtArg := ""
if remodRequested { if remodRequested {
remodExtArg = "-R" remodExtArg = "OPT_REMOD"
} }
// Pass opt to Dial() via extensions arg // Pass opt to Dial() via extensions arg
conn, err := xsnet.Dial(proto, server, cipherAlg, hmacAlg, kexAlg, kcpMode, remodExtArg) conn, err := xsnet.Dial(proto, server, cipherAlg, hmacAlg, kexAlg, kcpMode, remodExtArg)

View File

@ -709,7 +709,7 @@ func main() { //nolint:funlen,gocyclo
// proposes to use it. // proposes to use it.
if !remodSupported { if !remodSupported {
if (conn.Opts() & xsnet.CORemodulateShields) != 0 { if (conn.Opts() & xsnet.CORemodulateShields) != 0 {
logger.LogDebug("[client proposed -R, but we don't support it.]") logger.LogDebug("[client proposed cipher/hmac remod, but we don't support it.]")
conn.Close() conn.Close()
continue continue
} }

View File

@ -363,8 +363,8 @@ func (hc *Conn) applyConnExtensions(extensions ...string) {
log.Println("[extension arg = H_SHA512]") log.Println("[extension arg = H_SHA512]")
hc.cipheropts &= (0xFFFF00FF) hc.cipheropts &= (0xFFFF00FF)
hc.cipheropts |= (HmacSHA512 << 8) hc.cipheropts |= (HmacSHA512 << 8)
case "-R": case "OPT_REMOD":
log.Println("[extension arg = -R]") log.Println("[extension arg = OPT_REMOD]")
hc.opts |= CORemodulateShields hc.opts |= CORemodulateShields
//default: //default:
// log.Printf("[Dial ext \"%s\" ignored]\n", s) // log.Printf("[Dial ext \"%s\" ignored]\n", s)