Fix RSA unpacking bug

this can be seen when using test servers. when fingerprints are None. 
(error was TypeError: cannot unpack non-iterable NoneType object)
This commit is contained in:
painor 2019-11-05 00:20:14 +01:00 committed by GitHub
parent 4839d8bf59
commit 24193a2424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ def encrypt(fingerprint, data, *, use_old=False):
the cipher text, or None if no key matching this fingerprint is found.
"""
global _server_keys
key, old = _server_keys.get(fingerprint, None)
key, old = _server_keys.get(fingerprint, [None, None])
if (not key) or (old and not use_old):
return None