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

JSEP restriction on session ID is 2^62, should be 2^63 or 2^64 #855

Closed
alvestrand opened this issue Nov 3, 2018 · 9 comments
Closed

JSEP restriction on session ID is 2^62, should be 2^63 or 2^64 #855

alvestrand opened this issue Nov 3, 2018 · 9 comments
Assignees
Labels

Comments

@alvestrand
Copy link
Contributor

JSEP -24 currently says:

  The sess-id MUST be representable by a 64-bit signed
  integer, and the initial value MUST be less than (2**62)-1, as
  required by [RFC3264].  It is RECOMMENDED that the sess-id be
  constructed by generating a 64-bit quantity with the two highest
  bits being set to zero and the remaining 62 bits being
  cryptographically random.

There are two problems here:

  • RFC 3264 actually doesn't place that restriction on the sess-id, that's the restriction on the version field.

  • Deployed code (libwebrtc) generates sess-ids that are larger than 2^62-1

Quote from RFC 3264:

The offer (and answer) MUST be a valid SDP message, as defined by RFC
2327 [1], with one exception. RFC 2327 mandates that either an e or
a p line is present in the SDP message. This specification relaxes
that constraint; an SDP formulated for an offer/answer application
MAY omit both the e and p lines. The numeric value of the session id
and version in the o line MUST be representable with a 64 bit signed
integer. The initial value of the version MUST be less than
(2**62)-1, to avoid rollovers. Although the SDP specification allows
for multiple session descriptions to be concatenated together into a
large SDP message, an SDP message used in the offer/answer model MUST
contain exactly one session description.

So what's easiest to change, deployed code or JSEP?

@nils-ohlmeier
Copy link

Firefox also creates session IDs > 2^62.

The restriction in JSEP looks to me like someone accidentally put the requirements from 3264 version field onto the session ID.

I think this should be fixed in JSEP.

@juberti
Copy link
Contributor

juberti commented Nov 3, 2018

Would changing to 2^63 (and removing the citation for 3264) be sufficient?
cc @ekr

@nils-ohlmeier
Copy link

nils-ohlmeier commented Nov 3, 2018

Would changing to 2^63 (and removing the citation for 3264) be sufficient?

I think so yes. Firefox already does generate 2^63 session IDs.

@fluffy
Copy link
Contributor

fluffy commented Nov 4, 2018

I think saying 2^63 is probably wrong. Lets say that we changed it to 2^63 an something randomly choose a number very close to 2^63 then when that number got incremented a few times, it could be larger than 2^63. And do the ABNF silliness we don't have a way to represent this. We could do something like 2^63 - 1,000,000 or something if people had some sort of real concern about this extra bit.

@nils-ohlmeier
Copy link

We are talking about the session ID, which is not suppose to be incremented if I'm not mistaken. So the roll over concerns should only apply to the version.

@fluffy
Copy link
Contributor

fluffy commented Nov 4, 2018

@nils-ohlmeier is correct. I need coffee.

@juberti juberti added the triaged label Nov 6, 2018
juberti added a commit that referenced this issue Nov 8, 2018
Fixes #855
Also add ip-handling reference
@ghost ghost assigned juberti Nov 8, 2018
@ghost ghost added the in progress label Nov 8, 2018
@juberti
Copy link
Contributor

juberti commented Nov 8, 2018

PTAL at #858

@nils-ohlmeier
Copy link

Looks like @juberti was faster then me in creating a PR. Thank you.

@juberti
Copy link
Contributor

juberti commented Nov 9, 2018

yeah, next time I will read the etherpad notes first :)

@ghost ghost removed the in progress label Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants