summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-06-20 09:09:41 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-06-20 14:02:38 +0200
commit59fe10784db0513be4211bc2fa1ef3a5d6ee3db3 (patch)
tree9f5084cee1d50cef6a8c3768ae92bffffae99c55
parente8ab1129a1509ea6232c52a59053a498b79cb2da (diff)
downloadgnutls-59fe10784db0513be4211bc2fa1ef3a5d6ee3db3.tar.gz
ocsp: print response's signature algorithm in compact listing
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/x509/ocsp_output.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/x509/ocsp_output.c b/lib/x509/ocsp_output.c
index d5f3ee70a9..9d4191b816 100644
--- a/lib/x509/ocsp_output.c
+++ b/lib/x509/ocsp_output.c
@@ -510,28 +510,30 @@ print_resp(gnutls_buffer_st * str, gnutls_ocsp_resp_t resp,
gnutls_free(oid.data);
gnutls_free(data.data);
+
+ }
+
+ ret = gnutls_ocsp_resp_get_signature_algorithm(resp);
+ if (ret < 0)
+ addf(str, "error: get_signature_algorithm: %s\n",
+ gnutls_strerror(ret));
+ else {
+ const char *name =
+ gnutls_sign_algorithm_get_name(ret);
+ if (name == NULL)
+ name = _("unknown");
+ addf(str, _("\tSignature Algorithm: %s\n"), name);
+ }
+ if (ret != GNUTLS_SIGN_UNKNOWN && gnutls_sign_is_secure(ret) == 0) {
+ adds(str,
+ _("warning: signed using a broken signature "
+ "algorithm that can be forged.\n"));
}
/* Signature. */
if (format == GNUTLS_OCSP_PRINT_FULL) {
gnutls_datum_t sig;
- ret = gnutls_ocsp_resp_get_signature_algorithm(resp);
- if (ret < 0)
- addf(str, "error: get_signature_algorithm: %s\n",
- gnutls_strerror(ret));
- else {
- const char *name =
- gnutls_sign_algorithm_get_name(ret);
- if (name == NULL)
- name = _("unknown");
- addf(str, _("\tSignature Algorithm: %s\n"), name);
- }
- if (ret != GNUTLS_SIGN_UNKNOWN && gnutls_sign_is_secure(ret) == 0) {
- adds(str,
- _("warning: signed using a broken signature "
- "algorithm that can be forged.\n"));
- }
ret = gnutls_ocsp_resp_get_signature(resp, &sig);
if (ret < 0)