Changeset View
Changeset View
Standalone View
Standalone View
head/sys/crypto/via/padlock_hash.c
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
padlock_sha_free(void *vctx) | padlock_sha_free(void *vctx) | ||||
{ | { | ||||
struct padlock_sha_ctx *ctx; | struct padlock_sha_ctx *ctx; | ||||
ctx = vctx; | ctx = vctx; | ||||
if (ctx->psc_buf != NULL) { | if (ctx->psc_buf != NULL) { | ||||
//bzero(ctx->psc_buf, ctx->psc_size); | zfree(ctx->psc_buf, M_PADLOCK); | ||||
free(ctx->psc_buf, M_PADLOCK); | |||||
ctx->psc_buf = NULL; | ctx->psc_buf = NULL; | ||||
ctx->psc_offset = 0; | ctx->psc_offset = 0; | ||||
ctx->psc_size = 0; | ctx->psc_size = 0; | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
padlock_sha1_final(uint8_t *hash, void *vctx) | padlock_sha1_final(uint8_t *hash, void *vctx) | ||||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void | void | ||||
padlock_hash_free(struct padlock_session *ses) | padlock_hash_free(struct padlock_session *ses) | ||||
{ | { | ||||
if (ses->ses_ictx != NULL) { | if (ses->ses_ictx != NULL) { | ||||
padlock_free_ctx(ses->ses_axf, ses->ses_ictx); | padlock_free_ctx(ses->ses_axf, ses->ses_ictx); | ||||
bzero(ses->ses_ictx, ses->ses_axf->ctxsize); | zfree(ses->ses_ictx, M_PADLOCK); | ||||
free(ses->ses_ictx, M_PADLOCK); | |||||
ses->ses_ictx = NULL; | ses->ses_ictx = NULL; | ||||
} | } | ||||
if (ses->ses_octx != NULL) { | if (ses->ses_octx != NULL) { | ||||
padlock_free_ctx(ses->ses_axf, ses->ses_octx); | padlock_free_ctx(ses->ses_axf, ses->ses_octx); | ||||
bzero(ses->ses_octx, ses->ses_axf->ctxsize); | zfree(ses->ses_octx, M_PADLOCK); | ||||
free(ses->ses_octx, M_PADLOCK); | |||||
ses->ses_octx = NULL; | ses->ses_octx = NULL; | ||||
} | } | ||||
} | } |