Commit Graph

67 Commits (9fa3609c85e4b6608d366bed4e47ab9553cd5bc9)

Author SHA1 Message Date
Sébastien Helleu 9fa3609c85 relay: add command "handshake" in weechat relay protocol and nonce to prevent replay attacks (closes #1474)
This introduces a new command called "handshake" in the weechat relay protocol.
It should be sent by the client before the "init" command, to negotiate the way
to authenticate with a password.

3 new options are added:

* relay.network.auth_password
* relay.network.hash_iterations
* relay.network.nonce_size
2020-04-14 21:38:12 +02:00
Sébastien Helleu 7ddc815726 relay: actually use the client status "waiting_auth" in irc and weechat protocols (closes #1358)
Now the status "waiting_auth" is used and displayed in the relay buffer.

When a client connects, there are now 2 messages (except for irc protocol if
there's no password required):

relay: new client on port 9000: 1/weechat/1.2.3.4 (waiting auth)
relay: client 1/weechat/1.2.3.4 authenticated

If the authentication fails, the messages are:

relay: new client on port 9000: 1/weechat/1.2.3.4 (waiting auth)
=!= relay: authentication failed with client 1/weechat/1.2.3.4
2020-04-12 17:46:46 +02:00
Sébastien Helleu 2d2b49bfaa relay: accept hash of password in init command with option "password_hash"
Allowed algorithms are:

* PBKDF2 (SHA256 or SHA512, salt, iterations)
* SHA256
* SHA512
2020-03-02 00:46:10 +01:00
Sébastien Helleu b79cd6d546 relay: update buffers synchronization when buffers are renamed (closes #1428) 2020-01-12 17:03:16 +01:00
Sébastien Helleu feb6258910 core: update copyright dates 2020-01-04 10:41:26 +01:00
Sébastien Helleu 330149b9b6 relay: reject client with weechat protocol if password or totp is received in init command but not set in WeeChat (closes #1435) 2019-12-21 10:47:35 +01:00
Sébastien Helleu 9178156354 api: add argument "strip_items" in function string_split 2019-06-15 20:47:14 +02:00
Sébastien Helleu 3d95217745 api: return allocated string in hook_info callback and function info_get 2019-04-13 08:42:45 +02:00
Sébastien Helleu da43e95c75 relay: use option "delay" in call to command_options (closes #1327)
This fixes a crash when sending "/plugin reload relay" from a relay client.
2019-03-28 22:07:25 +01:00
Sébastien Helleu 92e176ab89 relay: use empty value by default for option relay.weechat.commands (issue #928)
The relay client is supposed to be safe by default, and the relay connection
should be protected by the different ways (restriction on IP address, SSL,
strong password, Time-based One-Time Password, local bind address and use of
SSH tunnel…).

So this option lets the user add extra security by allowing only some
commands (whitelist), or allowing any commands except a list of given
commands (blacklist).
2019-03-11 21:12:23 +01:00
Sébastien Helleu 2b70d71aa1 core: replace argument "keep_eol" by "flags" in function string_split (closes #1322) 2019-03-10 18:29:16 +01:00
Sébastien Helleu d290de2cba relay: add option relay.weechat.commands (closes #928) 2019-02-28 20:24:25 +01:00
Sébastien Helleu 2b0057239b core: update copyright dates 2019-01-01 15:40:51 +01:00
Sébastien Helleu 4712d0bb06 core: use https for links to GNU GPL license 2018-11-29 23:16:07 +01:00
Sébastien Helleu 738535e7f6 relay: add support of Time-based One-Time Password (TOTP) as second authentication factor in weechat protocol 2018-11-04 14:50:53 +01:00
Sébastien Helleu 8abd05fe3d core: replace "long unsigned int" by "unsigned long" 2018-10-01 22:21:25 +02:00
Sébastien Helleu ed4837b2f6 core: update copyright dates 2018-01-05 00:54:18 +01:00
Sébastien Helleu 532216e760 relay: check buffer pointer received in "sync" and "desync" commands (weechat protocol) (closes #936) 2017-03-26 15:15:56 +02:00
Sébastien Helleu 7ceacabd46 relay: remove buffer from synchronized buffers when it is closed (fix memory leak) 2017-03-26 08:55:08 +02:00
Sébastien Helleu 705d86e684 core: update copyright dates 2017-01-01 11:32:04 +01:00
Sébastien Helleu 133cbbd947 relay: set status to AUTH_FAILED in case of auth failure in weechat protocol (closes #825) 2016-10-21 07:49:10 +02:00
Sébastien Helleu 09c52755d1 relay: return an empty hdata when the requested hdata or pointer is not found (closes #767) 2016-07-29 15:55:42 +02:00
Sébastien Helleu af83fb55e1 relay: allow escape of comma in command "init" (weechat protocol) (issue #730) 2016-05-13 19:37:19 +02:00
Sébastien Helleu cf6aca1619 core: add pointer in some callbacks (closes #406)
This pointer is the first argument received by callbacks, and the
existing argument "data" is now automatically freed by WeeChat when the
object containing the callback is removed.

With this new pointer, the linked list of callbacks in scripts has been
removed. This will improve speed of scripts (using a lot of hooks),
reduce memory used by scripts and reduce time to unload scripts.

Following functions are affected in the C API:

* exec_on_files
* config_new
* config_new_section
* config_new_option
* hook_command
* hook_command_run
* hook_timer
* hook_fd
* hook_process
* hook_process_hashtable
* hook_connect
* hook_print
* hook_signal
* hook_hsignal
* hook_config
* hook_completion
* hook_modifier
* hook_info
* hook_info_hashtable
* hook_infolist
* hook_hdata
* hook_focus
* unhook_all_plugin
* buffer_new
* bar_item_new
* upgrade_new
* upgrade_read
2016-03-21 18:11:21 +01:00
Sébastien Helleu 1a94193147 relay: fix command "input" received from clients (weechat protocol) (closes #663)
The command "input" received with only spaces in content of message was
ignored by WeeChat (because of the split on spaces).
2016-01-23 10:37:07 +01:00
Sébastien Helleu 3330724574 core: update copyright dates 2016-01-01 11:09:53 +01:00
Sébastien Helleu a020c28ea6 core: update copyright dates 2015-01-01 09:23:23 +01:00
Sébastien Helleu debfb57d0f relay: send messages "_buffer_localvar_*" and "_buffer_type_changed" with sync "buffers" (closes #191) 2014-11-16 10:53:55 +01:00
Sébastien Helleu a6aee98cb1 relay: fix memory leak when receiving commands from client (weechat protocol) 2014-08-09 17:15:22 +02:00
Sébastien Helleu bb779271ae relay: don't send signals "buffer_clear" and "buffer_line_added" for relay raw/list buffers to clients (weechat protocol) 2014-05-29 16:49:50 +02:00
Sébastien Helleu faae8f470b relay: check pointers received in hdata command to prevent crashes with bad pointers (WeeChat protocol) 2014-05-24 18:18:11 +02:00
Sébastien Helleu 432ecaa9f4 relay: add message "_buffer_cleared" 2014-05-08 14:36:23 +02:00
Sébastien Helleu a311764d12 relay: add signal "relay_client_auth_ok" for irc and weechat protocols 2014-04-13 08:27:27 +02:00
Sébastien Helleu 836ed0bbfe relay: add messages "_buffer_hidden" and "_buffer_unhidden" 2014-04-05 16:53:48 +02:00
Sebastien Helleu cd66b459de relay: search buffers by full name 2014-03-11 15:30:51 +01:00
Sebastien Helleu 7a191c2de1 relay: fix crash on /upgrade received from a client (weechat protocol)
Some commands like /upgrade sent by relay client can cause problems, because
they were executed immediately (while relay code is running). The /upgrade
command unloads all plugins, so the result is unpredictable (it can cause a
crash).

This commit adds a timer (1 millisecond) to delay the execution of command
after we go back in the WeeChat main loop.
2014-03-07 09:22:21 +01:00
Sebastien Helleu 892aa79fb5 core: update copyright dates 2014-01-01 00:14:12 +01:00
Sebastien Helleu e900579fba relay: add support of secured data in option relay.network.password (evaluate content) (patch from Nils Görs) 2013-09-19 15:11:51 +02:00
Sebastien Helleu dd41e5776f relay: add command "ping" in weechat protocol (task #12689) 2013-06-09 20:43:24 +02:00
Sebastien Helleu 86a8b9fb5f relay: remove temporary option "nicklistdiff" (in command init), send nicklist diff by default (weechat protocol)
The temporary option was introduced because the nicklist diff was experimental.
It is now enabled by default, and there is no way to disable it. Therefore any
relay client using weechat protocol must implement the message "_nicklist_diff"
(unless nicklist is ignored by client).

Extra note: a full nicklist may still be sent if a message with diff would be
bigger than whole nicklist. So both full nicklist (message "_nicklist") and
nicklist diff (message "_nicklist_diff") must be implemented by clients.
2013-05-01 21:01:12 +02:00
Sebastien Helleu a9ff529d83 relay: rename compression "gzip" to "zlib" (compression is zlib, not gzip) (thanks to Dominik Honnef) 2013-03-17 16:14:20 +01:00
Sebastien Helleu 149c77decd core: fix typos in many comments and some strings 2013-03-17 12:55:20 +01:00
Sebastien Helleu 7672139d6b relay: add negative numbers (integer: -123456 and long: -1234567890L) in command "test" (weechat protocol) 2013-03-13 11:50:32 +01:00
Sebastien Helleu d2ff46fa69 relay: add message "_nicklist_diff" (differences between old and current nicklist)
This is an experimental feature, that must be explicitely enabled by clients
(for weechat protocol) in the init command with option "nicklistdiff", for example:

  init password=mypasswd,nicklistdiff=1

This option will be removed when clients will handle nicklist diff.
2013-03-09 09:04:49 +01:00
Sebastien Helleu c2aeb69c46 relay: add experimental websocket server support (RFC 6455) for irc and weechat protocols, new option relay.network.websocket_allowed_origins
It is a partial implementation of RFC 6455: fragmentation and control frames are
not yet supported.
Text and binary frames are supported.
2013-02-10 20:22:13 +01:00
Sebastien Helleu e4149b073d relay: add options "buffers" and "upgrade" for commands sync/desync in weechat protocol 2013-02-07 22:08:31 +01:00
Sebastien Helleu 7a1f9a1d7f relay: fix commands sync/desync in weechat protocol (bug #38215)
Fix:
- use proper arguments in commands sync/desync (use argv[0] instead of argv[1])
- when searching if a buffer is synchronized, its name has higher priority on "*"
  (so first check if buffer is synchronized, and if not found, search if "*" is
  synchronized)
- when receiving a "nicklist_*" signal, check if the buffer is synchronized with
  flag "RELAY_WEECHAT_PROTOCOL_SYNC_NICKLIST"
2013-02-03 09:51:15 +01:00
Sebastien Helleu afe729435a relay: fix typo in comment 2013-02-03 08:38:41 +01:00
Sebastien Helleu ac94f68b59 relay: add return of a NULL pointer in command "test" 2013-02-01 09:58:30 +01:00
Sebastien Helleu 08f360692d relay: add comments with example of messages in weechat protocol 2013-02-01 08:53:37 +01:00