From 9d7559077652247b444e4b658e9df7f2460f3122 Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Wed, 14 Jun 2000 04:42:11 +0000 Subject: Initialize tc_ptr to zero if authentication is not used. --- sys/netinet/ip_esp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 14901be6254..a8a75335c5d 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.44 2000/06/06 04:49:29 angelos Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.45 2000/06/14 04:42:10 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -420,7 +420,10 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) m_copydata(m, m->m_pkthdr.len - alen, alen, tc->tc_ptr); } else - crde = crp->crp_desc; + { + crde = crp->crp_desc; + tc->tc_ptr = 0; + } /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ @@ -943,6 +946,7 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, tc->tc_spi = tdb->tdb_spi; tc->tc_proto = tdb->tdb_sproto; + tc->tc_ptr = 0; bcopy(&tdb->tdb_dst, &tc->tc_dst, sizeof(union sockaddr_union)); /* Crypto operation descriptor */ -- cgit v1.2.3