Empty data segment during Login Phase is rather unlikely, but it's

not, by itself, a protocol error.  This fixes interoperability with
OpenBSD initiator.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-02-11 10:58:32 +00:00
parent 1885dba7b1
commit 017cbe4aaa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261752
3 changed files with 1 additions and 8 deletions

View File

@ -61,9 +61,6 @@ text_receive(struct connection *conn)
*/
if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0)
log_errx(1, "received Text PDU with unsupported \"C\" flag");
if (request->pdu_data_len == 0)
log_errx(1, "received Text PDU with empty data segment");
if (ntohl(bhstr->bhstr_cmdsn) < conn->conn_cmdsn) {
log_errx(1, "received Text PDU with decreasing CmdSN: "
"was %d, is %d", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn));

View File

@ -64,7 +64,7 @@ keys_load(struct keys *keys, const struct pdu *pdu)
size_t pair_len;
if (pdu->pdu_data_len == 0)
log_errx(1, "protocol error: empty data segment");
return;
if (pdu->pdu_data[pdu->pdu_data_len - 1] != '\0')
log_errx(1, "protocol error: key not NULL-terminated\n");

View File

@ -128,10 +128,6 @@ login_receive(struct connection *conn, bool initial)
log_errx(1, "received Login PDU with unsupported "
"Version-min 0x%x", bhslr->bhslr_version_min);
}
if (request->pdu_data_len == 0) {
login_send_error(request, 0x02, 0x00);
log_errx(1, "received Login PDU with empty data segment");
}
if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) {
login_send_error(request, 0x02, 0x05);
log_errx(1, "received Login PDU with decreasing CmdSN: "