Repository navigation
[paramiko] Update to 5.1.* - #16640
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
srittau
requested changes
Oct 29, 2026
Comment on lines
+9
to
+10
| c_MSG_KEX_HYBRID_INIT: bytes | ||
| c_MSG_KEX_HYBRID_REPLY: bytes |
Collaborator
There was a problem hiding this comment.
Suggested change
| c_MSG_KEX_HYBRID_INIT: bytes | |
| c_MSG_KEX_HYBRID_REPLY: bytes | |
| c_MSG_KEX_HYBRID_INIT: Final = b"\x1e" | |
| c_MSG_KEX_HYBRID_REPLY: Final = b"\x1f" |
| c_MSG_KEX_HYBRID_REPLY: bytes | ||
|
|
||
| class KexMLKEM768X25519: | ||
| name: str |
Collaborator
There was a problem hiding this comment.
Suggested change
| name: str | |
| name: Final = "mlkem768x25519-sha256" |
|
|
||
| class KexMLKEM768X25519: | ||
| name: str | ||
| hash_algo: Callable[[ReadableBuffer], _Hash] |
Collaborator
There was a problem hiding this comment.
Suggested change
| hash_algo: Callable[[ReadableBuffer], _Hash] | |
| hash_algo: ClassVar[Callable[[ReadableBuffer], _Hash]] |
| hash_algo: Callable[[ReadableBuffer], _Hash] | ||
| transport: Transport | ||
| # cryptography.hazmat.primitives.asymmetric.mlkem.MLKEM768PrivateKey, added in cryptography 48 | ||
| mlkem_key: Incomplete | None |
Collaborator
There was a problem hiding this comment.
Suggested change
| mlkem_key: Incomplete | None | |
| mlkem_key: MLKEM768PrivateKey | None |
This needs import from from cryptography.hazmat.primitives.asymmetric. This also requires cryptography >= 47.0.0. I think it's fine to bump the dependency in METADATA.toml.
Contributor
Author
|
Thanks, all four applied. I checked the versions: |
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
approved these changes
Oct 29, 2026
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.
Closes: #16561
stubtest failed on the stubsabot bump with one error:
paramiko.kex_mlkem failed to find stubs. paramiko 5.1 adds that module for themlkem768x25519-sha256hybrid key exchange (ML-KEM-768 with X25519), andTransportprefers it when it is available.The new
kex_mlkem.pyifollowskex_curve25519.pyi: the two message constants, andKexMLKEM768X25519withname,hash_algo,transport, the two private keys,is_available,start_kexandparse_next.mlkem_keyholds acryptography.hazmat.primitives.asymmetric.mlkem.MLKEM768PrivateKey, which only exists from cryptography 48, while these stubs requirecryptography>=37.0.0. Rather than raise that floor, I typed it asIncomplete | Nonewith a comment. Happy to switch to the real type and bump the dependency if you prefer.stubtest for paramiko 5.1,
mypy_test.py stubs/paramiko,pyright_test.py stubs/paramiko(with cryptography installed), black, ruff and flake8 pass locally.