/* Private message keys */
SilcCipher send_key; /* Private message key for sending */
SilcCipher receive_key; /* Private message key for receiving */
- unsigned char *key; /* Set only if appliation provided the
+ SilcHmac hmac_send; /* Private mesage key HMAC for sending */
+ SilcHmac hmac_receive; /* Private mesage key HMAC for receiving */
+ unsigned char *key; /* Set only if application provided the
key material. NULL if the library
generated the key. */
SilcUInt32 key_len; /* Key length */
* SOURCE
*/
struct SilcServerEntryStruct {
- /* Generate information */
+ /* General information */
char *server_name; /* Server name */
char *server_info; /* Server info */
SilcServerID *server_id; /* Server ID */
*
* SYNOPSIS
*
- * int silc_client_init(SilcClient client);
+ * bool silc_client_init(SilcClient client);
*
* DESCRIPTION
*
* client. Returns FALSE if error occurred, TRUE otherwise.
*
***/
-int silc_client_init(SilcClient client);
+bool silc_client_init(SilcClient client);
/****f* silcclient/SilcClientAPI/silc_client_run
*
*
* SYNOPSIS
*
- * int silc_client_connect_to_server(SilcClient client,
+ * bool silc_client_connect_to_server(SilcClient client,
* SilcClientConnectionParams *params,
* int port, char *host, void *context);
*
* If the `params' is provided they are used by the routine.
*
***/
-int silc_client_connect_to_server(SilcClient client,
- SilcClientConnectionParams *params,
- int port, char *host, void *context);
+bool silc_client_connect_to_server(SilcClient client,
+ SilcClientConnectionParams *params,
+ int port, char *host, void *context);
/****f* silcclient/SilcClientAPI/silc_client_add_connection
*
* SilcMessageFlags flags,
* unsigned char *data,
* SilcUInt32 data_len,
- * int force_send);
+ * bool_force_send);
*
* DESCRIPTION
*
SilcMessageFlags flags,
unsigned char *data,
SilcUInt32 data_len,
- int force_send);
+ bool force_send);
/****f* silcclient/SilcClientAPI/silc_client_send_private_message
*
* SilcMessageFlags flags,
* unsigned char *data,
* SilcUInt32 data_len,
- * int force_send);
+ * bool force_send);
*
* DESCRIPTION
*
SilcMessageFlags flags,
unsigned char *data,
SilcUInt32 data_len,
- int force_send);
+ bool force_send);
/* Client and Channel entry retrieval (idlist.c) */
*
* SYNOPSIS
*
- * void silc_client_command_call(SilcClient client,
+ * bool silc_client_command_call(SilcClient client,
* SilcClientConnection conn,
* const char *command_line, ...);
*
*
* SYNOPSIS
*
- * int silc_client_add_private_message_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry,
- * char *cipher,
- * unsigned char *key,
- * SilcUInt32 key_len,
- * bool generate_key,
- * bool responder);
+ * bool silc_client_add_private_message_key(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientEntry client_entry,
+ * const char *cipher,
+ * const char *hmac,
+ * unsigned char *key,
+ * SilcUInt32 key_len,
+ * bool generate_key,
+ * bool responder);
*
* DESCRIPTION
*
* indicated by the `client_entry'. If the `key' is NULL and the boolean
* value `generate_key' is TRUE the library will generate random key.
* The `key' maybe for example pre-shared-key, passphrase or similar.
- * The `cipher' MAY be provided but SHOULD be NULL to assure that the
- * requirements of the SILC protocol are met. The API, however, allows
- * to allocate any cipher.
+ * The `cipher' and `hmac' MAY be provided but SHOULD be NULL to assure
+ * that the requirements of the SILC protocol are met. The API, however,
+ * allows to allocate any cipher and HMAC.
*
* If `responder' is TRUE then the sending and receiving keys will be
* set according the client being the receiver of the private key. If
* otherwise.
*
***/
-int silc_client_add_private_message_key(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry,
- char *cipher,
- unsigned char *key,
- SilcUInt32 key_len,
- bool generate_key,
- bool responder);
+bool silc_client_add_private_message_key(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientEntry client_entry,
+ const char *cipher,
+ const char *hmac,
+ unsigned char *key,
+ SilcUInt32 key_len,
+ bool generate_key,
+ bool responder);
/****f* silcclient/SilcClientAPI/silc_client_add_private_message_key_ske
*
* SYNOPSIS
*
- * int silc_client_add_private_message_key_ske(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry,
- * char *cipher,
- * SilcSKEKeyMaterial *key);
+ * bool
+ * silc_client_add_private_message_key_ske(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientEntry client_entry,
+ * const char *cipher,
+ * const char *hmac,
+ * SilcSKEKeyMaterial *key);
*
* DESCRIPTION
*
* Same as silc_client_add_private_message_key but takes the key material
* from the SKE key material structure. This structure is received if
* the application uses the silc_client_send_key_agreement to negotiate
- * the key material. The `cipher' SHOULD be provided as it is negotiated
- * also in the SKE protocol.
+ * the key material. The `cipher' and `hmac' SHOULD be provided as it is
+ * negotiated also in the SKE protocol.
*
***/
-int silc_client_add_private_message_key_ske(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry,
- char *cipher,
- SilcSKEKeyMaterial *key,
- bool responder);
+bool silc_client_add_private_message_key_ske(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientEntry client_entry,
+ const char *cipher,
+ const char *hmac,
+ SilcSKEKeyMaterial *key,
+ bool responder);
/****f* silcclient/SilcClientAPI/silc_client_del_private_message_key
*
* SYNOPSIS
*
- * int silc_client_del_private_message_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcClientEntry client_entry);
+ * bool silc_client_del_private_message_key(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcClientEntry client_entry);
*
* DESCRIPTION
*
* client. Returns FALSE on error, TRUE otherwise.
*
***/
-int silc_client_del_private_message_key(SilcClient client,
- SilcClientConnection conn,
- SilcClientEntry client_entry);
+bool silc_client_del_private_message_key(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientEntry client_entry);
/****f* silcclient/SilcClientAPI/silc_client_list_private_message_keys
*
*
* SYNOPSIS
*
- * int silc_client_add_channel_private_key(SilcClient client,
- * SilcClientConnection conn,
- * SilcChannelEntry channel,
- * const char *name,
- * char *cipher,
- * char *hmac,
- * unsigned char *key,
- * SilcUInt32 key_len);
+ * bool silc_client_add_channel_private_key(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcChannelEntry channel,
+ * const char *name,
+ * char *cipher,
+ * char *hmac,
+ * unsigned char *key,
+ * SilcUInt32 key_len);
*
* DESCRIPTION
*
* as channel private key. However, this API allows it.
*
***/
-int silc_client_add_channel_private_key(SilcClient client,
- SilcClientConnection conn,
- SilcChannelEntry channel,
- const char *name,
- char *cipher,
- char *hmac,
- unsigned char *key,
- SilcUInt32 key_len);
+bool silc_client_add_channel_private_key(SilcClient client,
+ SilcClientConnection conn,
+ SilcChannelEntry channel,
+ const char *name,
+ char *cipher,
+ char *hmac,
+ unsigned char *key,
+ SilcUInt32 key_len);
/****f* silcclient/SilcClientAPI/silc_client_del_channel_private_keys
*
* SYNOPSIS
*
- * int silc_client_del_channel_private_keys(SilcClient client,
- * SilcClientConnection conn,
- * SilcChannelEntry channel);
+ * bool silc_client_del_channel_private_keys(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcChannelEntry channel);
*
* DESCRIPTION
*
* on error, TRUE otherwise.
*
***/
-int silc_client_del_channel_private_keys(SilcClient client,
- SilcClientConnection conn,
- SilcChannelEntry channel);
+bool silc_client_del_channel_private_keys(SilcClient client,
+ SilcClientConnection conn,
+ SilcChannelEntry channel);
/****f* silcclient/SilcClientAPI/silc_client_del_channel_private_key
*
* SYNOPSIS
*
- * int silc_client_del_channel_private_key(SilcClient client,
+ * bool silc_client_del_channel_private_key(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel,
* SilcChannelPrivateKey key);
* on error, TRUE otherwise.
*
***/
-int silc_client_del_channel_private_key(SilcClient client,
- SilcClientConnection conn,
- SilcChannelEntry channel,
- SilcChannelPrivateKey key);
+bool silc_client_del_channel_private_key(SilcClient client,
+ SilcClientConnection conn,
+ SilcChannelEntry channel,
+ SilcChannelPrivateKey key);
/****f* silcclient/SilcClientAPI/silc_client_list_channel_private_keys
*
* void *monitor_context,
* const char *local_ip,
* SilcUInt32 local_port,
+ * bool do_not_bind,
* SilcClientEntry client_entry,
* const char *filepath);
* SilcUInt32 *session_id);
* transmission of the file.
*
* This returns a file session ID for the file transmission to the
- * `session_id' pointer.. It can be used to close the session (and
+ * `session_id' pointer. It can be used to close the session (and
* abort the file transmission) by calling the silc_client_file_close
* function. The session ID is also returned in the `monitor' callback.
*
* listener for key exchange protocol to that IP. If `local_port' is
* non-zero that port is used. If `local_ip' is NULL then this will
* automatically attempt to bind it to local IP address of the machine.
- * If that fails then this does not bind to any address and port, and
- * assume that the remote client will provide the listener for the
- * key exchange protocol.
+ * If `do_not_bind' is TRUE then the `local_ip' and `local_port' are
+ * ignored and it is expected that the receiver will provide the
+ * point of contact. This is usefull if the sender is behind NAT.
*
* If error will occur during the file transfer process the error
* status will be returned in the monitor callback. In this case
void *monitor_context,
const char *local_ip,
SilcUInt32 local_port,
+ bool do_not_bind,
SilcClientEntry client_entry,
const char *filepath,
SilcUInt32 *session_id);