tfSslSetSessionProposals

Jump to: navigation, search

Table of Contents >> SSL Programmer's Reference


#include <trsocket.h>


int tfSslSetSessionProposals (
int sessionId,
int TM_FAR * propArray,
int propSize
);


Function Description

This function is used to set proposals for a certain session. For a client session, the proposals are used to construct the Client Hello message. For a server session, if TM_SSL_OPT_SERVERPROP option is on (see tfSslSetSessionOptions() for more detail), the proposals are used to match Client Hello message in order to determine the final cipher suite to use. The propSize cannot exceed TM_SSL_PROPOSAL_NUMBER, which is changeable at compile time. If user doesn't call this function to set any session proposals, the default list will be used.

Default Exportable Cipher Suites

For exportable version (TM_EXPORT_RESTRICT is defined in <trsystem.h>), the default cipher suites are:

  • TM_TLS_RSA_EPT1K_DES_CBC_SHA
  • TM_TLS_RSA_EPT1K_RC4_56_SHA
  • TM_TLS_RSA_EXPORT_RC4_40_MD5
  • TM_TLS_RSA_EXPORT_RC2_40_MD5
  • TM_TLS_DHE_DSS_EPT_DES40_CBC_SHA
  • TM_TLS_RSA_EXPORT_DES40_CBC_SHA

Default Non-Exportable Cipher Suites

For non-exportable version, the list of default cipher suites depends on your configuration (e.g. TM_USE_AES, TM_USE_SHA256, TM_PUBKEY_USE_DSA, TM_PUBKEY_USE_DIFFIEHELLMAN macros in trsystem.h). The list of default cipher suites can be found in file source/trssl.c, static constant tlSslProposalSuites[] (basically, all supported ciphers not listed above).


Parameters

  • sessionId
    The session we are going to set proposals
  • propArray
    Priority ordered array of cipher suites values, from strongest to weakest (see the Supported cipher suite list at SSL_Programmer's_Reference).
  • propSize
    Number of entries in the proposal array, up to TM_SSL_PROPOSAL_NUMBER (the length of the default list, as determined by your configuration). If more than TM_SSL_PROPOSAL_NUMBER entries are input, we will use the first TM_SSL_PROPOSAL_NUMBER entries.


Returns

  • TM_ENOERROR
    Success
  • TM_EINVAL
    Invalid input parameter, for example, the propArray is NULL, or propSize is zero, or sessionId not found
  • TM_EOPNOTSUPP
    Invalid proposals in the input array.


Table of Contents >> SSL Programmer's Reference