SilcChannelID *channel_id;
unsigned char *tmp;
SilcUInt32 len;
+ SilcBufferStruct buf;
if (cmd->error != SILC_STATUS_OK) {
SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
/* Get the invite list */
tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
-
+ if (tmp)
+ silc_buffer_set(&buf, tmp, len);
+
/* Notify application */
- COMMAND_REPLY((SILC_ARGS, channel, tmp));
+ COMMAND_REPLY((SILC_ARGS, channel, tmp ? &buf : NULL));
out:
SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_INVITE);
COMMAND_REPLY_ERROR;
goto out;
}
-
+
/* Get channel mode */
tmp = silc_argument_get_arg_type(cmd->args, 3, NULL);
if (!tmp) {
SilcChannelID *channel_id;
unsigned char *tmp;
SilcUInt32 len;
+ SilcBufferStruct buf;
if (cmd->error != SILC_STATUS_OK) {
SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
/* Get the ban list */
tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
-
+ if (tmp)
+ silc_buffer_set(&buf, tmp, len);
+
/* Notify application */
- COMMAND_REPLY((SILC_ARGS, channel, tmp));
+ COMMAND_REPLY((SILC_ARGS, channel, tmp ? &buf : NULL));
out:
SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_BAN);
{
SilcClientCommandReplyContext cmd = (SilcClientCommandReplyContext)context;
SilcClientConnection conn = (SilcClientConnection)cmd->sock->user_data;
+ SilcClientCommandReplyContext r = (SilcClientCommandReplyContext)context2;
SILC_LOG_DEBUG(("Start"));
goto out;
}
+ if (r && !silc_command_get_status(r->payload, NULL, &cmd->error)) {
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_get_status_message(cmd->error));
+ COMMAND_REPLY_ERROR;
+ goto out;
+ }
+
if (silc_client_command_reply_users_save(cmd, cmd->status, TRUE,
silc_client_command_reply_users_cb,
silc_client_command_reply_users))
SilcClientEntry client_entry;
SilcServerID *server_id = NULL;
SilcServerEntry server_entry;
- SilcSKEPKType type;
- unsigned char *tmp, *pk;
+ unsigned char *tmp;
SilcUInt32 len;
- SilcUInt16 pk_len;
SilcIdType id_type;
SilcPublicKey public_key = NULL;
/* Get the public key payload */
tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
if (tmp) {
- /* Decode the public key */
- SILC_GET16_MSB(pk_len, tmp);
- SILC_GET16_MSB(type, tmp + 2);
- pk = tmp + 4;
-
- if (type == SILC_SKE_PK_TYPE_SILC)
- if (!silc_pkcs_public_key_decode(pk, pk_len, &public_key))
- public_key = NULL;
- }
+ if (!silc_pkcs_public_key_payload_decode(tmp, len, &public_key))
+ public_key = NULL;
+ }
id_type = silc_id_payload_get_type(idp);
if (id_type == SILC_ID_CLIENT) {
goto out;
}
+ /* Save fingerprint */
+ if (!client_entry->fingerprint) {
+ client_entry->fingerprint = silc_calloc(20, sizeof(unsigned char));
+ client_entry->fingerprint_len = 20;
+ silc_hash_make(cmd->client->sha1hash, tmp + 4, len - 4,
+ client_entry->fingerprint);
+ }
+
/* Notify application */
COMMAND_REPLY((SILC_ARGS, id_type, client_entry, public_key));
} else if (id_type == SILC_ID_SERVER) {