/[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 34 by twoaday, Wed Oct 26 11:20:09 2005 UTC revision 226 by twoaday, Mon Jun 12 13:40:21 2006 UTC
# Line 1  Line 1 
1  /* wptKeyPropsDlg.cpp - WinPT key properties dialog  /* wptKeyPropsDlg.cpp - WinPT key properties dialog
2   *      Copyright (C) 2000, 2001, 2002, 2003, 2005 Timo Schulz   *      Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
6   * WinPT is free software; you can redistribute it and/or modify   * WinPT is free software; you can redistribute it and/or modify
7   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
8   * the Free Software Foundation; either version 2 of the License, or   * the Free Software Foundation; either version 2 of the License, or
9   * (at your option) any later version.   * (at your option) any later version.
10   *   *
11   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.   * GNU General Public License for more details.
15   *   *
16   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
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
21  #include <windows.h>  #include <config.h>
22    #endif
23  #include "../resource.h"  
24  #include "wptErrors.h"  #include <windows.h>
25  #include "wptGPG.h"  #include <assert.h>
26  #include "wptCommonCtl.h"  
27  #include "wptContext.h" /* for passphrase_s */  #include "resource.h"
28  #include "wptNLS.h"  #include "wptErrors.h"
29  #include "wptDlgs.h"  #include "wptGPG.h"
30  #include "wptTypes.h"  #include "wptCommonCtl.h"
31  #include "wptKeylist.h"  #include "wptContext.h" /* for passphrase_s */
32  #include "wptW32API.h"  #include "wptNLS.h"
33  #include "wptVersion.h"  #include "wptDlgs.h"
34  #include "wptKeyEdit.h"  #include "wptTypes.h"
35    #include "wptKeylist.h"
36  static void  #include "wptW32API.h"
37  do_change_ownertrust (winpt_key_t k, const char *s)  #include "wptVersion.h"
38  {  #include "wptKeyEdit.h"
39      char ot[64];  
40        
41      if( strstr( s, "ultimate" ) ) {  /* Check that the key is not expired or revoked. */
42          listview_get_item_text (k->callback.ctl, k->callback.idx, 5, ot, DIM (ot)-1);  static int
43          strcpy (ot, "Ultimate");  do_check_key (gpgme_key_t key)
44          listview_add_sub_item (k->callback.ctl, k->callback.idx, 5, ot);  {
45          /* fixme: If we switch back from Ultimate to a lower level */      int invalid = 0;
46      }  
47  }      invalid = key->expired;
48        if (!invalid)
49            invalid = key->revoked;
50  /* Check that the key is not expired or revoked. */      return invalid;
51  static int  }
52  do_check_key (gpgme_key_t key)  
53  {  
54      int okay = 0;  /* Convert a trust integer into a string representation. */
55      okay = key->expired;  static const char*
56      if (!okay)  ownertrust_to_string (int val, bool is_keypair)
57          okay = key->revoked;  {
58      return okay;      const char *inf;
59  }      int id = val;
60    
61        switch (id) {
62  /* Convert a trust integer into a string representation. */      case 1: inf = _("Don't know");         break;
63  static const char*      case 2: inf = _("I do NOT trust");     break;
64  ownertrust_to_string (int val)      case 3: inf = _("I trust marginally"); break;
65  {      case 4: inf = _("I trust fully");      break;
66      const char * inf;      case 5:
67      int id = val;      case 6:
68      switch (id) {          if (is_keypair)
69      case 1: inf = _("Don't know");         break;              inf = _("I trust ultimately (implicit)");
70      case 2: inf = _("I do NOT trust");     break;          else
71      case 3: inf = _("I trust marginally"); break;              inf = _("I trust ultimately"); break;
72      case 4: inf = _("I trust fully");      break;      default:inf = _("Unknown");            break;
73      case 5:      }
74      case 6: inf = _("I trust ultimately"); break;      
75      default:inf = _("Unknown");            break;      return inf;
76      }  }
77        
78      return inf;  
79  }  /* Generate a unique temp name for the photo which
80       depends on the dialog handle and return it. */
81    const char*
82  /* Generate a unique temp name for the photo which  get_photo_tmpname (HWND dlg)
83     depends on the dialog handle and return it. */  {
84  static const char*      static char buf[MAX_PATH+128+1];
85  get_photo_tmpname (HWND dlg)      char name[64];
86  {  
87      static char buf[64];      _snprintf (name, DIM (name)-1, "winpt_photo_%08lX.tmp", (DWORD)dlg);
88        get_temp_name (buf, DIM (buf)-1, name);
89      _snprintf (buf, sizeof (buf)-1, "winpt_photo_%08lX.tmp", (DWORD)dlg);      return buf;
90      return buf;  }
91  }  
92    
93    static void
94  /* Load the photo from the key @key */  draw_nophoto_img (HWND dlg)
95  static int  {
96  keyprops_load_photo (HWND dlg, gpgme_key_t key, gpgme_validity_t *r_valid)      /*..
97  {      n = DrawText (hdc, "No Photo-ID", -1, &r, DT_LEFT);
98      winpt_key_s k;      ..*/
99      FILE *f;  }
100      const BYTE *img;  
101      DWORD imglen = 0;  
102      int pos=0;  
103    /* Delete temporary photo file. */
104      winpt_get_pubkey (key->subkeys->keyid, &k);  void
105      img = k.ext->attrib.d;  key_unload_photo (HWND dlg)
106      imglen = k.ext->attrib.len;  {
107      if (!k.ext->attrib.validity)      DeleteFile (get_photo_tmpname (dlg));
108          get_uat_validity (key->subkeys->keyid, &k.ext->attrib.validity);  }
109      *r_valid = k.ext->attrib.validity;  
110    
111      if (!img || !imglen)  /* Load the photo from the key @key */
112          return -1;  int
113      f = fopen (get_photo_tmpname (dlg), "wb");  key_load_photo (HWND dlg, gpgme_key_t key, gpgme_validity_t *r_valid)
114      if (f) {  {
115          for (pos = 0; img[pos] != 0x10; pos++)      winpt_key_s k;
116                  ;      FILE *f;
117          pos += 16;      const BYTE *img;
118          fwrite (img + pos, 1, imglen - pos, f);      DWORD imglen = 0;
119          fwrite (img, 1, imglen, f);      int pos=0;
120          fclose (f);  
121      }      if (winpt_get_pubkey (key->subkeys->keyid, &k))
122      return 0;          BUG (0);
123  }      img = k.ext->attrib.d;
124        imglen = k.ext->attrib.len;
125        if (img && !k.ext->attrib.validity)
126  /* Display the photo in the image control in the dialog @dlg. */          get_uat_validity (key->subkeys->keyid, &k.ext->attrib.validity);
127  static int      if (r_valid)
128  keyprops_show_photo (HWND dlg)          *r_valid = k.ext->attrib.validity;
129  {  
130      RECT r;          if (!img || !imglen) {
131      POINT p;          draw_nophoto_img (dlg);
132      HWND h;          return -1;
133        }
134      h = GetDlgItem (dlg, IDC_KEYPROPS_IMG);  
135      GetWindowRect (h, &r);      f = fopen (get_photo_tmpname (dlg), "wb");
136      p.x = r.left + 5;      if (f) {
137      p.y = r.top - 2;          pos += 16;
138      memset (&p, 0, sizeof (p));          fwrite (img + pos, 1, imglen - pos, f);
139      PTD_jpg_show (h, &p, get_photo_tmpname (dlg));          fclose (f);
140            }
141      return 0;      return 0;
142  }  }
143    
144    
145  /* Return string representation of the key validity. @key. */  /* Return string representation of the key validity. @key. */
146  static const char*  static const char*
147  get_validity (gpgme_key_t key)  get_validity (gpgme_key_t key)
148  {  {
149      int val;      if (key->expired)
150      val = key->expired;          return _("Expired");    
151      if (val)      if (key->revoked)
152          return _("Expired");              return _("Revoked");
153      val = key->revoked;      if (key->disabled)
154      if (val)          return _("Disabled");
155          return _("Revoked");      if (key->invalid)
156      return get_key_trust2 (NULL, key->uids->validity, 0, 0);          return _("Invalid");
157  }      return get_key_trust2 (NULL, key->uids->validity, 0, 0);
158    }
159    
160  /* Return the preferred sym. algorithm from @key as a string. */  
161  static const char*  /* Return the preferred sym. algorithm from @key as a string. */
162  get_pref_cipher (winpt_key_t k)  static const char*
163  {  get_pref_cipher (winpt_key_t k)
164      const char *sym_prefs=NULL;      {
165        if (k->is_v3)
166      if (k->is_v3)          return "IDEA";
167          return "IDEA";      if (!k->ext || !k->ext->sym_prefs)
168      if (!k->ext->sym_prefs)          return "3DES";
169          return "3DES";      switch (*k->ext->sym_prefs) {
170      switch (*k->ext->sym_prefs) {      case 1: return "IDEA";
171      case 1: return "IDEA";      case 2: return "3DES";
172      case 2: return "3DES";      case 3: return "CAST5";
173      case 3: return "CAST5";      case 4: return "Blowfish";
174      case 4: return "Blowfish";      case 7: return "AES128";
175      case 7:      case 8: return "AES192";
176      case 8:      case 9: return "AES256";
177      case 9: return "AES";      case 10:return "Twofish";
178      case 10:return "Twofish";      }
179      }      return "Unknown";
180      return "Unknown";  }
181  }  
182    
183    /* Return true if the key has designated revokers. */
184  /* Return true if the key has designated revokers. */  static bool
185  static bool  check_for_desig_rev (gpgme_key_t key)
186  check_for_desig_rev (gpgme_key_t key)  {
187  {      winpt_key_s k;
188      winpt_key_s k;  
189      memset (&k, 0, sizeof (k));      memset (&k, 0, sizeof (k));
190      if (!winpt_get_pubkey (key->subkeys->keyid, &k))      if (!winpt_get_pubkey (key->subkeys->keyid, &k))
191          return k.ext->gloflags.has_desig_rev? true : false;          return k.ext->gloflags.has_desig_rev? true : false;
192      return false;      return false;
193  }  }
194    
195    
196  /* Print information (name) of the smart card. */  /* Print information (name) of the smart card. */
197  static const char*  static const char*
198  get_card_type (winpt_key_t k)  get_card_type (winpt_key_t k)
199  {      {    
200      static char buf[64];      static char buf[64];
201    
202      if (!k->ext->card_type)      if (!k->ext || !k->ext->card_type)
203          return "";          return "";
204      _snprintf (buf, sizeof (buf)-1, _("Card-Type: %s\r\n"), k->ext->card_type);      _snprintf (buf, DIM (buf)-1, _("Card-Type: %s\r\n"), k->ext->card_type);
205      return buf;      return buf;
206  }  }
207    
208    
209  /* Display the key information for key @k.  /* Return 1 if at least one user-ID is valid. */
210     Return value: gpgme key on success. */  static int
211  static void  key_is_valid (gpgme_key_t key)
212  display_key_info (HWND dlg, winpt_key_t k, gpgme_key_t *r_key)  {
213  {      gpgme_user_id_t u;
214      struct winpt_key_s k2;  
215      gpgme_key_t sk, key;      for (u=key->uids; u; u=u->next) {
216      char info[512];          if (u->validity >= GPGME_VALIDITY_MARGINAL)
217      const char *inf;              return 1;
218      u32 created, expires;          }
219        return 0;
220      memset (&k2, 0, sizeof (k2));        }
221      if (k->key_pair)  
222          winpt_get_seckey (k->keyid, &k2);  
223      else      
224          winpt_get_pubkey (k->keyid, &k2);  /* Display the key information for key @k.
225      sk = k2.ctx;             Return value: gpgme key on success. */
226      if (sk)  static void
227          k->is_protected = k2.is_protected;  display_key_info (HWND dlg, winpt_key_t k)
228      if (get_pubkey (k->keyid, &key))  {
229          BUG (0);          gpgme_key_t key;
230      created = key->subkeys->timestamp;        struct winpt_key_s sk;
231      expires = key->subkeys->expires;          char info[512];
232      _snprintf (info, DIM (info)-1,      const char *inf;
233                 _("Type: %s\r\n"      DWORD created, expires;
234                 "Key ID: %s\r\n"  
235                 "Algorithm: %s\r\n"      gpg_keycache_update_attr (k->ext, KC_ATTR_PREFSYM, 0);
236                 "Size: %s\r\n"      memset (&sk, 0, sizeof (sk));
237                 "Created: %s\r\n"      if (k->key_pair && !winpt_get_seckey (k->keyid, &sk))
238                 "Expires: %s\r\n"          k->is_protected = sk.is_protected;
239                 "Validity: %s\r\n"      key = k->ext->key;
240                 "Cipher: %s\r\n"      created = key->subkeys->timestamp;
241                 "%s\r\n"),      expires = key->subkeys->expires;
242                 get_key_type (key),      _snprintf (info, DIM (info)-1,
243                 k->keyid,                 _("Type: %s\r\n"
244                 get_key_algo (key, 0),                 "Key ID: 0x%s\r\n"
245                 get_key_size (key, 0),                 "Algorithm: %s\r\n"
246                 get_key_created (created),                 "Size: %s bits\r\n"
247                 get_key_expire_date (expires),                 "Created: %s\r\n"
248                 get_validity (key),                 "Expires: %s\r\n"
249                 get_pref_cipher (&k2),                 "Validity: %s\r\n"
250                 get_card_type (&k2));                 "Cipher: %s\r\n"
251                   "%s\r\n"),
252      SetDlgItemText (dlg, IDC_KEYPROPS_INFO, info);                 get_key_type (key),
253      SetDlgItemText (dlg, IDC_KEYPROPS_FPR, get_key_fpr (key));                   k->keyid,
254      inf = ownertrust_to_string (key->owner_trust);                 get_key_algo (key, 0),
255      SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf);                 get_key_size (key, 0),
256                   get_key_created (created),
257      *r_key = key;                 get_key_expire_date (expires),
258  }                 get_validity (key),
259                   get_pref_cipher (k),
260                   get_card_type (&sk));
261  /* Dialog box procedure to show the key properties. */  
262  BOOL CALLBACK      SetDlgItemText (dlg, IDC_KEYPROPS_INFO, info);
263  keyprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)      SetDlgItemText (dlg, IDC_KEYPROPS_FPR, get_key_fpr (key));  
264  {      inf = ownertrust_to_string (key->owner_trust, k->key_pair);
265      static winpt_key_t k;      SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf);
266      static gpgme_key_t key;  }
267      gpgme_validity_t valid;  
268      refresh_cache_s rcs = {0};  
269      const char *inf;  /* Context to store associated data of the dialog. */
270      int cancel = 0;  struct prop_info_s {
271      int rc;      winpt_key_t key;
272        };
273      /* XXX: static variable (k) prevent that the dialog can  
274              be opened twice. */  
275      switch (msg) {  static void
276      case WM_INITDIALOG:  on_init_dialog (HWND dlg, WPARAM wparam, LPARAM lparam)
277          if (!lparam)  {
278              dlg_fatal_error (dlg, "Could not get dialog param!");      gpgme_validity_t valid;
279          k = (winpt_key_t)lparam;  
280          #ifndef LANG_DE      winpt_key_t k = (winpt_key_t)lparam;
281          SetWindowText (dlg, _("Key Properties"));      SetWindowText (dlg, _("Key Properties"));
282          SetDlgItemText (dlg, IDC_KEYPROPS_OT_CHANGE, _("&Change"));      SetDlgItemText (dlg, IDC_KEYPROPS_OT_CHANGE, _("&Change"));
283          SetDlgItemText (dlg, IDC_KEYPROPS_REVOKERS, _("&Revokers"));      SetDlgItemText (dlg, IDC_KEYPROPS_REVOKERS, _("&Revokers"));
284          SetDlgItemText (dlg, IDC_KEYPROPS_CHANGE_PWD, _("Change &Passwd"));      SetDlgItemText (dlg, IDC_KEYPROPS_CHANGE_PWD, _("Change &Password"));
285          SetDlgItemText (dlg, IDC_KEYPROPS_OTINF, _("Ownertrust"));      SetDlgItemText (dlg, IDC_KEYPROPS_OTINF, _("Ownertrust"));  
286          #endif        
287        display_key_info (dlg, k);
288          display_key_info (dlg, k, &key);      if (!key_load_photo (dlg, k->ctx, &valid)) {
289          if (!keyprops_load_photo (dlg, key, &valid)) {          k->has_photo = 1;
290              k->has_photo = 1;            if (valid < GPGME_VALIDITY_MARGINAL)
291              if (valid < GPGME_VALIDITY_MARGINAL)              SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated."));
292                  SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated."));      }    
293          }      if (k->key_pair)
294          if (k->key_pair)          EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE);
295              EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE);      if (check_for_desig_rev (k->ctx))
296          if (check_for_desig_rev (key))          EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_REVOKERS), TRUE);
297              EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_REVOKERS), TRUE);      if (do_check_key (k->ctx))
298          center_window (dlg, NULL);          EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_OT_CHANGE), FALSE);
299          SetForegroundWindow (dlg);            center_window (dlg, NULL);  
300          return TRUE;      SetForegroundWindow (dlg);
301    }
302      case WM_DESTROY:  
303          unlink (get_photo_tmpname (dlg));  
304          break;  /* Dialog box procedure to show the key properties. */
305          BOOL CALLBACK
306      case WM_PAINT:  keyprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
307          if (k->has_photo)  {
308              keyprops_show_photo (dlg);      struct prop_info_s *prop = NULL;
309          break;      const char *inf;
310        int rc;
311      case WM_SYSCOMMAND:      
312          if (LOWORD (wparam) == SC_CLOSE)      if (msg != WM_INITDIALOG &&
313              EndDialog (dlg, TRUE);          (prop = (prop_info_s*)GetWindowLong (dlg, GWL_USERDATA)) == NULL)
314          return FALSE;          return FALSE;
315            
316      case WM_COMMAND:      switch (msg) {
317          switch (LOWORD (wparam)) {      case WM_INITDIALOG:
318          case IDOK:          assert (lparam != NULL);
319              EndDialog (dlg, TRUE);          prop = new struct prop_info_s;
320              return TRUE;          prop->key = (winpt_key_t)lparam;
321                        SetWindowLong (dlg, GWL_USERDATA, (LONG)prop);
322          case IDC_KEYPROPS_OT_CHANGE:          on_init_dialog (dlg, wparam, lparam);
323              if (do_check_key (key)) {          return TRUE;
324                  msg_box (dlg, _("The status of this key is 'revoked' or 'expired'.\n"  
325                                  "You cannot change the ownertrust of such keys."),      case WM_DESTROY:
326                                  _("WinPT Warning"), MB_ERR);          key_unload_photo (dlg);
327                  return TRUE;          delete prop;prop = NULL;
328              }          SetWindowLong (dlg, GWL_USERDATA, 0);
329              if( !k->key_pair && key->uids->validity < 3 ) {          break;
330                  rc = msg_box( dlg, _("This is a non-valid key.\n"        
331                                       "Modifying the ownertrust has no effect on such keys.\n\n"      case WM_PAINT:
332                                       "Do you really want to continue?"),          /* Display the photo in the frame of the dialog @dlg.
333                                       _("WinPT Warning"), MB_ICONWARNING|MB_YESNO );             The coordinates are fixed to (0,0). */
334                  if (rc == IDNO)          if (prop->key->has_photo) {
335                      return TRUE;              POINT p;
336              }              p.x = p.y = 0;
337              //GetDlgItemText (dlg, IDC_KEYPROPS_OT, info, sizeof info -1);              PTD_jpg_show (GetDlgItem (dlg, IDC_KEYPROPS_IMG),
338              dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYEDIT_OWNERTRUST,                              &p, get_photo_tmpname (dlg));
339                                dlg, (DLGPROC)keyedit_ownertrust_dlg_proc,          }
340                                (LPARAM)k, _("Change Ownertrust"),          break;
341                                IDS_WINPT_KEYEDIT_OWNERTRUST);  
342              if (k->callback.new_val == -1) { /* Cancel */      case WM_COMMAND:
343                  EndDialog (dlg, FALSE);          switch (LOWORD (wparam)) {
344                  break;          case IDOK:
345              }              EndDialog (dlg, TRUE);
346                return TRUE;
347              inf = ownertrust_to_string (k->callback.new_val);  
348              do_change_ownertrust (k, inf);          case IDCANCEL:
349              SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf);              EndDialog (dlg, FALSE);
350              msg_box (dlg, _("Ownertrust successfully changed."),              return TRUE;
351                       _("GnuPG Status"), MB_OK);              
352                        case IDC_KEYPROPS_OT_CHANGE:
353              /* reload only the keylist */              if (do_check_key (prop->key->ctx)) {
354              rcs.kr_reload = 1; rcs.kr_update = 1;                  msg_box (dlg, _("The status of this key is 'revoked' or 'expired'.\n"
355              rcs.tr_update = 0;                                  "You cannot change the ownertrust of such keys."),
356              DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, dlg,                                  _("WinPT Warning"), MB_ERR);
357                              keycache_dlg_proc, (LPARAM)&rcs);                  return TRUE;
358              return TRUE;              }
359                            if (!prop->key->key_pair && !key_is_valid (prop->key->ctx)) {
360          case IDC_KEYPROPS_CHANGE_PWD:                  rc = msg_box (dlg, _("This is a non-valid key.\n"
361              keyedit_change_passwd (k, dlg);                                               "Modifying the ownertrust has no effect on such keys.\n\n"
362              return TRUE;                                       "Do you really want to continue?"),
363                                         _("WinPT Warning"), MB_ICONWARNING|MB_YESNO);
364          case IDC_KEYPROPS_REVOKERS:                  if (rc == IDNO)
365              dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg,                      return TRUE;
366                                key_revokers_dlg_proc, (LPARAM)key, _("Key Revokers"),              }
367                                IDS_WINPT_KEY_REVOKERS);              rc = dialog_box_param (glob_hinst,
368              break;                                     (LPCSTR)IDD_WINPT_KEYEDIT_OWNERTRUST,
369          }                                      dlg, keyedit_ownertrust_dlg_proc,
370      }                                     (LPARAM)prop->key, _("Change Ownertrust"),
371                                            IDS_WINPT_KEYEDIT_OWNERTRUST);
372      return FALSE;              if (rc == FALSE) /* Cancel */
373  }                  return TRUE;
374    
375                inf = ownertrust_to_string (prop->key->callback.new_val,
376                                            prop->key->key_pair);
377                SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf);
378                msg_box (dlg, _("Ownertrust successfully changed."),
379                         _("GnuPG Status"), MB_OK);
380                prop->key->update = 1;
381                return TRUE;
382                
383            case IDC_KEYPROPS_CHANGE_PWD:
384                keyedit_change_passwd (prop->key, dlg);        
385                return TRUE;
386    
387            case IDC_KEYPROPS_REVOKERS:
388                prop->key->update = dialog_box_param (glob_hinst,
389                                              (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg,
390                                              key_revokers_dlg_proc, (LPARAM)prop->key,
391                                              _("Key Revokers"),
392                                              IDS_WINPT_KEY_REVOKERS);
393                UpdateWindow (dlg);
394                break;
395            }
396        }
397        
398        return FALSE;
399    }

Legend:
Removed from v.34  
changed lines
  Added in v.226

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26