Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCTP] state cookie generation #72

Open
rainliu opened this issue Jun 29, 2021 · 1 comment
Open

[SCTP] state cookie generation #72

rainliu opened this issue Jun 29, 2021 · 1 comment
Labels
subcrate:sctp For issues specific to the SCTP crate

Comments

@rainliu
Copy link
Member

rainliu commented Jun 29, 2021

move webrtc-rs/sctp#1 to here

looking at the state cookie generation implementation, shouldn't it include HMAC generation and other things as mentioned here?
@lolgesten
Copy link
Contributor

According to the RFC:

Note: After sending out INIT ACK with the State Cookie parameter,
      "Z" MUST NOT allocate any resources or keep any states for the new
      association.  Otherwise, "Z" will be vulnerable to resource
      attacks.

And later regarding state cookie generation:

From the TCB, identify and collect the minimal subset of
       information needed to re-create the TCB, and generate a MAC using
       this subset of information and a secret key

The current impl creates all resources from start, and doesn't do this "delayed init" via the state cookie. This is probably okay since the SCTP state is bound to the underlying lifetime of the DTLS, which in turn depends on ICE. "Resource attacks" might be unlikely if the lower levels guards for it.

But it begs the question, what do we want to do with this issue?

It seems unnecessary to encode a bunch of stuff into the state cookie when we

a) not going to use it to recreate the TCB (Association) from it
b) could keep any state wanted (such as created time) in the Association directly

We could maybe enforce a timely init by having a 60 second lifetime of the cookie. That doesn't need to be stored in the cookie itself however.

@k0nserv k0nserv added the subcrate:sctp For issues specific to the SCTP crate label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subcrate:sctp For issues specific to the SCTP crate
Projects
None yet
Development

No branches or pull requests

3 participants