HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)

Concepts
Overview of Conversation Security
Chapter 154
Each time the program successfully issues Accept_Conversation or
Accept_Incoming, CPI-C assigns a new context ID to the
conversation. The program can determine the value of this context
ID by issuing Extract_Conversation_Context with the appropriate
conversation ID.
The program's “current context” is normally the context ID
associated with the most recent Accept_Conversation or
Accept_Incoming.The program can use Set_Conversation_Context to
set the current context to the context ID of another of its incoming
conversations (subject to the restriction described below).
Any Allocate call is issued in the program's current context. This
means that, if the conversation security type is “same”, the user ID
from the incoming conversation associated with the current context
ID will be sent to the partner program.
In the previous example, program B must ensure that its current context
is the context associated with the incoming conversation from program
A, before issuing the Allocate call to program C. This ensures that A's
user ID is sent on the allocation request to program C. The current
context will normally be the correct one, unless B has issued another
Accept_Conversation, Accept_Incoming, or Set_Conversation_Context
call since accepting the conversation from A.
When a program uses Set_Conversation_Context to change its current
context, SNAplus2 does not retain the information from the previous
context unless there is still at least one active conversation associated
with it. This means that, if B finishes the conversation with A and then
changes its current context to communicate with a different program, it
will not be able to return to the first context ID in order to allocate the
conversation with C. If it needs to end the conversation with A before
allocating the conversation to C, it must allocate the conversation to C
before changing its current context to any other value.
End of Section Already-Verified Conversation Security
For Unix In some cases, a program may need to indicate “already verified” security
when it has not itself been invoked by another program, but has obtained
and verified the appropriate security information by another means (for
example, by a user entering a user ID and password during a logon
sequence). SNAplus2 supports this as follows: