@@ -216,17 +216,50 @@ static int wp_kdf_set_ctx_params(wp_KdfCtx* ctx, const OSSL_PARAM params[])
216216}
217217
218218/**
219- * Return an array of supported settable parameters for the KDF ke context.
219+ * Return an array of supported settable parameters for the HKDF ke context.
220220 *
221221 * @param [in] ctx ECDH key exchange context object. Unused.
222222 * @param [in] provCtx Provider context object. Unused.
223223 * @return Array of parameters with data type.
224224 */
225- static const OSSL_PARAM * wp_kdf_settable_ctx_params (wp_KdfCtx * ctx ,
225+ static const OSSL_PARAM * wp_hkdf_settable_ctx_params (wp_KdfCtx * ctx ,
226226 WOLFPROV_CTX * provCtx )
227227{
228+ (void )ctx ;
228229 (void )provCtx ;
229- return EVP_KDF_settable_ctx_params (EVP_KDF_CTX_kdf (ctx -> kdfCtx ));
230+ static const OSSL_PARAM settable_ctx_params [] = {
231+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_MODE , NULL , 0 ),
232+ OSSL_PARAM_int (OSSL_KDF_PARAM_MODE , NULL ),
233+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_PROPERTIES , NULL , 0 ),
234+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_DIGEST , NULL , 0 ),
235+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_KEY , NULL , 0 ),
236+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SALT , NULL , 0 ),
237+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_INFO , NULL , 0 ),
238+ OSSL_PARAM_END
239+ };
240+ return settable_ctx_params ;
241+ }
242+
243+ /**
244+ * Return an array of supported settable parameters for the HKDF ke context.
245+ *
246+ * @param [in] ctx ECDH key exchange context object. Unused.
247+ * @param [in] provCtx Provider context object. Unused.
248+ * @return Array of parameters with data type.
249+ */
250+ static const OSSL_PARAM * wp_tls1_prf_settable_ctx_params (wp_KdfCtx * ctx ,
251+ WOLFPROV_CTX * provCtx )
252+ {
253+ (void )ctx ;
254+ (void )provCtx ;
255+ static const OSSL_PARAM settable_ctx_params [] = {
256+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_PROPERTIES , NULL , 0 ),
257+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_DIGEST , NULL , 0 ),
258+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SECRET , NULL , 0 ),
259+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SEED , NULL , 0 ),
260+ OSSL_PARAM_END
261+ };
262+ return settable_ctx_params ;
230263}
231264
232265/*
@@ -254,7 +287,7 @@ const OSSL_DISPATCH wp_hkdf_keyexch_functions[] = {
254287 { OSSL_FUNC_KEYEXCH_DERIVE , (DFUNC )wp_kdf_derive },
255288 { OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS , (DFUNC )wp_kdf_set_ctx_params },
256289 { OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS ,
257- (DFUNC )wp_kdf_settable_ctx_params },
290+ (DFUNC )wp_hkdf_settable_ctx_params },
258291 { 0 , NULL }
259292};
260293
@@ -283,7 +316,7 @@ const OSSL_DISPATCH wp_tls1_prf_keyexch_functions[] = {
283316 { OSSL_FUNC_KEYEXCH_DERIVE , (DFUNC )wp_kdf_derive },
284317 { OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS , (DFUNC )wp_kdf_set_ctx_params },
285318 { OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS ,
286- (DFUNC )wp_kdf_settable_ctx_params },
319+ (DFUNC )wp_tls1_prf_settable_ctx_params },
287320 { 0 , NULL }
288321};
289322
0 commit comments