diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-01 15:18:34 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-07 14:51:19 +0200 |
commit | 595bc2b1dab1e597ace968864483c21b7633e137 (patch) | |
tree | c43a6255f3b94782e80ca7e3363310f2cb8b8d39 | |
parent | 26e9c71cf348009d2bf71b5c4396bab5806968fc (diff) | |
download | gnutls-595bc2b1dab1e597ace968864483c21b7633e137.tar.gz |
certtool: better print provable key validation parameters
That is, include hash in the printable set, and keep spaces
from next fields.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | src/certtool-common.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/certtool-common.c b/src/certtool-common.c index fa834f83e5..4d876976dc 100644 --- a/src/certtool-common.c +++ b/src/certtool-common.c @@ -1121,6 +1121,7 @@ static void privkey_info_int(FILE *outfile, common_info_st * cinfo, size_t size; const char *cprint; gnutls_x509_spki_t spki; + gnutls_digest_algorithm_t dig; /* Public key algorithm */ @@ -1139,7 +1140,6 @@ static void privkey_info_int(FILE *outfile, common_info_st * cinfo, fprintf(outfile, "%s\n", cprint ? cprint : "Unknown"); if (key_type == GNUTLS_PK_RSA_PSS) { - gnutls_digest_algorithm_t dig; unsigned int salt_size; ret = gnutls_x509_privkey_get_spki(key, spki, 0); @@ -1238,15 +1238,18 @@ static void privkey_info_int(FILE *outfile, common_info_st * cinfo, } } - fprintf(outfile, "\n"); - size = lbuffer_size; - ret = gnutls_x509_privkey_get_seed(key, NULL, lbuffer, &size); + ret = gnutls_x509_privkey_get_seed(key, &dig, lbuffer, &size); if (ret >= 0) { - fprintf(outfile, "Seed: %s\n", - raw_to_string(lbuffer, size)); + fprintf(outfile, "Validation parameters:\n"); + fprintf(outfile, "\tHash: %s\n", + gnutls_digest_get_name(dig)); + fprintf(outfile, "\tSeed: %s\n", + raw_to_hex(lbuffer, size)); } + fprintf(outfile, "\n"); + size = lbuffer_size; ret = gnutls_x509_privkey_get_key_id(key, GNUTLS_KEYID_USE_SHA256, lbuffer, &size); |