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

Fix minimum MAC size this fixes a deserialization error #1159

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

tdittr
Copy link
Contributor

@tdittr tdittr commented Oct 30, 2023

Before the last extension was always ignored if it was not at least 32 bytes without padding.

@tdittr tdittr force-pushed the fix-ef-min-length branch from 05b6a9c to 3bd9ac6 Compare October 31, 2023 08:49
@tdittr tdittr marked this pull request as ready for review October 31, 2023 08:49
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (39a15e9) 85.54% compared to head (ea720e9) 85.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1159      +/-   ##
==========================================
- Coverage   85.54%   85.52%   -0.03%     
==========================================
  Files          57       57              
  Lines       15720    15699      -21     
==========================================
- Hits        13448    13426      -22     
- Misses       2272     2273       +1     
Files Coverage Δ
ntp-proto/src/packet/extension_fields.rs 93.35% <ø> (-0.26%) ⬇️
ntp-proto/src/packet/mac.rs 84.21% <ø> (ø)
ntp-proto/src/packet/mod.rs 85.00% <94.44%> (+0.10%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rnijveld
Copy link
Member

@tdittr You can merge this after a rebase :)

Before the last extension was always ignored if it was not at least 32
bytes without padding.

Removed a test that did check for the wrong behavior
This test checked that a too short field was not actually serialized at
all, which is wrong. Making the encrypted field this short is also not
possible as the nonce alone is 16bytes + 4bytes of ef header + 4 bytes
NTS header...
@tdittr tdittr force-pushed the fix-ef-min-length branch from 3bd9ac6 to ea720e9 Compare October 31, 2023 12:58
@tdittr tdittr merged commit c5219c2 into main Oct 31, 2023
20 checks passed
@tdittr tdittr deleted the fix-ef-min-length branch October 31, 2023 13:04
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.

3 participants