[openssl] OpenSSL_1_1_1-stable update

Dr. Paul Dale pauli at openssl.org
Wed Nov 11 22:24:13 UTC 2020


The branch OpenSSL_1_1_1-stable has been updated
       via  8e813c085ac43ca6a58a20f7982b26ed31dc326a (commit)
      from  6f1bee08cf80b9473496991b51f1f4a0decd96de (commit)


- Log -----------------------------------------------------------------
commit 8e813c085ac43ca6a58a20f7982b26ed31dc326a
Author: Pauli <paul.dale at oracle.com>
Date:   Tue Nov 10 17:05:30 2020 +1000

    rsa_test: add return value check
    
    Fixes #13361
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/13362)
    
    (cherry picked from commit 93c87f745d5694b829d5b52d371d478b063a1fba)

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

Summary of changes:
 test/rsa_test.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/test/rsa_test.c b/test/rsa_test.c
index 3820785edc..98d5db8bee 100644
--- a/test/rsa_test.c
+++ b/test/rsa_test.c
@@ -223,18 +223,20 @@ static int pad_unknown(void)
 static int rsa_setkey(RSA** key, unsigned char* ctext, int idx)
 {
     int clen = 0;
+
     *key = RSA_new();
-    switch (idx) {
-    case 0:
-        clen = key1(*key, ctext);
-        break;
-    case 1:
-        clen = key2(*key, ctext);
-        break;
-    case 2:
-        clen = key3(*key, ctext);
-        break;
-    }
+    if (*key != NULL)
+        switch (idx) {
+        case 0:
+            clen = key1(*key, ctext);
+            break;
+        case 1:
+            clen = key2(*key, ctext);
+            break;
+        case 2:
+            clen = key3(*key, ctext);
+            break;
+        }
     return clen;
 }
 


More information about the openssl-commits mailing list