Lines Matching refs:psk_info
304 const coap_dtls_cpsk_info_t *psk_info; in coap_get_session_client_psk() local
317 psk_info = &session->cpsk_setup_data.psk_info; in coap_get_session_client_psk()
318 if (psk_info->identity.s && psk_info->identity.length > 0 && in coap_get_session_client_psk()
319 psk_info->key.s && psk_info->key.length > 0) { in coap_get_session_client_psk()
320 if (psk_info->identity.length <= max_identity_len && in coap_get_session_client_psk()
321 psk_info->key.length <= max_psk_len) { in coap_get_session_client_psk()
322 memcpy(identity, psk_info->identity.s, psk_info->identity.length); in coap_get_session_client_psk()
323 memcpy(psk, psk_info->key.s, psk_info->key.length); in coap_get_session_client_psk()
324 *identity_len = psk_info->identity.length; in coap_get_session_client_psk()
325 return psk_info->key.length; in coap_get_session_client_psk()
339 const coap_dtls_spsk_info_t *psk_info; in coap_get_context_server_psk() local
351 psk_info = &session->context->spsk_setup_data.psk_info; in coap_get_context_server_psk()
352 if (psk_info->key.s && psk_info->key.length > 0 && in coap_get_context_server_psk()
353 psk_info->key.length <= max_psk_len) { in coap_get_context_server_psk()
354 memcpy(psk, psk_info->key.s, psk_info->key.length); in coap_get_context_server_psk()
355 return psk_info->key.length; in coap_get_context_server_psk()
366 const coap_dtls_spsk_info_t *psk_info; in coap_get_context_server_hint() local
377 psk_info = &session->context->spsk_setup_data.psk_info; in coap_get_context_server_hint()
378 if (psk_info->hint.s && in coap_get_context_server_hint()
379 psk_info->hint.length > 0 && in coap_get_context_server_hint()
380 psk_info->hint.length <= max_hint_len) { in coap_get_context_server_hint()
381 memcpy(hint, psk_info->hint.s, psk_info->hint.length); in coap_get_context_server_hint()
382 return psk_info->hint.length; in coap_get_context_server_hint()
396 setup_data.psk_info.hint.s = (const uint8_t *)hint; in coap_context_set_psk()
397 setup_data.psk_info.hint.length = strlen(hint); in coap_context_set_psk()
401 setup_data.psk_info.key.s = key; in coap_context_set_psk()
402 setup_data.psk_info.key.length = key_len; in coap_context_set_psk()