ALT Linux Bugzilla
– Attachment 7712 Details for
Bug 35271
Поддержка GnuPG TOFU в sylpheed-3.7.0
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
sylpheed-3.7.0-tofu.diff
sylpheed-3.7.0-tofu.diff (text/plain), 7.82 KB, created by
Andrew Savchenko
on 2018-08-20 15:58:58 MSK
(
hide
)
Description:
sylpheed-3.7.0-tofu.diff
Filename:
MIME Type:
Creator:
Andrew Savchenko
Created:
2018-08-20 15:58:58 MSK
Size:
7.82 KB
patch
obsolete
>commit 7cf51cb2244619556788211b68d3daa277d380b5 >Author: Andrew Savchenko <bircoph@gmail.com> >Date: Mon Aug 20 15:22:58 2018 +0300 > > 3.7.0-alt1 > > Add GPG TOFU support. > >diff --git a/sylpheed-3.7.0-tofu.patch b/sylpheed-3.7.0-tofu.patch >new file mode 100644 >index 0000000..b9d758f >--- /dev/null >+++ b/sylpheed-3.7.0-tofu.patch >@@ -0,0 +1,184 @@ >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/INSTALL sylpheed-3.7.0/INSTALL >+--- sylpheed-3.7.0.orig/INSTALL 2017-06-28 11:38:36.000000000 +0300 >++++ sylpheed-3.7.0/INSTALL 2018-08-11 21:26:14.701733236 +0300 >+@@ -137,7 +137,7 @@ >+ >+ http://freshmeat.net/projects/compface/ >+ >+-GnuPG (>= 1.2.0) and GPGME (>= 1.0.0) are required for GnuPG (PGP) support. >++GnuPG (>= 1.2.0) and GPGME (>= 1.7.0) are required for GnuPG (PGP) support. >+ You can get GnuPG and GPGME from the following location: >+ >+ ftp://ftp.gnupg.org/gcrypt/gpgme/ >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/INSTALL.ja sylpheed-3.7.0/INSTALL.ja >+--- sylpheed-3.7.0.orig/INSTALL.ja 2017-06-28 11:38:43.000000000 +0300 >++++ sylpheed-3.7.0/INSTALL.ja 2018-08-11 21:26:25.734570136 +0300 >+@@ -137,7 +137,7 @@ >+ >+ http://freshmeat.net/projects/compface/ >+ >+-GnuPG (PGP)Âбþ¤ò͸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ GPGME 1.0.0 °Ê¹ß¤È GnuPG 1.2.0 °Ê¹ß¤¬ >++GnuPG (PGP)Âбþ¤ò͸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ GPGME 1.7.0 °Ê¹ß¤È GnuPG 1.2.0 °Ê¹ß¤¬ >+ ɬÍפǤ¹¡£ GnuPG ¤È GPGME ¤Ï°Ê²¼¤Î¾ì½ê¤«¤é¼èÆÀ¤Ç¤¤Þ¤¹: >+ >+ ftp://ftp.gnupg.org/gcrypt/gpgme/ >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/configure.ac sylpheed-3.7.0/configure.ac >+--- sylpheed-3.7.0.orig/configure.ac 2018-01-30 11:49:52.000000000 +0300 >++++ sylpheed-3.7.0/configure.ac 2018-08-11 20:36:02.043543279 +0300 >+@@ -179,7 +179,7 @@ >+ AC_MSG_CHECKING([whether to use GPGME]) >+ if test $ac_cv_enable_gpgme = yes; then >+ AC_MSG_RESULT(yes) >+- AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), >++ AM_PATH_GPGME(1.7.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), >+ [use_gpgme=no >+ ac_cv_enable_gpgme=no]) >+ if test $ac_cv_enable_gpgme = yes; then >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/rfc2015.c sylpheed-3.7.0/src/rfc2015.c >+--- sylpheed-3.7.0.orig/src/rfc2015.c 2014-03-26 09:55:35.000000000 +0400 >++++ sylpheed-3.7.0/src/rfc2015.c 2018-08-19 08:59:42.143390253 +0300 >+@@ -157,6 +157,12 @@ >+ (str, _(" aka \"%s\"\n"), user->uid); >+ user = user->next; >+ } >++ >++ /* gpgme_get_key doesn't set tofu description field even with >++ * GPGME_KEYLIST_MODE_WITH_TOFU flag set, so it should be >++ * extracted from sig->key directly */ >++ if (sig->key && sig->key->uids && sig->key->uids->tofu) >++ gpgmegtk_tofu_status_to_string (str, sig->key->uids); >+ } >+ >+ static gchar *sig_status_full(gpgme_ctx_t ctx, gpgme_verify_result_t result) >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/sigstatus.c sylpheed-3.7.0/src/sigstatus.c >+--- sylpheed-3.7.0.orig/src/sigstatus.c 2010-12-21 11:53:18.000000000 +0300 >++++ sylpheed-3.7.0/src/sigstatus.c 2018-08-19 10:58:18.915063156 +0300 >+@@ -238,9 +238,15 @@ >+ case GPG_ERR_NO_ERROR: >+ switch (signature->validity) { >+ case GPGME_VALIDITY_ULTIMATE: >++ result = use_name ? _("Good signature (ultimate trust) from \"%s\"") : >++ _("Good signature"); >++ break; >+ case GPGME_VALIDITY_FULL: >++ result = use_name ? _("Good signature (full trust) from \"%s\"") : >++ _("Good signature"); >++ break; >+ case GPGME_VALIDITY_MARGINAL: >+- result = use_name ? _("Good signature from \"%s\"") : >++ result = use_name ? _("Good signature (marginal trust) from \"%s\"") : >+ _("Good signature"); >+ break; >+ default: >+@@ -270,11 +276,100 @@ >+ result = _("No public key to verify the signature"); >+ break; >+ default: >+- result = _("Error verifying the signature"); >++ switch (signature->summary) { >++ case GPGME_SIGSUM_KEY_REVOKED: >++ result = _("The key or at least one certificate has been revoked"); >++ break; >++ case GPGME_SIGSUM_KEY_MISSING: >++ result = _("Can't verify due to a missing key or certificate"); >++ break; >++ case GPGME_SIGSUM_CRL_MISSING: >++ result = _("The CRL (or an equivalent mechanism) is not available"); >++ break; >++ case GPGME_SIGSUM_CRL_TOO_OLD: >++ result = _("Available CRL is too old"); >++ break; >++ case GPGME_SIGSUM_BAD_POLICY: >++ result = _("A policy requirement was not met"); >++ break; >++ case GPGME_SIGSUM_SYS_ERROR: >++ result = _("A system error occured"); >++ break; >++ case GPGME_SIGSUM_TOFU_CONFLICT: >++ result = _("A TOFU conflict was detected"); >++ break; >++ default: >++ result = _("Error verifying the signature"); >++ } >+ break; >+ } >+ >+ return result; >+ } >+ >++void tofu_to_string(GString *str, gpgme_tofu_info_t tofu, char *uid) >++{ >++ if (tofu->description) >++ g_string_sprintfa(str, _("%s\n"), tofu->description); >++ else >++ g_string_sprintfa(str, _("%s:\n"), uid); >++ >++ switch (tofu->validity) { >++ case 0: >++ g_string_append(str, _(" Validity [0]: CONFLICT. ")); >++ break; >++ case 1: >++ g_string_append(str, _(" Validity [1]: no prior history. ")); >++ break; >++ case 2: >++ g_string_append(str, _(" Validity [2]: too little history. ")); >++ break; >++ case 3: >++ g_string_append(str, _(" Validity [3]: enough history for basic trust. ")); >++ break; >++ case 4: >++ g_string_append(str, _(" Validity [4]: long established history. ")); >++ break; >++ default: >++ g_string_append(str, _(" Validity: unknown. ")); >++ break; >++ } >++ >++ switch (tofu->policy) { >++ case GPGME_TOFU_POLICY_AUTO: >++ g_string_append(str, _("Policy: auto.\n")); >++ break; >++ case GPGME_TOFU_POLICY_GOOD: >++ g_string_append(str, _("Policy: good.\n")); >++ break; >++ case GPGME_TOFU_POLICY_BAD: >++ g_string_append(str, _("Policy: bad.\n")); >++ break; >++ case GPGME_TOFU_POLICY_ASK: >++ g_string_append(str, _("Policy: ask.\n")); >++ break; >++ default: >++ g_string_append(str, _("Policy: unknown.\n")); >++ break; >++ } >++} >++ >++void gpgmegtk_tofu_status_to_string(GString *str, gpgme_user_id_t user) >++{ >++ gpgme_tofu_info_t tofu; >++ g_string_append(str, _("TOFU status:\n")); >++ >++ do { >++ if (!(tofu = user->tofu)) >++ continue; >++ tofu_to_string (str, tofu, user->uid); >++ >++ while ((tofu = tofu->next)) { >++ g_string_append(str, _("and:\n")); >++ tofu_to_string (str, tofu, user->uid); >++ } >++ } >++ while ((user = user->next)); >++} >++ >+ #endif /* USE_GPGME */ >+diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/sigstatus.h sylpheed-3.7.0/src/sigstatus.h >+--- sylpheed-3.7.0.orig/src/sigstatus.h 2006-08-31 12:21:21.000000000 +0400 >++++ sylpheed-3.7.0/src/sigstatus.h 2018-08-19 07:45:17.422291629 +0300 >+@@ -30,5 +30,6 @@ >+ >+ const gchar *gpgmegtk_sig_status_to_string(gpgme_signature_t signature, >+ gboolean use_name); >++void gpgmegtk_tofu_status_to_string(GString *str, gpgme_user_id_t user); >+ >+ #endif /* GPGMEGTK_SIGSTATUS_H */ >diff --git a/sylpheed.spec b/sylpheed.spec >index 5a7434c..bb31ee3 100644 >--- a/sylpheed.spec >+++ b/sylpheed.spec >@@ -1,6 +1,6 @@ > Name: sylpheed > Version: 3.7.0 >-Release: alt0.1 >+Release: alt1 > > Summary: a GTK+ based, lightweight, and fast e-mail client > License: GPLv2+ >@@ -34,13 +34,14 @@ Patch21: %name-3.1.0-alt-desktop.patch > Patch22: %name-3.1.0-alt-icons.patch > Patch23: %name-3.1.2-alt-glib2-2.32.0.patch > Patch24: %name-3.6.0-alt-certdir.patch >+Patch25: %name-3.7.0-tofu.patch > > > # old patches - not applied, should be obsolete now > Patch1000: %name-0.9.3cvs9-alt-wm_race.patch > > Requires: mailcap >-Requires: libgpgme >= 1.0.0 >+Requires: libgpgme >= 1.7.0 > > %{?_enable_ldap:BuildPreReq: libldap-devel} > %{?_enable_jpilot:BuildPreReq: libpilot-link-devel} >@@ -108,6 +109,7 @@ This package contains development files. > %patch22 -p2 > #patch23 -p2 > %patch24 -p2 >+%patch25 -p1 > > > cp -a %SOURCE5 README.actions >@@ -158,6 +160,9 @@ autoconf > %_includedir/sylpheed/ > > %changelog >+* Mon Aug 20 2018 Andrew Savchenko <bircoph@altlinux.org> 3.7.0-alt1 >+- add GPG TOFU support >+ > * Fri Mar 23 2018 Ilya Mashkin <oddity@altlinux.ru> 3.7.0-alt0.1 > - 3.7.0 (Closes: #34601) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35271
: 7712