summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2019-06-28 00:27:04 +0300
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2019-06-28 16:45:21 +0300
commit41f7f2c64131e778978e90eed62b576adc8fd82a (patch)
treed1b15155d16b5b20b00c6dcdf0a3c0e322dc1da0 /lib
parent2f376419dc0f6ad2d38c75d441e5f2dec6653882 (diff)
downloadgnutls-41f7f2c64131e778978e90eed62b576adc8fd82a.tar.gz
nettle/mac: in mac_fast call set_nonce after set_key
Calling set_nonce before set_key is plain incorrect. For GMAC key is not initialized. For UMAC set_key will reset nonce to empty. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/nettle/mac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c
index 64fa7e4925..6b688add33 100644
--- a/lib/nettle/mac.c
+++ b/lib/nettle/mac.c
@@ -391,9 +391,9 @@ static int wrap_nettle_mac_fast(gnutls_mac_algorithm_t algo,
if (ret < 0)
return gnutls_assert_val(ret);
+ ctx.set_key(&ctx, key_size, key);
if (ctx.set_nonce)
ctx.set_nonce(&ctx, nonce_size, nonce);
- ctx.set_key(&ctx, key_size, key);
ctx.update(&ctx, text_size, text);
ctx.digest(&ctx, ctx.length, digest);