]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - misc.c
Use a timing-safe memory compare to verify MACs.
authorSimon Tatham <anakin@pobox.com>
Sun, 26 Apr 2015 22:31:11 +0000 (23:31 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 26 Apr 2015 22:31:11 +0000 (23:31 +0100)
commit9d5a16402168f82ba1bd695c3e95bb4812ccd0a9
tree97dacc1498304c172a01f5c8aa7387531bd181ba
parent183a9ee98b6535f8d059b4c488f198532ad84586
Use a timing-safe memory compare to verify MACs.

Now that we have modes in which the MAC verification happens before
any other crypto operation and hence will be the only thing seen by an
attacker, it seems like about time we got round to doing it in a
cautious way that tries to prevent the attacker from using our memcmp
as a timing oracle.

So, here's an smemeq() function which has the semantics of !memcmp but
attempts to run in time dependent only on the length parameter. All
the MAC implementations now use this in place of !memcmp to verify the
MAC on input data.
misc.c
misc.h
sshmd5.c
sshsh256.c
sshsha.c