From bb9f6c3a8b71f9c9c6537b986f236571e58b3666 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Tue, 26 Mar 2024 18:49:56 +0100 Subject: [PATCH] correct TypeError: Strings must be encoded before hashing in node.py --- fail2ban-p2p/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban-p2p/node.py b/fail2ban-p2p/node.py index e9de9b2..3fc082d 100644 --- a/fail2ban-p2p/node.py +++ b/fail2ban-p2p/node.py @@ -232,7 +232,7 @@ class Node: error = True if pubkey: logger.debug("read friend's public key: %s" % pubkey ) - uid = str(hashlib.sha224(pubkey).hexdigest()) + uid = str(hashlib.sha224(pubkey.encode(encoding = 'UTF-8', errors = 'strict')).hexdigest()) try: address = re.search("address\s*=\s*(.*)", friendinfo).group(1) except AttributeError: