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 | |
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')
-rw-r--r-- | crypto/cmac/cmac.c | 3 | ||||
-rw-r--r-- | crypto/err/openssl.txt | 1 |
2 files changed, 3 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; diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index ac170dea6a..46d2eaa2eb 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -2694,6 +2694,7 @@ PROV_R_INVALID_MAC:151:invalid mac PROV_R_INVALID_MODE:125:invalid mode PROV_R_INVALID_MODE_INT:126:invalid mode int PROV_R_INVALID_SALT_LENGTH:112:invalid salt length +PROV_R_INVALID_SEED_LENGTH:154:invalid seed length PROV_R_INVALID_TAG:110:invalid tag PROV_R_INVALID_TAGLEN:118:invalid taglen PROV_R_MISSING_CEK_ALG:144:missing cek alg |