summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-16 12:29:38 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-16 12:29:38 +0200
commit8cd0e1a0eeab2af32e9f0d80ecf6ec1e7052f96c (patch)
tree3730dba1db9e84c54bd919ae84e92aac27c9dd1f /src
parent50c330960e53060a685b7ea9818c1bd29c490be8 (diff)
downloadgnutls-8cd0e1a0eeab2af32e9f0d80ecf6ec1e7052f96c.tar.gz
certtool: use gnutls_pkcs7_print() - partially
Diffstat (limited to 'src')
-rw-r--r--src/certtool.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/certtool.c b/src/certtool.c
index 7b47b6fb31..2efd0ca747 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -3653,10 +3653,8 @@ void pkcs7_info(common_info_st *cinfo)
gnutls_pkcs7_t pkcs7;
int result;
size_t size;
- gnutls_datum_t data, b64;
+ gnutls_datum_t data, b64, str;
int indx, count;
- unsigned i;
- gnutls_pkcs7_signature_info_st info;
result = gnutls_pkcs7_init(&pkcs7);
if (result < 0) {
@@ -3675,19 +3673,16 @@ void pkcs7_info(common_info_st *cinfo)
exit(1);
}
- for (i=0;;i++) {
- result = gnutls_pkcs7_get_signature_info(pkcs7, i, &info);
- if (result < 0)
- break;
-
- if (i==0)
- fprintf(outfile, "Signers:\n");
-
- print_pkcs7_sig_info(&info, cinfo);
-
- gnutls_pkcs7_signature_info_deinit(&info);
+ result = gnutls_pkcs7_print(pkcs7, GNUTLS_CRT_PRINT_COMPACT, &str);
+ if (result < 0) {
+ fprintf(stderr, "printing error: %s\n",
+ gnutls_strerror(result));
+ exit(1);
}
+ fprintf(outfile, "%s", str.data);
+ gnutls_free(str.data);
+
/* Read and print the certificates.
*/
result = gnutls_pkcs7_get_crt_count(pkcs7);