summaryrefslogtreecommitdiffstats
path: root/providers/implementations/macs/siphash_prov.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-08-31 14:44:17 +0100
committerMatt Caswell <matt@openssl.org>2020-09-03 09:40:52 +0100
commit0bc193dd05fa0f5580706f34994beb74baf3d531 (patch)
tree170c605323a9388c1a45dd2cb81896155cf89282 /providers/implementations/macs/siphash_prov.c
parent13c9843cff061304275a1723bcba137280e2e97d (diff)
Ensure EVP_MAC_update() passes the length even if it is 0
We leave it up to the EVP_MAC implemenations what to do with an update where the data length is 0. In the TLS HMAC implemenation this is still signficant. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12732)
Diffstat (limited to 'providers/implementations/macs/siphash_prov.c')
-rw-r--r--providers/implementations/macs/siphash_prov.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/providers/implementations/macs/siphash_prov.c b/providers/implementations/macs/siphash_prov.c
index 8797241e33..1bea7a2787 100644
--- a/providers/implementations/macs/siphash_prov.c
+++ b/providers/implementations/macs/siphash_prov.c
@@ -91,6 +91,9 @@ static int siphash_update(void *vmacctx, const unsigned char *data,
{
struct siphash_data_st *ctx = vmacctx;
+ if (datalen == 0)
+ return 1;
+
SipHash_Update(&ctx->siphash, data, datalen);
return 1;
}