From 73d383c0973a6b6d16293d80933b5d2fff0c1d7a Mon Sep 17 00:00:00 2001 Message-Id: <73d383c0973a6b6d16293d80933b5d2fff0c1d7a.1713544812.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 11 May 2017 10:42:15 +0100 Subject: [PATCH] server/bulkcrypto.c, server/tripe.8.in: Handle MAC names containing `/'. Organization: Straylight/Edgeware From: Mark Wooding Everything is fine (though unnecessarily ugly) if we take the final `/' as delimiting the tag length, rather than the initial one. So do that. --- server/bulkcrypto.c | 2 +- server/tripe.8.in | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/server/bulkcrypto.c b/server/bulkcrypto.c index 0e02f747..365aa176 100644 --- a/server/bulkcrypto.c +++ b/server/bulkcrypto.c @@ -98,7 +98,7 @@ static int gencomp_getalgs(gencomp_algs *a, const algswitch *asw, if ((p = key_getattr(kf, k, "mac")) != 0) { dstr_reset(&d); dstr_puts(&d, p); - if ((q = strchr(d.buf, '/')) != 0) + if ((q = strrchr(d.buf, '/')) != 0) *q++ = 0; if ((a->m = gmac_byname(d.buf)) == 0) { a_format(e, "unknown-mac", "%s", d.buf, A_END); diff --git a/server/tripe.8.in b/server/tripe.8.in index 9b3be609..3997e1db 100644 --- a/server/tripe.8.in +++ b/server/tripe.8.in @@ -450,6 +450,18 @@ be followed by a and the desired tag length in bits. The default is .IB hash \-hmac at half the underlying hash function's output length. +If the MAC's name contains a +.RB ` / ' +character, +e.g., +.RB ` sha512/256 ', +then an +.I additional +.RB ` / ' +and the tag size is required to disambiguate, +so, e.g., +one might write +.RB ` sha512/256/256 '. .TP .B mgf A `mask-generation function', used in the key-exchange. The default is -- [mdw]