# HG changeset patch # User Holger Weiß # Date 1448124295 -3600 # Node ID 90c25a29fb35de74d53b91a7c3de1f2d245547f1 # Parent c06488852cdcf091d7484a53d5d1bdcdb26a115f New option: 'gpg_path' The path to the gpg binary can now be specified in order to force the use of GnuPG version 1 on systems which have both versions installed. diff -r c06488852cdc -r 90c25a29fb35 mcabber/mcabber/pgp.c --- a/mcabber/mcabber/pgp.c Sun Nov 15 17:05:07 2015 +0100 +++ b/mcabber/mcabber/pgp.c Sat Nov 21 17:44:55 2015 +0100 @@ -32,9 +32,10 @@ #include #include "pgp.h" +#include "settings.h" #include "logprint.h" -#define MIN_GPGME_VERSION "1.0.0" +#define MIN_GPGME_VERSION "1.1.0" static struct gpg_struct { @@ -56,6 +57,7 @@ gpgme_ctx_t ctx; gpgme_engine_info_t info; + const char *gpg_path; // Check for version and OpenPGP protocol support. if (!gpgme_check_version(MIN_GPGME_VERSION)) { @@ -75,6 +77,14 @@ gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); + // The path to the gpg binary can be specified in order to force + // version 1, for example. + gpg_path = settings_opt_get("gpg_path"); + if (gpg_path) { + err = gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP, gpg_path, NULL); + if (err) return -1; + } + // Store private data. gpg_set_private_key(priv_key); gpg_set_passphrase(passphrase); diff -r c06488852cdc -r 90c25a29fb35 mcabber/mcabberrc.example --- a/mcabber/mcabberrc.example Sun Nov 15 17:05:07 2015 +0100 +++ b/mcabber/mcabberrc.example Sat Nov 21 17:44:55 2015 +0100 @@ -75,6 +75,10 @@ # can change it here. If this number is < 0, mcabber will keep asking # until the passphrase is good. #set pgp_passphrase_retries = 2 +# +# You can specify the path to the gpg binary, e.g. to force the use of +# GnuPG version 1 on systems which have both versions installed. +#set gpg_path = /usr/bin/gpg # Conference nickname # This nickname is used when joining a room, when no nick is explicitly