chiark / gitweb /
server/{keyexch,peer}.c: Maybe key-exchange messages come out of the blue.
[tripe] / server / peer.c
index e9b8f6681807a6f3c078e7bb3fdef660234ab146..2eb30bf5d5a5c86506157553373a889bb0cbe31d 100644 (file)
@@ -413,9 +413,8 @@ static void p_read(int fd, unsigned mode, void *v)
       }
       break;
     case MSG_KEYEXCH:
-      if (!p) goto unexp;
-      p_rxupdstats(p, n);
-      kx_message(&p->kx, ch & MSG_TYPEMASK, &b);
+      if (p) p_rxupdstats(p, n);
+      if (kx_message(p ? &p->kx : 0, &a, ch & MSG_TYPEMASK, &b)) goto unexp;
       break;
     case MSG_MISC:
       switch (ch & MSG_TYPEMASK) {