/[winpt]/trunk/Src/wptGPGME.cpp
ViewVC logotype

Diff of /trunk/Src/wptGPGME.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by werner, Mon Oct 31 14:04:59 2005 UTC revision 109 by twoaday, Fri Dec 2 07:32:13 2005 UTC
# Line 17  Line 17 
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19   */   */
   
20  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
23    
24  #include <sys/types.h>  #include <sys/types.h>
 #include <sys/types.h>  
25  #include <windows.h>  #include <windows.h>
26    
27  #include "resource.h"  #include "resource.h"
# Line 304  count_insecure_elgkeys (void) Line 302  count_insecure_elgkeys (void)
302      gpg_keycache_rewind (pc);      gpg_keycache_rewind (pc);
303      return n;      return n;
304  }  }
305    
306    
307    
308    /* Map the signature summary in @sum to signature status table index.
309       Return value: index to table. */
310    static int
311    sigsum_to_index (gpgme_sigsum_t sum)
312    {
313        if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_REVOKED))
314            return 7;
315        if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_SIG_EXPIRED))
316            return 6;
317        if (sum & GPGME_SIGSUM_GREEN)
318            return 1;
319        else if (sum & GPGME_SIGSUM_RED)
320            return 2;
321        else if (sum & GPGME_SIGSUM_KEY_MISSING)
322            return 3;
323        return 0;
324    }
325    
326    
327    /* Return a humand readable description for the signature status @sum. */
328    const char*
329    get_gpg_sigstat (gpgme_sigsum_t sum)
330    {
331        const char *gpg_sigstat[] = {
332            _("Error during verification process."),
333            _("The signature is good."),
334            _("The signature is BAD!"),
335            _("The signature could not be checked due to a missing key."),
336            _("No valid OpenPGP signature."),
337            _("Signature Error"),
338            _("Good Signature (Expired Key)"),
339            _("Good Signature (Revoked Key)"),
340            NULL
341        };
342        const unsigned int mask = 8;
343    
344        return gpg_sigstat[sigsum_to_index (sum) % mask];
345    }

Legend:
Removed from v.47  
changed lines
  Added in v.109

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26