aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-07-13 23:46:07 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-07-13 23:46:07 +0000
commit2e08e39ff53a55f7ba5db298069b00a9e73f2dc3 (patch)
treef865cd713b628abe8e76b8b6607f05dba7bd3eff /sys/netipsec
parent530a4c5af643ade67d2e5deb91692fa07382db46 (diff)
downloadsrc-2e08e39ff53a55f7ba5db298069b00a9e73f2dc3.tar.gz
src-2e08e39ff53a55f7ba5db298069b00a9e73f2dc3.zip
OCF: Add a typedef for session identifiers
No functional change. This should ease the transition from an integer session identifier model to an opaque pointer model.
Notes
Notes: svn path=/head/; revision=336269
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/ipsec.c5
-rw-r--r--sys/netipsec/ipsec.h2
-rw-r--r--sys/netipsec/keydb.h3
-rw-r--r--sys/netipsec/xform.h2
-rw-r--r--sys/netipsec/xform_ah.c8
-rw-r--r--sys/netipsec/xform_esp.c9
-rw-r--r--sys/netipsec/xform_ipcomp.c4
7 files changed, 18 insertions, 15 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index 5097b94a8d91..70485894c521 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -1322,9 +1322,10 @@ ok:
}
int
-ipsec_updateid(struct secasvar *sav, uint64_t *new, uint64_t *old)
+ipsec_updateid(struct secasvar *sav, crypto_session_t *new,
+ crypto_session_t *old)
{
- uint64_t tmp;
+ crypto_session_t tmp;
/*
* tdb_cryptoid is initialized by xform_init().
diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h
index 02fd96d32f42..0124b12c20cd 100644
--- a/sys/netipsec/ipsec.h
+++ b/sys/netipsec/ipsec.h
@@ -332,7 +332,7 @@ int udp_ipsec_pcbctl(struct inpcb *, struct sockopt *);
int ipsec_chkreplay(uint32_t, struct secasvar *);
int ipsec_updatereplay(uint32_t, struct secasvar *);
-int ipsec_updateid(struct secasvar *, uint64_t *, uint64_t *);
+int ipsec_updateid(struct secasvar *, crypto_session_t *, crypto_session_t *);
int ipsec_initialized(void);
void ipsec_setspidx_inpcb(struct inpcb *, struct secpolicyindex *, u_int);
diff --git a/sys/netipsec/keydb.h b/sys/netipsec/keydb.h
index 19eae7673fe2..6993b4e4ff1d 100644
--- a/sys/netipsec/keydb.h
+++ b/sys/netipsec/keydb.h
@@ -41,6 +41,7 @@
#include <sys/mutex.h>
#include <netipsec/key_var.h>
+#include <opencrypto/_cryptodev.h>
#ifndef _SOCKADDR_UNION_DEFINED
#define _SOCKADDR_UNION_DEFINED
@@ -162,7 +163,7 @@ struct secasvar {
const struct enc_xform *tdb_encalgxform;/* encoding algorithm */
const struct auth_hash *tdb_authalgxform;/* authentication algorithm */
const struct comp_algo *tdb_compalgxform;/* compression algorithm */
- uint64_t tdb_cryptoid; /* crypto session id */
+ crypto_session_t tdb_cryptoid; /* crypto session */
uint8_t alg_auth; /* Authentication Algorithm Identifier*/
uint8_t alg_enc; /* Cipher Algorithm Identifier */
diff --git a/sys/netipsec/xform.h b/sys/netipsec/xform.h
index 2720f72af3f2..389d0b66850b 100644
--- a/sys/netipsec/xform.h
+++ b/sys/netipsec/xform.h
@@ -71,7 +71,7 @@ struct xform_history {
struct xform_data {
struct secpolicy *sp; /* security policy */
struct secasvar *sav; /* related SA */
- uint64_t cryptoid; /* used crypto session id */
+ crypto_session_t cryptoid; /* used crypto session */
u_int idx; /* IPsec request index */
int protoff; /* current protocol offset */
int skip; /* data offset */
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c
index 1be268fc5c16..2e7ce26c5b05 100644
--- a/sys/netipsec/xform_ah.c
+++ b/sys/netipsec/xform_ah.c
@@ -544,7 +544,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff)
struct cryptop *crp;
struct xform_data *xd;
struct newah *ah;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
int hl, rplen, authsize, ahsize, error;
IPSEC_ASSERT(sav != NULL, ("null SA"));
@@ -699,7 +699,7 @@ ah_input_cb(struct cryptop *crp)
struct secasvar *sav;
struct secasindex *saidx;
caddr_t ptr;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
int authsize, rplen, ahsize, error, skip, protoff;
uint8_t nxt;
@@ -849,7 +849,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav,
struct mbuf *mi;
struct cryptop *crp;
struct newah *ah;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
uint16_t iplen;
int error, rplen, authsize, ahsize, maxpacketsize, roff;
uint8_t prot;
@@ -1082,7 +1082,7 @@ ah_output_cb(struct cryptop *crp)
struct secpolicy *sp;
struct secasvar *sav;
struct mbuf *m;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
caddr_t ptr;
u_int idx;
int skip, error;
diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c
index c6212e41a82e..9e48311ddc0d 100644
--- a/sys/netipsec/xform_esp.c
+++ b/sys/netipsec/xform_esp.c
@@ -271,7 +271,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff)
struct cryptop *crp;
struct newesp *esp;
uint8_t *ivp;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
int alen, error, hlen, plen;
IPSEC_ASSERT(sav != NULL, ("null SA"));
@@ -448,7 +448,7 @@ esp_input_cb(struct cryptop *crp)
struct secasvar *sav;
struct secasindex *saidx;
caddr_t ptr;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
int hlen, skip, protoff, error, alen;
crd = crp->crp_desc;
@@ -637,7 +637,8 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav,
struct secasindex *saidx;
unsigned char *pad;
uint8_t *ivp;
- uint64_t cntr, cryptoid;
+ uint64_t cntr;
+ crypto_session_t cryptoid;
int hlen, rlen, padding, blks, alen, i, roff;
int error, maxpacketsize;
uint8_t prot;
@@ -883,7 +884,7 @@ esp_output_cb(struct cryptop *crp)
struct secpolicy *sp;
struct secasvar *sav;
struct mbuf *m;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
u_int idx;
int error;
diff --git a/sys/netipsec/xform_ipcomp.c b/sys/netipsec/xform_ipcomp.c
index 7a4a630bb693..2b02091e9d81 100644
--- a/sys/netipsec/xform_ipcomp.c
+++ b/sys/netipsec/xform_ipcomp.c
@@ -280,7 +280,7 @@ ipcomp_input_cb(struct cryptop *crp)
struct secasvar *sav;
struct secasindex *saidx;
caddr_t addr;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
int hlen = IPCOMP_HLENGTH, error, clen;
int skip, protoff;
uint8_t nproto;
@@ -531,7 +531,7 @@ ipcomp_output_cb(struct cryptop *crp)
struct secpolicy *sp;
struct secasvar *sav;
struct mbuf *m;
- uint64_t cryptoid;
+ crypto_session_t cryptoid;
u_int idx;
int error, skip, protoff;