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

Annotation of /trunk/Src/wptSymEnc.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22 - (hide annotations)
Wed Aug 10 11:33:35 2005 UTC (19 years, 6 months ago) by twoaday
File size: 1731 byte(s)
2005-08-06  Timo Schulz  <twoaday@freakmail.de>
 
        * wptGPGME.cpp (keycache_update): Reload OpenPGP parts
        of the secret key.
        (keycache_init): cache name of secret keyring.
        * wptKeyList.cpp (keylist_upd_key): Do not add long keyid.
        (get_key_type): Do not assume 'ultimate' means key pair.
        * wptKeyEditDlgs.cpp (diff_time): New.
        (keyedit_addsubkey_dlg_proc): Changed design and use
        diff_time. Drop checks for invalid keylength (< 1024, > 4096)
        because the combo box automatically handles this.
        * wptKeyManager.cpp (km_set_implicit_trust): Return error code.
        * wptGPG.cpp (get_backup_name): New.
        (gnupg_backup_keyrings): Rotate backup names, from 0..3.
        * wptClipImportDialog.cpp (clip_import_dlg_proc): Free memory.
        * wptKeyManagerDlg.cpp (keymanager_dlg_proc): Use 0x short keyid and
        not the long keyid.


1 twoaday 2 /* wptSymEnc.cpp - Symmetric encryption support
2     * Copyright (C) 2002, 2003, 2004 Timo Schulz
3     *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU General Public License
8     * as published by the Free Software Foundation; either version 2
9     * of the License, or (at your option) any later version.
10     *
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14     * General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with WinPT; if not, write to the Free Software Foundation,
18     * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #include <windows.h>
22    
23     #include "wptGPG.h"
24     #include "wptCommonCtl.h"
25     #include "wptContext.h"
26     #include "wptDlgs.h"
27     #include "wptNLS.h"
28     #include "wptUTF8.h"
29     #include "wptTypes.h"
30     #include "wptErrors.h"
31    
32     int
33     gpgme_encrypt_symmetric (void)
34     {
35     gpgme_ctx_t ctx;
36     gpgme_error_t rc;
37     char * pass = NULL;
38     int cancel = 0;
39    
40 twoaday 22 pass = request_passphrase2 (_("Symmetric Encryption"), 0, &cancel);
41 twoaday 2 if (cancel)
42     return WPTERR_GENERAL;
43     rc = gpgme_new (&ctx);
44     if (rc)
45     BUG (0);
46     gpgme_set_passphrase (ctx, pass);
47     rc = gpgme_op_clip_symenc (ctx);
48     sfree_if_alloc (pass);
49     if (rc)
50     msg_box (NULL, gpgme_strerror (rc), _("Symmetric Encryption"), MB_ERR);
51     else
52     show_msg (GetDesktopWindow (), 1500, _("GnuPG Status: Finished"));
53     gpgme_release (ctx);
54     return rc? WPTERR_GENERAL : 0;
55     } /* gpgme_encrypt_symmetric */

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26