Skip to content

Commit

Permalink
swtpm_cert: Move error message about importing signing key into else …
Browse files Browse the repository at this point in the history
…branch

Move the error message about the failure to import a signing key into the
else branch where it should be (all other branches of the if-then-else
statement have a check already). Also mention the key's filename.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed Nov 13, 2024
1 parent 4eb51c3 commit 31dad49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/swtpm_cert/ek-cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,11 +1436,12 @@ if (_err != GNUTLS_E_SUCCESS) { \
} else {
err = gnutls_x509_privkey_import(sigkey, &datum, GNUTLS_X509_FMT_PEM);
}
/* 'certtool --infile <sigkey_filename> -k' not working?? */
CHECK_GNUTLS_ERROR(err, "Could not import signing key %s: %s\n",
sigkey_filename, gnutls_strerror(err));
}
gnutls_free(datum.data);
datum.data = NULL;
CHECK_GNUTLS_ERROR(err, "Could not import signing key : %s\n",
gnutls_strerror(err));

err = gnutls_load_file(issuercert_filename, &datum);
CHECK_GNUTLS_ERROR(err, "Could not read certificate from file %s : %s\n",
Expand Down

0 comments on commit 31dad49

Please sign in to comment.