Skip to content

Commit 55ad05b

Browse files
committed
don't check the type of priv_key
it breaks the CI: ~~~ > assert isinstance(priv_key, (pkcs7.PKCS7PrivateKeyTypes)) E AttributeError: module 'cryptography.hazmat.primitives.serialization.pkcs7' has no attribute 'PKCS7PrivateKeyTypes' ~~~ Signed-off-by: Gaëtan Lehmann <[email protected]>
1 parent 9cac2f4 commit 55ad05b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/efi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ def sign(payload, key_file, cert_file):
218218
"""Returns a signed PKCS7 of payload signed by key and cert."""
219219
with open(key_file, 'rb') as f:
220220
priv_key = serialization.load_pem_private_key(f.read(), password=None)
221-
assert isinstance(priv_key, (pkcs7.PKCS7PrivateKeyTypes))
222221

223222
with open(cert_file, 'rb') as f:
224223
cert = x509.load_pem_x509_certificate(f.read())
@@ -232,7 +231,7 @@ def sign(payload, key_file, cert_file):
232231
return (
233232
pkcs7.PKCS7SignatureBuilder()
234233
.set_data(payload)
235-
.add_signer(cert, priv_key, hashes.SHA256())
234+
.add_signer(cert, priv_key, hashes.SHA256()) # type: ignore
236235
.sign(serialization.Encoding.DER, options)
237236
)
238237

0 commit comments

Comments
 (0)