+Fri Jun 14 22:59:02 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Added new status types KEY_AGREEMENT_ALREADY_STARTED and
+ KEY_AGREEMENT_SELF_DENIED to lib/silcclient/silcclient.h.
+ Starting key agreement with itself is denied. Affected file
+ is lib/silcclient/client_keyagr.c.
+
+ * Fixed some error checkings from the SFTP library which caused
+ misbehaviour. Affected files are lib/silcsftp/sftp_client.c
+ and lib/silcsftp/sftp_util.c.
+
Tue Jun 11 16:36:02 CEST 2002 Johnny Mnemonic <johnny@themnemonic.org>
* Fixed a missing variadic parameter in a function call that
o /cumode for unknown nick does not give any error message (Fix this to
0.9.x).
- o The paths in Irssi SILC client binary are wrong. Stuff gets installed
- in (fe.) /usr/local/share but binary checks from /usr/local/lib and
- never from share.
-
- o /KEY is broken? KEY is broken when negotiating with itself.
-
TODO/bugs In SILC Client Library
================================
- o file transfer does not work everytime, and not with large files?
-
o The PRIVATE_MESSAGE_KEY packet is not handled (it is implemented
though). This should be added and perhaps new client operation
should be added to notify application that it was received and
{ "key_agreement_failure", "Key agreement failed with {nick $0}", 1, { 0 } },
{ "key_agreement_timeout", "Timeout during key agreement. The key agreement was not performed with {nick $0}", 1, { 0 } },
{ "key_agreement_aborted", "Key agreement was aborted with {nick $0}", 1, { 0 } },
+ { "key_agreement_started", "Key agreement is already started with {nick $0}", 1, { 0 } },
+ { "key_agreement_denied", "Key agreement cannot be started with yourself", 0 },
{ "pubkey_received", "Received {hilight $0} public key", 1, { 0 } },
{ "pubkey_fingerprint", "Fingerprint and babbleprint for the {hilight $0} key are %: $1", 2, { 0, 0 } },
{ "pubkey_babbleprint", " $0", 1, { 0 } },
SILCTXT_KEY_AGREEMENT_FAILURE,
SILCTXT_KEY_AGREEMENT_TIMEOUT,
SILCTXT_KEY_AGREEMENT_ABORTED,
+ SILCTXT_KEY_AGREEMENT_ALREADY_STARTED,
+ SILCTXT_KEY_AGREEMENT_SELF_DENIED,
SILCTXT_PUBKEY_RECEIVED,
SILCTXT_PUBKEY_FINGERPRINT,
SILCTXT_PUBKEY_BABBLEPRINT,
printformat_module("fe-common/silc", i->server, NULL, MSGLEVEL_CRAP,
SILCTXT_KEY_AGREEMENT_ABORTED, client_entry->nickname);
break;
+
+ case SILC_KEY_AGREEMENT_ALREADY_STARTED:
+ printformat_module("fe-common/silc", i->server, NULL, MSGLEVEL_CRAP,
+ SILCTXT_KEY_AGREEMENT_ALREADY_STARTED,
+ client_entry->nickname);
+ break;
+
+ case SILC_KEY_AGREEMENT_SELF_DENIED:
+ printformat_module("fe-common/silc", i->server, NULL, MSGLEVEL_CRAP,
+ SILCTXT_KEY_AGREEMENT_SELF_DENIED);
+ break;
default:
break;
SilcClientKeyAgreement ke = NULL;
SilcBuffer buffer;
- if (!client_entry || client_entry->ke)
+ if (!client_entry)
return;
+ if (client_entry->ke) {
+ completion(client, conn, client_entry, SILC_KEY_AGREEMENT_ALREADY_STARTED,
+ NULL, context);
+ return;
+ }
+
+ if (client_entry == conn->local_entry) {
+ completion(client, conn, client_entry, SILC_KEY_AGREEMENT_SELF_DENIED,
+ NULL, context);
+ return;
+ }
+
/* Create the listener if hostname and port was provided.
* also, use bindhost if it was specified.
*/
completion(client, conn, client_entry, SILC_KEY_AGREEMENT_FAILURE,
NULL, context);
silc_free(ke);
-
return;
}
client_entry->id, SILC_ID_CLIENT, NULL, NULL,
buffer->data, buffer->len, FALSE);
silc_buffer_free(buffer);
-
}
static int
SILC_LOG_DEBUG(("Start"));
- if (!client_entry || !hostname || !port)
+ if (!client_entry)
+ return;
+
+ if (!hostname || !port) {
+ completion(client, conn, client_entry, SILC_KEY_AGREEMENT_FAILURE,
+ NULL, context);
return;
+ }
+
+ if (client_entry == conn->local_entry) {
+ completion(client, conn, client_entry, SILC_KEY_AGREEMENT_SELF_DENIED,
+ NULL, context);
+ return;
+ }
ke = silc_calloc(1, sizeof(*ke));
ke->client = client;
if (!client_entry)
return;
+ if (client_entry == conn->local_entry) {
+ completion(client, conn, client_entry, SILC_KEY_AGREEMENT_SELF_DENIED,
+ NULL, context);
+ return;
+ }
+
ke = silc_calloc(1, sizeof(*ke));
ke->client = client;
ke->conn = conn;
SILC_KEY_AGREEMENT_FAILURE, /* The protocol failed */
SILC_KEY_AGREEMENT_TIMEOUT, /* The protocol timeout */
SILC_KEY_AGREEMENT_ABORTED, /* The protocol aborted */
+ SILC_KEY_AGREEMENT_ALREADY_STARTED, /* Already started */
+ SILC_KEY_AGREEMENT_SELF_DENIED, /* Negotiationg with itself denied */
} SilcKeyAgreementStatus;
/***/
silc_list_add(client->requests, req);
attrs_buf = silc_sftp_attr_encode(attrs);
- if (attrs_buf)
+ if (!attrs_buf)
return;
len = 4 + 4 + strlen(filename) + 4 + attrs_buf->len;
silc_list_add(client->requests, req);
attrs_buf = silc_sftp_attr_encode(attrs);
- if (attrs_buf)
+ if (!attrs_buf)
return;
len = 4 + 4 + strlen(path) + attrs_buf->len;
silc_list_add(client->requests, req);
attrs_buf = silc_sftp_attr_encode(attrs);
- if (attrs_buf)
+ if (!attrs_buf)
return;
len = 4 + 4 + strlen(path) + attrs_buf->len;
silc_sftp_handle_get(handle, &hdata, &hdata_len);
attrs_buf = silc_sftp_attr_encode(attrs);
- if (attrs_buf)
+ if (!attrs_buf)
return;
len = 4 + 4 + hdata_len + attrs_buf->len;
for (i = 0; i < name->count; i++) {
len += (8 + strlen(name->filename[i]) + strlen(name->long_filename[i]));
attr_buf[i] = silc_sftp_attr_encode(name->attrs[i]);
- if (attr_buf[i])
+ if (!attr_buf[i])
return NULL;
len += attr_buf[i]->len;
}