summaryrefslogtreecommitdiff
path: root/lib/libcrypto/kdf
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-05-05 08:14:15 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-05-05 08:14:15 +0000
commitf155a2865068ebaafaee386348ccdd8a2705b092 (patch)
treef6165fa962549f9c739c8df2fbd69063ef76e493 /lib/libcrypto/kdf
parente6a2304c01e1094ef8f6d3cd5f20785dc6ad1ae2 (diff)
Translate from OpenSSL's HKDF API to BoringSSL API.
ok beck jsing
Diffstat (limited to 'lib/libcrypto/kdf')
-rw-r--r--lib/libcrypto/kdf/hkdf_evp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libcrypto/kdf/hkdf_evp.c b/lib/libcrypto/kdf/hkdf_evp.c
index 37cdd92ba68..36eae19e2b6 100644
--- a/lib/libcrypto/kdf/hkdf_evp.c
+++ b/lib/libcrypto/kdf/hkdf_evp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hkdf_evp.c,v 1.13 2022/05/05 08:10:39 tb Exp $ */
+/* $OpenBSD: hkdf_evp.c,v 1.14 2022/05/05 08:14:14 tb Exp $ */
/* ====================================================================
* Copyright (c) 2016-2018 The OpenSSL Project. All rights reserved.
*
@@ -242,21 +242,20 @@ pkey_hkdf_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
switch (kctx->mode) {
case EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND:
- return HKDF(kctx->md, kctx->salt, kctx->salt_len, kctx->key,
- kctx->key_len, kctx->info, kctx->info_len, key,
- *keylen) != NULL;
+ return HKDF(key, *keylen, kctx->md, kctx->salt, kctx->salt_len,
+ kctx->key, kctx->key_len, kctx->info, kctx->info_len);
case EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY:
if (key == NULL) {
*keylen = EVP_MD_size(kctx->md);
return 1;
}
- return HKDF_Extract(kctx->md, kctx->salt, kctx->salt_len,
- kctx->key, kctx->key_len, key, keylen) != NULL;
+ return HKDF_extract(key, keylen, kctx->md, kctx->salt,
+ kctx->salt_len, kctx->key, kctx->key_len);
case EVP_PKEY_HKDEF_MODE_EXPAND_ONLY:
- return HKDF_Expand(kctx->md, kctx->key, kctx->key_len,
- kctx->info, kctx->info_len, key, *keylen) != NULL;
+ return HKDF_expand(key, *keylen, kctx->md, kctx->key,
+ kctx->key_len, kctx->info, kctx->info_len);
default:
return 0;