diff options
-rw-r--r-- | sys/netinet/ip_esp.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_esp3des.c | 16 | ||||
-rw-r--r-- | sys/netinet/ip_esp3desmd5.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_espdes.c | 17 | ||||
-rw-r--r-- | sys/netinet/ip_espdesmd5.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.h | 4 | ||||
-rw-r--r-- | sys/netinet/ip_sha1.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_sha1.h | 8 |
9 files changed, 46 insertions, 45 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index c39ffa6d1cd..0c76415d20c 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.4 1997/06/20 05:41:49 provos Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.5 1997/06/21 00:09:16 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -71,7 +71,7 @@ esp_input(register struct mbuf *m, int iphlen) struct ip *ipo; struct ifqueue *ifq = NULL; int s; - u_long spi; + u_int32_t spi; struct tdb *tdbp; espstat.esps_input++; @@ -100,7 +100,7 @@ esp_input(register struct mbuf *m, int iphlen) } ipo = mtod(m, struct ip *); } - spi = *((u_long *)((caddr_t)ipo + iphlen)); + spi = *((u_int32_t *)((caddr_t)ipo + iphlen)); /* * Find tunnel control block and (indirectly) call the appropriate diff --git a/sys/netinet/ip_esp3des.c b/sys/netinet/ip_esp3des.c index a1e3374fec8..18791ee7309 100644 --- a/sys/netinet/ip_esp3des.c +++ b/sys/netinet/ip_esp3des.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp3des.c,v 1.2 1997/06/20 19:43:05 provos Exp $ */ +/* $OpenBSD: ip_esp3des.c,v 1.3 1997/06/21 00:09:17 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -83,7 +83,7 @@ esp3des_init(struct tdb *tdbp, struct xformsw *xsp, struct mbuf *m) { struct esp3des_xdata *xd; struct encap_msghdr *em; - u_long rk[2]; + u_int32_t rk[2]; tdbp->tdb_xform = xsp; @@ -169,7 +169,7 @@ esp3des_input(struct mbuf *m, struct tdb *tdb) ipo = *ip; esp = (struct esp *)(ip + 1); - plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_long) - + plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_int32_t) - xd->edx_ivlen; if (plen & 07) { @@ -308,7 +308,7 @@ esp3des_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struc struct esp3des_xdata *xd; struct ip *ip, ipo; int i, ilen, olen, ohlen, nh, rlen, plen, padding; - u_long spi; + u_int32_t spi; struct mbuf *mi, *mo; u_char *pad, *idat, *odat; u_char iv[8], blk[8]; @@ -323,7 +323,7 @@ esp3des_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struc xd = (struct esp3des_xdata *)tdb->tdb_xdata; ilen = ntohs(ip->ip_len); - ohlen = sizeof (u_long) + xd->edx_ivlen; + ohlen = sizeof (u_int32_t) + xd->edx_ivlen; ipo = *ip; nh = ipo.ip_p; @@ -419,7 +419,7 @@ esp3des_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struc if (m == NULL) return ENOBUFS; - m = m_pullup(m, sizeof(struct ip) + xd->edx_ivlen + sizeof(u_long)); + m = m_pullup(m, sizeof(struct ip) + xd->edx_ivlen + sizeof(u_int32_t)); if (m == NULL) return ENOBUFS; @@ -440,9 +440,9 @@ esp3des_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struc bcopy((caddr_t)&ipo, mtod(m, caddr_t), sizeof (struct ip)); bcopy((caddr_t)&spi, mtod(m, caddr_t) + sizeof (struct ip), - sizeof (u_long)); + sizeof (u_int32_t)); bcopy((caddr_t)iv, mtod(m, caddr_t) + sizeof (struct ip) + - sizeof (u_long), xd->edx_ivlen); + sizeof (u_int32_t), xd->edx_ivlen); *mp = m; return 0; diff --git a/sys/netinet/ip_esp3desmd5.c b/sys/netinet/ip_esp3desmd5.c index ced12fb5a75..749ca56b7fe 100644 --- a/sys/netinet/ip_esp3desmd5.c +++ b/sys/netinet/ip_esp3desmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp3desmd5.c,v 1.6 1997/06/20 19:43:06 provos Exp $ */ +/* $OpenBSD: ip_esp3desmd5.c,v 1.7 1997/06/21 00:09:17 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -277,7 +277,7 @@ esp3desmd5_input(struct mbuf *m, struct tdb *tdb) ipo = *ip; esp = (struct esp *)(ip + 1); - plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_long) - + plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_int32_t) - xd->edx_ivlen; if (plen & 07) { @@ -291,8 +291,8 @@ esp3desmd5_input(struct mbuf *m, struct tdb *tdb) } oplen = plen; - ilen = m->m_len - sizeof (struct ip) - ESP3DESMD5_IVS - sizeof(u_long); - idat = mtod(m, unsigned char *) + sizeof (struct ip) + sizeof(u_long) + + ilen = m->m_len - sizeof (struct ip) - ESP3DESMD5_IVS - sizeof(u_int32_t); + idat = mtod(m, unsigned char *) + sizeof (struct ip) + sizeof(u_int32_t) + ESP3DESMD5_IVS; if (xd->edx_ivlen == 0) /* KeyIV in use */ @@ -518,7 +518,7 @@ esp3desmd5_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, st struct ip *ip, ipo; int i, ilen, olen, ohlen, nh, rlen, plen, padding; u_int32_t rplc; - u_long spi; + u_int32_t spi; struct mbuf *mi, *mo, *ms; u_char *pad, *idat, *odat; u_char iv[ESP3DESMD5_IVS], blk[8], auth[ESP3DESMD5_ALEN]; @@ -577,7 +577,7 @@ esp3desmd5_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, st bcopy(xd->edx_iv, iv, ESP3DESMD5_IVS); - MD5Update(&ctx, (u_char *)&spi, sizeof(u_long)); + MD5Update(&ctx, (u_char *)&spi, sizeof(u_int32_t)); MD5Update(&ctx, iv, ESP3DESMD5_IVS); rplc = htonl(xd->edx_rpl); MD5Update(&ctx, (unsigned char *)&rplc, ESP3DESMD5_RPLENGTH); diff --git a/sys/netinet/ip_espdes.c b/sys/netinet/ip_espdes.c index 86a0b3f5198..9cf7f6f8876 100644 --- a/sys/netinet/ip_espdes.c +++ b/sys/netinet/ip_espdes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_espdes.c,v 1.4 1997/06/20 05:41:51 provos Exp $ */ +/* $OpenBSD: ip_espdes.c,v 1.5 1997/06/21 00:09:18 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -82,7 +82,7 @@ espdes_init(struct tdb *tdbp, struct xformsw *xsp, struct mbuf *m) { struct espdes_xdata *xd; struct encap_msghdr *em; - u_long rk[2]; + u_int32_t rk[2]; tdbp->tdb_xform = xsp; @@ -159,7 +159,7 @@ espdes_input(struct mbuf *m, struct tdb *tdb) ipo = *ip; esp = (struct esp *)(ip + 1); - plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_long) - xd->edx_ivlen; + plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_int32_t) - xd->edx_ivlen; if (plen & 07) { #ifdef ENCDEBUG @@ -295,7 +295,7 @@ espdes_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct struct espdes_xdata *xd; struct ip *ip, ipo; int i, ilen, olen, ohlen, nh, rlen, plen, padding; - u_long spi; + u_int32_t spi; struct mbuf *mi, *mo; u_char *pad, *idat, *odat; u_char iv[8], blk[8]; @@ -310,7 +310,7 @@ espdes_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct xd = (struct espdes_xdata *)tdb->tdb_xdata; ilen = ntohs(ip->ip_len); - ohlen = sizeof (u_long) + xd->edx_ivlen; + ohlen = sizeof (u_int32_t) + xd->edx_ivlen; ipo = *ip; nh = ipo.ip_p; @@ -404,7 +404,7 @@ espdes_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct if (m == NULL) return ENOBUFS; - m = m_pullup(m, sizeof(struct ip) + xd->edx_ivlen + sizeof(u_long)); + m = m_pullup(m, sizeof(struct ip) + xd->edx_ivlen + sizeof(u_int32_t)); if (m == NULL) return ENOBUFS; @@ -424,8 +424,9 @@ espdes_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struct } bcopy((caddr_t)&ipo, mtod(m, caddr_t), sizeof (struct ip)); - bcopy((caddr_t)&spi, mtod(m, caddr_t) + sizeof (struct ip), sizeof (u_long)); - bcopy((caddr_t)iv, mtod(m, caddr_t) + sizeof (struct ip) + sizeof (u_long), xd->edx_ivlen); + bcopy((caddr_t)&spi, mtod(m, caddr_t) + sizeof (struct ip), sizeof (u_int32_t)); + bcopy((caddr_t)iv, mtod(m, caddr_t) + sizeof (struct ip) + + sizeof (u_int32_t), xd->edx_ivlen); *mp = m; return 0; diff --git a/sys/netinet/ip_espdesmd5.c b/sys/netinet/ip_espdesmd5.c index 21b6c616c63..f35d227748a 100644 --- a/sys/netinet/ip_espdesmd5.c +++ b/sys/netinet/ip_espdesmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_espdesmd5.c,v 1.6 1997/06/20 05:41:51 provos Exp $ */ +/* $OpenBSD: ip_espdesmd5.c,v 1.7 1997/06/21 00:09:18 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -263,7 +263,7 @@ espdesmd5_input(struct mbuf *m, struct tdb *tdb) ipo = *ip; esp = (struct esp *)(ip + 1); - plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_long) - + plen = m->m_pkthdr.len - sizeof (struct ip) - sizeof (u_int32_t) - xd->edx_ivlen; if (plen & 07) { @@ -277,8 +277,8 @@ espdesmd5_input(struct mbuf *m, struct tdb *tdb) } oplen = plen; - ilen = m->m_len - sizeof (struct ip) - ESPDESMD5_IVS - sizeof(u_long); - idat = mtod(m, unsigned char *) + sizeof (struct ip) + sizeof(u_long) + + ilen = m->m_len - sizeof (struct ip) - ESPDESMD5_IVS - sizeof(u_int32_t); + idat = mtod(m, unsigned char *) + sizeof (struct ip) + sizeof(u_int32_t) + ESPDESMD5_IVS; if (xd->edx_ivlen == 0) /* KeyIV in use */ @@ -502,7 +502,7 @@ espdesmd5_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, str struct ip *ip, ipo; int i, ilen, olen, ohlen, nh, rlen, plen, padding; u_int32_t rplc; - u_long spi; + u_int32_t spi; struct mbuf *mi, *mo, *ms; u_char *pad, *idat, *odat; u_char iv[ESPDESMD5_IVS], blk[8], auth[ESPDESMD5_ALEN]; @@ -561,7 +561,7 @@ espdesmd5_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, str bcopy(xd->edx_iv, iv, ESPDESMD5_IVS); - MD5Update(&ctx, (u_char *)&spi, sizeof(u_long)); + MD5Update(&ctx, (u_char *)&spi, sizeof(u_int32_t)); MD5Update(&ctx, iv, ESPDESMD5_IVS); rplc = htonl(xd->edx_rpl); MD5Update(&ctx, (unsigned char *)&rplc, ESPDESMD5_RPLENGTH); diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 0636dfe9c22..dabe093ee63 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.7 1997/06/20 05:41:53 provos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.8 1997/06/21 00:09:19 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -114,7 +114,7 @@ int ipspkernfs_dirty = 1; */ struct tdb * -gettdb(u_long spi, struct in_addr dst) +gettdb(u_int32_t spi, struct in_addr dst) { int hashval; struct tdb *tdbp; diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index a6a0a14a35c..53b42ab198d 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.5 1997/06/20 05:41:53 provos Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.6 1997/06/21 00:09:19 deraadt Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -110,7 +110,7 @@ extern int encdebug; struct tdb *tdbh[TDB_HASHMOD]; extern struct xformsw xformsw[], *xformswNXFORMSW; -extern struct tdb *gettdb(u_long, struct in_addr); +extern struct tdb *gettdb(u_int32_t, struct in_addr); extern void puttdb(struct tdb *); extern int tdb_delete(struct tdb *, int); diff --git a/sys/netinet/ip_sha1.c b/sys/netinet/ip_sha1.c index c9cfafbf703..a3334143d18 100644 --- a/sys/netinet/ip_sha1.c +++ b/sys/netinet/ip_sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_sha1.c,v 1.5 1997/06/20 20:11:30 provos Exp $ */ +/* $OpenBSD: ip_sha1.c,v 1.6 1997/06/21 00:09:20 deraadt Exp $ */ /* SHA-1 in C @@ -47,12 +47,12 @@ A million repetitions of "a" /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) +void SHA1Transform(u_int32_t state[5], unsigned char buffer[64]) { -unsigned long a, b, c, d, e; +u_int32_t a, b, c, d, e; typedef union { unsigned char c[64]; - unsigned long l[16]; + unsigned int l[16]; } CHAR64LONG16; CHAR64LONG16* block; #ifdef SHA1HANDSOFF @@ -119,7 +119,7 @@ void SHA1Init(SHA1_CTX* context) void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) { unsigned int i; -unsigned long j; +unsigned int j; j = context->count[0]; if ((context->count[0] += len << 3) < j) context->count[1] += (len>>29)+1; @@ -141,7 +141,7 @@ unsigned long j; void SHA1Final(unsigned char digest[20], SHA1_CTX* context) { -unsigned long i; +unsigned int i; unsigned char finalcount[8]; for (i = 0; i < 8; i++) { diff --git a/sys/netinet/ip_sha1.h b/sys/netinet/ip_sha1.h index 2a0cec5777f..64615eb0e3a 100644 --- a/sys/netinet/ip_sha1.h +++ b/sys/netinet/ip_sha1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_sha1.h,v 1.2 1997/02/24 14:06:44 niklas Exp $ */ +/* $OpenBSD: ip_sha1.h,v 1.3 1997/06/21 00:09:20 deraadt Exp $ */ /* SHA-1 in C @@ -7,12 +7,12 @@ By Steve Reid <steve@edmweb.com> */ typedef struct { - unsigned long state[5]; - unsigned long count[2]; + u_int32_t state[5]; + u_int32_t count[2]; unsigned char buffer[64]; } SHA1_CTX; -void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); +void SHA1Transform(u_int32_t state[5], unsigned char buffer[64]); void SHA1Init(SHA1_CTX* context); void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); void SHA1Final(unsigned char digest[20], SHA1_CTX* context); |