tfSslPskSessionHint

Jump to: navigation, search

Table of Contents >> SSL Programmer's Reference


#include <trsocket.h>


int tfSslPskSessionHint (
int sessionId,
const char TM_FAR * hintPtr,
unsigned int hintLength
);


Function Description

(TLS/SSL server only) Set or clear the PSK hint for a session. If not set, Treck will not send a PSK hint during initial handshake. This feature may be useful if TLS clients use different PSK keys for different servers (or groups of servers).

The value will be saved with the session and used by any TLS connection that is spawned from that session. The PSK hint is only sent if a PSK ciphersuite is chosen. Unless you call tfSslPskRegisterCallback() to provide a PSK callback function, PSK will not be negotiated.


Parameters

  • sessionId
    The session identifier returned by tfSslNewSession().
  • hintPtr
    Pointer to the PSK hint to send during the TLS handshake. Specify NULL to remove the hint. The value depends on what is expected by the peer, e.g. domain name.
  • hintLength
    The length of the PSK hint.


Returns

  • TM_ENOERROR
    Callback function is successfully registered.
  • TM_EINVAL
    Invalid session.
  • TM_ENOBUFS
    Insufficient memory.


Table of Contents >> SSL Programmer's Reference