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

refactor: move stuffer hex methods out of testlib #4653

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

lrstewart
Copy link
Contributor

Description of changes:

We need to be able to read / write hex for JA4. In this change, I take the testlib/s2n_stuffer_hex.c methods and clean them up for non-test use:

  • I deleted the methods that weren't being used and weren't needed for JA4 (the uint32 and uint64 versions). They're easy enough to add back later if we need them, but removing them reducing the testing area for now.
  • I rewrote the s2n_stuffer_read_hex and s2n_stuffer_write_hex methods to be lighter weight and only do one stuffer read / write
  • I made everything return S2N_RESULT

Call-outs:

This PR doesn't include the CBMC proofs we need for stuffer methods. It was already pretty large, so I'll put the proofs in a follow-up PR. I've written them, and they're passing locally.

Testing:

I also rewrote the tests. I didn't think the existing tests were clear enough about what was being tested, and there weren't enough known-value tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jul 17, 2024
@lrstewart lrstewart force-pushed the ja4_hex branch 2 times, most recently from 245767b to 0bec353 Compare July 17, 2024 17:34
@lrstewart lrstewart marked this pull request as ready for review July 17, 2024 17:53
stuffer/s2n_stuffer_hex.c Outdated Show resolved Hide resolved
stuffer/s2n_stuffer_hex.c Show resolved Hide resolved
stuffer/s2n_stuffer_hex.c Outdated Show resolved Hide resolved
stuffer/s2n_stuffer_hex.c Outdated Show resolved Hide resolved
@lrstewart lrstewart requested a review from goatgoose July 22, 2024 06:34
@lrstewart lrstewart enabled auto-merge July 23, 2024 05:29
@lrstewart lrstewart added this pull request to the merge queue Jul 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 23, 2024
@lrstewart lrstewart added this pull request to the merge queue Jul 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 23, 2024
@lrstewart lrstewart merged commit 4b15a4b into aws:main Jul 23, 2024
34 checks passed
@lrstewart lrstewart deleted the ja4_hex branch July 23, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants