From 74d5ec834ff5b4d49935e66dea4a7a3b3ba5b729 Mon Sep 17 00:00:00 2001 From: Michael Greene Date: Wed, 23 Nov 2022 11:26:49 -0800 Subject: [PATCH] fix fingerprint test --- pgpy/types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pgpy/types.py b/pgpy/types.py index 301595b..98f3896 100644 --- a/pgpy/types.py +++ b/pgpy/types.py @@ -648,6 +648,8 @@ class Fingerprint(str): # validate input before continuing: this should be a string of 40 hex digits content = content.upper().replace(' ', '') + if not re.match(r'^[0-9A-F]+$', content): + raise ValueError('Fingerprint must be a string of 40 hex digits') return str.__new__(cls, content) def __eq__(self, other):