@@ -218,17 +218,50 @@ static int wp_kdf_set_ctx_params(wp_KdfCtx* ctx, const OSSL_PARAM params[])
218218}
219219
220220/**
221- * Return an array of supported settable parameters for the KDF ke context.
221+ * Return an array of supported settable parameters for the HKDF ke context.
222222 *
223223 * @param [in] ctx ECDH key exchange context object. Unused.
224224 * @param [in] provCtx Provider context object. Unused.
225225 * @return Array of parameters with data type.
226226 */
227- static const OSSL_PARAM * wp_kdf_settable_ctx_params (wp_KdfCtx * ctx ,
227+ static const OSSL_PARAM * wp_hkdf_settable_ctx_params (wp_KdfCtx * ctx ,
228228 WOLFPROV_CTX * provCtx )
229229{
230+ (void )ctx ;
230231 (void )provCtx ;
231- return EVP_KDF_settable_ctx_params (EVP_KDF_CTX_kdf (ctx -> kdfCtx ));
232+ static const OSSL_PARAM settable_ctx_params [] = {
233+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_MODE , NULL , 0 ),
234+ OSSL_PARAM_int (OSSL_KDF_PARAM_MODE , NULL ),
235+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_PROPERTIES , NULL , 0 ),
236+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_DIGEST , NULL , 0 ),
237+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_KEY , NULL , 0 ),
238+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SALT , NULL , 0 ),
239+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_INFO , NULL , 0 ),
240+ OSSL_PARAM_END
241+ };
242+ return settable_ctx_params ;
243+ }
244+
245+ /**
246+ * Return an array of supported settable parameters for the HKDF ke context.
247+ *
248+ * @param [in] ctx ECDH key exchange context object. Unused.
249+ * @param [in] provCtx Provider context object. Unused.
250+ * @return Array of parameters with data type.
251+ */
252+ static const OSSL_PARAM * wp_tls1_prf_settable_ctx_params (wp_KdfCtx * ctx ,
253+ WOLFPROV_CTX * provCtx )
254+ {
255+ (void )ctx ;
256+ (void )provCtx ;
257+ static const OSSL_PARAM settable_ctx_params [] = {
258+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_PROPERTIES , NULL , 0 ),
259+ OSSL_PARAM_utf8_string (OSSL_KDF_PARAM_DIGEST , NULL , 0 ),
260+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SECRET , NULL , 0 ),
261+ OSSL_PARAM_octet_string (OSSL_KDF_PARAM_SEED , NULL , 0 ),
262+ OSSL_PARAM_END
263+ };
264+ return settable_ctx_params ;
232265}
233266
234267/*
@@ -256,7 +289,7 @@ const OSSL_DISPATCH wp_hkdf_keyexch_functions[] = {
256289 { OSSL_FUNC_KEYEXCH_DERIVE , (DFUNC )wp_kdf_derive },
257290 { OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS , (DFUNC )wp_kdf_set_ctx_params },
258291 { OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS ,
259- (DFUNC )wp_kdf_settable_ctx_params },
292+ (DFUNC )wp_hkdf_settable_ctx_params },
260293 { 0 , NULL }
261294};
262295
@@ -285,7 +318,7 @@ const OSSL_DISPATCH wp_tls1_prf_keyexch_functions[] = {
285318 { OSSL_FUNC_KEYEXCH_DERIVE , (DFUNC )wp_kdf_derive },
286319 { OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS , (DFUNC )wp_kdf_set_ctx_params },
287320 { OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS ,
288- (DFUNC )wp_kdf_settable_ctx_params },
321+ (DFUNC )wp_tls1_prf_settable_ctx_params },
289322 { 0 , NULL }
290323};
291324
0 commit comments