diff --git a/seaweed-block/core/frontend/iscsi/login.go b/seaweed-block/core/frontend/iscsi/login.go index a17f416671..c0e665f082 100644 --- a/seaweed-block/core/frontend/iscsi/login.go +++ b/seaweed-block/core/frontend/iscsi/login.go @@ -441,7 +441,6 @@ func (ln *LoginNegotiator) handleCHAPSecurity(req *Params, resp *PDU, respParams return false } ln.chapOK = true - respParams.Set("AuthMethod", "CHAP") return true } if alg, hasAlg := req.Get("CHAP_A"); hasAlg { diff --git a/seaweed-block/core/frontend/iscsi/login_test.go b/seaweed-block/core/frontend/iscsi/login_test.go index 8bcab07bfe..7fa0a57bb8 100644 --- a/seaweed-block/core/frontend/iscsi/login_test.go +++ b/seaweed-block/core/frontend/iscsi/login_test.go @@ -255,8 +255,8 @@ func TestLoginNegotiator_CHAP_ChallengeThenLoginOp(t *testing.T) { if err != nil { t.Fatalf("ParseParams round 3: %v", err) } - if v, _ := resp3Params.Get("AuthMethod"); v != "CHAP" { - t.Fatalf("round 3 AuthMethod=%q want CHAP", v) + if v, ok := resp3Params.Get("AuthMethod"); ok { + t.Fatalf("round 3 AuthMethod=%q should not be echoed after CHAP_R", v) } if neg.Phase() != iscsi.LoginPhaseOperational { t.Fatalf("phase=%v want Operational", neg.Phase())