]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
do not print Key ID in a pkcs12 structure if it is null.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 6 Apr 2012 06:41:01 +0000 (08:41 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 6 Apr 2012 06:41:01 +0000 (08:41 +0200)
src/certtool.c

index 0c4ed9aa18fdcb35a7f25416196be06d23d13eee..58ebcd19fecca0957896f3e42fa955c5c0ae6129 100644 (file)
@@ -2602,7 +2602,8 @@ print_bag_data (gnutls_pkcs12_bag_t bag)
       result = gnutls_pkcs12_bag_get_key_id (bag, i, &id);
       if (result < 0)
         error (EXIT_FAILURE, 0, "get_key_id: %s", gnutls_strerror (type));
-      fprintf (outfile, "\tKey ID: %s\n", raw_to_string (id.data, id.size));
+      if (id.size > 0)
+        fprintf (outfile, "\tKey ID: %s\n", raw_to_string (id.data, id.size));
 
       result = gnutls_pkcs12_bag_get_data (bag, i, &cdata);
       if (result < 0)