Deleted Added
full compact
xform_esp.c (105197) xform_esp.c (109623)
1/* $FreeBSD: head/sys/netipsec/xform_esp.c 105197 2002-10-16 02:10:08Z sam $ */
1/* $FreeBSD: head/sys/netipsec/xform_esp.c 109623 2003-01-21 08:56:16Z alfred $ */
2/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
3/*
4 * The authors of this code are John Ioannidis (ji@tla.org),
5 * Angelos D. Keromytis (kermit@csd.uch.gr) and
6 * Niels Provos (provos@physnet.uni-hamburg.de).
7 *
8 * The original version of this code was written by John Ioannidis
9 * for BSD/OS in Athens, Greece, in November 1995.

--- 175 unchanged lines hidden (view full) ---

185
186 /*
187 * NB: The null xform needs a non-zero blocksize to keep the
188 * crypto code happy but if we use it to set ivlen then
189 * the ESP header will be processed incorrectly. The
190 * compromise is to force it to zero here.
191 */
192 sav->ivlen = (txform == &enc_xform_null ? 0 : txform->blocksize);
2/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
3/*
4 * The authors of this code are John Ioannidis (ji@tla.org),
5 * Angelos D. Keromytis (kermit@csd.uch.gr) and
6 * Niels Provos (provos@physnet.uni-hamburg.de).
7 *
8 * The original version of this code was written by John Ioannidis
9 * for BSD/OS in Athens, Greece, in November 1995.

--- 175 unchanged lines hidden (view full) ---

185
186 /*
187 * NB: The null xform needs a non-zero blocksize to keep the
188 * crypto code happy but if we use it to set ivlen then
189 * the ESP header will be processed incorrectly. The
190 * compromise is to force it to zero here.
191 */
192 sav->ivlen = (txform == &enc_xform_null ? 0 : txform->blocksize);
193 sav->iv = (caddr_t) malloc(sav->ivlen, M_XDATA, M_WAITOK);
193 sav->iv = (caddr_t) malloc(sav->ivlen, M_XDATA, 0);
194 if (sav->iv == NULL) {
195 DPRINTF(("esp_init: no memory for IV\n"));
196 return EINVAL;
197 }
198 key_randomfill(sav->iv, sav->ivlen); /*XXX*/
199
200 /*
201 * Setup AH-related state.

--- 765 unchanged lines hidden ---
194 if (sav->iv == NULL) {
195 DPRINTF(("esp_init: no memory for IV\n"));
196 return EINVAL;
197 }
198 key_randomfill(sav->iv, sav->ivlen); /*XXX*/
199
200 /*
201 * Setup AH-related state.

--- 765 unchanged lines hidden ---