74 |
} |
} |
75 |
|
|
76 |
|
|
|
/* Map the signature summary in @sum to signature status table index. |
|
|
Return value: index to table. */ |
|
|
int |
|
|
sigsum_to_index (gpgme_sigsum_t sum) |
|
|
{ |
|
|
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_REVOKED)) |
|
|
return 7; |
|
|
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_SIG_EXPIRED)) |
|
|
return 6; |
|
|
if (sum & GPGME_SIGSUM_GREEN) |
|
|
return 1; |
|
|
else if (sum & GPGME_SIGSUM_RED) |
|
|
return 2; |
|
|
else if (sum & GPGME_SIGSUM_KEY_MISSING) |
|
|
return 3; |
|
|
return 0; |
|
|
} |
|
|
|
|
|
|
|
77 |
/* Build a verify signature list control. With the parent window |
/* Build a verify signature list control. With the parent window |
78 |
from @ctrl and the mod given in @fm_mode. @lv contains the |
from @ctrl and the mod given in @fm_mode. @lv contains the |
79 |
new control on success. |
new control on success. |
145 |
return WPTERR_GENERAL; |
return WPTERR_GENERAL; |
146 |
|
|
147 |
get_pubkey (sig->fpr, &key); |
get_pubkey (sig->fpr, &key); |
148 |
|
|
149 |
if (sig->summary == 0 && gpg_err_code (sig->status) == GPG_ERR_NO_ERROR) |
if (sig->summary == 0 && gpg_err_code (sig->status) == GPG_ERR_NO_ERROR) |
150 |
attr = get_gpg_sigstat (GPGME_SIGSUM_GREEN); |
attr = get_gpg_sigstat (GPGME_SIGSUM_GREEN); |
151 |
else |
else |
204 |
const char *attr; |
const char *attr; |
205 |
char t[64], *name; |
char t[64], *name; |
206 |
|
|
207 |
if (listview_add_item (lv, "")) |
if (listview_add_item (lv, "")) { |
208 |
|
log_debug ("verlist_add_sig_log: listview_add_item() failed.\n"); |
209 |
return WPTERR_GENERAL; |
return WPTERR_GENERAL; |
210 |
|
} |
211 |
|
|
212 |
get_pubkey (sig->fpr, &key); |
get_pubkey (sig->fpr, &key); |
213 |
|
|
217 |
else |
else |
218 |
listview_add_sub_item (lv, 0, 0, log->file); |
listview_add_sub_item (lv, 0, 0, log->file); |
219 |
free_if_alloc (name); |
free_if_alloc (name); |
220 |
|
|
221 |
if (sig->summary == 0 && gpg_err_code (sig->status) == GPG_ERR_NO_ERROR) |
if (sig->summary == 0 && gpg_err_code (sig->status) == GPG_ERR_NO_ERROR) |
222 |
attr = get_gpg_sigstat (GPGME_SIGSUM_GREEN); |
attr = get_gpg_sigstat (GPGME_SIGSUM_GREEN); |
223 |
else |
else |
242 |
_snprintf (t, sizeof (t)-1, "0x%s", attr + 32); |
_snprintf (t, sizeof (t)-1, "0x%s", attr + 32); |
243 |
listview_add_sub_item (lv, 0, 4, t); |
listview_add_sub_item (lv, 0, 4, t); |
244 |
} |
} |
245 |
else if( !log->use_uid && strlen( attr ) == 32 ) { |
else if (!log->use_uid && strlen( attr ) == 32) { |
246 |
_snprintf (t, sizeof (t)-1, "0x%s", attr + 24); |
_snprintf (t, sizeof (t)-1, "0x%s", attr + 24); |
247 |
listview_add_sub_item (lv, 0, 4, t); |
listview_add_sub_item (lv, 0, 4, t); |
248 |
} |
} |