summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-10-03 22:25:30 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-10-03 22:25:30 +0800
commite80daa98e9750d1045e5bc99b419c84ead70a684 (patch)
tree3a5081172fabd90b4befc733decafe0f2a388291 /packet.c
parent09eb32b6b53f6e09a713ce416051ad65a07c132a (diff)
downloaddropbear-e80daa98e9750d1045e5bc99b419c84ead70a684.tar.gz
Constant time memcmp for the hmac and password crypt
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index d458ccf..4ebd0d7 100644
--- a/packet.c
+++ b/packet.c
@@ -376,7 +376,7 @@ static int checkmac() {
/* compare the hash */
buf_setpos(ses.readbuf, contents_len);
- if (memcmp(mac_bytes, buf_getptr(ses.readbuf, mac_size), mac_size) != 0) {
+ if (constant_time_memcmp(mac_bytes, buf_getptr(ses.readbuf, mac_size), mac_size) != 0) {
return DROPBEAR_FAILURE;
} else {
return DROPBEAR_SUCCESS;