/[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 230 by twoaday, Mon Jun 19 14:04:31 2006 UTC revision 231 by twoaday, Tue Jun 20 09:18:44 2006 UTC
# Line 24  Line 24 
24  #endif  #endif
25    
26  #include <windows.h>  #include <windows.h>
27    #include <assert.h>
28    #include <time.h>
29    
30  #include "wptTypes.h"  #include "wptTypes.h"
31  #include "wptW32API.h"  #include "wptW32API.h"
# Line 119  void Line 121  void
121  verify_get_clip_info (gpgme_signature_t sig, char **r_header, char **r_footer)  verify_get_clip_info (gpgme_signature_t sig, char **r_header, char **r_footer)
122  {  {
123      struct winpt_key_s pk;      struct winpt_key_s pk;
124      const char *head = "***** BEGIN PGP SIGNED TEXT *****\r\n"      const char *head = _("*** PGP SIGNATURE VERIFICATION ***\r\n"
125                         "***** Signature made %s using key ID 0x%s\r\n"                           "*** Signature made:    %s\r\n"
126                         "***** %s\r\n"                           "*** Signature verfied: %s\r\n"
127                         "***** \"%s\" from %s\r\n";                           "*** %s\r\n"
128      const char *foot = "***** END PGP SIGNED TEXT *****";                               "*** Signature result:  %s\r\n"
129      const char *s, *made, *ot;                           "*** Signer: %s (0x%s)\r\n"
130                             "*** BEGIN PGP DECRYPTED TEXT ***\r\n");
131        const char *foot = _("\r\n*** END PGP DECRYPTED TEXT ***");
132        const char *s, *made, *ver, *ot;
133      char *p;      char *p;
134    
135      if (winpt_get_pubkey (sig->fpr, &pk))      if (winpt_get_pubkey (sig->fpr, &pk))
136          BUG (0);          BUG (0);
137    
138      ot = verify_get_key_ownertrust (pk.ctx->owner_trust, NULL);      ot = verify_get_key_ownertrust (pk.ctx->owner_trust, NULL);
139      made = strtimestamp (sig->timestamp);      made = strtimestamp (sig->timestamp);
140        ver = strtimestamp (time (NULL));
141      s = get_gpg_sigstat (sig->summary);      s = get_gpg_sigstat (sig->summary);
142      p = new char[strlen (head) + strlen (s) + strlen (made) +      p = new char[strlen (head) + strlen (s) + strlen (made) +
143                   strlen (sig->fpr) + strlen (ot) +                   strlen (sig->fpr) + strlen (ot) + strlen (ver) +
144                   strlen (pk.ext->uids->uid) + 1];                   strlen (pk.ext->uids->uid) + 1];
145      if (!p)      if (!p)
146          BUG (0);          BUG (0);
147      sprintf (p, head, made, get_keyid_from_fpr (sig->fpr), ot, s, pk.ext->uids->uid);      sprintf (p, head, made, ver, ot, s,
148                    pk.ext->uids->uid, get_keyid_from_fpr (sig->fpr));
149      *r_header = p;      *r_header = p;
150      *r_footer = m_strdup (foot);      *r_footer = m_strdup (foot);
151  }  }
# Line 153  verify_show_signature_state (gpgme_signa Line 161  verify_show_signature_state (gpgme_signa
161      char *pka_info = NULL;      char *pka_info = NULL;
162      int novalid = 0;      int novalid = 0;
163    
164      if (!sig->fpr)      assert (sig->fpr != NULL);
         BUG (NULL);  
165                    
166      keyid = get_keyid_from_fpr (sig->fpr);      keyid = get_keyid_from_fpr (sig->fpr);
167      memset (&key, 0, sizeof (key));      memset (&key, 0, sizeof (key));
   
168      if (!winpt_get_pubkey (keyid, &key)) {      if (!winpt_get_pubkey (keyid, &key)) {
169          s = verify_get_key_ownertrust (key.ctx->owner_trust, &novalid);          s = verify_get_key_ownertrust (key.ctx->owner_trust, &novalid);
170          uid = key.ext->uids->uid;                uid = key.ext->uids->uid;      
171      }        }
172      else {      else {
173          s = "";          s = "";
174          uid = _("user ID not found");          uid = _("user ID not found");

Legend:
Removed from v.230  
changed lines
  Added in v.231

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26