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

Diff of /trunk/Src/wptClipSignDlg.cpp

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

revision 24 by twoaday, Sat Oct 8 10:43:08 2005 UTC revision 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC
# Line 55  gpg_clip_sign (gpgme_ctx_t ctx, const ch Line 55  gpg_clip_sign (gpgme_ctx_t ctx, const ch
55      err = gpg_data_new_from_clipboard (&plain, wraplen);      err = gpg_data_new_from_clipboard (&plain, wraplen);
56      if (err)      if (err)
57          return err;          return err;
     gpgme_data_write (plain, "\r\n", 2);  
58    
59      get_pubkey (keyid, &key);      get_pubkey (keyid, &key);
60      if (key)      if (key)
# Line 109  one_key_proc (HWND dlg) Line 108  one_key_proc (HWND dlg)
108      set_gpg_passphrase_cb (&pwd, ctx, GPG_CMD_SIGN, dlg, _("Signing"));      set_gpg_passphrase_cb (&pwd, ctx, GPG_CMD_SIGN, dlg, _("Signing"));
109      err = gpg_clip_sign (ctx, signer, n );      err = gpg_clip_sign (ctx, signer, n );
110      memset (pwd.pwd, 0, sizeof pwd.pwd);      memset (pwd.pwd, 0, sizeof pwd.pwd);
111      if (err == gpg_error (GPG_ERR_BAD_PASSPHRASE))      if (gpgme_err_code (err) == GPG_ERR_BAD_PASSPHRASE)
112          agent_del_cache (pwd.keyid);          agent_del_cache (pwd.keyid);
113      if (err)      if (err)
114          msg_box (dlg, gpgme_strerror (err), _("Signing"), MB_ERR);          msg_box (dlg, gpgme_strerror (err), _("Signing"), MB_ERR);
# Line 125  BOOL CALLBACK Line 124  BOOL CALLBACK
124  clip_sign_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  clip_sign_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
125  {        {      
126      static listview_ctrl_t lv = NULL;      static listview_ctrl_t lv = NULL;
127      gpgme_keycache_t kc, sec_kc;      gpg_keycache_t kc, sec_kc;
128      gpgme_ctx_t ctx;      gpgme_ctx_t ctx;
129      gpgme_error_t err;      gpgme_error_t err;
130      passphrase_cb_s pwd;      passphrase_cb_s pwd;
# Line 144  clip_sign_dlg_proc (HWND dlg, UINT msg, Line 143  clip_sign_dlg_proc (HWND dlg, UINT msg,
143          sec_kc = keycache_get_ctx (KEYCACHE_PRV);          sec_kc = keycache_get_ctx (KEYCACHE_PRV);
144          if (!sec_kc)          if (!sec_kc)
145              BUG (dlg);              BUG (dlg);
146          if (gpgme_keycache_count (sec_kc) == 1) {          if (gpg_keycache_get_size (sec_kc) == 1) {
147              one_key_proc (dlg);              one_key_proc (dlg);
148              EndDialog (dlg, TRUE);              EndDialog (dlg, TRUE);
149              return FALSE;              return FALSE;
# Line 212  clip_sign_dlg_proc (HWND dlg, UINT msg, Line 211  clip_sign_dlg_proc (HWND dlg, UINT msg,
211              set_gpg_passphrase_cb (&pwd, ctx, GPG_CMD_SIGN, dlg, _("Signing"));              set_gpg_passphrase_cb (&pwd, ctx, GPG_CMD_SIGN, dlg, _("Signing"));
212              err = gpg_clip_sign (ctx, signer, reg_prefs.word_wrap);              err = gpg_clip_sign (ctx, signer, reg_prefs.word_wrap);
213              free_if_alloc (signer);              free_if_alloc (signer);
214              memset (pwd.pwd, 0, sizeof pwd.pwd);              release_gpg_passphrase_cb (&pwd);
215    
216              if (pwd.cancel && gpgme_err_code(err) == GPG_ERR_BAD_PASSPHRASE) {              if (pwd.cancel && gpgme_err_code(err) == GPG_ERR_BAD_PASSPHRASE) {
217                  /* The user hit the cancel button or bad passphrase */                  /* The user hit the cancel button or bad passphrase */
# Line 222  clip_sign_dlg_proc (HWND dlg, UINT msg, Line 221  clip_sign_dlg_proc (HWND dlg, UINT msg,
221              }              }
222              if (err) {              if (err) {
223                  msg_box (dlg, gpgme_strerror (err), _("Signing"), MB_ERR);                  msg_box (dlg, gpgme_strerror (err), _("Signing"), MB_ERR);
224                  gpgme_release( ctx );                  gpgme_release (ctx);
225                  return FALSE;                  return FALSE;
226              }              }
227              else                                  else                    

Legend:
Removed from v.24  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26