/* Put USER_INFO */
silc_client_attribute_del(silc_client, conn,
SILC_ATTRIBUTE_USER_INFO, NULL);
- tmp = silc_file_readfile(sv, &tmp_len);
+ tmp = silc_file_readfile(sv, &tmp_len, NULL);
if (tmp) {
tmp[tmp_len] = 0;
if (silc_vcard_decode(tmp, tmp_len, &vcard))
/* Put STATUS_MESSAGE */
silc_client_attribute_del(silc_client, conn,
SILC_ATTRIBUTE_STATUS_MESSAGE, NULL);
- tmp = silc_file_readfile(sv, &tmp_len);
+ tmp = silc_file_readfile(sv, &tmp_len, NULL);
if (tmp) {
mime = silc_mime_decode(NULL, tmp, tmp_len);
if (mime)
list = g_strsplit(sv, " ", -1);
for (entry = list; *entry != NULL; entry++) {
if (!strncasecmp(*entry, "silc-rsa:", 8)) {
- tmp = silc_file_readfile((*entry) + 8, &tmp_len);
+ tmp = silc_file_readfile((*entry) + 8, &tmp_len, NULL);
if (tmp) {
tmp[tmp_len] = 0;
pk.type = "silc-rsa";
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,
/* 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 (verifyd && silc_pkcs_verify(verify->public_key,
- usersign.data,
- usersign.data_len,
- verifyd, verify_len,
- sha1hash)) {
+ if (verifyd)
+ silc_pkcs_verify(verify->public_key, usersign.data,
+ usersign.data_len, verifyd, verify_len, sha1hash,
+ silc_query_attributes_verify, &verified);
+
+ if (verified) {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_USER_SIGN_VERIFIED);
} else {
SilcPKCSType type = 0;
unsigned char *verifyd;
SilcUInt32 verify_len;
+ SilcBool verified = FALSE;
if (!strcmp(serverpk.type, "silc-rsa"))
type = SILC_PKCS_SILC;
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(public_key, serversign.data,
+ serversign.data_len, verifyd, verify_len, sha1hash,
+ silc_query_attributes_verify, &verified);
+ if (verified) {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_SERVER_SIGN_VERIFIED);
} else {