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

Diff of /trunk/Src/wptClipDecryptDlg.cpp

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

revision 248 by twoaday, Fri Jul 28 11:11:09 2006 UTC revision 256 by twoaday, Sat Aug 5 10:31:06 2006 UTC
# Line 51  char* Line 51  char*
51  get_key_userid (const char *keyid)  get_key_userid (const char *keyid)
52  {  {
53      winpt_key_s key;      winpt_key_s key;
54      const char *fmt;      const char *fmt, *userid;
55      char *uid;      char *uid;
56    
57        fmt = "\n    \"%s\"";
58      memset (&key, 0, sizeof (key));      memset (&key, 0, sizeof (key));
59      if (winpt_get_pubkey (keyid, &key))      if (winpt_get_pubkey (keyid, &key))
60          return m_strdup (_("user ID not found"));          userid = (_("user ID not found"));
61      fmt = "\n    \"%s\"";      else
62      uid = new char[strlen (key.ext->uids->uid) + strlen (fmt)+ 2];          userid = key.ext->uids->uid;
63        uid = new char[strlen (userid) + strlen (fmt)+ 2];
64      if (!uid)      if (!uid)
65          BUG (NULL);          BUG (NULL);
66      sprintf (uid, fmt, key.ext->uids->uid);      sprintf (uid, fmt, userid);
67      winpt_release_pubkey (&key);      winpt_release_pubkey (&key);
68      return uid;      return uid;
69  }  }
# Line 129  verify_get_clip_info (gpgme_signature_t Line 131  verify_get_clip_info (gpgme_signature_t
131                           "*** Signer: %s (0x%s)\r\n"                           "*** Signer: %s (0x%s)\r\n"
132                           "*** BEGIN PGP DECRYPTED TEXT ***\r\n");                           "*** BEGIN PGP DECRYPTED TEXT ***\r\n");
133      const char *foot = _("\r\n*** END PGP DECRYPTED TEXT ***");      const char *foot = _("\r\n*** END PGP DECRYPTED TEXT ***");
134      const char *s, *made, *ver, *ot;      const char *s, *ver, *ot;
135      char *p;      char *p, *made;
136    
137      if (winpt_get_pubkey (sig->fpr, &pk))      if (winpt_get_pubkey (sig->fpr, &pk))
138          BUG (0);          BUG (0);
139    
140      ot = verify_get_key_ownertrust (pk.ctx->owner_trust, NULL);      ot = verify_get_key_ownertrust (pk.ctx->owner_trust, NULL);
141      made = strtimestamp (sig->timestamp);      made = m_strdup (strtimestamp (sig->timestamp));
142      ver = strtimestamp (time (NULL));      ver = strtimestamp (time (NULL));
143      s = get_gpg_sigstat (sig->summary);      s = get_gpg_sigstat (sig->summary);
144      p = new char[strlen (head) + strlen (s) + strlen (made) +      p = new char[strlen (head) + strlen (s) + strlen (made) +
# Line 148  verify_get_clip_info (gpgme_signature_t Line 150  verify_get_clip_info (gpgme_signature_t
150                  pk.ext->uids->uid, get_keyid_from_fpr (sig->fpr));                  pk.ext->uids->uid, get_keyid_from_fpr (sig->fpr));
151      *r_header = p;      *r_header = p;
152      *r_footer = m_strdup (foot);      *r_footer = m_strdup (foot);
153        free_if_alloc (made);
154  }  }
155    
156    
# Line 231  clip_decrypt_dlg (HWND hwnd, int use_vie Line 234  clip_decrypt_dlg (HWND hwnd, int use_vie
234          gpgme_recipient_t r = res->recipients;          gpgme_recipient_t r = res->recipients;
235          char *u = get_key_userid (r->keyid+8);          char *u = get_key_userid (r->keyid+8);
236          log_box (_("Decryption"), MB_ERR,          log_box (_("Decryption"), MB_ERR,
237                   _("Encrypted with %s key, ID %s.%s\n"                   _("Encrypted with %s key, ID 0x%s.%s\n"
238                     "Decryption failed: secret key not available."),                     "Decryption failed: secret key not available."),
239                     get_key_pubalgo (r->pubkey_algo), r->keyid+8, u);                     get_key_pubalgo (r->pubkey_algo), r->keyid+8, u);
240          free_if_alloc (u);          free_if_alloc (u);

Legend:
Removed from v.248  
changed lines
  Added in v.256

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26