Skip to content

fix(gcm): reset AEAD packet/nonce counters during key exchanges#166

Merged
vicajilau merged 8 commits into
masterfrom
fix/165-gcm-nonce-reset
Jun 14, 2026
Merged

fix(gcm): reset AEAD packet/nonce counters during key exchanges#166
vicajilau merged 8 commits into
masterfrom
fix/165-gcm-nonce-reset

Conversation

@vicajilau

@vicajilau vicajilau commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #165.

This PR resets the AES-GCM AEAD packet/nonce invocation counters _localAeadPacketCount and _remoteAeadPacketCount to 0 whenever new cipher keys are derived and applied (i.e. on NEWKEYS / key exchanges), matching the requirements for GCM in the SSH transport protocol.

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.83%. Comparing base (0d121d2) to head (6e7d988).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
- Coverage   52.83%   52.83%   -0.01%     
==========================================
  Files          63       63              
  Lines        5125     5127       +2     
==========================================
+ Hits         2708     2709       +1     
- Misses       2417     2418       +1     
Flag Coverage Δ
unittests 52.83% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/src/ssh_transport.dart 51.37% <100.00%> (+0.16%) ⬆️

... and 1 file with indirect coverage changes

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

@vicajilau vicajilau merged commit 8a19446 into master Jun 14, 2026
3 checks passed
@vicajilau vicajilau deleted the fix/165-gcm-nonce-reset branch June 14, 2026 08:08
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.

message authentication code incorrect with AES-GCM ciphers immediately after NEWKEYS

1 participant