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. 6
      jmclient/jmclient/client_protocol.py

6
jmclient/jmclient/client_protocol.py

@ -110,8 +110,10 @@ class JMClientProtocol(amp.AMP):
hashlen, max_encoded, hostid):
verif_result = True
if not btc.ecdsa_verify(str(msg), sig, pubkey):
jlog.debug("nick signature verification failed, ignoring: " + str(nick))
verif_result = False
# 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
nick_pkh_raw = btc.bin_sha256(pubkey)[:hashlen]
nick_stripped = nick[2:2 + max_encoded]

Loading…
Cancel
Save