[Winpt-commits] r234 - in trunk: . Include PTD Src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jun 27 12:16:45 CEST 2006
Author: twoaday
Date: 2006-06-27 12:16:41 +0200 (Tue, 27 Jun 2006)
New Revision: 234
Modified:
trunk/Include/wptGpgCmds.h
trunk/Include/wptKeyEdit.h
trunk/Include/wptTypes.h
trunk/PTD/ChangeLog
trunk/PTD/Makefile.am
trunk/PTD/resource.rc
trunk/Src/ChangeLog
trunk/Src/Makefile.am
trunk/Src/WinPT-en.rc
trunk/Src/wptFileManager.cpp
trunk/Src/wptKeyCache.cpp
trunk/Src/wptKeyEdit.cpp
trunk/Src/wptKeyEditDlgs.cpp
trunk/Src/wptKeyPropsDlg.cpp
trunk/Src/wptKeygenDlg.cpp
trunk/Src/wptMainProc.cpp
trunk/Src/wptNLS.c
trunk/Src/wptRegistry.cpp
trunk/configure.ac
Log:
Modified: trunk/Include/wptGpgCmds.h
===================================================================
--- trunk/Include/wptGpgCmds.h 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Include/wptGpgCmds.h 2006-06-27 10:16:41 UTC (rev 234)
@@ -1,5 +1,5 @@
/* wptGpgCmds.h - All valid gpg arguments
- * Copyright (C) 2000-2005 Timo Schulz
+ * Copyright (C) 2000-2006 Timo Schulz
*
* This file is part of WinPT.
*
@@ -23,10 +23,9 @@
/***************
* This is the array with all valid gnupg arguments. It it only used
- * by the config parser. It was generated with gpg --dump-options and
- * formatted with a little perl script include in 'Utils'.
+ * by the config parser.
*/
-/* gpg 1.4.1 */
+/* gpg 1.4.3 */
static const char *valid_gpg_args[] = {
"sign",
"clearsign",
@@ -101,10 +100,14 @@
"no-textmode",
"expert",
"no-expert",
+ "default-sig-expire",
"ask-sig-expire",
"no-ask-sig-expire",
+ "default-cert-expire",
"ask-cert-expire",
"no-ask-cert-expire",
+ "default-cert-level",
+ "min-cert-level",
"ask-cert-level",
"no-ask-cert-level",
"output",
@@ -148,8 +151,8 @@
"status-file",
"attribute-fd",
"attribute-file",
+ "sk-comments",
"no-sk-comments",
- "sk-comments",
"completes-needed",
"marginals-needed",
"max-cert-depth",
@@ -193,6 +196,7 @@
"print-mds",
"list-trustdb",
"pipemode",
+ "passphrase",
"passphrase-fd",
"passphrase-file",
"command-fd",
@@ -221,8 +225,6 @@
"compress-keys",
"compress-sigs",
"default-cert-check-level",
- "default-cert-level",
- "min-cert-level",
"always-trust",
"trust-model",
"force-ownertrust",
@@ -312,10 +314,16 @@
"enable-progress-filter",
"multifile",
"keyid-format",
+ "exit-on-status-write-error",
+ "limit-card-insert-tries",
"reader-port",
"ctapi-driver",
"pcsc-driver",
"disable-ccid",
+ "sign-with",
+ "user",
+ "require-backsigs",
+ "no-require-backsigs",
"dump-options",
"help",
"version",
@@ -323,5 +331,4 @@
NULL
};
-
#endif /* WPT_GPG_COMMANDS_H_ */
Modified: trunk/Include/wptKeyEdit.h
===================================================================
--- trunk/Include/wptKeyEdit.h 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Include/wptKeyEdit.h 2006-06-27 10:16:41 UTC (rev 234)
@@ -106,6 +106,7 @@
int cmd_sent;
const char *pass;
const char *new_pass;
+ const char *new_prefs;
const char *url;
int trust_id;
char *notation;
Modified: trunk/Include/wptTypes.h
===================================================================
--- trunk/Include/wptTypes.h 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Include/wptTypes.h 2006-06-27 10:16:41 UTC (rev 234)
@@ -22,12 +22,10 @@
#define WPT_TYPES_H
/* Type shortcuts. */
-typedef unsigned char byte;
typedef unsigned long u32;
-typedef unsigned int ui32;
typedef unsigned __int64 ui64;
-/* Crypto constants */
+/* crypto: Default keysize in bits */
#define DFAULT_KEYSIZE 2048
/* Message output combinations */
Modified: trunk/PTD/ChangeLog
===================================================================
--- trunk/PTD/ChangeLog 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/PTD/ChangeLog 2006-06-27 10:16:41 UTC (rev 234)
@@ -1,3 +1,8 @@
+2006-06-22 Timo Schulz <ts at g10code.de>
+
+ * resource.rc: Includes versioninfo.rc to build the
+ version block automatically.
+
2006-01-24 Timo Schulz <ts at g10code.de>
* PTD.cpp (PTD_jpg_show): Scale photo so it fits into the
Modified: trunk/PTD/Makefile.am
===================================================================
--- trunk/PTD/Makefile.am 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/PTD/Makefile.am 2006-06-27 10:16:41 UTC (rev 234)
@@ -35,7 +35,7 @@
PTD_LDADD = $(srcdir)/PTD.def -L../Gnupg -lgnupg $(W32LIBS) \
-lole32 -loleaut32 -luuid -lgdi32
-resource.o: resource.rc resource.h
+resource.o: resource.rc resource.h versioninfo.rc
.rc.o:
$(WINDRES) -I $(srcdir) -I . `test -f '$<' || echo '$(srcdir)/'`$< $@
Modified: trunk/PTD/resource.rc
===================================================================
--- trunk/PTD/resource.rc 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/PTD/resource.rc 2006-06-27 10:16:41 UTC (rev 234)
@@ -26,44 +26,7 @@
//
// Version
//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,12,2,0
- PRODUCTVERSION 0,12,2,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040704b0"
- BEGIN
- VALUE "Comments", "This is free software under the tems of the GNU GPL V2\0"
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "PTD - Privacy Tray Dynamic\0"
- VALUE "FileVersion", "1.0.0-pre1\0"
- VALUE "InternalName", "PTD\0"
- VALUE "LegalCopyright", "Copyright © 2006 Timo Schulz\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "PTD.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "PTD\0"
- VALUE "ProductVersion", "1.0.0-pre1\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x407, 1200
- END
-END
-
+#include "versioninfo.rc"
#endif // !_MAC
Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/ChangeLog 2006-06-27 10:16:41 UTC (rev 234)
@@ -1,3 +1,15 @@
+2006-06-24 Timo Schulz <ts at g10code.de>
+
+ * wptMainProc.cpp (winpt_main_proc): Localize missing string.
+ * wptKeyEditDlgs.cpp (do_add_new_subkey): Better fpr to keyid
+ conversion.
+ (subkey_list_init): Simplified.
+
+2006-06-22 Timo Schulz <ts at g10code.de>
+
+ * WinPT-en.rc: Include versioninfo.rc to generate
+ the version info automatically.
+
2006-06-19 Timo Schulz <ts at g10code.de>
* wptClipDecryptDlg.cpp (verify_get_clip_info): Improved
Modified: trunk/Src/Makefile.am
===================================================================
--- trunk/Src/Makefile.am 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/Makefile.am 2006-06-27 10:16:41 UTC (rev 234)
@@ -26,6 +26,7 @@
Safe.ico \
Sign.ico \
WinPT-en.rc \
+ versioninfo.rc \
winpt2.ico \
pubkey.ico \
keypair.ico
Modified: trunk/Src/WinPT-en.rc
===================================================================
--- trunk/Src/WinPT-en.rc 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/WinPT-en.rc 2006-06-27 10:16:41 UTC (rev 234)
@@ -76,27 +76,26 @@
// Dialog
//
-IDD_WINPT_KEYWIZARD DIALOG DISCARDABLE 0, 0, 273, 178
+IDD_WINPT_KEYWIZARD DIALOG DISCARDABLE 0, 0, 273, 183
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Key Generation Wizard"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Name and E-Mail Assignment",IDC_KEYWIZARD_TITLEINF,12,
11,93,8
- LTEXT "Every key pair must have a name associated with it. The name and\nemail address let your correspondents that your public key they are\nusing belongs to us.",
- IDC_KEYWIZARD_TEXT1INF,31,26,223,24
+ LTEXT "Every key pair must have a name associated with it. The name and\nemail address let your correspondents know that your public key they\nare using belongs to us.",
+ IDC_KEYWIZARD_TEXT1INF,33,26,231,27
GROUPBOX "",IDC_STATIC,3,51,264,9
LTEXT "&Real name:",IDC_KEYWIZARD_NAMEINF,15,69,37,8
EDITTEXT IDC_KEYWIZARD_NAME,67,67,189,12,ES_AUTOHSCROLL
LTEXT "By associating an email address with your key pair, you will enable WinPT to assist your correspondents in selecting the correct public\nkey when communicating with you.",
- IDC_KEYWIZARD_TEXT2INF,15,91,217,24
+ IDC_KEYWIZARD_TEXT2INF,16,91,217,24
LTEXT "&Email address:",IDC_KEYWIZARD_EMAILINF,15,125,46,8
EDITTEXT IDC_KEYWIZARD_EMAIL,67,123,190,12,ES_AUTOHSCROLL
CONTROL "&Prefer RSA keys",IDC_KEYWIZARD_USERSA,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,15,146,100,10
- DEFPUSHBUTTON "&OK",IDOK,117,156,50,14
- PUSHBUTTON "&Cancel",IDCANCEL,169,156,50,14
- PUSHBUTTON "E&xpert",IDC_KEYWIZARD_EXPERT,221,156,46,14
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,143,100,10
+ DEFPUSHBUTTON "&OK",IDOK,157,163,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,210,163,50,14
END
IDD_WINPT_CDISK_NEW DIALOG DISCARDABLE 0, 0, 186, 150
@@ -202,7 +201,7 @@
LEFTMARGIN, 2
RIGHTMARGIN, 269
TOPMARGIN, 3
- BOTTOMMARGIN, 171
+ BOTTOMMARGIN, 176
END
IDD_WINPT_CDISK_NEW, DIALOG
@@ -1129,22 +1128,22 @@
BS_AUTOCHECKBOX | WS_TABSTOP,7,86,94,10
END
-IDD_WINPT_KEYEDIT DIALOG DISCARDABLE 0, 0, 298, 183
+IDD_WINPT_KEYEDIT DIALOG DISCARDABLE 0, 0, 293, 178
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Key Edit"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List2",IDC_KEYEDIT_KEYLIST,"SysListView32",LVS_REPORT |
- LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,8,7,281,59
+ LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,4,3,281,59
CONTROL "List1",IDC_KEYEDIT_UIDLIST,"SysListView32",LVS_REPORT |
- LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,8,70,281,58
- LTEXT "Command>",IDC_KEYEDIT_CMDINF,160,140,42,8
- COMBOBOX IDC_KEYEDIT_CMD,204,138,84,108,CBS_DROPDOWNLIST |
+ LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,4,66,281,58
+ LTEXT "Command>",IDC_KEYEDIT_CMDINF,110,134,42,8
+ COMBOBOX IDC_KEYEDIT_CMD,154,132,84,108,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "&OK",IDOK,134,162,50,14
- PUSHBUTTON "&Close",IDCANCEL,186,162,50,14
- PUSHBUTTON "&Help",IDC_KEYEDIT_HELP,238,162,50,14
- PUSHBUTTON "&Revoke...",IDC_KEYEDIT_REVOKE,8,162,58,14
+ DEFPUSHBUTTON "&OK",IDOK,241,131,43,14
+ PUSHBUTTON "&Close",IDCANCEL,182,158,50,14
+ PUSHBUTTON "&Help",IDC_KEYEDIT_HELP,234,158,50,14
+ PUSHBUTTON "&Revoke...",IDC_KEYEDIT_REVOKE,4,158,58,14
END
IDD_WINPT_PROGRESS DIALOG DISCARDABLE 0, 0, 186, 58
@@ -1826,9 +1825,9 @@
IDD_WINPT_KEYEDIT, DIALOG
BEGIN
LEFTMARGIN, 4
- RIGHTMARGIN, 292
+ RIGHTMARGIN, 287
TOPMARGIN, 3
- BOTTOMMARGIN, 178
+ BOTTOMMARGIN, 173
END
IDD_WINPT_PROGRESS, DIALOG
@@ -1960,42 +1959,7 @@
// Version
//
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "This is free software under the terms of the GNU GPL v2\0"
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "Windows Privacy Tray (WinPT)\0"
- VALUE "FileVersion", "1.0.0pre1\0"
- VALUE "InternalName", "WinPT\0"
- VALUE "LegalCopyright", " Copyright (C) 2006 Timo Schulz\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "WinPT.exe\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Windows Privacy Tray\0"
- VALUE "ProductVersion", "1.0.0pre1\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
+#include "versioninfo.rc"
#endif // !_MAC
Modified: trunk/Src/wptFileManager.cpp
===================================================================
--- trunk/Src/wptFileManager.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptFileManager.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -789,7 +789,7 @@
fm_clearsign_8bit (listview_ctrl_t lv, fm_state_s *ctx)
{
FILE *f;
- byte buf[32];
+ BYTE buf[32];
char name[256];
int i, n, cnt=0;
Modified: trunk/Src/wptKeyCache.cpp
===================================================================
--- trunk/Src/wptKeyCache.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptKeyCache.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -351,7 +351,7 @@
gpg_iobuf_t inp;
PACKET *pkt;
struct keycache_s *c;
- const byte *sym_prefs;
+ const BYTE *sym_prefs;
char keyid[16+1];
int key_seen = 0;
size_t nsym =0;
Modified: trunk/Src/wptKeyEdit.cpp
===================================================================
--- trunk/Src/wptKeyEdit.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptKeyEdit.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -75,8 +75,14 @@
if (pend == NULL)
break;
switch (field) {
- case 4: r->pubkey_algo = (gpgme_pubkey_algo_t)atol (pend); break;
- case 10: strncpy (r->fpr, pend, 40); r->fpr[40] = 0; break;
+ case 4:
+ r->pubkey_algo = (gpgme_pubkey_algo_t)atol (pend);
+ break;
+
+ case 10:
+ strncpy (r->fpr, pend, 40);
+ r->fpr[40] = 0;
+ break;
}
}
if (p)
@@ -142,10 +148,11 @@
case 13: /* preferences */
if (strstr (pend, "mdc")) {
+ const char *s = "no-ks-modify";
len = strlen (pend) - 4; /* ,mdc */
- if (strstr (pend, "no-ks-modify")) {
+ if (strstr (pend, s)) {
i->flags.no_ks_modify = 1;
- len -= 13; /* ,no-ks-modify */
+ len -= strlen (s)+1; /* ',' + s */
}
i->prefs = (char*)calloc (1, len+1);
if (!i->prefs)
@@ -163,7 +170,7 @@
break;
case 14: /* index/flags */
- i->index = atol (pend);
+ i->index = atoi (pend);
if (strchr (pend, 'r'))
i->flags.revoked = 1;
if (strchr (pend, 'p'))
@@ -824,13 +831,16 @@
index @uid_index to the prefs given in @new_prefs.
Return value: 0 on success. */
gpgme_error_t
-GpgKeyEdit::setUseridPreferences (int _uid_index, const char *new_prefs)
+GpgKeyEdit::setUseridPreferences (int _uid_index, const char *_new_prefs)
{
if (!this->key)
return gpg_error (GPG_ERR_INV_OBJ);
if (key_has_passwd && !this->pass)
return gpg_error (GPG_ERR_INV_PASSPHRASE);
- return 0;
+ type = GPG_EDITKEY_SETPREF;
+ this->uid_index = _uid_index;
+ this->new_prefs = _new_prefs;
+ return gpg_editkey (this->ctx, this->key, this);
}
Modified: trunk/Src/wptKeyEditDlgs.cpp
===================================================================
--- trunk/Src/wptKeyEditDlgs.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptKeyEditDlgs.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -52,7 +52,7 @@
CMD_DELKEY,
CMD_EXPIRE,
CMD_SHOWPREF,
- //CMD_SETPREF,
+ CMD_SETPREF,
CMD_PASSWD,
CMD_PRIMARY,
CMD_TRUST,
@@ -80,7 +80,7 @@
{"DELKEY", 1, CMD_DELKEY},
{"EXPIRE", 1, CMD_EXPIRE},
{"SHOWPREF", 0, CMD_SHOWPREF},
- /*{"SETPREF", 1, CMD_SETPREF},*/
+ {"SETPREF", 1, CMD_SETPREF},
{"PASSWD", 1, CMD_PASSWD},
{"PRIMARY", 1, CMD_PRIMARY},
{"TRUST", 0, CMD_TRUST},
@@ -134,13 +134,13 @@
/* Key generation callback context. */
struct keygen_cb_s {
- int bits;
- int algo;
- u32 expire;
- char *fpr;
- char *name;
- char *comment;
- char *email;
+ int bits;
+ int algo;
+ DWORD expire;
+ char *fpr;
+ char *name;
+ char *comment;
+ char *email;
};
typedef struct keygen_cb_s *keygen_cb_t;
@@ -151,7 +151,7 @@
static subclass_s keyedit_uid_proc;
int keygen_check_date (SYSTEMTIME *st);
-void get_userid_preflist (char **r_prefs, int *r_flags);
+void get_userid_preflist (const char *old_prefs, char **r_prefs, int *r_flags);
char* get_subkey_keyid (const char *keyid);
void ComboBox_AddString_utf8 (HWND cb, const char *txt);
@@ -237,14 +237,15 @@
do_add_new_subkey (listview_ctrl_t lv, keygen_cb_t keygen, unsigned int flags)
{
char info[128], keyid[32];
- const char *expdate, *s;
+ const char *expdate, *s, *kid;
int n;
expdate = keygen->expire? get_key_expire_date (keygen->expire) : _("Never");
_snprintf (info, sizeof (info)-1, "%d-bit %s",
keygen->bits,
get_key_pubalgo ((gpgme_pubkey_algo_t)keygen->algo));
- _snprintf (keyid, sizeof (keyid)-1, "0x%s", keygen->fpr+8);
+ kid = get_keyid_from_fpr (keygen->fpr);
+ _snprintf (keyid, sizeof (keyid)-1, "0x%s", kid);
s = get_key_created (time (NULL));
n = listview_count_items (lv, 0);
listview_add_item_pos (lv, n);
@@ -631,7 +632,7 @@
case WM_INITDIALOG:
ctx = (keyedit_cb_t)lparam;
if (!ctx)
- BUG (0);
+ BUG (NULL);
SetWindowText (dlg, _("Add new Subkey"));
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFALGO, _("Key type"));
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFSIZE, _("Size in bits"));
@@ -982,7 +983,7 @@
memset (&k, 0, sizeof (k));
if (winpt_get_pubkey (keyid, &k))
- BUG (0);
+ BUG (NULL);
if (!k.is_v3)
return 0;
sym_prefs = k.ext->sym_prefs;
@@ -1058,7 +1059,7 @@
return TRUE;
}
-
+
/* Initialize sub key list from key @k and return
the new listview control. */
listview_ctrl_t
@@ -1081,72 +1082,63 @@
listview_ctrl_t lv;
char buf[256], tmp[128];
const char *t;
- int nkeys = 0, i, bits;
+ int nkeys = 0, i;
nkeys = count_subkeys (k->ctx);
if (!nkeys)
- BUG (0); /* should never happen. */
+ BUG (NULL); /* should never happen. */
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_KEYLIST));
for (i = 0; cols[i].fieldname != NULL; i++)
listview_add_column (lv, &cols[i]);
- for (i = 0; i < nkeys; i++) {
+ for (i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next) {
listview_add_item (lv, "");
listview_add_sub_item (lv, 0, 1, "");
memset (&lvi, 0, sizeof (lvi));
lvi.mask = LVIF_PARAM;
- lvi.lParam = (LPARAM)k->ext;
+ lvi.lParam = (LPARAM)sub;
if (ListView_SetItem (lv->ctrl, &lvi) == FALSE)
- BUG (0);
+ BUG (NULL);
}
- listview_set_ext_style( lv );
- for( i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next ) {
- memset( buf, 0, sizeof buf );
-
- bits = sub->length;
- _snprintf( tmp, sizeof tmp-1, "%d-bit ", bits );
- strcat( buf, tmp );
-
- _snprintf( tmp, sizeof tmp-1, "%s", get_key_pubalgo (sub->pubkey_algo));
- strcat( buf, tmp );
-
- listview_add_sub_item( lv, i, 0, buf );
+ listview_set_ext_style (lv);
+ for (i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next) {
+ _snprintf (buf, sizeof buf-1, "%d-bit %s", sub->length,
+ get_key_pubalgo (sub->pubkey_algo));
+ listview_add_sub_item (lv, i, SUBK_COL_DESC, buf);
t = sub->keyid;
- if( !t )
- t = "DEADBEEFDEADBEEF";
- _snprintf( tmp, sizeof tmp-1, "0x%s", t+8 );
- listview_add_sub_item( lv, i, 1, tmp );
+ assert (t != NULL);
+ _snprintf (tmp, sizeof tmp-1, "0x%s", t+8);
+ listview_add_sub_item (lv, i, SUBK_COL_KEYID, tmp);
t = get_key_created (sub->timestamp);
- if( !t )
+ if (!t)
t = "????" "-??" "-??";
- listview_add_sub_item( lv, i, 2, t );
+ listview_add_sub_item (lv, i, SUBK_COL_CREATION, t);
- if( sub->expires ) {
+ if (sub->expires) {
t = get_key_created (sub->expires);
- listview_add_sub_item( lv, i, 3, t );
+ listview_add_sub_item (lv, i, SUBK_COL_EXPIRES, t);
}
else
- listview_add_sub_item( lv, i, 3, _("Never") );
-
- if( sub->expired )
+ listview_add_sub_item (lv, i, SUBK_COL_EXPIRES, _("Never"));
+ if (sub->expired)
t = _("Expired");
- else if( sub->revoked )
+ else if (sub->revoked)
t = _("Revoked");
else
t = _("OK");
- listview_add_sub_item( lv, i, 4, t );
+ listview_add_sub_item (lv, i, SUBK_COL_STATUS, t);
if (sub->can_certify) t = "*"; else t = "";
- listview_add_sub_item (lv, i, 5, t);
+ listview_add_sub_item (lv, i, SUBK_COL_C_FLAG, t);
if (sub->can_sign) t = "*"; else t = "";
- listview_add_sub_item( lv, i, 6, t );
+ listview_add_sub_item( lv, i, SUBK_COL_S_FLAG, t );
if (sub->can_encrypt) t = "*"; else t = "";
- listview_add_sub_item( lv, i, 7, t );
+ listview_add_sub_item( lv, i, SUBK_COL_E_FLAG, t );
if (sub->can_authenticate) t = "*"; else t = "";
- listview_add_sub_item (lv, i, 8, t);
+ listview_add_sub_item (lv, i, SUBK_COL_A_FLAG, t);
}
return lv;
}
@@ -1170,7 +1162,7 @@
nuids = count_userids (k->ctx);
if (!nuids)
- BUG (0); /* should never happen. */
+ BUG (NULL); /* should never happen. */
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST));
for (j = 0; cols[j].fieldname != NULL; j++)
@@ -1235,7 +1227,7 @@
case CMD_ADDKEY:
case CMD_ADDPHOTO:
case CMD_ADDREVOKER:
- //case CMD_SETPREF:
+ case CMD_SETPREF:
return 1;
}
return 0;
@@ -1246,33 +1238,33 @@
static void
do_show_help (HWND dlg)
{
- char helptext[2048];
+ const char *help;
- _snprintf (helptext, sizeof (helptext)-1,
+ help =
_(
- "ADDUID \t\tadd a user ID\r\n"
- "ADDPHOTO \t\tadd a photo ID\r\n"
- "DELUID \t\tdelete a user ID\r\n"
- "ADDKEY \t\tadd a secondard key\r\n"
- "DELKEY \t\tdelete a secondary key\r\n"
- "ADDREVOKER\t\tadd a revocation key\r\n"
- "EXPIRE \t\tchange the expire date\r\n"
- "SHOWPREF \t\tlist preferences (verbose)\r\n"
- "SETPREF \t\tset preference list\r\n"
- "UPDPREF \t\tupdated preferences\r\n"
- "PASSWD \t\tchange the passphrase\r\n"
- "PRIMARY \t\tflag user ID as primary\r\n"
- "TRUST \t\tchange the ownertrust\r\n"
- "REVUID \t\trevoke a user ID\r\n"
- "REVKEY \t\trevoke a secondary key\r\n"
- "DISABLE \t\tdisable a key\r\n"
- "ENABLE \t\tenable a key\r\n"
- "SIGN \t\tsign a user-id (exportable)\r\n"
- "LSIGN \t\tsign a user-id (non-exportable)\r\n"
- "CLEAN \t\tremove unusable signatures from key\r\n"
- "MINIMIZE \t\tremove all signatures from key\r\n"
- ));
- msg_box (dlg, helptext, _("Key Edit Help"), MB_OK);
+ "ADDUID add a user ID\r\n"
+ "ADDPHOTO add a photo ID\r\n"
+ "DELUID delete a user ID\r\n"
+ "ADDKEY add a secondard key\r\n"
+ "DELKEY delete a secondary key\r\n"
+ "ADDREVOKER add a revocation key\r\n"
+ "EXPIRE change the expire date\r\n"
+ "SHOWPREF list preferences (verbose)\r\n"
+ "SETPREF set preference list\r\n"
+ "UPDPREF updated preferences\r\n"
+ "PASSWD change the passphrase\r\n"
+ "PRIMARY flag user ID as primary\r\n"
+ "TRUST change the ownertrust\r\n"
+ "REVUID revoke a user ID\r\n"
+ "REVKEY revoke a secondary key\r\n"
+ "DISABLE disable a key\r\n"
+ "ENABLE enable a key\r\n"
+ "SIGN sign a user-id (exportable)\r\n"
+ "LSIGN sign a user-id (non-exportable)\r\n"
+ "CLEAN remove unusable signatures from key\r\n"
+ "MINIMIZE remove all signatures from key\r\n"
+ );
+ msg_box (dlg, help, _("Key Edit Help"), MB_OK);
}
@@ -1532,41 +1524,52 @@
static int
do_editkey_setpref (winpt_key_t k, HWND dlg, listview_ctrl_t lv)
{
- gpgme_error_t rc;
+ gpgme_error_t err;
GpgKeyEdit *ke;
- char buf[256], * pass = NULL, * prefs;
- int j, id, cancel=0, flags=0;
+ gpg_uid_info_t uidinf = NULL;
+ char buf[256], *pass = NULL, *prefs = NULL;
+ int pos, id, cancel=0, flags=0;
- if ((j = listview_get_curr_pos (lv)) == -1) {
+ pos = listview_get_curr_pos (lv);
+ if (pos == -1) {
msg_box (dlg, _("Please select a user ID."), _("Key Edit"), MB_ERR);
return FALSE;
}
- listview_get_item_text (lv, j, 2, buf, sizeof buf-1);
- id = do_find_userid (k->keyid, buf, NULL, NULL);
+ listview_get_item_text (lv, pos, 2, buf, sizeof buf-1);
+ id = do_find_userid (k->keyid, buf, NULL, &uidinf);
if (id == -1)
BUG (NULL);
if (k->is_protected) {
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel);
+ gpg_uid_info_release (uidinf);
if (cancel)
return FALSE;
}
+ get_userid_preflist (uidinf->prefs, &prefs, &flags);
+ gpg_uid_info_release (uidinf);
+ if (!prefs) {
+ sfree_if_alloc (pass);
+ return FALSE;
+ }
+
ke = create_GpgKeyEdit (k->keyid);
if (k->is_protected)
ke->setPassphrase (pass);
else
- ke->setNoPassphrase (true);
+ ke->setNoPassphrase (true);
+ err = ke->setUseridPreferences (id, prefs);
+ if (err)
+ msg_box (dlg, gpgme_strerror (err), _("Set user ID preferences"), MB_ERR);
+ else {
+ k->update = 1;
+ status_box (dlg, _("User ID preferences successfully updated"), _("GnuPG Status"));
+ }
- get_userid_preflist (&prefs, &flags);
-
- rc = ke->setUseridPreferences (id, prefs);
- if (rc)
- msg_box (dlg, _("Could not set user ID preferences"), _("Key Edit"), MB_ERR);
-
sfree_if_alloc (pass);
free_if_alloc (prefs);
delete ke;
- return 0;
+ return err? FALSE: TRUE;
}
@@ -1591,7 +1594,7 @@
listview_get_item_text (lv, j, UID_COL_EMAIL, buf, sizeof (buf)-1);
id = do_find_userid (k->keyid, buf, NULL, NULL);
if (id == -1)
- BUG (0);
+ BUG (NULL);
if (k->is_protected) {
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel);
if (cancel)
@@ -1797,7 +1800,7 @@
listview_get_item_text (lv, pos, UID_COL_NAME, name, DIM (name)-1);
id = do_find_userid (k->keyid, email, name, NULL);
if (id == -1)
- BUG (0);
+ BUG (NULL);
ke = create_GpgKeyEdit (k->keyid);
err = ke->delUserid (id);
@@ -2051,7 +2054,7 @@
int id;
inf = km_key_get_info (key, 0);
- warn = _("Your key is listed as a designated revoker for the key\n\n"
+ warn = _("Your keys is listed as a designated revoker for the key\n\n"
"%s\n\n"
"Are you sure you want to create a revocation certificate\n"
"which allow to revoke the key listed above?");
@@ -2093,11 +2096,11 @@
keyedit_subkey_proc.current = (WNDPROC)subkey_subclass_proc;
keyedit_subkey_proc.old = (WNDPROC)GetWindowLong (item, GWL_WNDPROC);
if (keyedit_subkey_proc.old) {
- if( !SetWindowLong (item, GWL_WNDPROC,
+ if (!SetWindowLong (item, GWL_WNDPROC,
(LONG)keyedit_subkey_proc.current)) {
msg_box (dlg, _("Could not set subkey window procedure."),
_("Key Edit"), MB_ERR);
- BUG (0);
+ BUG (NULL);
}
}
item = GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST);
@@ -2110,7 +2113,7 @@
(LONG)keyedit_uid_proc.current)) {
msg_box (dlg, _("Could not set user ID window procedure."),
_("Key Edit"), MB_ERR);
- BUG (0);
+ BUG (NULL);
}
}
if (k->ctx->revoked) {
@@ -2121,6 +2124,7 @@
SetDlgItemText (dlg, IDCANCEL, _("&Close"));
SetDlgItemText (dlg, IDC_KEYEDIT_HELP, _("&Help"));
SetDlgItemText (dlg, IDC_KEYEDIT_REVOKE, _("&Revoke..."));
+ SetDlgItemText (dlg, IDOK, _("&OK"));
if (!check_desig_rev (k))
ShowWindow (GetDlgItem (dlg, IDC_KEYEDIT_REVOKE), SW_HIDE);
SetWindowText (dlg, _("Key Edit"));
@@ -2140,13 +2144,13 @@
break;
case WM_NOTIFY:
- NMHDR * notify;
+ NMHDR *notify;
notify = (NMHDR *)lparam;
if (!notify || notify->idFrom != IDC_KEYEDIT_UIDLIST)
break;
if (notify->code == NM_DBLCLK)
do_editkey_showpref (k, dlg, lvuid);
- if (notify->code == NM_RCLICK && k->key_pair) {
+ else if (notify->code == NM_RCLICK && k->key_pair) {
HMENU hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT_KEYEDIT));
HMENU popup = GetSubMenu (hm, 0);
POINT p;
@@ -2177,7 +2181,7 @@
case CMD_ADDKEY: keyedit_add_subkey (k, dlg, lvsub); break;
case CMD_EXPIRE: do_editkey_expire (k, dlg, lvsub); break;
case CMD_REVKEY: do_editkey_revoke (k, dlg, lvsub); break;
- /*case CMD_SETPREF:do_editkey_setpref( k, dlg, lvuid ); break;*/
+ case CMD_SETPREF:/*do_editkey_setpref (k, dlg, lvuid);*/ break;
case CMD_ADDUID: keyedit_add_userid( k, dlg, lvuid ); break;
case CMD_ADDREVOKER: keyedit_add_revoker( k, dlg ); break;
case CMD_ADDPHOTO: keyedit_add_photo( k, dlg ); break;
Modified: trunk/Src/wptKeyPropsDlg.cpp
===================================================================
--- trunk/Src/wptKeyPropsDlg.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptKeyPropsDlg.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -315,7 +315,7 @@
switch (msg) {
case WM_INITDIALOG:
- assert (lparam != NULL);
+ assert (lparam != 0);
prop = new struct prop_info_s;
prop->key = (winpt_key_t)lparam;
SetWindowLong (dlg, GWL_USERDATA, (LONG)prop);
Modified: trunk/Src/wptKeygenDlg.cpp
===================================================================
--- trunk/Src/wptKeygenDlg.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptKeygenDlg.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -294,7 +294,7 @@
NULL, "pubring.gpg");
if( name ) {
keyring = make_filename (path, "pubring", "gpg");
- if( !CopyFile (keyring, name, FALSE))
+ if (!CopyFile (keyring, name, FALSE))
log_box (_("Key Generation"), MB_ERR,
_("Could not copy %s -> %s"), keyring, name);
free_if_alloc (keyring);
@@ -390,11 +390,6 @@
SetForegroundWindow (dlg);
return TRUE;
- case WM_SYSCOMMAND:
- if (LOWORD (wparam) == SC_CLOSE)
- EndDialog (dlg, TRUE);
- return FALSE;
-
case WM_COMMAND:
if (HIWORD (wparam) == BN_CLICKED &&
LOWORD (wparam) == IDC_KEYGEN_EXPNEVER) {
@@ -518,6 +513,7 @@
}
+/* Wizard like keygen dialog for novice users. */
BOOL CALLBACK
keygen_wizard_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
@@ -525,37 +521,27 @@
static int pubkey_algo = GPG_KEYGEN_DSA_ELG;
gpgme_error_t err;
char email[128];
- char *utf8_name=NULL, * p, *fpr=NULL;
- char * pass = NULL;
+ char *utf8_name=NULL, *p, *fpr=NULL;
+ char *pass = NULL;
int cancel = 0;
-
- switch( msg ) {
+ switch (msg) {
case WM_INITDIALOG:
ctx = (genkey_s *)lparam;
- if (!ctx || (ctx && ctx->interactive == 0))
- EnableWindow (GetDlgItem (dlg, IDC_KEYWIZARD_EXPERT), FALSE);
SetDlgItemText (dlg, IDC_KEYWIZARD_USERSA, _("&Prefer RSA keys"));
SetDlgItemText (dlg, IDC_KEYWIZARD_NAMEINF, _("Real name:"));
SetDlgItemText (dlg, IDC_KEYWIZARD_EMAILINF, _("Email address:"));
SetDlgItemText (dlg, IDC_KEYWIZARD_TITLEINF, _("Name and E-Mail Assignment"));
- SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT1INF, _("Every key pair must have a name associated with it. The name and\nemail address let your correspondents that your public key they are\nusing belongs to us."));
+ SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT1INF, _("Every key pair must have a name associated with it. The name and\nemail address let your correspondents know that your public key they\nare using belongs to us."));
SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT2INF, _("By associating an email address with your key pair, you will enable WinPT to assist your correspondents in selecting the correct public\nkey when communicating with you."));
SetWindowText (dlg, _("Key Generation Wizard"));
SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
- SetDlgItemText (dlg, IDC_KEYWIZARD_EXPERT, _("E&xpert"));
SetForegroundWindow (dlg);
center_window (dlg, NULL);
break;
case WM_COMMAND:
switch (LOWORD( wparam)) {
- case IDC_KEYWIZARD_EXPERT:
- DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_KEYGEN, dlg,
- keygen_dlg_proc, 0);
- EndDialog (dlg, TRUE);
- break;
-
case IDOK:
if (!GetDlgItemText_utf8 (dlg, IDC_KEYWIZARD_NAME, &utf8_name)) {
msg_box (dlg, _("Please enter the name."),
@@ -598,7 +584,7 @@
sfree_if_alloc (p);
sfree_if_alloc (pass);
if (err) {
- msg_box (dlg, gpgme_strerror( err ), _("Key Generation Wizard"), MB_ERR);
+ msg_box (dlg, gpgme_strerror (err), _("Key Generation Wizard"), MB_ERR);
free_if_alloc (fpr);
return FALSE;
}
Modified: trunk/Src/wptMainProc.cpp
===================================================================
--- trunk/Src/wptMainProc.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptMainProc.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -414,6 +414,7 @@
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt"));
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify"));
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign"));
+ set_menu_text (popup, ID_WINPT_CURRWND_SYMENC, _("Symmetric"));
if (!secret_key_available ()) {
set_menu_state (popup, ID_WINPT_SIGN, MF_DISABLED|MF_GRAYED);
set_menu_state (popup, ID_WINPT_CURRWND_SIGN, MF_DISABLED|MF_GRAYED);
Modified: trunk/Src/wptNLS.c
===================================================================
--- trunk/Src/wptNLS.c 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptNLS.c 2006-06-27 10:16:41 UTC (rev 234)
@@ -83,6 +83,7 @@
{"de", "German", LANG_GERMAN},
{"fr", "French", LANG_FRENCH},
{"jp", "Japanese", LANG_JAPANESE},
+ {"pt_BR", "Portuguese (Brazil)", SUBLANG_PORTUGUESE_BRAZILIAN},
{NULL, 0}
};
Modified: trunk/Src/wptRegistry.cpp
===================================================================
--- trunk/Src/wptRegistry.cpp 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/Src/wptRegistry.cpp 2006-06-27 10:16:41 UTC (rev 234)
@@ -237,13 +237,13 @@
rc = RegCreateKey( HKEY_CLASSES_ROOT, ext, ® );
if( rc_ok( rc ) )
- rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (byte *)extname, strlen( extname ) );
+ rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (BYTE *)extname, strlen( extname ) );
if( rc_ok( rc ) )
rc = RegCloseKey( reg );
if( rc_ok( rc ) )
rc = RegCreateKey( HKEY_CLASSES_ROOT, extname, ® );
if( rc_ok( rc ) )
- rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (byte *) extname, strlen( extname ) );
+ rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (BYTE *) extname, strlen( extname ) );
if( rc_ok( rc ) )
rc = RegCloseKey( reg );
if( !rc_ok( rc ) ) {
@@ -260,13 +260,13 @@
rc = RegCreateKey( HKEY_CLASSES_ROOT, deficon, ® );
if( rc_ok( rc ) )
- rc = RegSetValueEx(reg, NULL, 0, REG_SZ, (byte *)iconfile, strlen( iconfile ) );
+ rc = RegSetValueEx(reg, NULL, 0, REG_SZ, (BYTE *)iconfile, strlen( iconfile ) );
if( rc_ok( rc ) )
rc = RegCloseKey( reg );
if( rc_ok( rc ) )
rc = RegCreateKey( HKEY_CLASSES_ROOT, defexec, ® );
if( rc_ok( rc ) )
- rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (byte *)p_exefile, strlen( exefile ) );
+ rc = RegSetValueEx( reg, NULL, 0, REG_SZ, (BYTE *)p_exefile, strlen( exefile ) );
if( rc_ok( rc ) )
rc = RegCloseKey( reg );
if( !rc_ok( rc ) ) {
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-06-20 15:27:45 UTC (rev 233)
+++ trunk/configure.ac 2006-06-27 10:16:41 UTC (rev 234)
@@ -15,7 +15,7 @@
# Version number: Remember to change it immediately *after* a release.
# Add a "-cvs" prefix for non-released code.
-AC_INIT(WinPT, 1.0.0pre1, http://www.winpt.org)
+AC_INIT(WinPT, 1.0.0pre2-cvs, http://www.winpt.org)
NEED_GPG_VERSION=1.4.2
NEED_GPGME_API=1
NEED_GPGME_VERSION=1.1.1
More information about the Winpt-commits
mailing list