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

Diff of /trunk/Src/WinPT.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 66 by twoaday, Thu Nov 3 17:55:18 2005 UTC
# Line 22  Line 22 
22  #endif  #endif
23    
24  #include <windows.h>  #include <windows.h>
 #include <windows.h>  
25    
26  #include "resource.h"  #include "resource.h"
27  #include "wptTypes.h"  #include "wptTypes.h"
# Line 39  Line 38 
38  #include "wptFileManager.h"  #include "wptFileManager.h"
39  #include "wptContext.h"  #include "wptContext.h"
40  #include "wptCardEdit.h"  #include "wptCardEdit.h"
41    #include "wptCrypto.h"
42    
43  #define MIN_GPG_VER   "1.4.3"   /* Minimal GPG version. */  #define MIN_GPG_VER   "1.4.3"   /* Minimal GPG version. */
44  #define MIN_GPGME_VER "1.2.0"   /* Minimal GPGME version. */  #define MIN_GPGME_VER "1.2.0"   /* Minimal GPGME version. */
# Line 128  check_default_key (gpg_keycache_t kc) Line 127  check_default_key (gpg_keycache_t kc)
127      defkey = get_gnupg_default_key ();      defkey = get_gnupg_default_key ();
128      if (defkey)      if (defkey)
129          err = gpg_keycache_find_key (kc, defkey, 0, &key);          err = gpg_keycache_find_key (kc, defkey, 0, &key);
130        else
131            msg_box (NULL, _("No useable secret key found."), _("WinPT Error"), MB_ERR);
132      free_if_alloc (defkey);      free_if_alloc (defkey);
133      return err? -1 : 0;      return err? -1 : 0;
134  }  }
# Line 188  check_crypto_engine (void) Line 189  check_crypto_engine (void)
189          return rc;          return rc;
190      }      }
191      /* We enable smartcard support for GPG: 1.9 or >= 1.4 */      /* We enable smartcard support for GPG: 1.9 or >= 1.4 */
192      if (ma >= 1 && mi >= 4)      if ((ma == 1 && mi >= 4) || ma > 1)
193          scard_support = 1;          scard_support = 1;
194    
195      gpgver[0] = ma;      gpgver[0] = ma;
# Line 255  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 256  WinMain (HINSTANCE hinst, HINSTANCE hpre
256    
257      glob_hinst = hinst;      glob_hinst = hinst;
258    
259      #ifdef _DEBUG  #ifdef _DEBUG
260      gpg_set_debug_mode (1);      gpg_set_debug_mode (1);
261      debug = 1;      debug = 1;
262      #endif  #endif
   
     s = PTD_get_version ();  
     if (strcmp (s, MIN_PTD_VER)) {  
         log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR,  
                  _("Please update your PTD.dll to the newest version, "  
                    "the version (%s) you use is too old."), s);  
         return 0;  
     }  
263    
264      if (gpg_md_selftest ()) {      if (gpg_md_selftest ()) {
265          msg_box (NULL, _("Cryptographic selftest failed."),          msg_box (NULL, _("Cryptographic selftest failed."),
# Line 319  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 312  WinMain (HINSTANCE hinst, HINSTANCE hpre
312                   _("GPG home directory is not set correctly.\n"                   _("GPG home directory is not set correctly.\n"
313                     "Please check the GPG registry settings:\n%s."),                     "Please check the GPG registry settings:\n%s."),
314                   winpt_strerror (rc));                   winpt_strerror (rc));
315          const char * s = get_fileopen_dlg (GetActiveWindow (),          s = get_fileopen_dlg (GetActiveWindow (),
316                                             _("Select GPG Public Keyring"),                                _("Select GPG Public Keyring"),
317                                             _("GPG Keyrings (*.gpg)\0*.gpg\0\0"),                                _("GPG Keyrings (*.gpg)\0*.gpg\0\0"),
318                                             NULL);                                NULL);
319          if (s != NULL) {          if (s != NULL) {
320              size_t n;              size_t n;
321              char * p = strrchr (s, '\\');              char * p = strrchr (s, '\\');
# Line 479  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 472  WinMain (HINSTANCE hinst, HINSTANCE hpre
472            
473      if (start_gpgprefs) {      if (start_gpgprefs) {
474          char *ring;          char *ring;
475          size_t size = 0;  
476          DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd,          DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd,
477                          gpgprefs_dlg_proc, 0);                          gpgprefs_dlg_proc, 0);
478          ring = get_gnupg_keyring (0, !NO_STRICT);          ring = get_gnupg_keyring (0, !NO_STRICT);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26