[openssl] openssl-3.0 update

tomas at openssl.org tomas at openssl.org
Fri Sep 3 10:35:28 UTC 2021


The branch openssl-3.0 has been updated
       via  45950ba740c9a3d7b3029c77d7a11fe154ae2e1c (commit)
      from  f161e0ace02526b6b78dfb2f7120ee0e100f3acd (commit)


- Log -----------------------------------------------------------------
commit 45950ba740c9a3d7b3029c77d7a11fe154ae2e1c
Author: slontis <shane.lontis at oracle.com>
Date:   Thu Sep 2 16:50:45 2021 +1000

    Add KEM dupctx test
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16495)
    
    (cherry picked from commit d7b5f06ede163851d39f5a8b507bd0670deeaa21)

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

Summary of changes:
 test/evp_libctx_test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c
index bfbbafdbab..e3eac8a068 100644
--- a/test/evp_libctx_test.c
+++ b/test/evp_libctx_test.c
@@ -525,7 +525,7 @@ static int kem_rsa_gen_recover(void)
     int ret = 0;
     EVP_PKEY *pub = NULL;
     EVP_PKEY *priv = NULL;
-    EVP_PKEY_CTX *sctx = NULL, *rctx = NULL;
+    EVP_PKEY_CTX *sctx = NULL, *rctx = NULL, *dctx = NULL;
     unsigned char secret[256] = { 0, };
     unsigned char ct[256] = { 0, };
     unsigned char unwrap[256] = { 0, };
@@ -536,11 +536,12 @@ static int kem_rsa_gen_recover(void)
           && TEST_ptr(sctx = EVP_PKEY_CTX_new_from_pkey(libctx, pub, NULL))
           && TEST_int_eq(EVP_PKEY_encapsulate_init(sctx, NULL), 1)
           && TEST_int_eq(EVP_PKEY_CTX_set_kem_op(sctx, "RSASVE"), 1)
-          && TEST_int_eq(EVP_PKEY_encapsulate(sctx, NULL, &ctlen, NULL,
+          && TEST_ptr(dctx = EVP_PKEY_CTX_dup(sctx))
+          && TEST_int_eq(EVP_PKEY_encapsulate(dctx, NULL, &ctlen, NULL,
                                               &secretlen), 1)
           && TEST_int_eq(ctlen, secretlen)
           && TEST_int_eq(ctlen, bits / 8)
-          && TEST_int_eq(EVP_PKEY_encapsulate(sctx, ct, &ctlen, secret,
+          && TEST_int_eq(EVP_PKEY_encapsulate(dctx, ct, &ctlen, secret,
                                               &secretlen), 1)
           && TEST_ptr(rctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL))
           && TEST_int_eq(EVP_PKEY_decapsulate_init(rctx, NULL), 1)
@@ -553,6 +554,7 @@ static int kem_rsa_gen_recover(void)
     EVP_PKEY_free(pub);
     EVP_PKEY_free(priv);
     EVP_PKEY_CTX_free(rctx);
+    EVP_PKEY_CTX_free(dctx);
     EVP_PKEY_CTX_free(sctx);
     return ret;
 }


More information about the openssl-commits mailing list