[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Kurt Roeckx kurt at openssl.org
Tue Jan 10 21:29:36 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  030c7cc63dd6abc9a718306bf3bd34037cbfd294 (commit)
      from  dc4667333bf5b712aa3c17b9713a6dda32d5feb1 (commit)


- Log -----------------------------------------------------------------
commit 030c7cc63dd6abc9a718306bf3bd34037cbfd294
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Thu Oct 20 20:49:22 2016 +0200

    Print the X509 version signed, and convert to unsigned for the hex version.
    
    Found by tis-interpreter
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    GH: #1754
    (cherry picked from commit 676befbeb76ca19c9e7b2febfabda16bd26e00a0)

-----------------------------------------------------------------------

Summary of changes:
 crypto/x509/t_x509.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index feeff75..ce67046 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -71,8 +71,13 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
     }
     if (!(cflag & X509_FLAG_NO_VERSION)) {
         l = X509_get_version(x);
-        if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0)
-            goto err;
+        if (l >= 0 && l <= 2) {
+            if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, (unsigned long)l) <= 0)
+                goto err;
+        } else {
+            if (BIO_printf(bp, "%8sVersion: Unknown (%ld)\n", "", l) <= 0)
+                goto err;
+        }
     }
     if (!(cflag & X509_FLAG_NO_SERIAL)) {
 


More information about the openssl-commits mailing list