Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 - 2004 Pekka Riikonen
+ Copyright (C) 2002 - 2007 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
/* Process list of attributes. Returns reply to the requested attributes. */
SilcBuffer silc_client_attributes_process(SilcClient client,
- SilcSocketConnection sock,
+ SilcClientConnection conn,
SilcDList attrs)
{
- SilcClientConnection conn = sock->user_data;
SilcBuffer buffer = NULL;
SilcAttrForeach f;
SilcAttribute attribute;
/* Always put our public key. */
pk.type = "silc-rsa";
- pk.data = silc_pkcs_public_key_encode(client->public_key, &pk.data_len);
+ pk.data = silc_pkcs_public_key_encode(conn->public_key, &pk.data_len);
buffer = silc_attribute_payload_encode(buffer,
SILC_ATTRIBUTE_USER_PUBLIC_KEY,
pk.data ? SILC_ATTRIBUTE_FLAG_VALID :
buffer = f.buffer;
/* Finally compute the digital signature of all the data we provided. */
- if (silc_pkcs_sign_with_hash(client->pkcs, client->sha1hash,
- buffer->data, buffer->len,
- sign, &sign_len)) {
+ if (silc_pkcs_sign(conn->private_key, silc_buffer_data(buffer),
+ silc_buffer_len(buffer), sign, sizeof(sign), &sign_len,
+ TRUE, conn->internal->sha1hash)) {
pk.type = NULL;
pk.data = sign;
pk.data_len = sign_len;
/* Delete one attribute */
SilcBool silc_client_attribute_del(SilcClient client,
- SilcClientConnection conn,
- SilcAttribute attribute,
- SilcAttributePayload attr)
+ SilcClientConnection conn,
+ SilcAttribute attribute,
+ SilcAttributePayload attr)
{
SilcBool ret;
if (!attribute)
return silc_client_attributes_request(SILC_ATTRIBUTE_USER_INFO,
+ SILC_ATTRIBUTE_USER_ICON,
SILC_ATTRIBUTE_SERVICE,
SILC_ATTRIBUTE_STATUS_MOOD,
SILC_ATTRIBUTE_STATUS_FREETEXT,