1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-02-02 01:44:40 +00:00

py-i2phosts-injector: fix splitting entries

Multiple split by '=' character may cause wrong hash addition because
trailing '==' were stripped from base64 hash. These trailing '==' are
used in ECDSA keys, see http://zzz.i2p/topics/1763
This commit is contained in:
Hidden Z 2014-12-22 18:47:23 +00:00
parent 6045b31350
commit 1fbcdeb4bd

View File

@ -75,7 +75,7 @@ for line in f:
continue continue
# strip trailing '\n' # strip trailing '\n'
line = line.rstrip('\n') line = line.rstrip('\n')
entry = line.split('=') entry = line.split('=', 1)
try: try:
hostname = validate_hostname(entry[0]) hostname = validate_hostname(entry[0])
base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness