summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-04-19 18:28:04 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-04-19 18:30:49 +0200
commitba5228d438e4c5ea2803622f737b05263cbb7700 (patch)
tree94ce3a5682f70bad5401512f8c1ab0c100c5c43a /lib
parent872409857351f28b1e3c21526bfa6606c918b176 (diff)
downloadgnutls-ba5228d438e4c5ea2803622f737b05263cbb7700.tar.gz
cleanups in output
Diffstat (limited to 'lib')
-rw-r--r--lib/x509/output.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 33a1b28729..b581855676 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -724,12 +724,14 @@ print_altname(gnutls_buffer_st * str, const char *prefix,
{
unsigned int altname_idx;
gnutls_datum_t t;
+ char *buffer;
+ size_t size;
+ int err;
for (altname_idx = 0;; altname_idx++) {
- char *buffer = NULL;
- size_t size = 0;
- int err;
+ buffer = NULL;
+ size = 0;
if (altname_type == TYPE_CRT_SAN)
err =
gnutls_x509_crt_get_subject_alt_name(cert.crt,
@@ -771,14 +773,14 @@ print_altname(gnutls_buffer_st * str, const char *prefix,
return;
}
- if (altname_type == TYPE_CRT_SAN)
+ if (altname_type == TYPE_CRT_SAN) {
err =
gnutls_x509_crt_get_subject_alt_name(cert.crt,
altname_idx,
buffer,
&size,
NULL);
- else if (altname_type == TYPE_CRQ_SAN)
+ } else if (altname_type == TYPE_CRQ_SAN) {
err =
gnutls_x509_crq_get_subject_alt_name(cert.crq,
altname_idx,
@@ -786,14 +788,14 @@ print_altname(gnutls_buffer_st * str, const char *prefix,
&size,
NULL,
NULL);
- else if (altname_type == TYPE_CRT_IAN)
+ } else if (altname_type == TYPE_CRT_IAN) {
err =
gnutls_x509_crt_get_issuer_alt_name(cert.crt,
altname_idx,
buffer,
&size,
NULL);
-
+ }
if (err < 0) {
gnutls_free(buffer);
addf(str,