/[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 260 by twoaday, Wed Aug 16 10:01:30 2006 UTC revision 270 by twoaday, Sat Oct 21 18:08:57 2006 UTC
# Line 47  static gpg_keycache_t sec = NULL; Line 47  static gpg_keycache_t sec = NULL;
47  static char *gpg_secring = NULL;  static char *gpg_secring = NULL;
48    
49    
50    /* Return 1 if no cache is available.
51       This can be the case if WinPT were run in command line mode. */
52  int  int
53  keycache_not_available (void)  keycache_not_available (void)
54  {  {
# Line 62  keycache_release (int cleanup) Line 64  keycache_release (int cleanup)
64      int n = gpg_keycache_get_size (pub);      int n = gpg_keycache_get_size (pub);
65    
66      /* XXX: update the value when the cache has changed. */      /* XXX: update the value when the cache has changed. */
67      sprintf (tmpbuf, "%d", n);      _snprintf (tmpbuf, sizeof (tmpbuf)-1, "%d", n);
68      set_reg_key (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys", tmpbuf);      set_reg_key (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys", tmpbuf);
69    
70      if (pub) {      if (pub) {
# Line 108  keycache_init (const char *pubring, cons Line 110  keycache_init (const char *pubring, cons
110      if (secring != NULL) {      if (secring != NULL) {
111          free_if_alloc (gpg_secring);          free_if_alloc (gpg_secring);
112          gpg_secring = get_gnupg_keyring (0, NO_STRICT);          gpg_secring = get_gnupg_keyring (0, NO_STRICT);
113            log_debug ("keycache_init: secring path '%s'\r\n", gpg_secring);
114      }      }
115            
116      p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys");      p = get_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "nKeys");
# Line 256  get_seckey (const char *keyid, gpgme_key Line 259  get_seckey (const char *keyid, gpgme_key
259  static int  static int
260  sigsum_to_index (gpgme_sigsum_t sum)  sigsum_to_index (gpgme_sigsum_t sum)
261  {  {
262      /* xxx: gpgme should set _valid if the sig is good but the      if (sum & GPGME_SIGSUM_RED)
263              key has been expired; check the code */          return 2;
264      if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_SIG_EXPIRED))      else if (sum & GPGME_SIGSUM_SIG_EXPIRED)
265          return 8;          return 8;
266      if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_REVOKED))      else if (sum & GPGME_SIGSUM_KEY_REVOKED)
267          return 7;          return 7;
268      if ((sum & GPGME_SIGSUM_VALID) && (sum & GPGME_SIGSUM_KEY_EXPIRED))      else if (sum & GPGME_SIGSUM_KEY_EXPIRED)
269          return 6;          return 6;
270      if (sum & GPGME_SIGSUM_GREEN)      else if (sum & GPGME_SIGSUM_GREEN)
271          return 1;          return 1;
     else if (sum & GPGME_SIGSUM_RED)  
         return 2;  
272      else if (sum & GPGME_SIGSUM_KEY_MISSING)      else if (sum & GPGME_SIGSUM_KEY_MISSING)
273          return 3;          return 3;
274      return 0;      return 0;
275  }  }
276    
277    
278  /* Return a humand readable description for the signature status @sum. */  /* Return a humand readable description for the signature status @sum.
279       Warning: this function does not consider the validity of the key. */
280  const char*  const char*
281  get_gpg_sigstat (gpgme_sigsum_t sum)  get_gpg_sigstat (gpgme_sigsum_t sum)
282  {  {

Legend:
Removed from v.260  
changed lines
  Added in v.270

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26