Skip to content

Commit

Permalink
reveal used macs only once
Browse files Browse the repository at this point in the history
without this, messages get larger the longer an otr session stays
active. this leads to anti-spam measures being triggered (on ICQ for
example) and is also the cause for the infamous bug mmb/weechat-otr#17
  • Loading branch information
tribut committed Jan 20, 2014
1 parent 6caa298 commit f02d006
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/potr/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def createDataMessage(self, message, flags=0, tlvs=None):
msg = proto.DataMessage(flags, self.ourKeyid-1, self.theirKeyid,
long_to_bytes(self.ourDHKey.pub), sess.sendctr.byteprefix(),
encmsg, b'', b''.join(self.savedMacKeys))

self.savedMacKeys = []

msg.mac = SHA1HMAC(sess.sendmac, msg.getMacedData())
return msg

Expand Down

0 comments on commit f02d006

Please sign in to comment.