From a28786061957adcb584835d2a6e3c134e308060a Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Fri, 22 Oct 2010 19:34:49 +0000 Subject: [PATCH] validation.py: fail if hash contains .i2p= (full foo.i2p=key) --- web/lib/validation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/lib/validation.py b/web/lib/validation.py index a792ca3..30f7ad5 100644 --- a/web/lib/validation.py +++ b/web/lib/validation.py @@ -66,6 +66,9 @@ def validate_b64hash(data, check_uniq=True): # check for b32 address misuse if re.match(r'.*\.b32\.i2p$', data): raise forms.ValidationError('You should paste base64 hash, not a base32!') + # fail if contains .i2p= (full foo.i2p=key) + if re.search(r'\.i2p=', data): + raise forms.ValidationError('Do not paste full hosts.txt entry! Only base64 hash are needed') # Minimum key length 516 bytes if length < 516: raise forms.ValidationError('Specified base64 hash are less than 516 bytes')