Browse Source

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
pull/1/head
Hidden Z 10 years ago
parent
commit
1fbcdeb4bd
  1. 2
      bin/py-i2phosts-injector

2
bin/py-i2phosts-injector

@ -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

Loading…
Cancel
Save