Lines Matching refs:psk
2113 if (conf->psk != NULL && conf->psk_len != 0) { in mbedtls_ssl_conf_has_static_psk()
2130 if (conf->psk != NULL) { in ssl_conf_remove_psk()
2131 mbedtls_platform_zeroize(conf->psk, conf->psk_len); in ssl_conf_remove_psk()
2133 mbedtls_free(conf->psk); in ssl_conf_remove_psk()
2134 conf->psk = NULL; in ssl_conf_remove_psk()
2175 const unsigned char *psk, size_t psk_len, in mbedtls_ssl_conf_psk() argument
2186 if (psk == NULL) { in mbedtls_ssl_conf_psk()
2196 if ((conf->psk = mbedtls_calloc(1, psk_len)) == NULL) { in mbedtls_ssl_conf_psk()
2200 memcpy(conf->psk, psk, conf->psk_len); in mbedtls_ssl_conf_psk()
2224 if (ssl->handshake->psk != NULL) { in ssl_remove_psk()
2225 mbedtls_platform_zeroize(ssl->handshake->psk, in ssl_remove_psk()
2227 mbedtls_free(ssl->handshake->psk); in ssl_remove_psk()
2234 const unsigned char *psk, size_t psk_len) in mbedtls_ssl_set_hs_psk() argument
2243 if (psk == NULL || ssl->handshake == NULL) { in mbedtls_ssl_set_hs_psk()
2276 status = psa_import_key(&key_attributes, psk, psk_len, &key); in mbedtls_ssl_set_hs_psk()
2285 if ((ssl->handshake->psk = mbedtls_calloc(1, psk_len)) == NULL) { in mbedtls_ssl_set_hs_psk()
2290 memcpy(ssl->handshake->psk, psk, ssl->handshake->psk_len); in mbedtls_ssl_set_hs_psk()
2298 mbedtls_svc_key_id_t psk, in mbedtls_ssl_conf_psk_opaque() argument
2310 if (mbedtls_svc_key_id_is_null(psk)) { in mbedtls_ssl_conf_psk_opaque()
2313 conf->psk_opaque = psk; in mbedtls_ssl_conf_psk_opaque()
2326 mbedtls_svc_key_id_t psk) in mbedtls_ssl_set_hs_psk_opaque() argument
2328 if ((mbedtls_svc_key_id_is_null(psk)) || in mbedtls_ssl_set_hs_psk_opaque()
2334 ssl->handshake->psk_opaque = psk; in mbedtls_ssl_set_hs_psk_opaque()
4183 if (handshake->psk != NULL) { in mbedtls_ssl_handshake_free()
4184 mbedtls_platform_zeroize(handshake->psk, handshake->psk_len); in mbedtls_ssl_handshake_free()
4185 mbedtls_free(handshake->psk); in mbedtls_ssl_handshake_free()
5406 if (conf->psk != NULL) { in mbedtls_ssl_config_free()
5407 mbedtls_platform_zeroize(conf->psk, conf->psk_len); in mbedtls_ssl_config_free()
5408 mbedtls_free(conf->psk); in mbedtls_ssl_config_free()
5409 conf->psk = NULL; in mbedtls_ssl_config_free()
6420 mbedtls_svc_key_id_t psk; in ssl_compute_master() local
6427 psk = mbedtls_ssl_get_opaque_psk(ssl); in ssl_compute_master()
6457 status = setup_psa_key_derivation(&derivation, psk, alg, in ssl_compute_master()
6458 ssl->conf->psk, ssl->conf->psk_len, in ssl_compute_master()
6764 const unsigned char *psk = NULL; in mbedtls_ssl_psk_derive_premaster() local
6766 int psk_ret = mbedtls_ssl_get_psk(ssl, &psk, &psk_len); in mbedtls_ssl_psk_derive_premaster()
6875 memcpy(p, psk, psk_len); in mbedtls_ssl_psk_derive_premaster()