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)
This commit is contained in:
parent
7e6a302549
commit
d0123525cd
1 changed files with 6 additions and 0 deletions
|
@ -167,6 +167,12 @@ static int pkey_siphash_ctrl_str(EVP_PKEY_CTX *ctx,
|
||||||
{
|
{
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
return 0;
|
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)
|
if (strcmp(type, "key") == 0)
|
||||||
return EVP_PKEY_CTX_str2ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, value);
|
return EVP_PKEY_CTX_str2ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, value);
|
||||||
if (strcmp(type, "hexkey") == 0)
|
if (strcmp(type, "hexkey") == 0)
|
||||||
|
|
Loading…
Reference in a new issue