projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integer type name change.
[silc.git]
/
lib
/
silcclient
/
client_channel.c
diff --git
a/lib/silcclient/client_channel.c
b/lib/silcclient/client_channel.c
index 4f89d7270b01458f2fc23a81516c8d4aab10d099..c98a8823909d602fe8b666995b99e7e0f5e4e5ed 100644
(file)
--- a/
lib/silcclient/client_channel.c
+++ b/
lib/silcclient/client_channel.c
@@
-22,7
+22,8
@@
channel key receiving and setting, and channel private key handling
routines. */
channel key receiving and setting, and channel private key handling
routines. */
-#include "clientlibincludes.h"
+#include "silcincludes.h"
+#include "silcclient.h"
#include "client_internal.h"
/* Sends packet to the `channel'. Packet to channel is always encrypted
#include "client_internal.h"
/* Sends packet to the `channel'. Packet to channel is always encrypted
@@
-38,7
+39,7
@@
void silc_client_send_channel_message(SilcClient client,
SilcChannelPrivateKey key,
SilcMessageFlags flags,
unsigned char *data,
SilcChannelPrivateKey key,
SilcMessageFlags flags,
unsigned char *data,
-
ui
nt32 data_len,
+
SilcUI
nt32 data_len,
int force_send)
{
int i;
int force_send)
{
int i;
@@
-48,7
+49,7
@@
void silc_client_send_channel_message(SilcClient client,
SilcCipher cipher;
SilcHmac hmac;
unsigned char *id_string;
SilcCipher cipher;
SilcHmac hmac;
unsigned char *id_string;
-
ui
nt32 iv_len;
+
SilcUI
nt32 iv_len;
int block_len;
SILC_LOG_DEBUG(("Sending packet to channel"));
int block_len;
SILC_LOG_DEBUG(("Sending packet to channel"));
@@
-164,7
+165,7
@@
typedef struct {
static void silc_client_channel_message_cb(SilcClient client,
SilcClientConnection conn,
SilcClientEntry *clients,
static void silc_client_channel_message_cb(SilcClient client,
SilcClientConnection conn,
SilcClientEntry *clients,
-
ui
nt32 clients_count,
+
SilcUI
nt32 clients_count,
void *context)
{
SilcChannelClientResolve res = (SilcChannelClientResolve)context;
void *context)
{
SilcChannelClientResolve res = (SilcChannelClientResolve)context;
@@
-342,7
+343,7
@@
void silc_client_save_channel_key(SilcClient client,
SilcChannelEntry channel)
{
unsigned char *id_string, *key, *cipher, *hmac, hash[32];
SilcChannelEntry channel)
{
unsigned char *id_string, *key, *cipher, *hmac, hash[32];
-
ui
nt32 tmp_len;
+
SilcUI
nt32 tmp_len;
SilcChannelID *id;
SilcChannelKeyPayload payload;
SilcChannelID *id;
SilcChannelKeyPayload payload;
@@
-396,8
+397,7
@@
void silc_client_save_channel_key(SilcClient client,
key = silc_channel_key_get_key(payload, &tmp_len);
cipher = silc_channel_key_get_cipher(payload, NULL);
channel->key_len = tmp_len * 8;
key = silc_channel_key_get_key(payload, &tmp_len);
cipher = silc_channel_key_get_cipher(payload, NULL);
channel->key_len = tmp_len * 8;
- channel->key = silc_calloc(tmp_len, sizeof(*channel->key));
- memcpy(channel->key, key, tmp_len);
+ channel->key = silc_memdup(key, tmp_len);
if (!silc_cipher_alloc(cipher, &channel->channel_key)) {
client->internal->ops->say(
if (!silc_cipher_alloc(cipher, &channel->channel_key)) {
client->internal->ops->say(
@@
-474,7
+474,7
@@
int silc_client_add_channel_private_key(SilcClient client,
char *cipher,
char *hmac,
unsigned char *key,
char *cipher,
char *hmac,
unsigned char *key,
-
ui
nt32 key_len)
+
SilcUI
nt32 key_len)
{
SilcChannelPrivateKey entry;
unsigned char hash[32];
{
SilcChannelPrivateKey entry;
unsigned char hash[32];
@@
-520,8
+520,7
@@
int silc_client_add_channel_private_key(SilcClient client,
/* Save the key */
entry = silc_calloc(1, sizeof(*entry));
/* Save the key */
entry = silc_calloc(1, sizeof(*entry));
- entry->key = silc_calloc(keymat->enc_key_len / 8, sizeof(*entry->key));
- memcpy(entry->key, keymat->send_enc_key, keymat->enc_key_len / 8);
+ entry->key = silc_memdup(keymat->send_enc_key, keymat->enc_key_len / 8);
entry->key_len = keymat->enc_key_len / 8;
/* Allocate the cipher and set the key*/
entry->key_len = keymat->enc_key_len / 8;
/* Allocate the cipher and set the key*/
@@
-630,10
+629,10
@@
SilcChannelPrivateKey *
silc_client_list_channel_private_keys(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
silc_client_list_channel_private_keys(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
-
ui
nt32 *key_count)
+
SilcUI
nt32 *key_count)
{
SilcChannelPrivateKey *keys = NULL, entry;
{
SilcChannelPrivateKey *keys = NULL, entry;
-
ui
nt32 count = 0;
+
SilcUI
nt32 count = 0;
if (!channel->private_keys)
return NULL;
if (!channel->private_keys)
return NULL;
@@
-654,7
+653,7
@@
silc_client_list_channel_private_keys(SilcClient client,
/* Frees the SilcChannelPrivateKey array. */
void silc_client_free_channel_private_keys(SilcChannelPrivateKey *keys,
/* Frees the SilcChannelPrivateKey array. */
void silc_client_free_channel_private_keys(SilcChannelPrivateKey *keys,
-
ui
nt32 key_count)
+
SilcUI
nt32 key_count)
{
silc_free(keys);
}
{
silc_free(keys);
}