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

Add Sequence Token Generator ? #2175

Open
sbernard31 opened this issue Sep 5, 2023 · 3 comments
Open

Add Sequence Token Generator ? #2175

sbernard31 opened this issue Sep 5, 2023 · 3 comments

Comments

@sbernard31
Copy link
Contributor

I understand that current default TokenGenerator is random based.

Looking at 4.2. Updated Token Processing Requirements for Clients , It seems that recommended way is a sequence number.

When CoAP is used with a security protocol not providing bindings between requests and responses, the Tokens have cryptographic importance. The client MUST make sure that Tokens are not used in a way so that responses risk being associated with the wrong request.

One easy way to accomplish this is to implement the Token (or part of the Token) as a sequence number, starting at zero for each new or rekeyed secure connection. This approach SHOULD be followed.

Do you think that SequenceGenerator should be added and/or maybe use as default ?

@boaks
Copy link
Contributor

boaks commented Sep 5, 2023

It seems that recommended way is a sequence number.

And previously, it was a random.

Do you think that SequenceGenerator should be added and/or maybe use as default ?

If you like to add one, OK. I don't think, it makes sense to use it as default.
Anyway, it's easy to define it as application specific default, if someone wants that.

@boaks
Copy link
Contributor

boaks commented Sep 5, 2023

By the way, assuming that such an attack would make only sense say within 24h. How many, say 4 bytes token are emitted usually in 24h per device? What will be the probability, that one of 4 byte tokens are reused within 24h?
And just to say, if the DTLS sequence number receive window is enabled, what will be left of that attack?

@boaks
Copy link
Contributor

boaks commented Feb 10, 2024

The API is able to work with a custom implementation of TokenGenerator. If someone is interested, please go for it. In the case someone wants to contribute it, that will be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants