[openssl] master update

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


The branch master has been updated
       via  93c87f745d5694b829d5b52d371d478b063a1fba (commit)
      from  d8701e25239dc3d0c9d871e53873f592420f71d0 (commit)


- Log -----------------------------------------------------------------
commit 93c87f745d5694b829d5b52d371d478b063a1fba
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)

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

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 67f2980881..5e7529876a 100644
--- a/test/rsa_test.c
+++ b/test/rsa_test.c
@@ -231,18 +231,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