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

Diff of /trunk/Src/wptKeyPropsDlg.cpp

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

revision 77 by twoaday, Mon Nov 14 15:01:01 2005 UTC revision 133 by twoaday, Mon Jan 9 09:15:29 2006 UTC
# Line 17  Line 17 
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
   
20  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
# Line 83  get_photo_tmpname (HWND dlg) Line 82  get_photo_tmpname (HWND dlg)
82  }  }
83    
84    
85    static void
86    draw_nophoto_img (HWND dlg)
87    {
88        /*..
89        n = DrawText (hdc, "No Photo-ID", -1, &r, DT_LEFT);
90        ..*/
91    }
92    
93    
94  /* Load the photo from the key @key */  /* Load the photo from the key @key */
95  static int  static int
96  keyprops_load_photo (HWND dlg, gpgme_key_t key, gpgme_validity_t *r_valid)  keyprops_load_photo (HWND dlg, gpgme_key_t key, gpgme_validity_t *r_valid)
# Line 100  keyprops_load_photo (HWND dlg, gpgme_key Line 108  keyprops_load_photo (HWND dlg, gpgme_key
108          get_uat_validity (key->subkeys->keyid, &k.ext->attrib.validity);          get_uat_validity (key->subkeys->keyid, &k.ext->attrib.validity);
109      *r_valid = k.ext->attrib.validity;      *r_valid = k.ext->attrib.validity;
110    
111      if (!img || !imglen)      if (!img || !imglen) {
112            draw_nophoto_img (dlg);
113          return -1;          return -1;
114        }
115    
116      f = fopen (get_photo_tmpname (dlg), "wb");      f = fopen (get_photo_tmpname (dlg), "wb");
117      if (f) {      if (f) {
118          for (pos = 0; img[pos] != 0x10; pos++)          //for (pos = 0; img[pos] != 0x10; pos++)
119                  ;          //      ;
120          pos += 16;          pos += 16;
121          fwrite (img + pos, 1, imglen - pos, f);          fwrite (img + pos, 1, imglen - pos, f);
         fwrite (img, 1, imglen, f);  
122          fclose (f);          fclose (f);
123      }      }
124      return 0;      return 0;
# Line 208  display_key_info (HWND dlg, winpt_key_t Line 218  display_key_info (HWND dlg, winpt_key_t
218      gpgme_key_t sk, key;      gpgme_key_t sk, key;
219      char info[512];      char info[512];
220      const char *inf;      const char *inf;
221      u32 created, expires;          u32 created, expires;
222    
223      memset (&k2, 0, sizeof (k2));            memset (&k2, 0, sizeof (k2));      
224      if (k->key_pair)      if (k->key_pair)
225          winpt_get_seckey (k->keyid, &k2);          winpt_get_seckey (k->keyid, &k2);
226      else          else    
227          winpt_get_pubkey (k->keyid, &k2);          winpt_get_pubkey (k->keyid, &k2);
228      sk = k2.ctx;              sk = k2.ctx;
229      if (sk)      if (sk)
230          k->is_protected = k2.is_protected;          k->is_protected = k2.is_protected;
231      if (get_pubkey (k->keyid, &key))      if (get_pubkey (k->keyid, &key))
# Line 226  display_key_info (HWND dlg, winpt_key_t Line 236  display_key_info (HWND dlg, winpt_key_t
236                 _("Type: %s\r\n"                 _("Type: %s\r\n"
237                 "Key ID: %s\r\n"                 "Key ID: %s\r\n"
238                 "Algorithm: %s\r\n"                 "Algorithm: %s\r\n"
239                 "Size: %s\r\n"                 "Size: %s bits\r\n"
240                 "Created: %s\r\n"                 "Created: %s\r\n"
241                 "Expires: %s\r\n"                 "Expires: %s\r\n"
242                 "Validity: %s\r\n"                 "Validity: %s\r\n"
# Line 324  keyprops_dlg_proc (HWND dlg, UINT msg, W Line 334  keyprops_dlg_proc (HWND dlg, UINT msg, W
334                  if (rc == IDNO)                  if (rc == IDNO)
335                      return TRUE;                      return TRUE;
336              }              }
   
337              dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYEDIT_OWNERTRUST,              dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYEDIT_OWNERTRUST,
338                                dlg, (DLGPROC)keyedit_ownertrust_dlg_proc,                                dlg, (DLGPROC)keyedit_ownertrust_dlg_proc,
339                                (LPARAM)k, _("Change Ownertrust"),                                (LPARAM)k, _("Change Ownertrust"),

Legend:
Removed from v.77  
changed lines
  Added in v.133

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26