| 1 |
/* |
/* |
| 2 |
* Copyright (c) 1998-2001, Robert O'Callahan |
* Copyright (c) 1998-2001, Robert O'Callahan |
| 3 |
* (C) 2004-2017 TeraTerm Project |
* (C) 2004-2019 TeraTerm Project |
| 4 |
* All rights reserved. |
* All rights reserved. |
| 5 |
* |
* |
| 6 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
| 42 |
#include "ttlib.h" |
#include "ttlib.h" |
| 43 |
#include "keyfiles.h" |
#include "keyfiles.h" |
| 44 |
#include "arc4random.h" |
#include "arc4random.h" |
| 45 |
|
#include "auth.h" |
| 46 |
|
|
| 47 |
#include <stdlib.h> |
#include <stdlib.h> |
| 48 |
#include <stdio.h> |
#include <stdio.h> |
| 4164 |
return; |
return; |
| 4165 |
} |
} |
| 4166 |
|
|
|
static void init_password_control(HWND dlg, int item) |
|
|
{ |
|
|
HWND passwordControl = GetDlgItem(dlg, item); |
|
|
|
|
|
SetWindowLong(passwordControl, GWL_USERDATA, |
|
|
SetWindowLong(passwordControl, GWL_WNDPROC, |
|
|
(LONG) password_wnd_proc)); |
|
|
} |
|
|
|
|
| 4167 |
// bcrypt KDF形式で秘密鍵を保存する |
// bcrypt KDF形式で秘密鍵を保存する |
| 4168 |
// based on OpenSSH 6.5:key_save_private(), key_private_to_blob2() |
// based on OpenSSH 6.5:key_save_private(), key_private_to_blob2() |
| 4169 |
static void save_bcrypt_private_key(char *passphrase, char *filename, char *comment, HWND dlg, PTInstVar pvar, int rounds) |
static void save_bcrypt_private_key(char *passphrase, char *filename, char *comment, HWND dlg, PTInstVar pvar, int rounds) |
| 4398 |
} |
} |
| 4399 |
#endif |
#endif |
| 4400 |
|
|
| 4401 |
init_password_control(dlg, IDC_KEY_EDIT); |
init_password_control(pvar, dlg, IDC_KEY_EDIT); |
| 4402 |
init_password_control(dlg, IDC_CONFIRM_EDIT); |
init_password_control(pvar, dlg, IDC_CONFIRM_EDIT); |
| 4403 |
|
|
| 4404 |
// default key type |
// default key type |
| 4405 |
SendMessage(GetDlgItem(dlg, IDC_RSA_TYPE), BM_SETCHECK, BST_CHECKED, 0); |
SendMessage(GetDlgItem(dlg, IDC_RSA_TYPE), BM_SETCHECK, BST_CHECKED, 0); |