Skip to content

Commit ee017b2

Browse files
authored
Fix approximately 100 mypy errors in test_crypto.py (#1394)
1 parent 10acb2b commit ee017b2

File tree

4 files changed

+96
-86
lines changed

4 files changed

+96
-86
lines changed

src/OpenSSL/crypto.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,12 +1410,12 @@ def digest(self, digest_name: str) -> bytes:
14101410
]
14111411
)
14121412

1413-
def subject_name_hash(self) -> bytes:
1413+
def subject_name_hash(self) -> int:
14141414
"""
14151415
Return the hash of the X509 subject.
14161416
14171417
:return: The hash of the subject.
1418-
:rtype: :py:class:`bytes`
1418+
:rtype: :py:class:`int`
14191419
"""
14201420
return _lib.X509_subject_name_hash(self._x509)
14211421

@@ -1858,7 +1858,9 @@ def set_time(self, vfy_time: datetime.datetime) -> None:
18581858
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)
18591859

18601860
def load_locations(
1861-
self, cafile: StrOrBytesPath, capath: StrOrBytesPath | None = None
1861+
self,
1862+
cafile: StrOrBytesPath | None,
1863+
capath: StrOrBytesPath | None = None,
18621864
) -> None:
18631865
"""
18641866
Let X509Store know where we can find trusted certificates for the

src/OpenSSL/rand.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
PRNG management routines, thin wrappers.
33
"""
44

5+
from __future__ import annotations
6+
57
import warnings
68

79
from OpenSSL._util import lib as _lib

0 commit comments

Comments
 (0)