Skip to content

Commit

Permalink
swtpm: Display error messages if g_setenv fails
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed Aug 21, 2024
1 parent 8d31d88 commit 8634768
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/swtpm/tpmlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,13 @@ static int tpmlib_maybe_configure_openssl(TPMLIB_TPMVersion tpmversion)
if (ret)
return 1;
if (fix_flags & FIX_ENABLE_SHA1_SIGNATURES) {
if (!g_setenv("OPENSSL_ENABLE_SHA1_SIGNATURES", "1", true)) {
logprintf(STDERR_FILENO,
"Error: Could not set OPENSSL_ENABLE_SHA1_SIGNATURES=1\n");
return 1;
}
logprintf(STDOUT_FILENO,
"Warning: Setting OPENSSL_ENABLE_SHA1_SIGNATURES=1\n");
g_setenv("OPENSSL_ENABLE_SHA1_SIGNATURES", "1", true);
check_sha1_signatures = true;
}

Expand Down

0 comments on commit 8634768

Please sign in to comment.