Changeset View
Changeset View
Standalone View
Standalone View
head/sys/opencrypto/cryptosoft.c
Show First 20 Lines • Show All 980 Lines • ▼ Show 20 Lines | |||||
* Free a session. | * Free a session. | ||||
*/ | */ | ||||
static int | static int | ||||
swcr_freesession_locked(device_t dev, u_int64_t tid) | swcr_freesession_locked(device_t dev, u_int64_t tid) | ||||
{ | { | ||||
struct swcr_data *swd; | struct swcr_data *swd; | ||||
struct enc_xform *txf; | struct enc_xform *txf; | ||||
struct auth_hash *axf; | struct auth_hash *axf; | ||||
struct comp_algo *cxf; | |||||
u_int32_t sid = CRYPTO_SESID2LID(tid); | u_int32_t sid = CRYPTO_SESID2LID(tid); | ||||
if (sid > swcr_sesnum || swcr_sessions == NULL || | if (sid > swcr_sesnum || swcr_sessions == NULL || | ||||
swcr_sessions[sid] == NULL) | swcr_sessions[sid] == NULL) | ||||
return EINVAL; | return EINVAL; | ||||
/* Silently accept and return */ | /* Silently accept and return */ | ||||
if (sid == 0) | if (sid == 0) | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | while ((swd = swcr_sessions[sid]) != NULL) { | ||||
case CRYPTO_SHA1: | case CRYPTO_SHA1: | ||||
axf = swd->sw_axf; | axf = swd->sw_axf; | ||||
if (swd->sw_ictx) | if (swd->sw_ictx) | ||||
free(swd->sw_ictx, M_CRYPTO_DATA); | free(swd->sw_ictx, M_CRYPTO_DATA); | ||||
break; | break; | ||||
case CRYPTO_DEFLATE_COMP: | case CRYPTO_DEFLATE_COMP: | ||||
cxf = swd->sw_cxf; | /* Nothing to do */ | ||||
break; | break; | ||||
} | } | ||||
free(swd, M_CRYPTO_DATA); | free(swd, M_CRYPTO_DATA); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines |