diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index 20fcd66bd..8cbf9266b 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -108,7 +108,7 @@ zu kompilieren und welche Pakete optional genutzt werden können. | libncursesw5-dev ^(2)^ | | *ja* | Ncurses Oberfläche. | libcurl4-gnutls-dev | | *ja* | URL Transfer. | zlib1g-dev | | *ja* | Kompression für Pakete, die mittels Relay- (WeeChat Protokoll), Script-Erweiterung übertragen werden. -| libgcrypt20-dev | | *ja* | Geschützte Daten, IRC SASL Authentifikation (DH-BLOWFISH/DH-AES), Skript-Erweiterung. +| libgcrypt20-dev | | *ja* | Geschützte Daten, IRC SASL Authentifikation (DH-BLOWFISH/DH-AES). | libgnutls28-dev | ≥ 2.2.0 ^(3)^ | | SSL Verbindung zu einem IRC Server, Unterstützung von SSL in der Relay-Erweiterung, IRC SASL Authentifikation (ECDSA-NIST256P-CHALLENGE). | gettext | | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch). | ca-certificates | | | Zertifikate für SSL Verbindungen. diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index d6de9c32d..8d902e69a 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -102,7 +102,7 @@ compile WeeChat. | libncursesw5-dev ^(2)^ | | *yes* | Ncurses interface. | libcurl4-gnutls-dev | | *yes* | URL transfer. | zlib1g-dev | | *yes* | Compression of packets in relay plugin (weechat protocol), script plugin. -| libgcrypt20-dev | | *yes* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin. +| libgcrypt20-dev | | *yes* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES). | libgnutls28-dev | ≥ 2.2.0 ^(3)^ | | SSL connection to IRC server, support of SSL in relay plugin, IRC SASL authentication (ECDSA-NIST256P-CHALLENGE). | gettext | | | Internationalization (translation of messages; base language is English). | ca-certificates | | | Certificates for SSL connections. diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc index 6d03360f0..3c3880297 100644 --- a/doc/fr/weechat_user.fr.adoc +++ b/doc/fr/weechat_user.fr.adoc @@ -105,7 +105,7 @@ compiler WeeChat. | libncursesw5-dev ^(2)^ | | *oui* | Interface ncurses. | libcurl4-gnutls-dev | | *oui* | Transfert d'URL. | zlib1g-dev | | *oui* | Compression des paquets dans l'extension relay (protocole weechat), extension script. -| libgcrypt20-dev | | *oui* | Données sécurisées, authentification IRC SASL (DH-BLOWFISH/DH-AES), extension script. +| libgcrypt20-dev | | *oui* | Données sécurisées, authentification IRC SASL (DH-BLOWFISH/DH-AES). | libgnutls28-dev | ≥ 2.2.0 ^(3)^ | | Connexion SSL au serveur IRC, support SSL dans l'extension relay, authentification IRC SASL (ECDSA-NIST256P-CHALLENGE). | gettext | | | Internationalisation (traduction des messages; la langue de base est l'anglais). | ca-certificates | | | Certificats pour les connexions SSL. diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc index 4e8f0d91a..7637aa7e7 100644 --- a/doc/it/weechat_user.it.adoc +++ b/doc/it/weechat_user.it.adoc @@ -123,7 +123,7 @@ compilare WeeChat. // TRANSLATION MISSING | zlib1g-dev | | *sì* | Compression of packets in relay plugin (weechat protocol), script plugin. // TRANSLATION MISSING -| libgcrypt20-dev | | *sì* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin. +| libgcrypt20-dev | | *sì* | Secured data, IRC SASL authentication (DH-BLOWFISH/DH-AES). // TRANSLATION MISSING | libgnutls28-dev | ≥ 2.2.0 ^(3)^ | | Connessione SSL al server IRC, support of SSL in relay plugin, IRC SASL authentication (ECDSA-NIST256P-CHALLENGE). | gettext | | | Internazionalizzazione (traduzione dei messaggi; la lingua base è l'inglese). diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index 1e38b7c7b..20541fef2 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -107,7 +107,7 @@ macOS では https://brew.sh/[Homebrew] を使ってください: | libncursesw5-dev ^(2)^ | | *必須* | ncurses インターフェース | libcurl4-gnutls-dev | | *必須* | URL 転送 | zlib1g-dev | | *必須* | relay プラグインでパケットを圧縮 (weechat プロトコル)、スクリプトプラグイン -| libgcrypt20-dev | | *必須* | 保護データ、IRC SASL 認証 (DH-BLOWFISH/DH-AES)、スクリプトプラグイン +| libgcrypt20-dev | | *必須* | 保護データ、IRC SASL 認証 (DH-BLOWFISH/DH-AES) | libgnutls28-dev | 2.2.0 以上 ^(3)^ | | IRC サーバへの SSL 接続、IRC SASL 認証 (ECDSA-NIST256P-CHALLENGE) | gettext | | | 国際化 (メッセージの翻訳; ベース言語は英語です) | ca-certificates | | | SSL 接続に必要な証明書、relay プラグインで SSL サポート diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc index 13012d345..204d8fe21 100644 --- a/doc/pl/weechat_user.pl.adoc +++ b/doc/pl/weechat_user.pl.adoc @@ -108,7 +108,7 @@ WeeChat. | libncursesw5-dev ^(2)^ | | *tak* | Interfejs ncurses. | libcurl4-gnutls-dev | | *tak* | Transfer URL. | zlib1g-dev | | *tak* | Kompresja pakietów we wtyczce relay (protokół weechat), wtyczka script. -| libgcrypt20-dev | | *tak* | Zabezpieczone dane, uwierzytelnianie IRC SASL (DH-BLOWFISH/DH-AES), wtyczka script. +| libgcrypt20-dev | | *tak* | Zabezpieczone dane, uwierzytelnianie IRC SASL (DH-BLOWFISH/DH-AES). | libgnutls28-dev | ≥ 2.2.0 ^(3)^ | | Połączenia SSL z serwerami IRC, wsparcie dla SSL we wtyczce relay, uwierzytelnianie IRC SASL (ECDSA-NIST256P-CHALLENGE). | gettext | | | Internacjonalizacja (tłumaczenie wiadomości; język bazowy to Angielski). | ca-certificates | | | Certyfikaty dla połączeń SSL. diff --git a/src/plugins/script/CMakeLists.txt b/src/plugins/script/CMakeLists.txt index 6346a4064..9ece566bb 100644 --- a/src/plugins/script/CMakeLists.txt +++ b/src/plugins/script/CMakeLists.txt @@ -33,7 +33,6 @@ set_target_properties(script PROPERTIES PREFIX "") set(LINK_LIBS) list(APPEND LINK_LIBS ${ZLIB_LIBRARY}) -list(APPEND LINK_LIBS ${GCRYPT_LDFLAGS}) target_link_libraries(script ${LINK_LIBS} coverage_config) diff --git a/src/plugins/script/Makefile.am b/src/plugins/script/Makefile.am index 2be84705a..5fccb6609 100644 --- a/src/plugins/script/Makefile.am +++ b/src/plugins/script/Makefile.am @@ -17,7 +17,7 @@ # along with WeeChat. If not, see . # -AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) $(GCRYPT_CFLAGS) +AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) libdir = ${weechat_libdir}/plugins @@ -43,6 +43,6 @@ script_la_SOURCES = script.c \ script-repo.h script_la_LDFLAGS = -module -no-undefined -script_la_LIBADD = $(SCRIPT_LFLAGS) $(ZLIB_LFLAGS) $(GCRYPT_LFLAGS) +script_la_LIBADD = $(SCRIPT_LFLAGS) $(ZLIB_LFLAGS) EXTRA_DIST = CMakeLists.txt diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index 2e42c2f49..26dd7db8b 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "../weechat-plugin.h" #include "script.h" @@ -756,13 +755,7 @@ script_repo_sha512sum_file (const char *filename) { struct stat st; FILE *file; - char sha512sum[512]; - const char *hexa = "0123456789abcdef"; - unsigned char *data, *result; - gcry_md_hd_t hd; - int mdlen, i; - - sha512sum[0] = '\0'; + char *data, *hash; if (stat (filename, &st) == -1) return NULL; @@ -780,21 +773,11 @@ script_repo_sha512sum_file (const char *filename) } fclose (file); - gcry_md_open (&hd, GCRY_MD_SHA512, 0); - mdlen = gcry_md_get_algo_dlen (GCRY_MD_SHA512); - gcry_md_write (hd, data, st.st_size); - result = gcry_md_read (hd, GCRY_MD_SHA512); - for (i = 0; i < mdlen; i++) - { - sha512sum[i * 2] = hexa[(result[i] & 0xFF) / 16]; - sha512sum[(i * 2) + 1] = hexa[(result[i] & 0xFF) % 16]; - } - sha512sum[((mdlen - 1) * 2) + 2] = '\0'; - gcry_md_close (hd); + hash = weechat_string_hash (data, st.st_size, "sha512"); free (data); - return strdup (sha512sum); + return hash; } /*