Skip to content

Commit

Permalink
Allow zero length mac key
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
  • Loading branch information
xnox committed Apr 18, 2024
1 parent ea31561 commit 55201d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions providers/common/securitycheck.c
Expand Up @@ -234,14 +234,15 @@ int ossl_dh_check_key(OSSL_LIB_CTX *ctx, const DH *dh)

/*
* Check for valid MAC key size
* Allow zero lenght key, as TLS13 KDF extract starts like this
*
*/
int ossl_mac_check_key(size_t min, size_t requested)
{
#ifndef FIPS_MODULE
return (requested >= min);
return (requested == 0) || (requested >= min);
#else
return (requested >= 112);
return (requested == 0) || (requested >= 112);
# endif
}

Expand Down

0 comments on commit 55201d4

Please sign in to comment.