if (silc_pkcs_get_type(pubkey) != SILC_PKCS_SILC)
continue;
- pk = silc_pkcs_public_key_encode(pubkey, &pk_len);
+ pk = silc_pkcs_public_key_encode(NULL, pubkey, &pk_len);
if (!pk)
continue;
va_end(va);
}
+void static verify_message_signature_verified(SilcBool success,
+ void *context)
+{
+ *(SilcBool *)context = success;
+}
+
/* Try to verify a message using locally stored public key data */
int verify_message_signature(SilcClientEntry sender,
SilcUInt32 pk_datalen;
struct stat st;
int ret = SILC_MSG_SIGNED_VERIFIED, i;
+ SilcBool verified = FALSE;
/* get public key from the signature payload and compare it with the
one stored in the client entry */
}
/* the public key is now in pk, our "level of trust" in ret */
- if ((pk) && silc_message_signed_verify(message, pk,
- sha1hash) != SILC_AUTH_OK)
- ret = SILC_MSG_SIGNED_FAILED;
+ if (pk) {
+ silc_message_signed_verify(message, pk, sha1hash,
+ verify_message_signature_verified, &verified);
+ if (!verified)
+ ret = SILC_MSG_SIGNED_FAILED;
+ }
if (pk)
silc_pkcs_public_key_free(pk);
name = va_arg(va, char *);
client_entry = va_arg(va, SilcClientEntry);
- memset(buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf) - 1, "%s@%s",
- client_entry->username, client_entry->hostname);
- signal_emit("message invite", 4, server, channel ? channel->channel_name :
- name, client_entry->nickname, buf);
+ silc_snprintf(buf, sizeof(buf) - 1, "%s@%s",
+ client_entry->username, client_entry->hostname);
+ signal_emit("message invite", 4, server, name,
+ client_entry->nickname, buf);
break;
case SILC_NOTIFY_TYPE_JOIN:
if (silc_client_on_channel(channel, client_entry2)) {
silc_snprintf(buf, sizeof(buf), "%s", client_entry2->nickname);
silc_client_nickname_format(client, conn, client_entry2, TRUE);
- if (!silc_utf8_strcasecmp(buf, client_entry2->nickname))
+ if (!silc_utf8_strcasecmp(buf, client_entry2->nickname)) {
+ nicklist_rename_unique(SERVER(server), client_entry2, buf,
+ client_entry2, client_entry2->nickname);
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_USER_APPEARS,
buf, client_entry2->nickname);
+ }
}
silc_client_list_free(client, conn, clients);
silc_free(name);
if (silc_client_on_channel(channel, client_entry2)) {
silc_snprintf(buf, sizeof(buf), "%s", client_entry2->nickname);
silc_client_nickname_format(client, conn, client_entry2, TRUE);
- if (!silc_utf8_strcasecmp(buf, client_entry2->nickname))
+ if (!silc_utf8_strcasecmp(buf, client_entry2->nickname)) {
+ nicklist_rename_unique(SERVER(server), client_entry2, buf,
+ client_entry2, client_entry2->nickname);
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_USER_APPEARS,
buf, client_entry2->nickname);
+ }
}
silc_client_list_free(client, conn, clients);
silc_free(name);
NICK_REC *ownnick;
if (SILC_STATUS_IS_ERROR(status)) {
+ if (status == SILC_STATUS_ERR_NO_SUCH_SERVER) {
+ char *tmp = va_arg(vp, char *);
+ if (tmp)
+ silc_say_error("JOIN: %s: %s", tmp,
+ silc_get_status_message(status));
+ return;
+ }
+ if (status == SILC_STATUS_ERR_NO_SUCH_CHANNEL) {
+ char *tmp = va_arg(vp, char *);
+ if (tmp)
+ silc_say_error("JOIN: %s: %s", tmp,
+ silc_get_status_message(status));
+ return;
+ }
silc_say_error("JOIN: %s", silc_get_status_message(status));
return;
}
}
/* Encode public key */
- pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+ pk = silc_pkcs_public_key_encode(NULL, public_key, &pk_len);
if (!pk) {
if (completion)
completion(FALSE, context);
}
/* Encode the key data */
- encpk = silc_pkcs_public_key_encode(local_pubkey, &encpk_len);
+ encpk = silc_pkcs_public_key_encode(NULL, local_pubkey, &encpk_len);
if (!encpk) {
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_RECEIVED,verify->entity_name ?
void *context;
} *GetAuthMethod;
-static void silc_get_auth_ask_passphrase(unsigned char *passphrase,
+static void silc_get_auth_ask_passphrase(const unsigned char *passphrase,
SilcUInt32 passphrase_len,
void *context)
{