From 9225a4550abebd26ff3642d8f5ed4f96b2e4bff7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 31 Aug 2014 16:21:24 +0200 Subject: Replace memcmp with a constant-time version in some places --- src/methods/generic_umac/generic_umac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/methods/generic_umac') diff --git a/src/methods/generic_umac/generic_umac.c b/src/methods/generic_umac/generic_umac.c index aaaf9e7..167ee79 100644 --- a/src/methods/generic_umac/generic_umac.c +++ b/src/methods/generic_umac/generic_umac.c @@ -224,7 +224,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses if (ok) ok = session->uhash->digest(session->uhash_state, &tag, inblocks+1, in_len); - if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) { + if (!ok || !block_equal(&tag, &outblocks[0])) { fastd_buffer_free(*out); return false; } -- cgit v1.2.3