From ac349547f5695910990a1ae1b9d6d82a3c2c74d4 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Fri, 22 Oct 2010 19:33:31 +0000 Subject: [PATCH] validation.py: check for passing b32 address instead of base64 hash --- web/lib/validation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/lib/validation.py b/web/lib/validation.py index 3d076b8..a792ca3 100644 --- a/web/lib/validation.py +++ b/web/lib/validation.py @@ -63,6 +63,9 @@ def validate_b64hash(data, check_uniq=True): # strip leading and trailing whitespaces data = data.strip() length = len(data) + # check for b32 address misuse + if re.match(r'.*\.b32\.i2p$', data): + raise forms.ValidationError('You should paste base64 hash, not a base32!') # Minimum key length 516 bytes if length < 516: raise forms.ValidationError('Specified base64 hash are less than 516 bytes')