frontend(iscsi): keep CHAP challenge in security stage

This commit is contained in:
pingqiu committed 2026-05-05 00:18:40 -07:00
1 parent 5394b21d75
commit f8b5701594
2 files changed
+4

No files matched your search

@@ -236,6 +236,7 @@ func (ln *LoginNegotiator) HandleLoginPDU(req *PDU, resolver TargetResolver) *PD
if ln.chapRequiredForSession() && !ln.chapOK {
if _, challenged := respParams.Get("CHAP_C"); challenged {
transit = false
nsg = StageSecurityNeg
} else {
setLoginReject(resp, LoginStatusInitiatorErr, LoginDetailAuthFailed)
return resp
@@ -275,6 +275,9 @@ func TestLoginNegotiator_CHAP_ChallengeIgnoresPrematureTransit(t *testing.T) {
if resp.LoginTransit() {
t.Fatal("response should not transit before CHAP_N/CHAP_R is verified")
}
if resp.LoginNSG() != iscsi.StageSecurityNeg {
t.Fatalf("NSG=%d want SecurityNeg while challenge is outstanding", resp.LoginNSG())
}
if neg.Phase() != iscsi.LoginPhaseSecurity {
t.Fatalf("phase=%v want Security", neg.Phase())
}