1 |
/* wptKeygenDlg.cpp - Key Generation dialog |
/* wptKeygenDlg.cpp - Key Generation dialog |
2 |
* Copyright (C) 2000-2004 Timo Schulz |
* Copyright (C) 2000-2005 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
126 |
|
|
127 |
|
|
128 |
BOOL CALLBACK |
BOOL CALLBACK |
129 |
keygen_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam ) |
keygen_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
130 |
{ |
{ |
131 |
static genkey_s *ctx; |
static genkey_s *ctx; |
132 |
static int hide = 1; |
static int hide = 1; |
244 |
_("Key Generation"), MB_ERR ); |
_("Key Generation"), MB_ERR ); |
245 |
return FALSE; |
return FALSE; |
246 |
} |
} |
247 |
else if( strlen( pwd ) < 8 ) { |
else if (check_passwd_quality (pwd, 0)) { |
248 |
int id = msg_box( dlg, _("Your passphrase should be at least 8 characters" |
int id = msg_box( dlg, _("Your passphrase should be at least 8 characters" |
249 |
" long\nand should contain non-alphabetic characters." |
" long\nand should contain non-alphabetic characters." |
250 |
"\n\nStill proceed?"), |
"\n\nStill proceed?"), |
315 |
|
|
316 |
keycache_update (0, fpr); |
keycache_update (0, fpr); |
317 |
keycache_update (1, fpr); |
keycache_update (1, fpr); |
318 |
if (ctx != NULL) |
if (ctx->first_start == 0 && ctx != NULL) |
319 |
get_pubkey (fpr, &ctx->newkey); |
get_pubkey (fpr, &ctx->newkey); |
320 |
safe_free (fpr); |
safe_free (fpr); |
321 |
|
|
398 |
_("Key Generation Wizard"), MB_WARN); |
_("Key Generation Wizard"), MB_WARN); |
399 |
return FALSE; |
return FALSE; |
400 |
} |
} |
401 |
pass = request_passphrase2 (_("Key Generation"), &cancel); |
pass = request_passphrase2 (_("Key Generation"), PASSDLG_STRICT, &cancel); |
402 |
if (cancel) |
if (cancel) |
403 |
return FALSE; |
return FALSE; |
404 |
utf8_name = wincp_to_utf8 (name, strlen (name)); |
utf8_name = wincp_to_utf8 (name, strlen (name)); |
406 |
BUG( NULL ); |
BUG( NULL ); |
407 |
if (IsDlgButtonChecked (dlg, IDC_KEYWIZARD_USERSA)) |
if (IsDlgButtonChecked (dlg, IDC_KEYWIZARD_USERSA)) |
408 |
pubkey_algo = GPGME_KEYGEN_DSA_RSA; |
pubkey_algo = GPGME_KEYGEN_DSA_RSA; |
409 |
p = gpgme_genkey_params (pubkey_algo, 2048, utf8_name, |
p = gpgme_genkey_params (pubkey_algo, DFAULT_KEYSIZE, utf8_name, |
410 |
NULL, email, NULL, pass); |
NULL, email, NULL, pass); |
411 |
free( utf8_name ); |
free( utf8_name ); |
412 |
keygen_cb_dlg_create(); |
keygen_cb_dlg_create(); |
427 |
|
|
428 |
keycache_update (0, fpr); |
keycache_update (0, fpr); |
429 |
keycache_update (1, fpr); |
keycache_update (1, fpr); |
430 |
if (ctx != NULL) { |
if (ctx->first_start == 0 && ctx != NULL) |
431 |
get_pubkey (fpr, &ctx->newkey); |
get_pubkey (fpr, &ctx->newkey); |
|
log_box ("debug", 0, "%s %p", fpr, ctx->newkey); |
|
|
} |
|
432 |
safe_free (fpr); |
safe_free (fpr); |
433 |
|
|
434 |
ask_for_backup (dlg); |
ask_for_backup (dlg); |