diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_ah.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 18 | ||||
-rw-r--r-- | sys/netinet/ip_ipcomp.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.h | 19 |
4 files changed, 22 insertions, 33 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index c06dad5b72c..9be571c0220 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.147 2021/06/18 15:34:21 bluhm Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.148 2021/07/08 09:22:30 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -96,7 +96,7 @@ ah_attach(void) int ah_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii) { - struct auth_hash *thash = NULL; + const struct auth_hash *thash = NULL; struct cryptoini cria, crin; int error; @@ -529,7 +529,7 @@ error6: int ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) { - struct auth_hash *ahx = (struct auth_hash *) tdb->tdb_authalgxform; + const struct auth_hash *ahx = tdb->tdb_authalgxform; struct tdb_crypto *tc = NULL; u_int32_t btsx, esn; u_int8_t hl; @@ -717,7 +717,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) int ah_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) { - struct auth_hash *ahx = (struct auth_hash *) tdb->tdb_authalgxform; + const struct auth_hash *ahx = tdb->tdb_authalgxform; int roff, rplen, skip, protoff; u_int32_t btsx, esn; caddr_t ptr; @@ -892,7 +892,7 @@ int ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, int protoff) { - struct auth_hash *ahx = (struct auth_hash *) tdb->tdb_authalgxform; + const struct auth_hash *ahx = tdb->tdb_authalgxform; struct cryptodesc *crda; struct tdb_crypto *tc = NULL; struct mbuf *mi; diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 0d11b45b4e7..948f838bef8 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.164 2021/07/07 18:03:46 bluhm Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.165 2021/07/08 09:22:30 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -90,8 +90,8 @@ esp_attach(void) int esp_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii) { - struct enc_xform *txform = NULL; - struct auth_hash *thash = NULL; + const struct enc_xform *txform = NULL; + const struct auth_hash *thash = NULL; struct cryptoini cria, crie, crin; int error; @@ -337,8 +337,8 @@ esp_zeroize(struct tdb *tdbp) int esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) { - struct auth_hash *esph = (struct auth_hash *) tdb->tdb_authalgxform; - struct enc_xform *espx = (struct enc_xform *) tdb->tdb_encalgxform; + const struct auth_hash *esph = tdb->tdb_authalgxform; + const struct enc_xform *espx = tdb->tdb_encalgxform; struct cryptodesc *crde = NULL, *crda = NULL; struct cryptop *crp = NULL; struct tdb_crypto *tc = NULL; @@ -546,7 +546,7 @@ esp_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) u_int8_t lastthree[3], aalg[AH_HMAC_MAX_HASHLEN]; int hlen, roff, skip, protoff; struct mbuf *m1, *mo; - struct auth_hash *esph; + const struct auth_hash *esph; u_int32_t btsx, esn; caddr_t ptr; #ifdef ENCDEBUG @@ -558,7 +558,7 @@ esp_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) NET_ASSERT_LOCKED(); - esph = (struct auth_hash *) tdb->tdb_authalgxform; + esph = tdb->tdb_authalgxform; /* If authentication was performed, check now. */ if (esph != NULL) { @@ -743,8 +743,8 @@ int esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, int protoff) { - struct enc_xform *espx = (struct enc_xform *) tdb->tdb_encalgxform; - struct auth_hash *esph = (struct auth_hash *) tdb->tdb_authalgxform; + const struct enc_xform *espx = tdb->tdb_encalgxform; + const struct auth_hash *esph = tdb->tdb_authalgxform; int ilen, hlen, rlen, padding, blks, alen, roff, error; u_int64_t replay64; u_int32_t replay; diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c index c93c34a4c96..8540694dcb5 100644 --- a/sys/netinet/ip_ipcomp.c +++ b/sys/netinet/ip_ipcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipcomp.c,v 1.68 2021/06/18 15:34:21 bluhm Exp $ */ +/* $OpenBSD: ip_ipcomp.c,v 1.69 2021/07/08 09:22:30 bluhm Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org) @@ -77,7 +77,7 @@ ipcomp_attach(void) int ipcomp_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii) { - struct comp_algo *tcomp = NULL; + const struct comp_algo *tcomp = NULL; struct cryptoini cric; int error; @@ -133,7 +133,7 @@ ipcomp_zeroize(struct tdb *tdbp) int ipcomp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) { - struct comp_algo *ipcompx = (struct comp_algo *) tdb->tdb_compalgxform; + const struct comp_algo *ipcompx = tdb->tdb_compalgxform; struct tdb_crypto *tc; int hlen, error; @@ -321,7 +321,7 @@ int ipcomp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, int protoff) { - struct comp_algo *ipcompx = (struct comp_algo *) tdb->tdb_compalgxform; + const struct comp_algo *ipcompx = tdb->tdb_compalgxform; int error, hlen; struct cryptodesc *crdc = NULL; struct cryptop *crp = NULL; diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index bf71c019c03..fea61e91770 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.198 2021/07/07 18:03:46 bluhm Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.199 2021/07/08 09:22:30 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -321,9 +321,9 @@ struct tdb { /* tunnel descriptor block */ struct tdb *tdb_onext; struct xformsw *tdb_xform; /* Transform to use */ - struct enc_xform *tdb_encalgxform; /* Enc algorithm */ - struct auth_hash *tdb_authalgxform; /* Auth algorithm */ - struct comp_algo *tdb_compalgxform; /* Compression algo */ + const struct enc_xform *tdb_encalgxform; /* Enc algorithm */ + const struct auth_hash *tdb_authalgxform; /* Auth algorithm */ + const struct comp_algo *tdb_compalgxform; /* Compression algo */ #define TDBF_UNIQUE 0x00001 /* This should not be used by others */ #define TDBF_TIMER 0x00002 /* Absolute expiration timer in use */ @@ -518,17 +518,6 @@ extern char ipsec_def_enc[]; extern char ipsec_def_auth[]; extern char ipsec_def_comp[]; -extern struct enc_xform enc_xform_des; -extern struct enc_xform enc_xform_3des; -extern struct enc_xform enc_xform_blf; -extern struct enc_xform enc_xform_cast5; - -extern struct auth_hash auth_hash_hmac_md5_96; -extern struct auth_hash auth_hash_hmac_sha1_96; -extern struct auth_hash auth_hash_hmac_ripemd_160_96; - -extern struct comp_algo comp_algo_deflate; - extern TAILQ_HEAD(ipsec_policy_head, ipsec_policy) ipsec_policy_head; struct cryptop; |