256 |
static int |
static int |
257 |
sigsum_to_index (gpgme_sigsum_t sum) |
sigsum_to_index (gpgme_sigsum_t sum) |
258 |
{ |
{ |
259 |
|
/* xxx: gpgme should set _valid if the sig is good but the |
260 |
|
key has been expired; check the code */ |
261 |
|
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_SIG_EXPIRED)) |
262 |
|
return 8; |
263 |
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_REVOKED)) |
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_REVOKED)) |
264 |
return 7; |
return 7; |
265 |
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_SIG_EXPIRED)) |
if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_EXPIRED)) |
266 |
return 6; |
return 6; |
267 |
if (sum & GPGME_SIGSUM_GREEN) |
if (sum & GPGME_SIGSUM_GREEN) |
268 |
return 1; |
return 1; |
285 |
_("The signature could not be checked due to a missing key"), |
_("The signature could not be checked due to a missing key"), |
286 |
_("No valid OpenPGP signature"), |
_("No valid OpenPGP signature"), |
287 |
_("Signature Error"), |
_("Signature Error"), |
288 |
_("Good Signature (Expired Key)"), |
_("Good signature (Expired Key)"), |
289 |
_("Good Signature (Revoked Key)"), |
_("Good signature (Revoked Key)"), |
290 |
|
_("Good signature (Expired)"), |
291 |
NULL |
NULL |
292 |
}; |
}; |
293 |
const unsigned int mask = 8; |
const unsigned int mask = 9; |
294 |
|
|
295 |
return gpg_sigstat[sigsum_to_index (sum) % mask]; |
return gpg_sigstat[sigsum_to_index (sum) % mask]; |
296 |
} |
} |
297 |
|
|
298 |
|
|
299 |
|
/* Return true if at least one secret key is available. */ |
300 |
bool |
bool |
301 |
secret_key_available (void) |
secret_key_available (void) |
302 |
{ |
{ |