From 738535e7f628d9b4a26cccc8b598e07e63ac1123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 4 Nov 2018 14:26:59 +0100 Subject: [PATCH] relay: add support of Time-based One-Time Password (TOTP) as second authentication factor in weechat protocol --- ChangeLog.adoc | 1 + doc/de/weechat_user.de.adoc | 29 ++++++ doc/en/weechat_relay_protocol.en.adoc | 11 ++- doc/en/weechat_user.en.adoc | 28 ++++++ doc/fr/weechat_relay_protocol.fr.adoc | 11 ++- doc/fr/weechat_user.fr.adoc | 30 +++++++ doc/it/weechat_user.it.adoc | 29 ++++++ doc/ja/weechat_relay_protocol.ja.adoc | 13 ++- doc/ja/weechat_user.ja.adoc | 29 ++++++ doc/pl/weechat_user.pl.adoc | 29 ++++++ src/plugins/relay/relay-config.c | 88 ++++++++++++++++++- src/plugins/relay/relay-config.h | 6 ++ src/plugins/relay/relay-server.c | 60 ++++++++++--- .../relay/weechat/relay-weechat-protocol.c | 56 +++++++++--- src/plugins/relay/weechat/relay-weechat.c | 21 ++++- src/plugins/relay/weechat/relay-weechat.h | 1 + 16 files changed, 409 insertions(+), 33 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 3d3fea9fb..e59a08acc 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -22,6 +22,7 @@ New features:: * api: add functions string_base_encode and string_base_decode, remove functions string_encode_base64 and string_decode_base64 * api: add support of Time-based One-Time Password (TOTP), add infos "totp_generate" and "totp_validate" + * relay: add support of Time-based One-Time Password (TOTP) as second authentication factor in weechat protocol Bug fixes:: diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index 109780656..b5636e093 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -3233,6 +3233,35 @@ Es wird nachdrücklich Empfohlen ein Passwort für die Relay-Verbindung zu nutze Dieses Passwort wird sowohl für das _irc_ als auch für das _weechat_ Protokoll verwendet. +// TRANSLATION MISSING +[[relay_totp]] +==== TOTP + +TOTP (Time-based One-Time Password) can be used as secondary authentication +factor for _weechat_ protocol, in addition to the password. + +This is optional and increases the security level. + +One-time passwords can be generated with applications, for example: + +* FreeOTP: + https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp[Android], + https://itunes.apple.com/fr/app/freeotp-authenticator/id872559395[iOS] + (https://freeotp.github.io/[web site]) +* Google Authenticator: + https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2[Android], + https://itunes.apple.com/fr/app/google-authenticator/id388497605[iOS] + +The TOTP secret must be set in WeeChat and the application used to generate +one-time passwords. + +It must be a string encoded in base32, with only letters and digits from 2 to 7, +for example: + +---- +/set relay.network.totp_secret "secretpasswordbase32" +---- + [[relay_ssl]] ==== SSL diff --git a/doc/en/weechat_relay_protocol.en.adoc b/doc/en/weechat_relay_protocol.en.adoc index afe0a0c1a..ac6999471 100644 --- a/doc/en/weechat_relay_protocol.en.adoc +++ b/doc/en/weechat_relay_protocol.en.adoc @@ -114,8 +114,12 @@ init [