Skip to content

Commit

Permalink
Fix approximately 100 mypy errors in test_crypto.py (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Jan 7, 2025
1 parent 10acb2b commit ee017b2
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 86 deletions.
8 changes: 5 additions & 3 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,12 +1410,12 @@ def digest(self, digest_name: str) -> bytes:
]
)

def subject_name_hash(self) -> bytes:
def subject_name_hash(self) -> int:
"""
Return the hash of the X509 subject.
:return: The hash of the subject.
:rtype: :py:class:`bytes`
:rtype: :py:class:`int`
"""
return _lib.X509_subject_name_hash(self._x509)

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

def load_locations(
self, cafile: StrOrBytesPath, capath: StrOrBytesPath | None = None
self,
cafile: StrOrBytesPath | None,
capath: StrOrBytesPath | None = None,
) -> None:
"""
Let X509Store know where we can find trusted certificates for the
Expand Down
2 changes: 2 additions & 0 deletions src/OpenSSL/rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
PRNG management routines, thin wrappers.
"""

from __future__ import annotations

import warnings

from OpenSSL._util import lib as _lib
Expand Down
Loading

0 comments on commit ee017b2

Please sign in to comment.