-/* $OpenBSD: ip_ah.c,v 1.149 2021/07/08 15:13:14 bluhm Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.150 2021/07/08 21:07:19 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
* ah_init() is called when an SPI is being set up.
*/
int
-ah_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii)
+ah_init(struct tdb *tdbp, const struct xformsw *xsp, struct ipsecinit *ii)
{
const struct auth_hash *thash = NULL;
struct cryptoini cria, crin;
-/* $OpenBSD: ip_ipsp.c,v 1.239 2021/07/08 15:13:14 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.240 2021/07/08 21:07:19 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
* This is the proper place to define the various encapsulation transforms.
*/
-struct xformsw xformsw[] = {
+const struct xformsw xformsw[] = {
#ifdef IPSEC
{
.xf_type = XF_IP4,
#endif /* TCP_SIGNATURE */
};
-struct xformsw *xformswNXFORMSW = &xformsw[nitems(xformsw)];
+const struct xformsw *const xformswNXFORMSW = &xformsw[nitems(xformsw)];
#define TDB_HASHSIZE_INIT 32
int
tdb_init(struct tdb *tdbp, u_int16_t alg, struct ipsecinit *ii)
{
- struct xformsw *xsp;
+ const struct xformsw *xsp;
int err;
#ifdef ENCDEBUG
char buf[INET6_ADDRSTRLEN];
-/* $OpenBSD: ip_ipsp.h,v 1.199 2021/07/08 09:22:30 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.200 2021/07/08 21:07:19 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
struct tdb *tdb_inext;
struct tdb *tdb_onext;
- struct xformsw *tdb_xform; /* Transform to use */
+ const struct xformsw *tdb_xform; /* Transform to use */
const struct enc_xform *tdb_encalgxform; /* Enc algorithm */
const struct auth_hash *tdb_authalgxform; /* Auth algorithm */
const struct comp_algo *tdb_compalgxform; /* Compression algo */
u_short xf_flags; /* flags (see below) */
char *xf_name; /* human-readable name */
int (*xf_attach)(void); /* called at config time */
- int (*xf_init)(struct tdb *, struct xformsw *, struct ipsecinit *);
+ int (*xf_init)(struct tdb *, const struct xformsw *,
+ struct ipsecinit *);
int (*xf_zeroize)(struct tdb *); /* termination */
int (*xf_input)(struct mbuf *, struct tdb *, int, int); /* input */
int (*xf_output)(struct mbuf *, struct tdb *, struct mbuf **,
/* XF_IP4 */
int ipe4_attach(void);
-int ipe4_init(struct tdb *, struct xformsw *, struct ipsecinit *);
+int ipe4_init(struct tdb *, const struct xformsw *, struct ipsecinit *);
int ipe4_zeroize(struct tdb *);
int ipe4_input(struct mbuf *, struct tdb *, int, int);
/* XF_AH */
int ah_attach(void);
-int ah_init(struct tdb *, struct xformsw *, struct ipsecinit *);
+int ah_init(struct tdb *, const struct xformsw *, struct ipsecinit *);
int ah_zeroize(struct tdb *);
int ah_input(struct mbuf *, struct tdb *, int, int);
int ah_input_cb(struct tdb *, struct tdb_crypto *, struct mbuf *, int);
/* XF_ESP */
int esp_attach(void);
-int esp_init(struct tdb *, struct xformsw *, struct ipsecinit *);
+int esp_init(struct tdb *, const struct xformsw *, struct ipsecinit *);
int esp_zeroize(struct tdb *);
int esp_input(struct mbuf *, struct tdb *, int, int);
int esp_input_cb(struct tdb *, struct tdb_crypto *, struct mbuf *, int);
/* XF_IPCOMP */
int ipcomp_attach(void);
-int ipcomp_init(struct tdb *, struct xformsw *, struct ipsecinit *);
+int ipcomp_init(struct tdb *, const struct xformsw *, struct ipsecinit *);
int ipcomp_zeroize(struct tdb *);
int ipcomp_input(struct mbuf *, struct tdb *, int, int);
int ipcomp_input_cb(struct tdb *, struct tdb_crypto *, struct mbuf *, int);
/* XF_TCPSIGNATURE */
int tcp_signature_tdb_attach(void);
-int tcp_signature_tdb_init(struct tdb *, struct xformsw *,
+int tcp_signature_tdb_init(struct tdb *, const struct xformsw *,
struct ipsecinit *);
int tcp_signature_tdb_zeroize(struct tdb *);
int tcp_signature_tdb_input(struct mbuf *, struct tdb *, int, int);