mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
frontend(iscsi): keep CHAP challenge in security stage
This commit is contained in:
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())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user