| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
GSSAPI
GSSAPI.InitContext

# Method GSSAPI.InitContext()->init()

Method init

  `string init(void|string remote_token)`

Description

  Initiates a security context to send to a remote peer.

  This wraps `GSS_Init_sec_context` according to RFC 2743 section 2.2.1.

  The underlying mechanism might require several tokens to be passed back and forth to establish the context. If is_established returns zero after a call to this function then the caller must wait for a token from the remote peer to feed as remote_token in another call to this function.

Parameter `remote_token`

  A token from the remote peer, as returned by a call to GSSAPI.AcceptContext.accept (or some other `GSS_Accept_sec_context` wrapper) in it. This is zero or left out on the initial call, but used later if the remote peer sends back tokens to process as part of the context establishment.

Returns

  If a string is returned then it must be passed to the remote peer which will feed it to GSSAPI.AcceptContext.accept or some other `GSS_Accept_sec_context` wrapper. An empty string is never returned.

  Zero is returned if there is no token to send to the remote peer. Note that is_established might still return zero in that case, meaning more remote tokens are necessary.

Note

  This function might block on network connections to remote authentication servers.