Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize tcti in advance #839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/tabrmd-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ init_thread_func (gpointer user_data)

g_info ("init_thread_func start");
g_mutex_lock (&data->init_mutex);

rc = Tss2_TctiLdr_Initialize (data->options.tcti_conf, &tcti_ctx);
if (rc != TSS2_RC_SUCCESS || tcti_ctx == NULL) {
g_critical ("%s: failed to create TCTI with conf \"%s\", got RC: 0x%x",
__func__, data->options.tcti_conf, rc);
ret = EX_IOERR;
goto err_out;
}

/* Setup program signals */
if (g_unix_signal_add(SIGINT, signal_handler, data->loop) <= 0 ||
g_unix_signal_add(SIGTERM, signal_handler, data->loop) <= 0)
Expand Down Expand Up @@ -170,13 +179,6 @@ init_thread_func (gpointer user_data)
ipc_frontend_connect (data->ipc_frontend,
&data->init_mutex);

rc = Tss2_TctiLdr_Initialize (data->options.tcti_conf, &tcti_ctx);
if (rc != TSS2_RC_SUCCESS || tcti_ctx == NULL) {
g_critical ("%s: failed to create TCTI with conf \"%s\", got RC: 0x%x",
__func__, data->options.tcti_conf, rc);
ret = EX_IOERR;
goto err_out;
}
tcti = tcti_new (tcti_ctx);
data->tpm2 = tpm2_new (tcti);
g_clear_object (&tcti);
Expand Down