Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Encryption callbacks [Table of Contents] Notification callbacks

Open Client Client-Library/C Reference Manual

[-] Chapter 2 Topics
[-] Callbacks
[-] Negotiation callbacks

Negotiation callbacks

Client-Library uses the negotiation callback to handle both trusted-user security handshakes and challenge/response security handshakes.

For more information on these types of handshakes, see the "Security features".

Challenge/response security handshakes

During server login, a challenge/response security handshake occurs when the server issues a challenge, to which the client must respond.

A connection uses a negotiation callback to provide its response to the challenge. To do this, the connection installs a negotiation callback routine. At connection time, when Client-Library receives the server challenge, Client-Library triggers the negotiation callback.

A connection that participates in challenge/response security handshakes must have its CS_SEC_CHALLENGE property or its CS_SEC_APPDEFINED property set to CS_TRUE.

When the application calls ct_connect to connect to the server:

  1. If the server replies with a challenge, then Client-Library calls the connection's negotiation callback routine.

  2. The negotiation callback routine generates the response and returns either CS_CONTINUE, CS_SUCCEED, or CS_FAIL.

Defining a negotiation callback

A negotiation callback is defined as follows:

CS_RETCODE CS_PUBLIC
 negotiation_cb(connection, inmsgid,
                 outmsgid, inbuffmt, inbuf, outbuffmt,
                 outbuf, outbufoutlen)
 
 CS_CONNECTION   *connection;
 CS_INT                      inmsgid;
 CS_INT                      *outmsgid;
 CS_DATAFMT            *inbuffmt;
 CS_BYTE                   *inbuf;
 CS_DATAFMT            *outbuffmt;
 CS_BYTE                   *outbuf;
 CS_INT                      *outbufoutlen;

where:

A negotiation callback must return CS_SUCCEED, CS_FAIL, or CS_CONTINUE:


Encryption callbacks [Table of Contents] Notification callbacks