[openssl] master update

Dr. Paul Dale pauli at openssl.org
Thu Apr 15 23:01:09 UTC 2021


The branch master has been updated
       via  34ed73339602c361d09fe4233d65cef996356239 (commit)
      from  4a95b70d1e3df791ea569e94067cf0bec1f69557 (commit)


- Log -----------------------------------------------------------------
commit 34ed73339602c361d09fe4233d65cef996356239
Author: Pauli <pauli at openssl.org>
Date:   Tue Apr 13 12:11:41 2021 +1000

    SipHash: Fix CTRL API for the digest size.
    
    Adds a mapping from "digestsize" to "size" for setting a param.
    
    Fixes #14370
    
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14850)

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

Summary of changes:
 crypto/evp/ctrl_params_translate.c               | 8 ++++++++
 test/recipes/30-test_evp_data/evpmac_siphash.txt | 8 +++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
index 2d09f182cf..65414f6ede 100644
--- a/crypto/evp/ctrl_params_translate.c
+++ b/crypto/evp/ctrl_params_translate.c
@@ -2093,6 +2093,14 @@ static const struct translation_st evp_pkey_ctx_translations[] = {
       EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES, "rsa_keygen_primes", NULL,
       OSSL_PKEY_PARAM_RSA_PRIMES, OSSL_PARAM_UNSIGNED_INTEGER, NULL },
 
+    /*-
+     * SipHash
+     * ======
+     */
+    { SET, -1, -1, EVP_PKEY_OP_TYPE_SIG,
+      EVP_PKEY_CTRL_SET_DIGEST_SIZE, "digestsize", NULL,
+      OSSL_MAC_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL },
+
     /*-
      * TLS1-PRF
      * ========
diff --git a/test/recipes/30-test_evp_data/evpmac_siphash.txt b/test/recipes/30-test_evp_data/evpmac_siphash.txt
index a9081a1c81..8fb6e1cb29 100644
--- a/test/recipes/30-test_evp_data/evpmac_siphash.txt
+++ b/test/recipes/30-test_evp_data/evpmac_siphash.txt
@@ -134,6 +134,12 @@ Key = 000102030405060708090A0B0C0D0E0F
 Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
 Output = 724506EB4C328A95
 
+MAC = SipHash by EVP_PKEY
+Ctrl = digestsize:8
+Key = 000102030405060708090A0B0C0D0E0F
+Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
+Output = 724506EB4C328A95
+
 # SIPHASH - default values: 2,4 rounds, explicit 16-byte mac
 
 MAC = SipHash
@@ -161,7 +167,7 @@ Result = MAC_INIT_ERROR
 # by EVP_PKEY this time
 
 MAC = SipHash by EVP_PKEY
-Ctrl = size:13
+Ctrl = digestsize:13
 Key = 000102030405060708090A0B0C0D0E0F
 Result = EVPPKEYCTXCTRL_ERROR
 


More information about the openssl-commits mailing list