diff options
author | Richard Levitte <levitte@openssl.org> | 2018-09-08 23:19:06 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2018-09-09 01:47:56 +0200 |
commit | d0123525cd82be320f6b8b91ca287a2e572341cc (patch) | |
tree | d35035175aa286d4fec2bd47ccafae5999b3599c | |
parent | 7e6a3025493bae3018e8a9c71b93350859b1c484 (diff) |
SipHash: make it possible to control the hash size through string controls
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7154)
-rw-r--r-- | crypto/siphash/siphash_pmeth.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/siphash/siphash_pmeth.c b/crypto/siphash/siphash_pmeth.c index a635260253..5c981bdb0b 100644 --- a/crypto/siphash/siphash_pmeth.c +++ b/crypto/siphash/siphash_pmeth.c @@ -167,6 +167,12 @@ static int pkey_siphash_ctrl_str(EVP_PKEY_CTX *ctx, { if (value == NULL) return 0; + if (strcmp(type, "digestsize") == 0) { + size_t hash_size = atoi(value); + + return pkey_siphash_ctrl(ctx, EVP_PKEY_CTRL_SET_DIGEST_SIZE, hash_size, + NULL); + } if (strcmp(type, "key") == 0) return EVP_PKEY_CTX_str2ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, value); if (strcmp(type, "hexkey") == 0) |