Subject: Question about SCTP AUTH information structure (SCTP_AUTHINFO)

From: Wei Yongjun <[email-masked]>
Date: Wed, 03 Mar 2010 15:08:06 +0800

Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 7bit

Hi all:

The draft-ietf-tsvwg-sctpsocket-21.txt include the following test:

5.2.8.  SCTP AUTH Information Structure (SCTP_AUTHINFO)

   This cmsghdr structure specifies SCTP options for sendmsg().

          +--------------+---------------+----------------------+
          | cmsg_level   | cmsg_type     | cmsg_data[]          |
          +--------------+---------------+----------------------+
          | IPPROTO_SCTP | SCTP_AUTHINFO | struct sctp_authinfo |
          +--------------+---------------+----------------------+

   Here is the definition of the sctp_authinfo structure:

   struct sctp_authinfo {
     uint16_t auth_keyid;
   };

   auth_keyid:  This specifies the shared key identifier used for
      sending the user message.

   An sctp_authinfo item always corresponds to the data in msg_iov.

What is the action when the user DATA chunk be bundled with other
DATA chunk, if We specified different shared key identifier to
those user DATAs?

Regards

Wei Yongjun

---

From: Randy Stewart <[email-masked]>
Date: Fri, 5 Mar 2010 04:34:20 -0800

Yongjun-san

I believe when you send with this option you are changing the
key number that you are using. So any new chunks sent at that
point that are auth'd are now using the new key. If each
send specified a different key you would end up with the maybe the last
key as the active one.

At least that is my guess.. Michael?

R

>   This cmsghdr structure specifies SCTP options for sendmsg().

-----
Randall Stewart
[email-masked]

---

From: Michael Tuexen <[email-masked]>
Date: Fri, 5 Mar 2010 13:41:05 +0100

> point that are auth'd are now using the new key. If each
NO. it only allies to the message you sent down.
> At least that is my guess.. Michael?
When you use the SCTP_AUTHINFO it does only apply to the message
you are currently sending. When you want to change the "default",
you use the SCTP_AUTH_ACTIVE_KEY socket option.

Best regards
Michael

---

From: Randy Stewart <[email-masked]>
Date: Fri, 5 Mar 2010 05:03:12 -0800

Hmm.. having not paid much attention to that section of
the text ;-)

So when I send down a key with a message only that message
gets the key... interesting... Is this useful for some reason?

I mean why not just change the key??

R

-----
Randall Stewart
[email-masked]

---

From: Michael Tuexen <[email-masked]>
Date: Fri, 5 Mar 2010 14:41:07 +0100

> gets the key... interesting... Is this useful for some reason?
The key is something specific to the user message. You can
use a default or a specific value. Like the PPID, where you
can provide a CMSG or set the default. For DTLS we only have
on key (sendingwise) at a time, but the API is generic.
> I mean why not just change the key??
Then you need
getsockopt(old_key);
if (oldkey != newkey)
	setsockopt(new_key);
send();
if (oldkey!=newkey)
	setsockopt(oldkey);
However, this breaks when you have multiple threads. So having
a way to do this atomically with the send call is the right
way, I think.

Best regards
Michael

---

From: "Brian F. G. Bidulock" <[email-masked]>
Date: Fri, 5 Mar 2010 11:33:57 -0700

Michael,

Michael Tuexen wrote:                       (Fri, 05 Mar 2010 14:41:07)
> a way to do this atomically with the send call is the right

Why not just use sendmsg() with newkey
as ancillary data?

--brian

-- 
Brian F. G. Bidulock
[email-masked]
http://www.openss7.org/