diff options
author | Robbie Harwood <rharwood@redhat.com> | 2019-10-17 12:45:03 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2019-10-17 12:45:03 +1000 |
commit | f6dead1b72a04b113b4b198ac98a8b9b994ad86f (patch) | |
tree | 2b8869a78f16f0035fc6707440812b2dcc5ac516 /crypto/cmac | |
parent | 028687c08b20ecc463afaf2d692542b88ebfe8bc (diff) |
[KDF] Add feedback-mode and CMAC support to KBKDF
Implement SP800-108 section 5.2 with CMAC support. As a side effect,
enable 5.1 with CMAC and 5.2 with HMAC. Add test vectors from RFC 6803.
Add OSSL_KDF_PARAM_CIPHER and PROV_R_INVALID_SEED_LENGTH.
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10143)
Diffstat (limited to 'crypto/cmac')
-rw-r--r-- | crypto/cmac/cmac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c index b1be991f87..ec12970cb2 100644 --- a/crypto/cmac/cmac.c +++ b/crypto/cmac/cmac.c @@ -199,7 +199,8 @@ int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen) return 0; if ((bl = EVP_CIPHER_CTX_block_size(ctx->cctx)) < 0) return 0; - *poutlen = (size_t)bl; + if (poutlen != NULL) + *poutlen = (size_t)bl; if (!out) return 1; lb = ctx->nlast_block; |