Skip to content

Commit e0aae18

Browse files
Apply review: Final constants, ClassVar hash_algo, MLKEM768PrivateKey
1 parent 4866176 commit e0aae18

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎stubs/paramiko/METADATA.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version = "5.1.*"
22
upstream-repository = "https://github.com/paramiko/paramiko"
3-
# Requires a version of cryptography where cryptography.hazmat.primitives.ciphers.Cipher is generic
4-
dependencies = ["cryptography>=37.0.0"]
3+
# Requires a version of cryptography with cryptography.hazmat.primitives.asymmetric.mlkem
4+
dependencies = ["cryptography>=47.0.0"]
55

66
[tool.stubtest]
77
# linux and darwin are equivalent

‎stubs/paramiko/paramiko/kex_mlkem.pyi‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
from _typeshed import Incomplete, ReadableBuffer
1+
from _typeshed import ReadableBuffer
22
from collections.abc import Callable
33
from hashlib import _Hash
4+
from typing import ClassVar, Final
45

6+
from cryptography.hazmat.primitives.asymmetric.mlkem import MLKEM768PrivateKey
57
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
68
from paramiko.message import Message
79
from paramiko.transport import Transport
810

9-
c_MSG_KEX_HYBRID_INIT: bytes
10-
c_MSG_KEX_HYBRID_REPLY: bytes
11+
c_MSG_KEX_HYBRID_INIT: Final = b"\x1e"
12+
c_MSG_KEX_HYBRID_REPLY: Final = b"\x1f"
1113

1214
class KexMLKEM768X25519:
13-
name: str
14-
hash_algo: Callable[[ReadableBuffer], _Hash]
15+
name: Final = "mlkem768x25519-sha256"
16+
hash_algo: ClassVar[Callable[[ReadableBuffer], _Hash]]
1517
transport: Transport
16-
# cryptography.hazmat.primitives.asymmetric.mlkem.MLKEM768PrivateKey, added in cryptography 48
17-
mlkem_key: Incomplete | None
18+
mlkem_key: MLKEM768PrivateKey | None
1819
x25519_key: X25519PrivateKey | None
1920
def __init__(self, transport: Transport) -> None: ...
2021
@classmethod

0 commit comments

Comments
 (0)