/[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 328 by twoaday, Fri Sep 25 16:07:38 2009 UTC revision 340 by twoaday, Sun Nov 27 13:15:07 2011 UTC
# Line 194  passphrase_callback_proc (HWND dlg, UINT Line 194  passphrase_callback_proc (HWND dlg, UINT
194                  else {                  else {
195                      char *p = new char[n+2];                      char *p = new char[n+2];
196                      SafeGetDlgItemText (dlg, item_ctrl_id (c->gpg_cmd), p, n+1);                      SafeGetDlgItemText (dlg, item_ctrl_id (c->gpg_cmd), p, n+1);
197                      if (emulate_utf8_bug)                      c->pwd = m_strdup (p);
                         c->pwd = native_to_utf8 (p);  
                     else  
                         c->pwd = m_strdup (p);  
198                      sfree_if_alloc (p);                      sfree_if_alloc (p);
199                  }                  }
200                  if (c->gpg != NULL) {                  if (c->gpg != NULL) {
# Line 291  parse_gpg_description (const char *uid_h Line 288  parse_gpg_description (const char *uid_h
288      uid_hint += 16; /* skip keyid */      uid_hint += 16; /* skip keyid */
289      uid_hint += 1;  /* space */      uid_hint += 1;  /* space */
290    
291        struct winpt_key_s skey;
292        gpgme_subkey_t sk;
293        if (winpt_get_seckey (mainkey, &skey))
294            BUG (0);
295        for (sk = skey.ctx->subkeys; sk; sk = sk->next) {
296            if (memcmp (sk->keyid, usedkey, 8) == 0)
297                break;
298        }
299      uid = utf8_to_native (uid_hint);      uid = utf8_to_native (uid_hint);
300      if (strcmp (usedkey, mainkey))      if (strcmp (usedkey, mainkey))
301          _snprintf (desc, desc_size-1,          _snprintf (desc, desc_size-1,
302                     _("You need a passphrase to unlock the secret key for user:\n"                     _("You need a passphrase to unlock the secret key for user:\n"
303                       "\"%s\"\n"                       "\"%s\"\n"
304                       "%s key, ID 0x%s (main key ID 0x%s)\n"),                       "%d-bit %s key, ID 0x%s, created %s (main key ID 0x%s)\n"),
305                     uid, get_key_pubalgo (algo), usedkey+8, mainkey+8);                     uid, sk->length, get_key_pubalgo (algo),
306                       usedkey+8, get_key_created (sk->timestamp), mainkey+8);
307      else if (!strcmp (usedkey, mainkey))      else if (!strcmp (usedkey, mainkey))
308          _snprintf (desc, desc_size-1,          _snprintf (desc, desc_size-1,
309                     _("You need a passphrase to unlock the secret key for user:\n"                     _("You need a passphrase to unlock the secret key for user:\n"
310                       "\"%s\"\n"                       "\"%s\"\n"
311                       "%s key, ID 0x%s\n"),                       "%d-bit %s key, created %s, ID 0x%s\n"),
312                       uid, get_key_pubalgo (algo), usedkey+8);                       uid, sk->length, get_key_pubalgo (algo),
313                         get_key_created (sk->timestamp), usedkey+8);
314      safe_free (uid);      safe_free (uid);
315      return 0;      return 0;
316  }  }

Legend:
Removed from v.328  
changed lines
  Added in v.340

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26