udpkey.c: Use correct name and key size when client derives MAC key.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 24 May 2014 13:00:03 +0000 (14:00 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 20 Jun 2014 20:05:20 +0000 (21:05 +0100)
This is a nasty interop bug because the server gets the derivation right
-- so the two can potentially end up with different keys.  Fortunately
things mostly work anyway.

udpkey.c

index 6081329..769bdb1 100644 (file)
--- a/udpkey.c
+++ b/udpkey.c
@@ -1012,7 +1012,7 @@ static int receive_v0(struct query *q, struct server *s, buf *bin, buf *bout)
      debug_ge("Z", s->k.g, Z); )
   derive(&s->k, R, Z, "cipher", s->k.cc->name, s->k.cc->keysz, &kk, &ksz);
   c = GC_INIT(s->k.cc, kk, ksz);
-  derive(&s->k, R, Z, "mac", s->k.cc->name, s->k.cc->keysz, &kk, &ksz);
+  derive(&s->k, R, Z, "mac", s->k.mc->name, s->k.mc->keysz, &kk, &ksz);
   m = GM_KEY(s->k.mc, kk, ksz);
 
   /* Find where the MAC tag is. */