SSL_CTX_use_psk_identity_hint(3) OpenSSL SSL_CTX_use_psk_identity_hint(3) NNAAMMEE SSL_CTX_use_psk_identity_hint, SSL_use_psk_identity_hint, SSL_CTX_set_psk_server_callback, SSL_set_psk_server_callback - set PSK identity hint to use SSYYNNOOPPSSIISS #include int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint); int SSL_use_psk_identity_hint(SSL *ssl, const char *hint); void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)); void SSL_set_psk_server_callback(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)); DDEESSCCRRIIPPTTIIOONN _S_S_L___C_T_X___u_s_e___p_s_k___i_d_e_n_t_i_t_y___h_i_n_t_(_) sets the given NNUULLLL-terminated PSK identity hint hhiinntt to SSL context object ccttxx. _S_S_L___u_s_e___p_s_k___i_d_e_n_- _t_i_t_y___h_i_n_t_(_) sets the given NNUULLLL-terminated PSK identity hint hhiinntt to SSL connection object ssssll. If hhiinntt is NNUULLLL the current hint from ccttxx or ssssll is deleted. In the case where PSK identity hint is NNUULLLL, the server does not send the ServerKeyExchange message to the client. A server application must provide a callback function which is called when the server receives the ClientKeyExchange message from the client. The purpose of the callback function is to validate the received PSK identity and to fetch the pre-shared key used during the connection setup phase. The callback is set using functions _S_S_L___C_T_X___s_e_t___p_s_k___s_e_r_v_e_r___c_a_l_l_b_a_c_k_(_) or _S_S_L___s_e_t___p_s_k___s_e_r_v_e_r___c_a_l_l_b_a_c_k_(_). The callback function is given the connection in parameter ssssll, NNUULLLL-termi- nated PSK identity sent by the client in parameter iiddeennttiittyy, and a buf- fer ppsskk of length mmaaxx__ppsskk__lleenn bytes where the pre-shared key is to be stored. RREETTUURRNN VVAALLUUEESS _S_S_L___C_T_X___u_s_e___p_s_k___i_d_e_n_t_i_t_y___h_i_n_t_(_) and _S_S_L___u_s_e___p_s_k___i_d_e_n_t_i_t_y___h_i_n_t_(_) return 1 on success, 0 otherwise. Return values from the server callback are interpreted as follows: 0 PSK identity was not found. An "unknown_psk_identity" alert message will be sent and the connection setup fails. >0 PSK identity was found and the server callback has provided the PSK successfully in parameter ppsskk. Return value is the length of ppsskk in bytes. It is an error to return a value greater than mmaaxx__ppsskk__lleenn. If the PSK identity was not found but the callback instructs the protocol to continue anyway, the callback must provide some random data to ppsskk and return the length of the random data, so the con- nection will fail with decryption_error before it will be finished completely. 1.0.2u 2019-12-20 SSL_CTX_use_psk_identity_hint(3)