diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-05-16 11:43:41 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-05-16 11:43:41 +1000 |
commit | 8bbeaaa4fc12f8b00fbea4dc649ef74b59f73b17 (patch) | |
tree | bf043355836767d39f96bd2a67b9bc3b7798dd9d /crypto/evp/kdf_lib.c | |
parent | 0211740fcc47a954be19cceb65fb57a6f7deb797 (diff) |
Added X963KDF API
X963 KDF is used for CMS ec keyagree Recipient Info.
The X963 KDF that is used by CMS EC Key Agreement has been moved
into a EVP_KDF object. This KDF is almost identical to the the SSKDF
hash variant, so it has been implemented inside the SSKDF code with
its own method table.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8902)
Diffstat (limited to 'crypto/evp/kdf_lib.c')
-rw-r--r-- | crypto/evp/kdf_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/evp/kdf_lib.c b/crypto/evp/kdf_lib.c index be5d7c6061..6131d8ef77 100644 --- a/crypto/evp/kdf_lib.c +++ b/crypto/evp/kdf_lib.c @@ -22,8 +22,12 @@ EVP_KDF_CTX *EVP_KDF_CTX_new(const EVP_KDF *kdf) { - EVP_KDF_CTX *ctx = OPENSSL_zalloc(sizeof(EVP_KDF_CTX)); + EVP_KDF_CTX *ctx = NULL; + if (kdf == NULL) + return NULL; + + ctx = OPENSSL_zalloc(sizeof(EVP_KDF_CTX)); if (ctx == NULL || (ctx->impl = kdf->new()) == NULL) { EVPerr(EVP_F_EVP_KDF_CTX_NEW, ERR_R_MALLOC_FAILURE); OPENSSL_free(ctx); @@ -38,8 +42,6 @@ EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id) { const EVP_KDF *kdf = EVP_get_kdfbynid(id); - if (kdf == NULL) - return NULL; return EVP_KDF_CTX_new(kdf); } |