Skip to content

Fix Arbitrary batched tokens structures description #19

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

Conversation

thibmeu
Copy link
Contributor

@thibmeu thibmeu commented Nov 21, 2024

The description of arbitrary batched tokens structures did not satisfy with standard tls serialisation, and was ocnfusing.

This commit addresses:

  • token_requests array is prefixed with the length of its underlying byte array. The previous spec refered to the number of TokenRequest, which is incorrect.
  • token_requests array is an array of TokenRequest. It's only when serialized that it contains serialized TokenRequest. The wording has been updated.
  • TokenRequest serialization is not redefined. Its moved to a note instead of a struct definition.

The description of arbitrary batched tokens structures did not satisfy
with standard tls serialisation, and was ocnfusing.

This commit addresses:

* token_requests array is prefixed with the length of its underlying byte
  array. The previous spec refered to the number of TokenRequest, which
  is incorrect.
* toen_requests array is an array of TokenRequest. It's only when
  serialized that it contains serialized TokenRequest. The wording has
  been updated.
* TokenRequest serialization is not redefined. Its moved to a note
  instead of a struct definition.
@thibmeu
Copy link
Contributor Author

thibmeu commented Nov 21, 2024

Build error seems to be because I'm using a forked repository instead of the main one.

Copy link
Collaborator

@raphaelrobert raphaelrobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the incorrect encoding, I missed that one.

Comment on lines 407 to 414
Note that when serialiazed in network byte order, BatchTokenRequest:

- is prepended with a 2-octet integer representing the length of its underlying
byte array. This is not the number of TokenRequest.

- has each of its TokenRequest serialized in network byte order. Specifically,
this implies each TokenRequest is prepended with its length as a 2-octet
integer.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this paragraph for now. Instead, there should be a section about TLS encoding elsewhere that applies to all structs with vectors.
As mentioned at IETF121, I think we should use Variable-Size Vector Length Headers.
I can follow up with a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having a dedicated paragraph about all struct would be good.
the structure uses fixed array as these were the ones used in the already written batched private tokens.
having variable tokens would work as well. the upside is to allow for more tokens (2^30 instead of 2^16), and save 1 byte when there are less than 2^6 tokens. the downside is it's harder to bound the possible privacy leak (especially with arbitrary batched tokens).

removing it for now

thibmeu and others added 2 commits November 24, 2024 17:53
Co-authored-by: raphaelrobert <raphaelrobert@users.noreply.github.com>
Co-authored-by: raphaelrobert <raphaelrobert@users.noreply.github.com>
Copy link
Collaborator

@raphaelrobert raphaelrobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes

@raphaelrobert raphaelrobert merged commit 983a8a5 into ietf-wg-privacypass:main Nov 24, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants