/[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 256 by twoaday, Sat Aug 5 10:31:06 2006 UTC revision 273 by twoaday, Fri Dec 8 10:22:17 2006 UTC
# Line 42  Line 42 
42  static int  static int
43  do_check_key (gpgme_key_t key)  do_check_key (gpgme_key_t key)
44  {  {
45      int invalid = 0;      int invalid;
46    
47      invalid = key->expired;      invalid = key->expired;
48      if (!invalid)      if (!invalid)
# Line 221  key_is_valid (gpgme_key_t key) Line 221  key_is_valid (gpgme_key_t key)
221  }  }
222    
223    
224    /* Return extended algorithm information. */
225    const char*
226    props_get_key_algo (gpgme_key_t key, int idx)
227    {
228        /* PGP calls the old RSAv3 keys 'RSA Legacy' and because this
229           is a good method to differ between OpenPGP v4 cert-only keys
230           and v3 RSA keys, we use the same notation. */
231        if (key->subkeys != NULL && strlen (key->subkeys->fpr) == 32)
232            return "RSA Legacy";
233        return get_key_algo (key, idx);
234    }
235    
236    
237  /* Display the key information for key @k.  /* Display the key information for key @k.
238     Return value: gpgme key on success. */     Return value: gpgme key on success. */
# Line 252  display_key_info (HWND dlg, winpt_key_t Line 264  display_key_info (HWND dlg, winpt_key_t
264                 "%s\r\n"),                 "%s\r\n"),
265                 get_key_type (key),                 get_key_type (key),
266                 k->keyid,                 k->keyid,
267                 get_key_algo (key, 0),                 props_get_key_algo (key, 0),
268                 get_key_size (key, 0),                 get_key_size (key, 0),
269                 get_key_created (created),                 get_key_created (created),
270                 get_key_expire_date (expires),                 get_key_expire_date (expires),
# Line 290  on_init_dialog (HWND dlg, WPARAM wparam, Line 302  on_init_dialog (HWND dlg, WPARAM wparam,
302          k->has_photo = 1;          k->has_photo = 1;
303          if (valid < GPGME_VALIDITY_MARGINAL)          if (valid < GPGME_VALIDITY_MARGINAL)
304              SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated."));              SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated."));
305      }          }
306      if (k->key_pair)      if (k->key_pair)
307          EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE);          EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE);
308      if (check_for_desig_rev (k->ctx))      if (check_for_desig_rev (k->ctx))
# Line 351  keyprops_dlg_proc (HWND dlg, UINT msg, W Line 363  keyprops_dlg_proc (HWND dlg, UINT msg, W
363              return TRUE;              return TRUE;
364                            
365          case IDC_KEYPROPS_OT_CHANGE:          case IDC_KEYPROPS_OT_CHANGE:
             if (do_check_key (prop->key->ctx)) {  
                 msg_box (dlg, _("The status of this key is 'revoked' or 'expired'.\n"  
                                 "You cannot change the ownertrust of such keys."),  
                                 _("WinPT Warning"), MB_ERR);  
                 return TRUE;  
             }  
366              if (!prop->key->key_pair && !key_is_valid (prop->key->ctx)) {              if (!prop->key->key_pair && !key_is_valid (prop->key->ctx)) {
367                  rc = msg_box (dlg, _("This is a non-valid key.\n"                  rc = msg_box (dlg, _("This is a non-valid key.\n"
368                                       "Modifying the ownertrust has no effect on such keys.\n\n"                                       "Modifying the ownertrust has no effect on such keys.\n\n"

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26