X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/ea96b00d33fc166078b270aa45db716b52a85e5e..7ed14135434df136e971a43b1774b827714ef7f9:/peer.c diff --git a/peer.c b/peer.c index 9a2fc591..e9fd280c 100644 --- a/peer.c +++ b/peer.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: peer.c,v 1.8 2003/05/16 12:09:03 mdw Exp $ + * $Id: peer.c,v 1.9 2003/07/13 11:19:49 mdw Exp $ * * Communication with the peer * @@ -29,6 +29,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: peer.c,v $ + * Revision 1.9 2003/07/13 11:19:49 mdw + * Incopatible protocol fix! Include message type code under MAC tag to prevent + * cut-and-paste from key-exchange messages to general packet transport. + * * Revision 1.8 2003/05/16 12:09:03 mdw * Allow binding to a chosen address. * @@ -135,7 +139,7 @@ found: return; } buf_init(&bb, buf_o, sizeof(buf_o)); - if (ksl_decrypt(&p->ks, &b, &bb)) { + if (ksl_decrypt(&p->ks, MSG_PACKET, &b, &bb)) { p->st.n_reject++; a_warn("couldn't decrypt inbound packet from `%s'", p->name); return; @@ -218,7 +222,7 @@ void p_tun(peer *p, buf *b) buf *bb = p_txstart(p, MSG_PACKET); TIMER; - if (ksl_encrypt(&p->ks, b, bb)) + if (ksl_encrypt(&p->ks, MSG_PACKET, b, bb)) kx_start(&p->kx); if (BOK(bb) && BLEN(bb)) { p->st.n_ipout++;