Commit Graph

322 Commits (8560b09dad11202f7c1edfd40519ecf70cc2cc33)

Author SHA1 Message Date
Sébastien Helleu 8560b09dad relay: add missing gcrypt lib in CMake and autotools files
This fixes build on Cygwin.
2020-04-15 22:50:27 +02:00
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 ccd45e4921 relay: update message displayed when the client is connected/authenticated 2020-04-12 20:24:39 +02:00
Sébastien Helleu b947512c9a relay: add option relay.network.auth_timeout 2020-04-12 19:36:12 +02:00
Sébastien Helleu fb6fc22c74 relay: add a function to send outqueue to the client 2020-04-12 19:25:21 +02:00
Sébastien Helleu 9f55f90bbf relay: update default colors for client status
Colors changed:

* relay.color.status_active: lightblue -> green
* relay.color.status_auth_failed: lightred -> lightmagenta
* relay.color.status_connecting: yellow -> white
* relay.color.status_waiting_auth: brown -> yellow

The color relay.color.status_disconnected remains lightred by default.
2020-04-12 18:02:27 +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 07505bb53c relay: add comments in truct t_relay_weechat_data 2020-04-12 15:35:03 +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 0271eacbe5 relay: rename variable length_hash to hash_size 2020-03-01 23:14:55 +01:00
Sébastien Helleu 9a6a27ef58 core: move crypto functions to wee-crypto.c, rename API function string_hash to crypto_hash 2020-03-01 21:24:27 +01:00
Sébastien Helleu c4ef3d6c2e core: merge functions string_hash_binary and string_hash into a single function string_hash 2020-03-01 16:41:28 +01:00
Sébastien Helleu bb363ab27f relay: call function string_hash_binary in relay_websocket_build_handshake to compute SHA1 hash
This removes dependency on libgcrypt in relay plugin.
2020-03-01 09:03:49 +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 c6161d0e4a plugins: sort options added in configuration sections 2019-10-23 19:45:06 +02:00
Sébastien Helleu baf8f635ff core: fix style in CMake files 2019-10-01 18:31:41 +02:00
Sébastien Helleu 1d6714e428 core: auto disable upgrade process (command line option "--upgrade") if the file weechat.upgrade is not found 2019-06-24 21:35:37 +02: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 22895f3f5e relay: set socket option SO_KEEPALIVE only for TCP sockets when creating the socket (issue #733) 2019-06-04 22:59:42 +02:00
Sébastien Helleu 479d234ced relay: set socket option SO_REUSEADDR only for TCP sockets when creating the socket (issue #733) 2019-06-04 22:54:00 +02:00
Sébastien Helleu 86d9cb1e41 relay: set socket option SO_REUSEADDR only for TCP sockets (issue #733) 2019-06-04 22:45:54 +02:00
Sébastien Helleu b4dadd6d98 relay: add UNIX domain socket completion for command /relay add (issue #733) 2019-06-04 22:29:18 +02:00
Sébastien Helleu 22e6777aed relay: fix crash when deleting a relay (issue #733) 2019-06-04 22:19:39 +02:00
Sébastien Helleu 66011b4bee relay: fix truncated path when the unix socket path is longer than the authorized one (issue #733) 2019-06-04 22:19:31 +02:00
Sébastien Helleu 90610c55c8 relay: remove useless condition
This fixes a compilation warning on FreeBSD.
2019-05-13 22:08:35 +02:00
Sébastien Helleu ec5aca81e7 relay: set address to "local" if not known 2019-05-13 21:57:23 +02:00
Sébastien Helleu 9ed89beaa0 core: update translations 2019-05-13 21:43:11 +02:00
Sébastien Helleu 8121747e7b relay: rename variables in function relay_config_check_path_length 2019-05-13 20:50:13 +02:00
Sébastien Helleu 6f3e563f8b relay: fix comment 2019-05-12 22:57:25 +02:00
Sébastien Helleu d1577b34da relay: set mode 700 on the unix socket file (only the owner can use it) 2019-05-12 22:27:43 +02:00
Sébastien Helleu ef1fcbd183 relay: do not overwrite a file if it's not a socket, display an error when the socket can not be created 2019-05-12 22:18:42 +02:00
Sébastien Helleu 585eb337e8 relay: evaluate path of unix socket relay 2019-05-12 21:53:23 +02:00
Sébastien Helleu b228ccdfc3 relay: rename function relay_config_check_path_len to relay_config_check_path_length 2019-05-12 21:39:22 +02:00
Sébastien Helleu ade52cdc7d relay: fix update of port/path variables in relay server when options relay.port.* and relay.path.* are changed with /set 2019-05-12 21:39:22 +02:00
Sébastien Helleu eacc08f2e1 relay: fix section used when the unix relay does not start with "unix." 2019-05-12 21:39:22 +02:00
Sébastien Helleu f273487688 relay: add unix relay format in /help relay 2019-05-12 21:39:22 +02:00
Sébastien Helleu 170c523c84 relay: remove extra newline at the end of /help relay 2019-05-12 21:39:22 +02:00
Sébastien Helleu c4230ecece relay: remove local variable ptr_server from function relay_config_check_path_cb (not needed) 2019-05-12 21:39:22 +02:00
Sébastien Helleu c1af2702b8 relay: improve message displayed on a new client 2019-05-12 21:39:22 +02:00
Sébastien Helleu 78fda01dd5 relay: improve message displayed when the relay is removed 2019-05-12 21:39:22 +02:00
Sébastien Helleu 9d04bc5801 relay: improve message displayed when the relay is added 2019-05-12 21:39:22 +02:00
Sébastien Helleu abe85999d8 relay: rename function relay_config_create_option_port to relay_config_create_option_port_path 2019-05-12 21:39:22 +02:00
Sébastien Helleu df3848e1f0 relay: fix code style 2019-05-12 21:39:22 +02:00
Sébastien Helleu c78fb8dc7c relay: rename variable "un" to "unix_socket" 2019-05-12 18:52:22 +02:00
Ryan Farley ffefd1b785 relay: add UNIX socket support (closes #733) 2019-05-12 18:51:13 +02:00
Ryan Farley 8df3ad3d26 cmake: allow custom libdir (fix #1341)
Allows for custom LIBDIR to specified with cmake builds. WEECHAT_LIBDIR
is used for a custom Weechat directory, or set from LIBDIR (as LIBDIR
used to be set).
2019-04-25 16:53:55 -05: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