From a9e8b33309c1ad26cc00fb737e50c073f710db94 Mon Sep 17 00:00:00 2001 From: Eduardo Erlo Date: Tue, 23 Jul 2024 13:53:18 -0300 Subject: [PATCH] Fix public key fetcher bug when the split public key has an "n" in the edges. Public keys may be split in more than one TXT record. For such cases, there's a chance that the letter "n" sits exactly at the beginning or at the end of some of the record strings, we cannot use python's split('\\n') because it will take out the "n" and generate a wrong public key. Changed by replace('\\n', '') to avoid this issue. --- sigutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigutil.py b/sigutil.py index e6ce013..3fbf454 100755 --- a/sigutil.py +++ b/sigutil.py @@ -81,7 +81,7 @@ def get_publickey(domain): # Concatenate all of the key segments for key in sorted(list(segments.keys())): - pembits = pembits + segments[key].strip('\n').strip('\\n').strip() + pembits = pembits + segments[key].replace('\n', '').replace('\\n', '').strip() return pembits, record_strings except: