NAME
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 useSYNOPSIS
#include <openssl/ssl.h>SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);
SSL_use_psk_identity_hint(SSL *ssl, const char *hint);
SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
SSL_set_psk_server_callback(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));
DESCRIPTION
SSL_CTX_use_psk_identity_hint() sets the given NULL-terminated PSK identity hint hint to SSL context object ctx. SSL_use_psk_identity_hint() sets the given NULL-terminated PSK identity hint hint to SSL connection object ssl. If hint is NULL the current hint from ctx or ssl is deleted.RETURN VALUES
SSL_CTX_use_psk_identity_hint() and SSL_use_psk_identity_hint() return 1 on success, 0 otherwise.- >0
-
PSK identity was found and the server callback has provided the PSK successfully in parameter psk. Return value is the length of psk in bytes. It is an error to return a value greater than max_psk_len.
- 0
- PSK identity was not found. An “unknown_psk_identity” alert message will be sent and the connection setup fails.