Return-Path: <owner-ips@ece.cmu.edu>
X-Sieve: cmu-sieve 2.0
Return-Path: <owner-ips@ece.cmu.edu>
Received: (from majordom@localhost)
	by ece.cmu.edu (8.11.0/8.10.2) id gBI1QwS08746
	for ips-outgoing; Tue, 17 Dec 2002 20:26:58 -0500 (EST)
X-Authentication-Warning: ece.cmu.edu: majordom set sender to owner-ips@ece.cmu.edu using -f
Received: from lion.ninthwonder.com (lion.ninthwonder.com [151.199.66.147])
	by ece.cmu.edu (8.11.0/8.10.2) with ESMTP id gBI1QuW08738
	for <ips@ece.cmu.edu>; Tue, 17 Dec 2002 20:26:56 -0500 (EST)
Received: by lion.ninthwonder.com (Postfix, from userid 1021)
	id B99BF30706; Tue, 17 Dec 2002 20:26:55 -0500 (EST)
Date: Tue, 17 Dec 2002 17:22:48 -0800 (PST)
From: Bill Studenmund <wrstuden@wasabisystems.com>
X-X-Sender:  <wrstuden@candlekeep.home-net.internetconnect.net>
To: <ips@ece.cmu.edu>
Subject: iSCSI: Kerb auth issue 1 - checksum
Message-ID: <Pine.NEB.4.33.0212171637530.478-100000@candlekeep.home-net.internetconnect.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-ips@ece.cmu.edu
Precedence: bulk

There is one aspect of Kerberos 5 mk_req/mk_rep authentication that was
not covered in the iSCSI draft, the use of a "checksum". In this context,
a "checksum" is generated from a string of data (will elaborate in a sec)
and is used to tie the kerberos authentication packet to a specific
authentication instance. Its intent is so that neither a man-in-the-middle
nor a passive listener can take the authentication info and authenticat
itself to the server in a separate connection; you can't re-use the
authentication info.

telnet uses: the authenticator's type and authentication "way." Not being
100% on telnet, I can't say more.

rsh uses: a string which contains the source port number, if encruption is
present, the remote command, and the remote username.

In this note I'd like to propose one for iSCSI.

I think the checksum string for iSCSI should contain the initiator name,
the isid, the target name, the target portal group tag, and the connection
id. This checksum would limit the reuse window of kerberos authentication
data to doing a login-with-auth-logout of the just-created connection. I
think the initiator would notice this.

Specifically I think the string should be (indistinguishable from) the
output of:

	uint8_t		*initiator_name, *target_name;
	uint8_t		buffer[SIZE_LARGE_ENOUGH_TO_NOT_OVERFLOW];
	uint8_t		isid_buffer[6];
	uint64_t	isid;
	uint16_t	tsih;
	uint16_t	connid;

	/*
	 * Assume that initiator_name, target_name, tsih, and connid are
	 * initialized to the appropriate values, and that isid_buffer
	 * contains a copy of the isid used
	 */

	/* turn the isid buffer into a 64-bit big-endian number */
	isid = ((uint64_t)ntohl(*((uint32_t *)isid_buffer))) << 16
		| ntohs(*((uint16_t *)(&isid_buffer[4])));

	sprintf(buffer, "%si%" PRIx64 ",%st%x,%d",
		initiator_name, isid, target_name, tsih, connid);

PRIx64 is the c99 printf macro that will give the correct formatting to
print a 64-bit number in hex.

Note that the isid handling above is equivalent to the hex string
representation of the isid as a binary string (without the leading 0x).

For the initiator name "iqn.2000-05.com.wasabisystems.wonderdriver",
target name "iqn.2000-05.com.wasabisystems.storagebox", isid
0x400038873ff4 (inside Wasabi's enterprise number), tsih 1, and connection
id 64, the checksum string would be:

"iqn.2000-05.com.wasabisystems.wonderdriveri400038873ff4,iqn.2000-05.com.wasabisystems.storageboxt1,64"

Thoughts?

Take care,

Bill

