From d9cdab324df0189be2ca39c0ebf5f7ac6d7d0ea3 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 5 May 2026 00:29:08 -0700 Subject: [PATCH] frontend(iscsi): omit final CHAP auth echo --- seaweed-block/core/frontend/iscsi/login.go | 1 - seaweed-block/core/frontend/iscsi/login_test.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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())