| 4447 |
int bits; |
int bits; |
| 4448 |
cbarg_t cbarg; |
cbarg_t cbarg; |
| 4449 |
char comment[1024]; // comment string in private key |
char comment[1024]; // comment string in private key |
| 4450 |
|
int enable_bcrypt_kdf = 0, enable_bcrypt_rounds = 0; |
| 4451 |
|
|
| 4452 |
cbarg.cnt = 0; |
cbarg.cnt = 0; |
| 4453 |
cbarg.type = key_type; |
cbarg.type = key_type; |
| 4498 |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA256_TYPE), FALSE); |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA256_TYPE), FALSE); |
| 4499 |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA384_TYPE), FALSE); |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA384_TYPE), FALSE); |
| 4500 |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA521_TYPE), FALSE); |
EnableWindow(GetDlgItem(dlg, IDC_ECDSA521_TYPE), FALSE); |
| 4501 |
|
EnableWindow(GetDlgItem(dlg, IDC_ED25519_TYPE), FALSE); |
| 4502 |
EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); |
EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); |
| 4503 |
EnableWindow(GetDlgItem(dlg, IDOK), FALSE); |
EnableWindow(GetDlgItem(dlg, IDOK), FALSE); |
| 4504 |
EnableWindow(GetDlgItem(dlg, IDCANCEL), FALSE); |
EnableWindow(GetDlgItem(dlg, IDCANCEL), FALSE); |
| 4505 |
|
|
| 4506 |
|
enable_bcrypt_kdf = IsWindowEnabled(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK)); |
| 4507 |
|
enable_bcrypt_rounds = IsWindowEnabled(GetDlgItem(dlg, IDC_BCRYPT_KDF_ROUNDS)); |
| 4508 |
|
EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), FALSE); |
| 4509 |
|
EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_ROUNDS), FALSE); |
| 4510 |
|
|
| 4511 |
if (generate_ssh_key(key_type, bits, keygen_progress, &cbarg)) { |
if (generate_ssh_key(key_type, bits, keygen_progress, &cbarg)) { |
| 4512 |
MSG msg; |
MSG msg; |
| 4513 |
int c = 0; |
int c = 0; |
| 4546 |
EnableWindow(GetDlgItem(dlg, IDOK), TRUE); |
EnableWindow(GetDlgItem(dlg, IDOK), TRUE); |
| 4547 |
EnableWindow(GetDlgItem(dlg, IDCANCEL), TRUE); |
EnableWindow(GetDlgItem(dlg, IDCANCEL), TRUE); |
| 4548 |
|
|
| 4549 |
|
if (enable_bcrypt_kdf) { |
| 4550 |
|
EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_CHECK), TRUE); |
| 4551 |
|
} |
| 4552 |
|
if (enable_bcrypt_rounds) { |
| 4553 |
|
EnableWindow(GetDlgItem(dlg, IDC_BCRYPT_KDF_ROUNDS), TRUE); |
| 4554 |
|
} |
| 4555 |
|
|
| 4556 |
// set focus to passphrase edit control (2007.1.27 maya) |
// set focus to passphrase edit control (2007.1.27 maya) |
| 4557 |
SetFocus(GetDlgItem(dlg, IDC_KEY_EDIT)); |
SetFocus(GetDlgItem(dlg, IDC_KEY_EDIT)); |
| 4558 |
} |
} |