chiark / gitweb /
server/bulkcrypto.c, server/tripe.8.in: Handle MAC names containing `/'.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 11 May 2017 09:42:15 +0000 (10:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 17:19:09 +0000 (18:19 +0100)
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
server/tripe.8.in

index 0e02f747cc104c40459b0db583517b1b1ab0b003..365aa1760abc7bddb5ee18bcdcb3c31125cb5fbf 100644 (file)
@@ -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 ((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);
       *q++ = 0;
     if ((a->m = gmac_byname(d.buf)) == 0) {
       a_format(e, "unknown-mac", "%s", d.buf, A_END);
index 9b3be609c14f3acd71c9dc178e81b913f13084e4..3997e1dbf2537f6106c72dac37b839ee5242ca14 100644 (file)
@@ -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.
 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
 .TP
 .B mgf
 A `mask-generation function', used in the key-exchange.  The default is