libiscsi icon indicating copy to clipboard operation
libiscsi copied to clipboard

CHAP_A tests does not seem to work as expected

Open martinhoyer opened this issue 1 year ago • 0 comments

While investigating a test failure of iSCSI.iSCSICHAP.Invalid test, we noticed that the test is sending CHAP_A=5 instead of CHAP_A=56 or null using tcpdump.

https://github.com/sahlberg/libiscsi/blob/03e9ddc0a61fa64d84cb4faa4c06b42f694e2301/test-tool/test_iscsi_chap.c#L93 In chap_mod_strip_replace_queue, this part is the culprit:

	ret = test_iscsi_strip_tag(iscsi, pdu, "CHAP_A=");
	if (ret == -ENOENT) {
		logging(LOG_VERBOSE, "ignoring login PDU without CHAP_A");
		goto out;
	}

as the strip_tag returns -ENOENT and the replace_queue function goes directly to return orig_queue_pdu(iscsi, pdu);, which leads to above-mentioned sending of CHAP_A=5, which results in test wrongly assuming iSCSI login should fail.

martinhoyer avatar Nov 22 '23 13:11 martinhoyer