projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Created SILC GIT repository.
[silc.git]
/
apps
/
irssi
/
src
/
silc
/
core
/
silc-queries.c
diff --git
a/apps/irssi/src/silc/core/silc-queries.c
b/apps/irssi/src/silc/core/silc-queries.c
index 271e3d5e77b41d44ad8e18df7ab5cc68198a15f2..18590f767e5d15defcb07a8726b9157fc07e7bf4 100644
(file)
--- a/
apps/irssi/src/silc/core/silc-queries.c
+++ b/
apps/irssi/src/silc/core/silc-queries.c
@@
-4,7
+4,7
@@
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 - 200
7
Pekka Riikonen
+ Copyright (C) 2002 - 200
8
Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-364,7
+364,8
@@
void silc_query_attributes_default(SilcClient client,
mask |= SILC_ATTRIBUTE_MOOD_ANXIOUS;
}
silc_client_attribute_add(silc_client, conn,
mask |= SILC_ATTRIBUTE_MOOD_ANXIOUS;
}
silc_client_attribute_add(silc_client, conn,
- SILC_ATTRIBUTE_STATUS_MOOD, (void *)mask,
+ SILC_ATTRIBUTE_STATUS_MOOD,
+ SILC_32_TO_PTR(mask),
sizeof(SilcUInt32));
g_strfreev(list);
}
sizeof(SilcUInt32));
g_strfreev(list);
}
@@
-435,7
+436,8
@@
void silc_query_attributes_default(SilcClient client,
mask |= SILC_ATTRIBUTE_CONTACT_VIDEO;
}
silc_client_attribute_add(silc_client, conn,
mask |= SILC_ATTRIBUTE_CONTACT_VIDEO;
}
silc_client_attribute_add(silc_client, conn,
- SILC_ATTRIBUTE_PREFERRED_CONTACT, (void *)mask,
+ SILC_ATTRIBUTE_PREFERRED_CONTACT,
+ SILC_32_TO_PTR(mask),
sizeof(SilcUInt32));
g_strfreev(list);
}
sizeof(SilcUInt32));
g_strfreev(list);
}
@@
-560,6
+562,11
@@
typedef struct {
bool nopk;
} *AttrVerify;
bool nopk;
} *AttrVerify;
+static void silc_query_attributes_verify(SilcBool success, void *context)
+{
+ *(SilcBool *)context = success;
+}
+
void silc_query_attributes_print(SILC_SERVER_REC *server,
SilcClient client,
SilcClientConnection conn,
void silc_query_attributes_print(SILC_SERVER_REC *server,
SilcClient client,
SilcClientConnection conn,
@@
-842,14
+849,17
@@
void silc_query_attributes_print(SILC_SERVER_REC *server,
/* Verify the signature now */
unsigned char *verifyd;
SilcUInt32 verify_len;
/* Verify the signature now */
unsigned char *verifyd;
SilcUInt32 verify_len;
+ SilcBool verified = FALSE;
if (verify->public_key) {
verifyd = silc_attribute_get_verify_data(attrs, FALSE, &verify_len);
if (verify->public_key) {
verifyd = silc_attribute_get_verify_data(attrs, FALSE, &verify_len);
- if (verifyd && silc_pkcs_verify(verify->public_key,
- usersign.data,
- usersign.data_len,
- verifyd, verify_len,
- sha1hash)) {
+ if (verifyd)
+ silc_pkcs_verify_async(verify->public_key, usersign.data,
+ usersign.data_len, verifyd, verify_len,
+ TRUE, sha1hash,
+ silc_query_attributes_verify, &verified);
+
+ if (verified) {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_USER_SIGN_VERIFIED);
} else {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_USER_SIGN_VERIFIED);
} else {
@@
-873,6
+883,7
@@
void silc_query_attributes_print(SILC_SERVER_REC *server,
SilcPKCSType type = 0;
unsigned char *verifyd;
SilcUInt32 verify_len;
SilcPKCSType type = 0;
unsigned char *verifyd;
SilcUInt32 verify_len;
+ SilcBool verified = FALSE;
if (!strcmp(serverpk.type, "silc-rsa"))
type = SILC_PKCS_SILC;
if (!strcmp(serverpk.type, "silc-rsa"))
type = SILC_PKCS_SILC;
@@
-887,11
+898,12
@@
void silc_query_attributes_print(SILC_SERVER_REC *server,
serverpk.data_len,
&public_key)) {
verifyd = silc_attribute_get_verify_data(attrs, TRUE, &verify_len);
serverpk.data_len,
&public_key)) {
verifyd = silc_attribute_get_verify_data(attrs, TRUE, &verify_len);
- if (verifyd && silc_pkcs_verify(public_key,
- serversign.data,
- serversign.data_len,
- verifyd, verify_len,
- sha1hash)) {
+ if (verifyd)
+ silc_pkcs_verify_async(public_key, serversign.data,
+ serversign.data_len, verifyd,
+ verify_len, TRUE, sha1hash,
+ silc_query_attributes_verify, &verified);
+ if (verified) {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_SERVER_SIGN_VERIFIED);
} else {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_SERVER_SIGN_VERIFIED);
} else {