* Find correct make to use in prepare-clean. A patch by
toma. Affected file prepare-clean.
+Sat Nov 3 22:04:00 PST 2001 Brian Costello <bc@mksecure.com>
+
+ * Added irssi variables use_auto_addr, auto_bind_ip,
+ auto_bind_port and auto_public_ip.
+
+ * Changed the interface for silc_client_send_key_agreement
+ in lib/silcclient/silcapi.h
+
+ Affected files:
+
+ irssi/src/silc/core/silc-core.c
+ irssi/config
+ lib/silcclient/silcapi.h
+ irssi/src/silc/core/silc-channels.c
+ lib/silcclient/client_keyagr.c
+ irssi/docs/help/key
+
Sat Nov 3 17:48:55 EET 2001 Pekka Riikonen <priikone@silcnet.org>
* Added silc_pkcs_public_key_compare to compare two
use_msgs_window = "no";
autocreate_windows = "no";
autocreate_query_level = "none";
+ use_auto_addr = "no";
};
"fe-text" = { topicbar = "no"; mail_counter = "yes"; indent = "8"; };
};
you can reply to the sender with the hostname and
port of your key agreement server with this command.
+ If the hostname and port are ommitted, the irssi
+ boolean variable use_auto_addr will be examined. If
+ this variable is set, the value of auto_bind_ip will
+ be used as the IP address to listen for the return
+ reply, the value of auto_public_ip will be the IP
+ address sent to the remote client, and auto_bind_port
+ will be the port value to be bound to AND sent to
+ the remote client. If auto_public_ip is unset, but
+ auto_bind_ip IS, irssi will send the auto_bind_ip
+ variable's value to the remote client.
+
negotiate [<hostname> [<port>]]
This may be called to start the key agreement with
uint32 argc = 0;
unsigned char **argv;
uint32 *argv_lens, *argv_types;
+ char *bindhost = NULL;
if (!server || !IS_SILC_SERVER(server) || !server->connected)
cmd_return_error(CMDERR_NOT_CONNECTED);
internal = silc_calloc(1, sizeof(*internal));
internal->type = type;
internal->server = server;
+
+ if (!hostname) {
+ if (settings_get_bool("use_auto_addr")) {
+
+ hostname = (char *)settings_get_str("auto_public_ip");
+
+/* If the hostname isn't set, treat this case as if auto_public_ip wasn't
+ * set.
+ */
+ if ((hostname) && (*hostname == '\0')) {
+ hostname = NULL;
+ }
+ else {
+ bindhost = (char *)settings_get_str("auto_bind_ip");
+
+/* if the bind_ip isn't set, but the public_ip IS, then assume then
+ * public_ip is the same value as the bind_ip.
+ */
+ if ((bindhost) && (*bindhost == '\0')) {
+ bindhost = hostname;
+ }
+ port = settings_get_int("auto_bind_port");
+ }
+ } /* if use_auto_addr */
+ }
}
/* Start command is used to start key agreement (after receiving the
SILCTXT_KEY_AGREEMENT, argv[2]);
internal->responder = TRUE;
silc_client_send_key_agreement(silc_client, conn, client_entry, hostname,
- port, 120, keyagr_completion, internal);
+ bindhost, port, 120, keyagr_completion,
+ internal);
if (!hostname)
silc_free(internal);
goto out;
/* Do some irssi initializing */
settings_add_bool("server", "skip_motd", FALSE);
settings_add_str("server", "alternate_nick", NULL);
+
+ /* Initialize the auto_addr variables Is "server" the best choice for
+ * this? No existing category seems to apply.
+ */
+
+ settings_add_bool("server", "use_auto_addr", FALSE);
+ settings_add_str("server", "auto_bind_ip", "");
+ settings_add_str("server", "auto_public_ip", "");
+ settings_add_int("server", "auto_bind_port", 0);
+
silc_init_userinfo();
/* Initialize client parameters */
void silc_client_send_key_agreement(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
- char *hostname,
+ const char *hostname,
+ const char *bindhost,
int port,
uint32 timeout_secs,
SilcKeyAgreementCallback completion,
if (client_entry->ke)
return;
- /* Create the listener if hostname and port was provided */
+ /* Create the listener if hostname and port was provided.
+ * also, use bindhost if it was specified.
+ */
+
if (hostname) {
ke = silc_calloc(1, sizeof(*ke));
+
+ if (bindhost) {
+ ke->fd = silc_net_create_server(port, bindhost);
+ }
+ else {
ke->fd = silc_net_create_server(port, hostname);
+ }
if (ke->fd < 0) {
client->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
"Cannot create listener on %s on port %d: %s",
- hostname, port, strerror(errno));
+ (bindhost) ? bindhost:hostname, port, strerror(errno));
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
void silc_client_send_key_agreement(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
- char *hostname,
+ const char *hostname,
+ const char *bindhost,
int port,
uint32 timeout_secs,
SilcKeyAgreementCallback completion,