summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-03-28 22:31:14 +0200
committerMatěj Cepl <mcepl@cepl.eu>2023-03-28 23:21:49 +0200
commite4dd7c452b4eb01c65701178f1ce04ecfd60e07a (patch)
tree63584ef57fa74361db6d9e741c0318961bded25f
parent10df590493b09039c4c76ed56aca47c0a3de4657 (diff)
downloadm2crypto-e4dd7c452b4eb01c65701178f1ce04ecfd60e07a.tar.gz
Fix mypy problems
-rw-r--r--src/M2Crypto/ASN1.py3
-rw-r--r--src/M2Crypto/EC.py4
-rw-r--r--src/M2Crypto/SSL/Connection.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/M2Crypto/ASN1.py b/src/M2Crypto/ASN1.py
index b29326a..424945d 100644
--- a/src/M2Crypto/ASN1.py
+++ b/src/M2Crypto/ASN1.py
@@ -182,7 +182,8 @@ class ASN1_TIME(object):
self.asn1_time = asn1_time
self._pyfree = _pyfree
else:
- self.asn1_time = m2.asn1_time_new() # type: bytes (ASN1_TIME*)
+ # that's (ASN1_TIME*)
+ self.asn1_time = m2.asn1_time_new() # type: bytes
self._pyfree = 1
def __del__(self):
diff --git a/src/M2Crypto/EC.py b/src/M2Crypto/EC.py
index 8cd052a..2e74267 100644
--- a/src/M2Crypto/EC.py
+++ b/src/M2Crypto/EC.py
@@ -10,7 +10,7 @@ Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.
Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam.
All rights reserved."""
-from M2Crypto import BIO, Err, EVP, m2, util
+from M2Crypto import BIO, Err, EC, EVP, m2, util
from typing import AnyStr, Callable, Dict, Optional, Tuple, Union # noqa
EC_Key = bytes
@@ -411,7 +411,7 @@ def load_pub_key(file):
def load_key_string_pubkey(string, callback=util.passphrase_callback):
- # type: (str, Callable) -> PKey
+ # type: (str, Callable) -> EC.PKey
"""
Load an M2Crypto.EC.PKey from a public key as a string.
diff --git a/src/M2Crypto/SSL/Connection.py b/src/M2Crypto/SSL/Connection.py
index c5693c9..62a661e 100644
--- a/src/M2Crypto/SSL/Connection.py
+++ b/src/M2Crypto/SSL/Connection.py
@@ -101,10 +101,10 @@ class Connection(object):
self._free_bio()
def close(self, freeBio=False):
+ # type: (Optional[bool]) -> None
"""
if freeBio is true, call _free_bio
"""
- # type: () -> None
m2.ssl_shutdown(self.ssl)
if freeBio:
self._free_bio()