[openssl] master update

shane.lontis at oracle.com shane.lontis at oracle.com
Tue May 25 21:30:57 UTC 2021


The branch master has been updated
       via  b8c09a893c00588ea4e5ea615b9b0d117e952144 (commit)
       via  2710ddef6fdee65f0fc89c1e8698736f9317ed14 (commit)
      from  1376708c1cfee91a891057db132aa45aa2a81a98 (commit)


- Log -----------------------------------------------------------------
commit b8c09a893c00588ea4e5ea615b9b0d117e952144
Author: Jon Spillett <jon.spillett at oracle.com>
Date:   Fri May 14 14:46:25 2021 +1000

    Add special case to skip RC4 reinit
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/15276)

commit 2710ddef6fdee65f0fc89c1e8698736f9317ed14
Author: Jon Spillett <jon.spillett at oracle.com>
Date:   Fri May 14 11:15:25 2021 +1000

    Add an evp_libctx_test test run for legacy provider
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/15276)

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

Summary of changes:
 test/evp_libctx_test.c            | 17 +++++++++++++----
 test/recipes/30-test_evp_libctx.t | 14 ++++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c
index cb8b3b7fb4..1fcfdadeef 100644
--- a/test/evp_libctx_test.c
+++ b/test/evp_libctx_test.c
@@ -314,7 +314,7 @@ err:
 
 static int test_cipher_reinit(int test_id)
 {
-    int ret = 0, diff, ccm, siv;
+    int ret = 0, diff, ccm, siv, no_null_key;
     int out1_len = 0, out2_len = 0, out3_len = 0;
     EVP_CIPHER *cipher = NULL;
     EVP_CIPHER_CTX *ctx = NULL;
@@ -354,6 +354,14 @@ static int test_cipher_reinit(int test_id)
     /* siv cannot be called with NULL key as the iv is irrelevant */
     siv = (EVP_CIPHER_mode(cipher) == EVP_CIPH_SIV_MODE);
 
+    /*
+     * Skip init call with a null key for RC4 as the stream cipher does not
+     * handle reinit (1.1.1 behaviour).
+     */
+    no_null_key = EVP_CIPHER_is_a(cipher, "RC4")
+                  || EVP_CIPHER_is_a(cipher, "RC4-40")
+                  || EVP_CIPHER_is_a(cipher, "RC4-HMAC-MD5");
+
     /* DES3-WRAP uses random every update - so it will give a different value */
     diff = EVP_CIPHER_is_a(cipher, "DES3-WRAP");
 
@@ -362,9 +370,10 @@ static int test_cipher_reinit(int test_id)
         || !TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv))
         || !TEST_int_eq(EVP_EncryptUpdate(ctx, out2, &out2_len, in, sizeof(in)),
                         ccm ? 0 : 1)
-        || !TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv))
+        || (!no_null_key
+        && (!TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv))
         || !TEST_int_eq(EVP_EncryptUpdate(ctx, out3, &out3_len, in, sizeof(in)),
-                        ccm || siv ? 0 : 1))
+                        ccm || siv ? 0 : 1))))
         goto err;
 
     if (ccm == 0) {
@@ -375,7 +384,7 @@ static int test_cipher_reinit(int test_id)
                 goto err;
         } else {
             if (!TEST_mem_eq(out1, out1_len, out2, out2_len)
-                || (!siv && !TEST_mem_eq(out1, out1_len, out3, out3_len)))
+                || (!siv && !no_null_key && !TEST_mem_eq(out1, out1_len, out3, out3_len)))
                 goto err;
         }
     }
diff --git a/test/recipes/30-test_evp_libctx.t b/test/recipes/30-test_evp_libctx.t
index 81abbdb3bf..0086cf22c9 100644
--- a/test/recipes/30-test_evp_libctx.t
+++ b/test/recipes/30-test_evp_libctx.t
@@ -16,6 +16,7 @@ BEGIN {
     setup("test_evp_libctx");
 }
 
+my $no_legacy = disabled('legacy') || ($ENV{NO_LEGACY} // 0);
 my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
 
 use lib srctop_dir('Configurations');
@@ -24,9 +25,7 @@ use lib bldtop_dir('.');
 # If no fips then run the test with no extra arguments.
 my @test_args = ( );
 
-plan tests =>
-    ($no_fips ? 0 : 1)          # FIPS install test
-    + 1;
+plan tests => ($no_fips ? 0 : 1) + ($no_legacy ? 0 : 1) + 1;
 
 unless ($no_fips) {
     @test_args = ("-config", srctop_file("test","fips-and-base.cnf"),
@@ -37,4 +36,11 @@ unless ($no_fips) {
 
 ok(run(test(["evp_libctx_test",
              "-config", srctop_file("test","default.cnf"),])),
-   "running default-and-legacy evp_libctx_test");
+   "running default evp_libctx_test");
+
+unless ($no_legacy) {
+    ok(run(test(["evp_libctx_test",
+                 "-config", srctop_file("test","default-and-legacy.cnf"),])),
+       "running default-and-legacy evp_libctx_test");
+}
+


More information about the openssl-commits mailing list