| 39 |
#include "key.h" |
#include "key.h" |
| 40 |
#include "hosts.h" |
#include "hosts.h" |
| 41 |
#include "dns.h" |
#include "dns.h" |
| 42 |
|
#include "dlglib.h" |
| 43 |
|
|
| 44 |
#include <openssl/bn.h> |
#include <openssl/bn.h> |
| 45 |
#include <openssl/evp.h> |
#include <openssl/evp.h> |
| 54 |
#include <memory.h> |
#include <memory.h> |
| 55 |
|
|
| 56 |
|
|
| 57 |
static HFONT DlgHostsAddFont; |
#undef DialogBoxParam |
| 58 |
static HFONT DlgHostsReplaceFont; |
#define DialogBoxParam(p1,p2,p3,p4,p5) \ |
| 59 |
|
TTDialogBoxParam(p1,p2,p3,p4,p5) |
| 60 |
|
#undef EndDialog |
| 61 |
|
#define EndDialog(p1,p2) \ |
| 62 |
|
TTEndDialog(p1, p2) |
| 63 |
|
|
| 64 |
|
//static HFONT DlgHostsAddFont; |
| 65 |
|
//static HFONT DlgHostsReplaceFont; |
| 66 |
|
|
| 67 |
// BASE64構成文字列(ここでは'='は含まれていない) |
// BASE64構成文字列(ここでは'='は含まれていない) |
| 68 |
static char base64[] ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
static char base64[] ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
| 1710 |
LPARAM lParam) |
LPARAM lParam) |
| 1711 |
{ |
{ |
| 1712 |
PTInstVar pvar; |
PTInstVar pvar; |
| 1713 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 1714 |
HFONT font; |
// HFONT font; |
| 1715 |
char uimsg[MAX_UIMSG]; |
char uimsg[MAX_UIMSG]; |
| 1716 |
|
|
| 1717 |
switch (msg) { |
switch (msg) { |
| 1784 |
} |
} |
| 1785 |
|
|
| 1786 |
init_hosts_dlg(pvar, dlg); |
init_hosts_dlg(pvar, dlg); |
| 1787 |
|
#if 0 |
| 1788 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 1789 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 1790 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsAddFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsAddFont, pvar)) { |
| 1804 |
else { |
else { |
| 1805 |
DlgHostsAddFont = NULL; |
DlgHostsAddFont = NULL; |
| 1806 |
} |
} |
| 1807 |
|
#endif |
| 1808 |
// add host check boxにチェックをデフォルトで入れておく |
// add host check boxにチェックをデフォルトで入れておく |
| 1809 |
SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0); |
SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0); |
| 1810 |
|
|
| 1833 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 1834 |
|
|
| 1835 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
| 1836 |
|
#if 0 |
| 1837 |
if (DlgHostsAddFont != NULL) { |
if (DlgHostsAddFont != NULL) { |
| 1838 |
DeleteObject(DlgHostsAddFont); |
DeleteObject(DlgHostsAddFont); |
| 1839 |
} |
} |
| 1840 |
|
#endif |
| 1841 |
return TRUE; |
return TRUE; |
| 1842 |
|
|
| 1843 |
case IDCANCEL: /* kill the connection */ |
case IDCANCEL: /* kill the connection */ |
| 1845 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 1846 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 1847 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 1848 |
|
#if 0 |
| 1849 |
if (DlgHostsAddFont != NULL) { |
if (DlgHostsAddFont != NULL) { |
| 1850 |
DeleteObject(DlgHostsAddFont); |
DeleteObject(DlgHostsAddFont); |
| 1851 |
} |
} |
| 1852 |
|
#endif |
| 1853 |
return TRUE; |
return TRUE; |
| 1854 |
|
|
| 1855 |
case IDC_FP_HASH_ALG_MD5: |
case IDC_FP_HASH_ALG_MD5: |
| 1876 |
LPARAM lParam) |
LPARAM lParam) |
| 1877 |
{ |
{ |
| 1878 |
PTInstVar pvar; |
PTInstVar pvar; |
| 1879 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 1880 |
HFONT font; |
// HFONT font; |
| 1881 |
char uimsg[MAX_UIMSG]; |
char uimsg[MAX_UIMSG]; |
| 1882 |
|
|
| 1883 |
switch (msg) { |
switch (msg) { |
| 1950 |
} |
} |
| 1951 |
|
|
| 1952 |
init_hosts_dlg(pvar, dlg); |
init_hosts_dlg(pvar, dlg); |
| 1953 |
|
#if 0 |
| 1954 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 1955 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 1956 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsReplaceFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsReplaceFont, pvar)) { |
| 1969 |
else { |
else { |
| 1970 |
DlgHostsReplaceFont = NULL; |
DlgHostsReplaceFont = NULL; |
| 1971 |
} |
} |
| 1972 |
|
#endif |
| 1973 |
// デフォルトでチェックは入れない |
// デフォルトでチェックは入れない |
| 1974 |
return TRUE; /* because we do not set the focus */ |
return TRUE; /* because we do not set the focus */ |
| 1975 |
|
|
| 1997 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 1998 |
|
|
| 1999 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
| 2000 |
|
#if 0 |
| 2001 |
if (DlgHostsReplaceFont != NULL) { |
if (DlgHostsReplaceFont != NULL) { |
| 2002 |
DeleteObject(DlgHostsReplaceFont); |
DeleteObject(DlgHostsReplaceFont); |
| 2003 |
} |
} |
| 2004 |
|
#endif |
| 2005 |
return TRUE; |
return TRUE; |
| 2006 |
|
|
| 2007 |
case IDCANCEL: /* kill the connection */ |
case IDCANCEL: /* kill the connection */ |
| 2009 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 2010 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 2011 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 2012 |
|
#if 0 |
| 2013 |
if (DlgHostsReplaceFont != NULL) { |
if (DlgHostsReplaceFont != NULL) { |
| 2014 |
DeleteObject(DlgHostsReplaceFont); |
DeleteObject(DlgHostsReplaceFont); |
| 2015 |
} |
} |
| 2016 |
|
#endif |
| 2017 |
return TRUE; |
return TRUE; |
| 2018 |
|
|
| 2019 |
case IDC_FP_HASH_ALG_MD5: |
case IDC_FP_HASH_ALG_MD5: |
| 2040 |
LPARAM lParam) |
LPARAM lParam) |
| 2041 |
{ |
{ |
| 2042 |
PTInstVar pvar; |
PTInstVar pvar; |
| 2043 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 2044 |
HFONT font; |
// HFONT font; |
| 2045 |
char uimsg[MAX_UIMSG]; |
char uimsg[MAX_UIMSG]; |
| 2046 |
|
|
| 2047 |
switch (msg) { |
switch (msg) { |
| 2114 |
} |
} |
| 2115 |
|
|
| 2116 |
init_hosts_dlg(pvar, dlg); |
init_hosts_dlg(pvar, dlg); |
| 2117 |
|
#if 0 |
| 2118 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 2119 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 2120 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsAddFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgHostsAddFont, pvar)) { |
| 2134 |
else { |
else { |
| 2135 |
DlgHostsAddFont = NULL; |
DlgHostsAddFont = NULL; |
| 2136 |
} |
} |
| 2137 |
|
#endif |
| 2138 |
// add host check box のデフォルトは off にする |
// add host check box のデフォルトは off にする |
| 2139 |
// SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0); |
// SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0); |
| 2140 |
|
|
| 2163 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 2164 |
|
|
| 2165 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
| 2166 |
|
#if 0 |
| 2167 |
if (DlgHostsAddFont != NULL) { |
if (DlgHostsAddFont != NULL) { |
| 2168 |
DeleteObject(DlgHostsAddFont); |
DeleteObject(DlgHostsAddFont); |
| 2169 |
} |
} |
| 2170 |
|
#endif |
| 2171 |
return TRUE; |
return TRUE; |
| 2172 |
|
|
| 2173 |
case IDCANCEL: /* kill the connection */ |
case IDCANCEL: /* kill the connection */ |
| 2175 |
pvar->hosts_state.hosts_dialog = NULL; |
pvar->hosts_state.hosts_dialog = NULL; |
| 2176 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 2177 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 2178 |
|
#if 0 |
| 2179 |
if (DlgHostsAddFont != NULL) { |
if (DlgHostsAddFont != NULL) { |
| 2180 |
DeleteObject(DlgHostsAddFont); |
DeleteObject(DlgHostsAddFont); |
| 2181 |
} |
} |
| 2182 |
|
#endif |
| 2183 |
return TRUE; |
return TRUE; |
| 2184 |
|
|
| 2185 |
case IDC_FP_HASH_ALG_MD5: |
case IDC_FP_HASH_ALG_MD5: |