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

Diff of /trunk/Src/wptSymEnc.cpp

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

revision 193 by twoaday, Sat Apr 1 12:36:35 2006 UTC revision 226 by twoaday, Mon Jun 12 13:40:21 2006 UTC
# Line 1  Line 1 
1  /* wptSymEnc.cpp - Symmetric encryption support  /* wptSymEnc.cpp - Symmetric encryption support
2   *      Copyright (C) 2002, 2003, 2004, 2005, 2006 Timo Schulz   *      Copyright (C) 2002-2006 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 59  sym_passphrase_cb (void *hook, const cha Line 59  sym_passphrase_cb (void *hook, const cha
59    
60  /* Perform symmetric encryption on the current clipboard data.  /* Perform symmetric encryption on the current clipboard data.
61     Return 0 for success. */     Return 0 for success. */
62  int  gpgme_error_t
63  gpg_encrypt_symmetric (void)  gpg_clip_sym_encrypt (void)
64  {  {
65      gpgme_ctx_t ctx;      gpgme_ctx_t ctx;
66      gpgme_data_t plain=NULL;      gpgme_data_t plain=NULL;
# Line 81  gpg_encrypt_symmetric (void) Line 81  gpg_encrypt_symmetric (void)
81          goto leave;          goto leave;
82      rc = gpgme_data_new (&ciph);      rc = gpgme_data_new (&ciph);
83      gpgme_set_armor (ctx, 1);      gpgme_set_armor (ctx, 1);
84        gpgme_set_textmode (ctx, 1);
85    
86      gpgme_set_passphrase_cb (ctx, sym_passphrase_cb, pass);      gpgme_set_passphrase_cb (ctx, sym_passphrase_cb, pass);
87    
88      rc = gpgme_op_encrypt (ctx, NULL, (gpgme_encrypt_flags_t)0, plain, ciph);          rc = gpgme_op_encrypt (ctx, NULL, (gpgme_encrypt_flags_t)0, plain, ciph);
89      if (rc)      if (rc)
90          msg_box (NULL, gpgme_strerror (rc), _("Symmetric Encryption"), MB_ERR);          msg_box (NULL, gpgme_strerror (rc), _("Symmetric Encryption"), MB_ERR);
91      else {      else {
# Line 100  leave: Line 101  leave:
101          gpgme_data_release (ciph);          gpgme_data_release (ciph);
102      gpgme_release (ctx);      gpgme_release (ctx);
103      sfree_if_alloc (pass);      sfree_if_alloc (pass);
104      return rc? WPTERR_GENERAL : 0;      return rc;
105  }  }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26