diff options
Diffstat (limited to 'module/icp/io/aes.c')
-rw-r--r-- | module/icp/io/aes.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/module/icp/io/aes.c b/module/icp/io/aes.c index 6ff51f9b7..d6f01304f 100644 --- a/module/icp/io/aes.c +++ b/module/icp/io/aes.c @@ -945,17 +945,9 @@ out: memset(aes_ctx.ac_keysched, 0, aes_ctx.ac_keysched_len); kmem_free(aes_ctx.ac_keysched, aes_ctx.ac_keysched_len); } -#ifdef CAN_USE_GCM_ASM - if (aes_ctx.ac_flags & (GCM_MODE|GMAC_MODE) && - ((gcm_ctx_t *)&aes_ctx)->gcm_Htable != NULL) { - - gcm_ctx_t *ctx = (gcm_ctx_t *)&aes_ctx; - - memset(ctx->gcm_Htable, 0, ctx->gcm_htab_len); - kmem_free(ctx->gcm_Htable, ctx->gcm_htab_len); + if (aes_ctx.ac_flags & (GCM_MODE|GMAC_MODE)) { + gcm_clear_ctx((gcm_ctx_t *)&aes_ctx); } -#endif - return (ret); } @@ -1101,18 +1093,7 @@ out: vmem_free(aes_ctx.ac_pt_buf, aes_ctx.ac_data_len); } } else if (aes_ctx.ac_flags & (GCM_MODE|GMAC_MODE)) { - if (((gcm_ctx_t *)&aes_ctx)->gcm_pt_buf != NULL) { - vmem_free(((gcm_ctx_t *)&aes_ctx)->gcm_pt_buf, - ((gcm_ctx_t *)&aes_ctx)->gcm_pt_buf_len); - } -#ifdef CAN_USE_GCM_ASM - if (((gcm_ctx_t *)&aes_ctx)->gcm_Htable != NULL) { - gcm_ctx_t *ctx = (gcm_ctx_t *)&aes_ctx; - - memset(ctx->gcm_Htable, 0, ctx->gcm_htab_len); - kmem_free(ctx->gcm_Htable, ctx->gcm_htab_len); - } -#endif + gcm_clear_ctx((gcm_ctx_t *)&aes_ctx); } return (ret); |