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

Diff of /trunk/Src/wptPassphraseCB.cpp

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

revision 68 by werner, Mon Oct 31 21:14:11 2005 UTC revision 69 by twoaday, Sat Nov 5 12:28:12 2005 UTC
# Line 68  static BOOL CALLBACK Line 68  static BOOL CALLBACK
68  passphrase_callback_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  passphrase_callback_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
69  {      {    
70      static passphrase_cb_s * c;      static passphrase_cb_s * c;
71      gpgme_decrypt_result_t res;      gpgme_decrypt_result_t res = NULL;
72      gpgme_sign_result_t res_sig;      gpgme_sign_result_t res_sig = NULL;
73      gpgme_key_t key;      gpgme_key_t key;
74      gpgme_recipient_t recip, r;      gpgme_recipient_t recip=NULL, r;
75      void *ctx = NULL, *item;      void *item;
76      const char *id;      const char *id;
77      char *info;      char *info;
78      int n;      int n;
# Line 257  parse_gpg_description (const char *uid_h Line 257  parse_gpg_description (const char *uid_h
257      char *uid, *p;      char *uid, *p;
258      int n=0;      int n=0;
259    
260        algo = (gpgme_pubkey_algo_t)0;
261      /* Each uid_hint contains a long key-ID so it is at least 16 bytes. */      /* Each uid_hint contains a long key-ID so it is at least 16 bytes. */
262      if (strlen (uid_hint) < 17) {      if (strlen (uid_hint) < 17) {
263          *desc = 0;          *desc = 0;
# Line 316  passphrase_cb (void *hook, const char *u Line 317  passphrase_cb (void *hook, const char *u
317      passphrase_cb_s *c = (passphrase_cb_s*)hook;      passphrase_cb_s *c = (passphrase_cb_s*)hook;
318      HANDLE hd = (HANDLE)fd;      HANDLE hd = (HANDLE)fd;
319      void *item;      void *item;
320      const char *keyid, *pass;      const char *keyid=NULL, *pass;
321      DWORD n;      DWORD n;
322      int rc;      int rc=0;
323    
324      if (!c)      if (!c)
325          return gpg_error (GPG_ERR_INV_ARG);          return gpg_error (GPG_ERR_INV_ARG);
# Line 334  passphrase_cb (void *hook, const char *u Line 335  passphrase_cb (void *hook, const char *u
335          if (strlen (passphrase_info) < 16 &&          if (strlen (passphrase_info) < 16 &&
336              !strstr (passphrase_info, "OPENPGP")) {              !strstr (passphrase_info, "OPENPGP")) {
337              /* assume symetric encryption. */              /* assume symetric encryption. */
338              int n=2;              int pos=2;
339              c->sym.sym_algo = atoi (passphrase_info);              c->sym.sym_algo = atoi (passphrase_info);
340              if (c->sym.sym_algo > 9)              if (c->sym.sym_algo > 9)
341                  n++;                  pos++;
342              /* XXX: be more strict. */              /* XXX: be more strict. */
343              c->sym.s2k_mode = atoi (passphrase_info+n);              c->sym.s2k_mode = atoi (passphrase_info+pos);
344              c->sym.s2k_hash = atoi (passphrase_info+n+2);              c->sym.s2k_hash = atoi (passphrase_info+pos+2);
345          }          }
346    
347          keyid = parse_gpg_keyid (passphrase_info);          keyid = parse_gpg_keyid (passphrase_info);

Legend:
Removed from v.68  
changed lines
  Added in v.69

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26