Repository navigation
Conversation
Transport._parse_kex_init raised IncompatiblePeer ("no acceptable macs")
whenever the two sides' MAC lists had no overlap, even when the negotiated
cipher is an AEAD (aes*[email protected]). AEAD ciphers authenticate packets
themselves, and draft-miller-sshm-aes-gcm (the rules OpenSSH and others use
in place of RFC 5647's) says MAC negotiation MUST be skipped in that case
and that failing to agree on a MAC MUST NOT cause connection failure. Peers
sending an empty MAC list alongside AES-GCM were therefore unreachable.
Only require an agreed MAC, per direction, when that direction's cipher is
not AEAD, and stop looking up MAC parameters for AEAD ciphers when
activating the inbound/outbound cipher (the MAC may now be unset).
Non-AEAD ciphers still fail without a shared MAC; a test covers this.
Fixes paramiko#2491.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KEznjXd8oFYDG6RiwXtZuE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transport._parse_kex_init raised IncompatiblePeer ("no acceptable macs") whenever the two sides' MAC lists had no overlap, even when the negotiated cipher is an AEAD (aes*[email protected]). AEAD ciphers authenticate packets themselves, and draft-miller-sshm-aes-gcm (the rules OpenSSH and others use in place of RFC 5647's) says MAC negotiation MUST be skipped in that case and that failing to agree on a MAC MUST NOT cause connection failure. Peers sending an empty MAC list alongside AES-GCM were therefore unreachable.
Only require an agreed MAC, per direction, when that direction's cipher is not AEAD, and stop looking up MAC parameters for AEAD ciphers when activating the inbound/outbound cipher (the MAC may now be unset).
Non-AEAD ciphers still fail without a shared MAC; a test covers this.
Fixes #2491.
Additional information:
AEAD ciphers (aes*[email protected]) authenticate packets themselves, so a
separate MAC isn't needed. Per draft-miller-sshm-aes-gcm, when an AEAD cipher
is selected "MAC negotiation MUST be skipped" and failing to agree on a MAC
"MUST NOT cause connection failure". Paramiko instead raised IncompatiblePeer
("no acceptable macs") for peers that send an empty/disjoint MAC list.
References:
Non-AEAD ciphers still require a shared MAC; there's a test for that.