Function silc_ske_set_callbacks
SYNOPSIS
void silc_ske_set_callbacks(SilcSKE ske,
SilcSKESendPacketCb send_packet,
SilcSKECb payload_receive,
SilcSKEVerifyCb verify_key,
SilcSKECb proto_continue,
SilcSKECheckVersion check_version,
void *context);
DESCRIPTION
Sets the callback functions for the SKE session.
The `send_packet' callback is a function that sends the packet to
network. The SKE library will call it at any time packet needs to
be sent to the remote host.
The `payload_receive' callback is called when the remote host's Key
Exchange Start Payload has been processed. The payload is saved
to ske->start_payload if the application would need it. The application
must also provide the payload to the next state of the SKE.
The `verify_key' callback is called to verify the received public key
or certificate. The verification process is most likely asynchronous.
That is why the application must call the completion callback when the
verification process has been completed. The library then calls the user
callback (`proto_continue'), if it is provided to indicate that the SKE
protocol may continue. If this SKE session context is used to perform
rekey, this callback usually is not provided as argument since sending
public key in rekey is not mandatory. Setting this callback implies
that remote end MUST send its public key, and this could cause
problems when performing rekey. When doing normal SKE session this
callback should be set.
The `proto_continue' callback is called to indicate that it is
safe to continue the execution of the SKE protocol after executing
an asynchronous operation, such as calling the `verify_key' callback
function, which is asynchronous. The application should check the
ske->status in this function to check whether it is Ok to continue
the execution of the protocol.
The `check_version' callback is called to verify the remote host's
version. The application may check its own version against the remote
host's version and determine whether supporting the remote host
is possible.
The `context' is passed as argument to all of the above callback
functions.
|