[openssl] master update

tomas at openssl.org tomas at openssl.org
Fri Feb 26 17:43:53 UTC 2021


The branch master has been updated
       via  d2ccfb9caa9f69d4980f8fe49a15a043c91b40c5 (commit)
       via  4519ea90eb8137ce3f00860a705f8320f41b6057 (commit)
      from  db7fbd54cf0636e25d4f8b8fddd829741064b831 (commit)


- Log -----------------------------------------------------------------
commit d2ccfb9caa9f69d4980f8fe49a15a043c91b40c5
Author: Tomas Mraz <tomas at openssl.org>
Date:   Thu Feb 25 15:08:16 2021 +0100

    evp_pkey_provided_test: Improve diagnostic output
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14316)

commit 4519ea90eb8137ce3f00860a705f8320f41b6057
Author: Tomas Mraz <tomas at openssl.org>
Date:   Thu Feb 25 14:43:21 2021 +0100

    tests: Always print errors before test verdict
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14316)

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

Summary of changes:
 test/evp_pkey_provided_test.c | 9 +++++----
 test/testutil/driver.c        | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c
index fd0dcdd38a..18b62d4645 100644
--- a/test/evp_pkey_provided_test.c
+++ b/test/evp_pkey_provided_test.c
@@ -361,15 +361,16 @@ static int test_fromdata_rsa(void)
         || !TEST_false(EVP_PKEY_copy_parameters(copy_pk, pk)))
         goto err;
 
+    ret = test_print_key_using_pem("RSA", pk)
+          && test_print_key_using_encoder("RSA", pk);
+ err:
+    /* for better diagnostics always compare key params */
     for (i = 0; fromdata_params[i].key != NULL; ++i) {
         if (!TEST_true(BN_set_word(bn_from, key_numbers[i]))
             || !TEST_true(EVP_PKEY_get_bn_param(pk, fromdata_params[i].key, &bn))
             || !TEST_BN_eq(bn, bn_from))
-            goto err;
+            ret = 0;
     }
-    ret = test_print_key_using_pem("RSA", pk)
-          && test_print_key_using_encoder("RSA", pk);
- err:
     BN_free(bn_from);
     BN_free(bn);
     EVP_PKEY_free(pk);
diff --git a/test/testutil/driver.c b/test/testutil/driver.c
index 467c3e8eb3..24222fa865 100644
--- a/test/testutil/driver.c
+++ b/test/testutil/driver.c
@@ -327,8 +327,8 @@ int run_tests(const char *test_prog_name)
         } else if (all_tests[i].num == -1) {
             set_test_title(all_tests[i].test_case_name);
             verdict = all_tests[i].test_fn();
-            test_verdict(verdict, "%d - %s", ii + 1, test_title);
             finalize(verdict != 0);
+            test_verdict(verdict, "%d - %s", ii + 1, test_title);
             if (verdict == 0)
                 num_failed++;
         } else {


More information about the openssl-commits mailing list