Skip to content

Conversation

@ImanAfaneh293
Copy link
Contributor

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using tox)
  • If the PR is still not finished, please create a Draft Pull Request

fixes #xxx

When icv_size is set to 8 or 12, the encrypted packet should contain a
truncated ICV of that length. Previously, the implementation always
defaulted to the full 16-byte ICV for AES-GCM, ignoring the configured
truncation.

This change ensures:
1. Encryption truncates the generated tag to the requested icv_size using
the Cipher API.
2. Decryption correctly verifies packets with truncated tags using the
   Cipher API.

Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.84%. Comparing base (f303033) to head (ec22ff5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4902   +/-   ##
=======================================
  Coverage   80.84%   80.84%           
=======================================
  Files         369      369           
  Lines       90968    90989   +21     
=======================================
+ Hits        73544    73563   +19     
- Misses      17424    17426    +2     
Files with missing lines Coverage Δ
scapy/layers/ipsec.py 90.39% <100.00%> (+0.39%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant