[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Sat Apr 23 03:19:18 UTC 2016


The branch master has been updated
       via  9f13d4dd5ec420fb2fa0a7b94a6d66bb2700a492 (commit)
       via  53e409db615550c4bf5da2c9a5f56c7065315636 (commit)
      from  c62981390d6cf9e3d612c489b8b77c2913b25807 (commit)


- Log -----------------------------------------------------------------
commit 9f13d4dd5ec420fb2fa0a7b94a6d66bb2700a492
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Fri Apr 22 18:44:23 2016 +0100

    add test for CVE-2016-2109
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 53e409db615550c4bf5da2c9a5f56c7065315636
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Fri Apr 22 18:37:42 2016 +0100

    In d2i_test return error for malloc failure.
    
    Bad ASN.1 data should never be able to trigger a malloc failure so return
    an error in d2i_test if a malloc failure occurs.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

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

Summary of changes:
 test/d2i-tests/bad_bio.der | Bin 0 -> 7 bytes
 test/d2i_test.c            |   3 +++
 test/recipes/25-test_d2i.t |   6 +++++-
 3 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 test/d2i-tests/bad_bio.der

diff --git a/test/d2i-tests/bad_bio.der b/test/d2i-tests/bad_bio.der
new file mode 100644
index 0000000..8681f05
Binary files /dev/null and b/test/d2i-tests/bad_bio.der differ
diff --git a/test/d2i_test.c b/test/d2i_test.c
index 49882a3..78adf48 100644
--- a/test/d2i_test.c
+++ b/test/d2i_test.c
@@ -108,6 +108,9 @@ static int execute_test(D2I_TEST_FIXTURE fixture)
         ret = 1;
 
  err:
+    /* Don't indicate success for memory allocation errors */
+    if (ret == 1 && ERR_GET_REASON(ERR_peek_error()) == ERR_R_MALLOC_FAILURE)
+        ret = 0;
     BIO_free(bio);
     OPENSSL_free(der);
     ASN1_item_free(value, item_type);
diff --git a/test/recipes/25-test_d2i.t b/test/recipes/25-test_d2i.t
index 111fa5b..9e1a643 100644
--- a/test/recipes/25-test_d2i.t
+++ b/test/recipes/25-test_d2i.t
@@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
 
 setup("test_d2i");
 
-plan tests => 2;
+plan tests => 3;
 
 ok(run(test(["d2i_test", "X509", "decode",
              srctop_file('test','d2i-tests','bad_cert.der')])),
@@ -24,3 +24,7 @@ ok(run(test(["d2i_test", "X509", "decode",
 ok(run(test(["d2i_test", "GENERAL_NAME", "decode",
              srctop_file('test','d2i-tests','bad_generalname.der')])),
    "Running d2i_test bad_generalname.der");
+
+ok(run(test(["d2i_test", "ASN1_ANY", "BIO",
+             srctop_file('test','d2i-tests','bad_bio.der')])),
+   "Running d2i_test bad_bio.der");


More information about the openssl-commits mailing list