From 4dafd519dbbdc17887f2de4f6cabe33ac4667ab0 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 4 Jul 2017 17:55:55 +0100 Subject: [PATCH 1/1] symm/hmac-def.h: Fix the NMAC and SSLMAC classes. Thanks to GCC 6 for pointing out that many of the necessary bits of functionality were hanging around unused. (Why did earlier versions not spot this?) It looks like they never worked properly. I hereby deprecate them, and intend to remove them in Catacomb 2.5. --- symm/hmac-def.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/symm/hmac-def.h b/symm/hmac-def.h index 032c69f2..893c6868 100644 --- a/symm/hmac-def.h +++ b/symm/hmac-def.h @@ -231,7 +231,7 @@ void pre##_macdone(pre##_macctx *ctx, void *mac) \ \ /* --- Generic MAC interface --- */ \ \ -static const gmac_ops gkops; \ +static const gmac_ops gkops, gnkops, gsslkops; \ static const ghash_ops gops, gnops, gsslops; \ \ typedef struct gkctx { \ @@ -269,7 +269,7 @@ static gmac *gnkey(const void *k, size_t sz) \ gkctx *gk = S_CREATE(gkctx); \ const octet *kk = k; \ assert(keysz(sz, pre##_nmackeysz) == sz); \ - gk->m.ops = &gkops; \ + gk->m.ops = &gnkops; \ gk->gops = &gnops; \ pre##_nmacinit(&gk->k, kk, kk + PRE##_STATESZ); \ return (&gk->m); \ @@ -278,7 +278,7 @@ static gmac *gnkey(const void *k, size_t sz) \ static gmac *gsslkey(const void *k, size_t sz) \ { \ gkctx *gk = S_CREATE(gkctx); \ - gk->m.ops = &gkops; \ + gk->m.ops = &gsslkops; \ gk->gops = &gsslops; \ pre##_sslmacinit(&gk->k, k, sz); \ return (&gk->m); \ @@ -341,10 +341,10 @@ static const ghash_ops gops = \ { &gch, ghhash, ghdone, ghdestroy, ghcopy }; \ static const gchash gnch = { #pre "-nmac", PRE##_HASHSZ, ghinit }; \ static const ghash_ops gnops = \ - { &gch, ghhash, ghdone, ghdestroy, ghcopy }; \ + { &gnch, ghhash, ghdone, ghdestroy, ghcopy }; \ static const gchash gsslch = { #pre "-sslmac", PRE##_HASHSZ, ghinit }; \ static const ghash_ops gsslops = \ - { &gch, ghhash, ghdone, ghdestroy, ghcopy }; \ + { &gsslch, ghhash, ghdone, ghdestroy, ghcopy }; \ \ HMAC_TEST(PRE, pre) -- 2.11.0