summaryrefslogtreecommitdiff
blob: b9d758f9935f46c875278c28e4e63f9cd3f89ec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
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 */