From bcf5c14b99444967e13b1522090c685dbf9e8796 Mon Sep 17 00:00:00 2001 From: angelos Date: Sun, 23 Apr 2000 05:01:53 +0000 Subject: [PATCH] Change the type of freesession to take u_int64_t as argument. --- sys/crypto/crypto.c | 7 +++---- sys/crypto/crypto.h | 2 +- sys/crypto/cryptosoft.c | 3 ++- sys/crypto/cryptosoft.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index c30c50dabb3..d6a4f4cedc0 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -115,7 +115,7 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri) int crypto_freesession(u_int64_t sid) { - u_int32_t hid, lid; + u_int32_t hid; int err = 0; if (crypto_drivers == NULL) @@ -123,7 +123,6 @@ crypto_freesession(u_int64_t sid) /* Determine two IDs */ hid = (sid >> 31) & 0xffffffff; - lid = sid & 0xffffffff; if (hid >= crypto_drivers_num) return ENOENT; @@ -133,7 +132,7 @@ crypto_freesession(u_int64_t sid) /* Call the driver cleanup routine, if available */ if (crypto_drivers[hid].cc_freesession) - err = crypto_drivers[hid].cc_freesession(lid); + err = crypto_drivers[hid].cc_freesession(sid); /* * If this was the last session of a driver marked as invalid, make @@ -228,7 +227,7 @@ crypto_register(u_int32_t driverid, int alg, void *newses, void *freeses, crypto_drivers[driverid].cc_process = (int (*) (struct cryptop *)) process; crypto_drivers[driverid].cc_freesession = - (int (*) (u_int32_t)) freeses; + (int (*) (u_int64_t)) freeses; } return 0; diff --git a/sys/crypto/crypto.h b/sys/crypto/crypto.h index 9e3d688acab..b46433a6029 100644 --- a/sys/crypto/crypto.h +++ b/sys/crypto/crypto.h @@ -145,7 +145,7 @@ struct cryptocap int (*cc_newsession) (u_int32_t *, struct cryptoini *); int (*cc_process) (struct cryptop *); - int (*cc_freesession) (u_int32_t); + int (*cc_freesession) (u_int64_t); }; diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c index 87e5909160a..f68b811aa70 100644 --- a/sys/crypto/cryptosoft.c +++ b/sys/crypto/cryptosoft.c @@ -564,11 +564,12 @@ swcr_newsession(u_int32_t *sid, struct cryptoini *cri) * Free a session. */ int -swcr_freesession(u_int32_t sid) +swcr_freesession(u_int64_t tid) { struct swcr_data *swd; struct enc_xform *txf; struct auth_hash *axf; + u_int32_t sid = (tid >> 31) & 0xffff; if ((sid > swcr_sesnum) || (swcr_sessions == NULL) || (swcr_sessions[sid] == NULL)) diff --git a/sys/crypto/cryptosoft.h b/sys/crypto/cryptosoft.h index 459d08530b8..7741f7d1339 100644 --- a/sys/crypto/cryptosoft.h +++ b/sys/crypto/cryptosoft.h @@ -62,7 +62,7 @@ extern int swcr_authcompute(struct cryptodesc *, struct swcr_data *, caddr_t, int); extern int swcr_process(struct cryptop *); extern int swcr_newsession(u_int32_t *, struct cryptoini *); -extern int swcr_freesession(u_int32_t); +extern int swcr_freesession(u_int64_t); extern void swcr_init(void); #endif /* _KERNEL */ -- 2.20.1