summaryrefslogtreecommitdiffstats
path: root/src/methods/generic_gmac
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-31 16:21:24 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-31 16:21:24 +0200
commit9225a4550abebd26ff3642d8f5ed4f96b2e4bff7 (patch)
tree5afffac11e8dff1dda0004df3ac5bed56a6bdd87 /src/methods/generic_gmac
parent46a82c570cf940479be968864eb9638407d7d84f (diff)
downloadfastd-9225a4550abebd26ff3642d8f5ed4f96b2e4bff7.tar
fastd-9225a4550abebd26ff3642d8f5ed4f96b2e4bff7.zip
Replace memcmp with a constant-time version in some places
Diffstat (limited to 'src/methods/generic_gmac')
-rw-r--r--src/methods/generic_gmac/generic_gmac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/methods/generic_gmac/generic_gmac.c b/src/methods/generic_gmac/generic_gmac.c
index 30a2f2f..519c354 100644
--- a/src/methods/generic_gmac/generic_gmac.c
+++ b/src/methods/generic_gmac/generic_gmac.c
@@ -261,7 +261,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
ok = session->ghash->digest(session->ghash_state, &tag, inblocks+1, n_blocks*sizeof(fastd_block128_t));
}
- if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) {
+ if (!ok || !block_equal(&tag, &outblocks[0])) {
fastd_buffer_free(*out);
return false;
}