Add error checking, small nit on ouput
authorFdaSilvaYY <fdasilvayy@gmail.com>
Tue, 27 Sep 2016 21:03:41 +0000 (23:03 +0200)
committerRich Salz <rsalz@openssl.org>
Wed, 19 Oct 2016 10:42:43 +0000 (06:42 -0400)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1632)
(cherry picked from commit 31dad404fd6854ec8dd697bcccfef1e8dba3faff)

crypto/ts/ts_lib.c

index 99c0580f2aef39da1c496f9b6cec67d79ba2f891..de36e0e08420e6a896fdabed0b73855cede5c005 100644 (file)
@@ -57,9 +57,10 @@ int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions)
     for (i = 0; i < n; i++) {
         ex = X509v3_get_ext(extensions, i);
         obj = X509_EXTENSION_get_object(ex);
-        i2a_ASN1_OBJECT(bio, obj);
+        if (i2a_ASN1_OBJECT(bio, obj) < 0)
+            return 0;
         critical = X509_EXTENSION_get_critical(ex);
-        BIO_printf(bio, ": %s\n", critical ? "critical" : "");
+        BIO_printf(bio, ":%s\n", critical ? " critical" : "");
         if (!X509V3_EXT_print(bio, ex, 0, 4)) {
             BIO_printf(bio, "%4s", "");
             ASN1_STRING_print(bio, X509_EXTENSION_get_data(ex));