Browse Source

Merge #354: PM-sig-verification: also accept lowercase hostid as valid.

078b2e2 Message-signature-verification: also accept lowercase hostid as valid.     The hostid upper/lowercase seems can be different depending     on how someone connects to an IRC server (via TOR, clearnet,     etc.). This leads to message signature verification failures,     if the receiving counterparty has a differently capitalized id. (Alex Cato)
master
AdamISZ 7 years ago
parent
commit
593f7f07e9
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 2
      jmclient/jmclient/client_protocol.py

2
jmclient/jmclient/client_protocol.py

@ -110,6 +110,8 @@ class JMClientProtocol(amp.AMP):
hashlen, max_encoded, hostid):
verif_result = True
if not btc.ecdsa_verify(str(msg), sig, pubkey):
# workaround for hostid, which sometimes is lowercase-only for some IRC connections
if not btc.ecdsa_verify(str(msg[:-len(hostid)] + hostid.lower()), sig, pubkey):
jlog.debug("nick signature verification failed, ignoring: " + str(nick))
verif_result = False
#check that nick matches hash of pubkey

Loading…
Cancel
Save