/* Big TODO: do SM release in all handles, clean the saved card context -- current DF, EF, etc. */ static int sm_release (struct sc_card *card, struct sc_remote_data *rdata, unsigned char *out, size_t out_len) { struct sc_context *ctx = card->ctx; struct sm_info *sm_info = &card->sm_ctx.info; int rv; LOG_FUNC_CALLED(ctx); if (!card->sm_ctx.module.ops.finalize) LOG_FUNC_RETURN(ctx, SC_SUCCESS); rv = card->sm_ctx.module.ops.finalize(ctx, sm_info, rdata, out, out_len); sm_restore_sc_context(card, sm_info); LOG_FUNC_RETURN(ctx, rv); }
/* Big TODO: do SM release in all handles, clean the saved card context -- current DF, EF, etc. */ static int sm_release (struct sc_card *card, struct sc_remote_data *rdata, unsigned char *out, size_t out_len) { struct sc_context *ctx = card->ctx; #ifdef ENABLE_SM struct sm_info *sm_info = &card->sm_ctx.info; int rv; LOG_FUNC_CALLED(ctx); if (!card->sm_ctx.module.ops.finalize) LOG_FUNC_RETURN(ctx, SC_SUCCESS); rv = card->sm_ctx.module.ops.finalize(ctx, sm_info, rdata, out, out_len); sm_restore_sc_context(card, sm_info); LOG_FUNC_RETURN(ctx, rv); #else LOG_TEST_RET(ctx, SC_ERROR_NOT_SUPPORTED, "built without support of SM and External Authentication"); return SC_ERROR_NOT_SUPPORTED; #endif }