diff options
author | Pauli <paul.dale@oracle.com> | 2020-08-05 15:26:48 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-08-07 08:07:07 +1000 |
commit | 5f6a0b2ff055cf3ad09a1d49a4b95b13e1106b35 (patch) | |
tree | dcf50d5c3e37b6a2ca3a18dac9e44bab58a910ed /providers/implementations/macs/kmac_prov.c | |
parent | 992492f5e82e0cf9b24acc14ea90ce8afd4c447a (diff) |
mac: add some consistency to setting the XXX_final output length.
The various MACs were all over the place with respects to what they did with
the output length in the final call. Now they all unconditionally set the
output length and the EVP layer handles the possibility of a NULL pointer.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12582)
Diffstat (limited to 'providers/implementations/macs/kmac_prov.c')
-rw-r--r-- | providers/implementations/macs/kmac_prov.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/providers/implementations/macs/kmac_prov.c b/providers/implementations/macs/kmac_prov.c index 46b0bd644a..792bc6c5bb 100644 --- a/providers/implementations/macs/kmac_prov.c +++ b/providers/implementations/macs/kmac_prov.c @@ -298,8 +298,7 @@ static int kmac_final(void *vmacctx, unsigned char *out, size_t *outl, ok = right_encode(encoded_outlen, &len, lbits) && EVP_DigestUpdate(ctx, encoded_outlen, len) && EVP_DigestFinalXOF(ctx, out, kctx->out_len); - if (ok && outl != NULL) - *outl = kctx->out_len; + *outl = kctx->out_len; return ok; } |