MINOR: ssl: Remove empty lines from "show ssl ocsp-response" output
There were empty lines in the output of the CLI's "show ssl
ocsp-response" command (after the certificate ID and between two
certificates). This patch removes them since an empty line should mark
the end of the output.
Must be backported in 2.5.
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 2f030ba..57cb7c7 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -7210,13 +7210,12 @@
BIO_printf(bp, "%*sCertificate ID:\n", indent, "");
indent += 2;
- BIO_printf(bp, "\n%*sIssuer Name Hash: ", indent, "");
+ BIO_printf(bp, "%*sIssuer Name Hash: ", indent, "");
i2a_ASN1_STRING(bp, piNameHash, 0);
BIO_printf(bp, "\n%*sIssuer Key Hash: ", indent, "");
i2a_ASN1_STRING(bp, piKeyHash, 0);
BIO_printf(bp, "\n%*sSerial Number: ", indent, "");
i2a_ASN1_INTEGER(bp, pSerial);
- BIO_printf(bp, "\n");
}
return 1;
}
@@ -7276,6 +7275,9 @@
/* Dump the CERTID info */
ocsp_certid_print(bio, certid, 1);
write = BIO_read(bio, tmp->area, tmp->size-1);
+ /* strip trailing LFs */
+ while (write > 0 && tmp->area[write-1] == '\n')
+ write--;
tmp->area[write] = '\0';
chunk_appendf(trash, "%s\n", tmp->area);