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

Diff of /trunk/Src/wptKeyEditDlgs.cpp

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

revision 179 by twoaday, Mon Feb 13 09:38:03 2006 UTC revision 180 by twoaday, Mon Mar 6 14:41:58 2006 UTC
# Line 352  keyedit_addphoto_dlg_proc (HWND dlg, UIN Line 352  keyedit_addphoto_dlg_proc (HWND dlg, UIN
352    
353          case IDC_ADDPHOTO_SELFILE:          case IDC_ADDPHOTO_SELFILE:
354              s = get_fileopen_dlg (dlg, _("Select Image File"),              s = get_fileopen_dlg (dlg, _("Select Image File"),
355                                    _("JPEG Files (*.jpg, *.jpeg)\0*.jpg;*.jpeg\0\0"),                                    "JPEG Files (*.jpg, *.jpeg)\0*.jpg;*.jpeg\0\0",
356                                    NULL);                                    NULL);
357              if (s && !is_jpg_file (s)) {              if (s && !is_jpg_file (s)) {
358                  log_box (_("Add Photo"), MB_ERR,                  log_box (_("Add Photo"), MB_ERR,
# Line 892  BOOL Line 892  BOOL
892  keyedit_add_photo (winpt_key_t k, HWND dlg)  keyedit_add_photo (winpt_key_t k, HWND dlg)
893  {  {
894      if (!k->key_pair) {      if (!k->key_pair) {
895          msg_box (dlg, _("There is no secret key available!"), _("Add Photo"), MB_ERR);          msg_box (dlg, _("There is no secret key available!"),
896                     _("Add Photo"), MB_ERR);
897          return FALSE;          return FALSE;
898      }      }
899      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_KEYEDIT_ADDPHOTO, dlg,      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_KEYEDIT_ADDPHOTO, dlg,
# Line 934  keyedit_change_ownertrust (winpt_key_t k Line 935  keyedit_change_ownertrust (winpt_key_t k
935  }  }
936    
937    
938    /* Check if the given key is supposed to have IDEA
939       for secret key protection. */
940  static int  static int
941  is_idea_protect_algo (const char * keyid)  is_idea_protect_algo (const char *keyid)
942  {  {
943      winpt_key_s k;      winpt_key_s k;
944      const unsigned char *sym_prefs;      const unsigned char *sym_prefs;
# Line 943  is_idea_protect_algo (const char * keyid Line 946  is_idea_protect_algo (const char * keyid
946    
947      memset (&k, 0, sizeof (k));      memset (&k, 0, sizeof (k));
948      if (winpt_get_pubkey (keyid, &k))      if (winpt_get_pubkey (keyid, &k))
949          BUG (NULL);          BUG (0);
950      sym_prefs = k.ext->sym_prefs;      sym_prefs = k.ext->sym_prefs;
951        if (!k.is_v3)
952            return 0;
953      if (!sym_prefs)      if (!sym_prefs)
954          return 1; /* assume that only v3 keys have no symmetric cipher preferences          return 1; /* assume that only v3 keys have no symmetric cipher preferences
955                       and thus IDEA is explicit. */                       and thus IDEA is explicit. */
# Line 953  is_idea_protect_algo (const char * keyid Line 958  is_idea_protect_algo (const char * keyid
958      if ((n == 0 || n == 1) && *sym_prefs == 0x01)      if ((n == 0 || n == 1) && *sym_prefs == 0x01)
959          return 1;          return 1;
960      return 0;      return 0;
961  } /* is_idea_protect_algo */  }
962    
963    
964  BOOL  BOOL
# Line 971  keyedit_change_passwd (winpt_key_t k, HW Line 976  keyedit_change_passwd (winpt_key_t k, HW
976          return FALSE;          return FALSE;
977      }      }
978    
979      if( !idea_available && is_idea_protect_algo( k->keyid ) ) {      if (!idea_available && is_idea_protect_algo (k->keyid)) {
980          msg_box( dlg, _("Cannot change passphrase because the key\n"          msg_box (dlg, _("Cannot change passphrase because the key\n"
981                          "is protected with the IDEA encryption algorithm."),                          "is protected with the IDEA encryption algorithm."),
982                          _("Key Edit"), MB_ERR );                          _("Key Edit"), MB_ERR);
983          return FALSE;          return FALSE;
984      }      }
985    

Legend:
Removed from v.179  
changed lines
  Added in v.180

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26