| 2537 |
} |
} |
| 2538 |
} |
} |
| 2539 |
|
|
| 2540 |
static void set_move_button_status(HWND dlg) |
static void set_move_button_status(HWND dlg, int type, int up, int down) |
| 2541 |
{ |
{ |
| 2542 |
HWND cipherControl = GetDlgItem(dlg, IDC_SSHCIPHERPREFS); |
HWND cipherControl = GetDlgItem(dlg, type); |
| 2543 |
int curPos = (int) SendMessage(cipherControl, LB_GETCURSEL, 0, 0); |
int curPos = (int) SendMessage(cipherControl, LB_GETCURSEL, 0, 0); |
| 2544 |
int maxPos = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0) - 1; |
int maxPos = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0) - 1; |
| 2545 |
|
|
| 2546 |
EnableWindow(GetDlgItem(dlg, IDC_SSHMOVECIPHERUP), |
EnableWindow(GetDlgItem(dlg, up), |
| 2547 |
curPos > 0 && curPos <= maxPos); |
curPos > 0 && curPos <= maxPos); |
| 2548 |
EnableWindow(GetDlgItem(dlg, IDC_SSHMOVECIPHERDOWN), |
EnableWindow(GetDlgItem(dlg, down), |
| 2549 |
curPos >= 0 && curPos < maxPos); |
curPos >= 0 && curPos < maxPos); |
| 2550 |
} |
} |
| 2551 |
|
|
| 2553 |
{ |
{ |
| 2554 |
HWND compressionControl = GetDlgItem(dlg, IDC_SSHCOMPRESSIONLEVEL); |
HWND compressionControl = GetDlgItem(dlg, IDC_SSHCOMPRESSIONLEVEL); |
| 2555 |
HWND cipherControl = GetDlgItem(dlg, IDC_SSHCIPHERPREFS); |
HWND cipherControl = GetDlgItem(dlg, IDC_SSHCIPHERPREFS); |
| 2556 |
|
HWND kexControl = GetDlgItem(dlg, IDC_SSHKEX_LIST); |
| 2557 |
|
HWND hostkeyControl = GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST); |
| 2558 |
|
HWND macControl = GetDlgItem(dlg, IDC_SSHMAC_LIST); |
| 2559 |
|
HWND compControl = GetDlgItem(dlg, IDC_SSHCOMP_LIST); |
| 2560 |
int i; |
int i; |
| 2561 |
int ch; |
int ch; |
| 2562 |
char uimsg[MAX_UIMSG]; |
char uimsg[MAX_UIMSG]; |
| 2573 |
GetDlgItemText(dlg, IDC_COMPRESSHIGH, uimsg, sizeof(uimsg)); |
GetDlgItemText(dlg, IDC_COMPRESSHIGH, uimsg, sizeof(uimsg)); |
| 2574 |
UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS_HIGHEST", pvar, uimsg); |
UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS_HIGHEST", pvar, uimsg); |
| 2575 |
SetDlgItemText(dlg, IDC_COMPRESSHIGH, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_COMPRESSHIGH, pvar->ts->UIMsg); |
| 2576 |
|
|
| 2577 |
GetDlgItemText(dlg, IDC_CIPHERORDER, uimsg, sizeof(uimsg)); |
GetDlgItemText(dlg, IDC_CIPHERORDER, uimsg, sizeof(uimsg)); |
| 2578 |
UTIL_get_lang_msg("DLG_SSHSETUP_CHIPER", pvar, uimsg); |
UTIL_get_lang_msg("DLG_SSHSETUP_CHIPER", pvar, uimsg); |
| 2579 |
SetDlgItemText(dlg, IDC_CIPHERORDER, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_CIPHERORDER, pvar->ts->UIMsg); |
| 2583 |
GetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, uimsg, sizeof(uimsg)); |
GetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, uimsg, sizeof(uimsg)); |
| 2584 |
UTIL_get_lang_msg("DLG_SSHSETUP_CHIPER_DOWN", pvar, uimsg); |
UTIL_get_lang_msg("DLG_SSHSETUP_CHIPER_DOWN", pvar, uimsg); |
| 2585 |
SetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, pvar->ts->UIMsg); |
| 2586 |
|
|
| 2587 |
|
GetDlgItemText(dlg, IDC_KEX_ORDER, uimsg, sizeof(uimsg)); |
| 2588 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_KEX", pvar, uimsg); |
| 2589 |
|
SetDlgItemText(dlg, IDC_KEX_ORDER, pvar->ts->UIMsg); |
| 2590 |
|
GetDlgItemText(dlg, IDC_SSHKEX_MOVEUP, uimsg, sizeof(uimsg)); |
| 2591 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_KEX_UP", pvar, uimsg); |
| 2592 |
|
SetDlgItemText(dlg, IDC_SSHKEX_MOVEUP, pvar->ts->UIMsg); |
| 2593 |
|
GetDlgItemText(dlg, IDC_SSHKEX_MOVEDOWN, uimsg, sizeof(uimsg)); |
| 2594 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_KEX_DOWN", pvar, uimsg); |
| 2595 |
|
SetDlgItemText(dlg, IDC_SSHKEX_MOVEDOWN, pvar->ts->UIMsg); |
| 2596 |
|
|
| 2597 |
|
GetDlgItemText(dlg, IDC_HOST_KEY_ORDER, uimsg, sizeof(uimsg)); |
| 2598 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY", pvar, uimsg); |
| 2599 |
|
SetDlgItemText(dlg, IDC_HOST_KEY_ORDER, pvar->ts->UIMsg); |
| 2600 |
|
GetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEUP, uimsg, sizeof(uimsg)); |
| 2601 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY_UP", pvar, uimsg); |
| 2602 |
|
SetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEUP, pvar->ts->UIMsg); |
| 2603 |
|
GetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEDOWN, uimsg, sizeof(uimsg)); |
| 2604 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY_DOWN", pvar, uimsg); |
| 2605 |
|
SetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEDOWN, pvar->ts->UIMsg); |
| 2606 |
|
|
| 2607 |
|
GetDlgItemText(dlg, IDC_MAC_ORDER, uimsg, sizeof(uimsg)); |
| 2608 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_MAC", pvar, uimsg); |
| 2609 |
|
SetDlgItemText(dlg, IDC_MAC_ORDER, pvar->ts->UIMsg); |
| 2610 |
|
GetDlgItemText(dlg, IDC_SSHMAC_MOVEUP, uimsg, sizeof(uimsg)); |
| 2611 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_MAC_UP", pvar, uimsg); |
| 2612 |
|
SetDlgItemText(dlg, IDC_SSHMAC_MOVEUP, pvar->ts->UIMsg); |
| 2613 |
|
GetDlgItemText(dlg, IDC_SSHMAC_MOVEDOWN, uimsg, sizeof(uimsg)); |
| 2614 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_MAC_DOWN", pvar, uimsg); |
| 2615 |
|
SetDlgItemText(dlg, IDC_SSHMAC_MOVEDOWN, pvar->ts->UIMsg); |
| 2616 |
|
|
| 2617 |
|
GetDlgItemText(dlg, IDC_COMP_ORDER, uimsg, sizeof(uimsg)); |
| 2618 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_COMP", pvar, uimsg); |
| 2619 |
|
SetDlgItemText(dlg, IDC_COMP_ORDER, pvar->ts->UIMsg); |
| 2620 |
|
GetDlgItemText(dlg, IDC_SSHCOMP_MOVEUP, uimsg, sizeof(uimsg)); |
| 2621 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_COMP_UP", pvar, uimsg); |
| 2622 |
|
SetDlgItemText(dlg, IDC_SSHCOMP_MOVEUP, pvar->ts->UIMsg); |
| 2623 |
|
GetDlgItemText(dlg, IDC_SSHCOMP_MOVEDOWN, uimsg, sizeof(uimsg)); |
| 2624 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_COMP_DOWN", pvar, uimsg); |
| 2625 |
|
SetDlgItemText(dlg, IDC_SSHCOMP_MOVEDOWN, pvar->ts->UIMsg); |
| 2626 |
|
|
| 2627 |
GetDlgItemText(dlg, IDC_KNOWNHOSTS, uimsg, sizeof(uimsg)); |
GetDlgItemText(dlg, IDC_KNOWNHOSTS, uimsg, sizeof(uimsg)); |
| 2628 |
UTIL_get_lang_msg("DLG_SSHSETUP_KNOWNHOST", pvar, uimsg); |
UTIL_get_lang_msg("DLG_SSHSETUP_KNOWNHOST", pvar, uimsg); |
| 2629 |
SetDlgItemText(dlg, IDC_KNOWNHOSTS, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_KNOWNHOSTS, pvar->ts->UIMsg); |
| 2662 |
SendMessage(compressionControl, TBM_SETPOS, TRUE, |
SendMessage(compressionControl, TBM_SETPOS, TRUE, |
| 2663 |
pvar->settings.CompressionLevel); |
pvar->settings.CompressionLevel); |
| 2664 |
|
|
| 2665 |
|
// Cipher order |
| 2666 |
normalize_cipher_order(pvar->settings.CipherOrder); |
normalize_cipher_order(pvar->settings.CipherOrder); |
| 2667 |
|
|
| 2668 |
for (i = 0; pvar->settings.CipherOrder[i] != 0; i++) { |
for (i = 0; pvar->settings.CipherOrder[i] != 0; i++) { |
| 2675 |
} |
} |
| 2676 |
|
|
| 2677 |
SendMessage(cipherControl, LB_SETCURSEL, 0, 0); |
SendMessage(cipherControl, LB_SETCURSEL, 0, 0); |
| 2678 |
set_move_button_status(dlg); |
set_move_button_status(dlg, IDC_SSHCIPHERPREFS, IDC_SSHMOVECIPHERUP, IDC_SSHMOVECIPHERDOWN); |
| 2679 |
|
|
| 2680 |
|
// KEX order |
| 2681 |
|
normalize_kex_order(pvar->settings.KexOrder); |
| 2682 |
|
for (i = 0; pvar->settings.KexOrder[i] != 0; i++) { |
| 2683 |
|
int index = pvar->settings.KexOrder[i] - '0'; |
| 2684 |
|
char FAR *name = NULL; |
| 2685 |
|
|
| 2686 |
|
if (index == 0) { |
| 2687 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_KEX_BORDER", pvar, |
| 2688 |
|
"<KEXs below this line are disabled>"); |
| 2689 |
|
name = pvar->ts->UIMsg; |
| 2690 |
|
} else { |
| 2691 |
|
name = get_kex_algorithm_name(index); |
| 2692 |
|
} |
| 2693 |
|
|
| 2694 |
|
if (name != NULL) { |
| 2695 |
|
SendMessage(kexControl, LB_ADDSTRING, 0, (LPARAM) name); |
| 2696 |
|
} |
| 2697 |
|
} |
| 2698 |
|
SendMessage(kexControl, LB_SETCURSEL, 0, 0); |
| 2699 |
|
set_move_button_status(dlg, IDC_SSHKEX_LIST, IDC_SSHKEX_MOVEUP, IDC_SSHKEX_MOVEDOWN); |
| 2700 |
|
|
| 2701 |
|
// Host Key order |
| 2702 |
|
normalize_host_key_order(pvar->settings.HostKeyOrder); |
| 2703 |
|
for (i = 0; pvar->settings.HostKeyOrder[i] != 0; i++) { |
| 2704 |
|
int index = pvar->settings.HostKeyOrder[i] - '0'; |
| 2705 |
|
char FAR *name = NULL; |
| 2706 |
|
|
| 2707 |
|
if (index == 0) { |
| 2708 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY_BORDER", pvar, |
| 2709 |
|
"<Host Keys below this line are disabled>"); |
| 2710 |
|
name = pvar->ts->UIMsg; |
| 2711 |
|
} else { |
| 2712 |
|
name = get_ssh_keytype_name(index); |
| 2713 |
|
} |
| 2714 |
|
|
| 2715 |
|
if (name != NULL) { |
| 2716 |
|
SendMessage(hostkeyControl, LB_ADDSTRING, 0, (LPARAM) name); |
| 2717 |
|
} |
| 2718 |
|
} |
| 2719 |
|
SendMessage(hostkeyControl, LB_SETCURSEL, 0, 0); |
| 2720 |
|
set_move_button_status(dlg, IDC_SSHHOST_KEY_LIST, IDC_SSHHOST_KEY_MOVEUP, IDC_SSHHOST_KEY_MOVEDOWN); |
| 2721 |
|
|
| 2722 |
|
// MAC order |
| 2723 |
|
normalize_mac_order(pvar->settings.MacOrder); |
| 2724 |
|
for (i = 0; pvar->settings.MacOrder[i] != 0; i++) { |
| 2725 |
|
int index = pvar->settings.MacOrder[i] - '0'; |
| 2726 |
|
char FAR *name = NULL; |
| 2727 |
|
|
| 2728 |
|
if (index == 0) { |
| 2729 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_MAC_BORDER", pvar, |
| 2730 |
|
"<MACs below this line are disabled>"); |
| 2731 |
|
name = pvar->ts->UIMsg; |
| 2732 |
|
} else { |
| 2733 |
|
name = get_ssh2_mac_name(index); |
| 2734 |
|
} |
| 2735 |
|
|
| 2736 |
|
if (name != NULL) { |
| 2737 |
|
SendMessage(macControl, LB_ADDSTRING, 0, (LPARAM) name); |
| 2738 |
|
} |
| 2739 |
|
} |
| 2740 |
|
SendMessage(macControl, LB_SETCURSEL, 0, 0); |
| 2741 |
|
set_move_button_status(dlg, IDC_SSHMAC_LIST, IDC_SSHMAC_MOVEUP, IDC_SSHMAC_MOVEDOWN); |
| 2742 |
|
|
| 2743 |
|
// Compression order |
| 2744 |
|
normalize_comp_order(pvar->settings.CompOrder); |
| 2745 |
|
for (i = 0; pvar->settings.CompOrder[i] != 0; i++) { |
| 2746 |
|
int index = pvar->settings.CompOrder[i] - '0'; |
| 2747 |
|
char FAR *name = NULL; |
| 2748 |
|
|
| 2749 |
|
if (index == 0) { |
| 2750 |
|
UTIL_get_lang_msg("DLG_SSHSETUP_COMP_BORDER", pvar, |
| 2751 |
|
"<Compressions below this line are disabled>"); |
| 2752 |
|
name = pvar->ts->UIMsg; |
| 2753 |
|
} else { |
| 2754 |
|
name = get_ssh2_comp_name(index); |
| 2755 |
|
} |
| 2756 |
|
|
| 2757 |
|
if (name != NULL) { |
| 2758 |
|
SendMessage(compControl, LB_ADDSTRING, 0, (LPARAM) name); |
| 2759 |
|
} |
| 2760 |
|
} |
| 2761 |
|
SendMessage(compControl, LB_SETCURSEL, 0, 0); |
| 2762 |
|
set_move_button_status(dlg, IDC_SSHCOMP_LIST, IDC_SSHCOMP_MOVEUP, IDC_SSHCOMP_MOVEDOWN); |
| 2763 |
|
|
| 2764 |
for (i = 0; (ch = pvar->settings.KnownHostsFiles[i]) != 0 && ch != ';'; |
for (i = 0; (ch = pvar->settings.KnownHostsFiles[i]) != 0 && ch != ';'; |
| 2765 |
i++) { |
i++) { |
| 2868 |
char buf[4096]; |
char buf[4096]; |
| 2869 |
char buf2[1024]; |
char buf2[1024]; |
| 2870 |
HWND compressionControl = GetDlgItem(dlg, IDC_SSHCOMPRESSIONLEVEL); |
HWND compressionControl = GetDlgItem(dlg, IDC_SSHCOMPRESSIONLEVEL); |
| 2871 |
HWND cipherControl = GetDlgItem(dlg, IDC_SSHCIPHERPREFS); |
HWND cipherControl; |
| 2872 |
int i, j, buf2index, bufindex; |
int i, j, buf2index, bufindex; |
| 2873 |
int count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
int count; |
| 2874 |
|
|
| 2875 |
pvar->settings.CompressionLevel = |
pvar->settings.CompressionLevel = |
| 2876 |
(int) SendMessage(compressionControl, TBM_GETPOS, 0, 0); |
(int) SendMessage(compressionControl, TBM_GETPOS, 0, 0); |
| 2877 |
|
|
| 2878 |
|
// Cipher order |
| 2879 |
|
cipherControl = GetDlgItem(dlg, IDC_SSHCIPHERPREFS); |
| 2880 |
|
count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
| 2881 |
buf2index = 0; |
buf2index = 0; |
| 2882 |
for (i = 0; i < count; i++) { |
for (i = 0; i < count; i++) { |
| 2883 |
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
| 2899 |
normalize_cipher_order(buf2); |
normalize_cipher_order(buf2); |
| 2900 |
strncpy_s(pvar->settings.CipherOrder, sizeof(pvar->settings.CipherOrder), buf2, _TRUNCATE); |
strncpy_s(pvar->settings.CipherOrder, sizeof(pvar->settings.CipherOrder), buf2, _TRUNCATE); |
| 2901 |
|
|
| 2902 |
|
// KEX order |
| 2903 |
|
cipherControl = GetDlgItem(dlg, IDC_SSHKEX_LIST); |
| 2904 |
|
count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
| 2905 |
|
buf2index = 0; |
| 2906 |
|
for (i = 0; i < count; i++) { |
| 2907 |
|
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
| 2908 |
|
|
| 2909 |
|
if (len > 0 && len < sizeof(buf)) { /* should always be true */ |
| 2910 |
|
buf[0] = 0; |
| 2911 |
|
SendMessage(cipherControl, LB_GETTEXT, i, (LPARAM) buf); |
| 2912 |
|
for (j = 0; |
| 2913 |
|
j <= KEX_DH_MAX |
| 2914 |
|
&& strcmp(buf, get_kex_algorithm_name(j)) != 0; j++) { |
| 2915 |
|
} |
| 2916 |
|
if (j <= KEX_DH_MAX) { |
| 2917 |
|
buf2[buf2index] = '0' + j; |
| 2918 |
|
buf2index++; |
| 2919 |
|
} else { |
| 2920 |
|
buf2[buf2index] = '0'; // disabled line |
| 2921 |
|
buf2index++; |
| 2922 |
|
} |
| 2923 |
|
} |
| 2924 |
|
} |
| 2925 |
|
buf2[buf2index] = 0; |
| 2926 |
|
normalize_kex_order(buf2); |
| 2927 |
|
strncpy_s(pvar->settings.KexOrder, sizeof(pvar->settings.KexOrder), buf2, _TRUNCATE); |
| 2928 |
|
|
| 2929 |
|
// Host Key order |
| 2930 |
|
cipherControl = GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST); |
| 2931 |
|
count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
| 2932 |
|
buf2index = 0; |
| 2933 |
|
for (i = 0; i < count; i++) { |
| 2934 |
|
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
| 2935 |
|
|
| 2936 |
|
if (len > 0 && len < sizeof(buf)) { /* should always be true */ |
| 2937 |
|
buf[0] = 0; |
| 2938 |
|
SendMessage(cipherControl, LB_GETTEXT, i, (LPARAM) buf); |
| 2939 |
|
for (j = 0; |
| 2940 |
|
j <= KEY_MAX |
| 2941 |
|
&& strcmp(buf, get_ssh_keytype_name(j)) != 0; j++) { |
| 2942 |
|
} |
| 2943 |
|
if (j <= KEY_MAX) { |
| 2944 |
|
buf2[buf2index] = '0' + j; |
| 2945 |
|
buf2index++; |
| 2946 |
|
} else { |
| 2947 |
|
buf2[buf2index] = '0'; // disabled line |
| 2948 |
|
buf2index++; |
| 2949 |
|
} |
| 2950 |
|
} |
| 2951 |
|
} |
| 2952 |
|
buf2[buf2index] = 0; |
| 2953 |
|
normalize_host_key_order(buf2); |
| 2954 |
|
strncpy_s(pvar->settings.HostKeyOrder, sizeof(pvar->settings.HostKeyOrder), buf2, _TRUNCATE); |
| 2955 |
|
|
| 2956 |
|
// MAC order |
| 2957 |
|
cipherControl = GetDlgItem(dlg, IDC_SSHMAC_LIST); |
| 2958 |
|
count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
| 2959 |
|
buf2index = 0; |
| 2960 |
|
for (i = 0; i < count; i++) { |
| 2961 |
|
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
| 2962 |
|
|
| 2963 |
|
if (len > 0 && len < sizeof(buf)) { /* should always be true */ |
| 2964 |
|
buf[0] = 0; |
| 2965 |
|
SendMessage(cipherControl, LB_GETTEXT, i, (LPARAM) buf); |
| 2966 |
|
for (j = 0; |
| 2967 |
|
j <= HMAC_MAX |
| 2968 |
|
&& strcmp(buf, get_ssh2_mac_name(j)) != 0; j++) { |
| 2969 |
|
} |
| 2970 |
|
if (j <= HMAC_MAX) { |
| 2971 |
|
buf2[buf2index] = '0' + j; |
| 2972 |
|
buf2index++; |
| 2973 |
|
} else { |
| 2974 |
|
buf2[buf2index] = '0'; // disabled line |
| 2975 |
|
buf2index++; |
| 2976 |
|
} |
| 2977 |
|
} |
| 2978 |
|
} |
| 2979 |
|
buf2[buf2index] = 0; |
| 2980 |
|
normalize_mac_order(buf2); |
| 2981 |
|
strncpy_s(pvar->settings.MacOrder, sizeof(pvar->settings.MacOrder), buf2, _TRUNCATE); |
| 2982 |
|
|
| 2983 |
|
// Compression order |
| 2984 |
|
cipherControl = GetDlgItem(dlg, IDC_SSHCOMP_LIST); |
| 2985 |
|
count = (int) SendMessage(cipherControl, LB_GETCOUNT, 0, 0); |
| 2986 |
|
buf2index = 0; |
| 2987 |
|
for (i = 0; i < count; i++) { |
| 2988 |
|
int len = SendMessage(cipherControl, LB_GETTEXTLEN, i, 0); |
| 2989 |
|
|
| 2990 |
|
if (len > 0 && len < sizeof(buf)) { /* should always be true */ |
| 2991 |
|
buf[0] = 0; |
| 2992 |
|
SendMessage(cipherControl, LB_GETTEXT, i, (LPARAM) buf); |
| 2993 |
|
for (j = 0; |
| 2994 |
|
j <= COMP_MAX |
| 2995 |
|
&& strcmp(buf, get_ssh2_comp_name(j)) != 0; j++) { |
| 2996 |
|
} |
| 2997 |
|
if (j <= COMP_MAX) { |
| 2998 |
|
buf2[buf2index] = '0' + j; |
| 2999 |
|
buf2index++; |
| 3000 |
|
} else { |
| 3001 |
|
buf2[buf2index] = '0'; // disabled line |
| 3002 |
|
buf2index++; |
| 3003 |
|
} |
| 3004 |
|
} |
| 3005 |
|
} |
| 3006 |
|
buf2[buf2index] = 0; |
| 3007 |
|
normalize_comp_order(buf2); |
| 3008 |
|
strncpy_s(pvar->settings.CompOrder, sizeof(pvar->settings.CompOrder), buf2, _TRUNCATE); |
| 3009 |
|
|
| 3010 |
buf[0] = 0; |
buf[0] = 0; |
| 3011 |
GetDlgItemText(dlg, IDC_READWRITEFILENAME, buf, sizeof(buf)); |
GetDlgItemText(dlg, IDC_READWRITEFILENAME, buf, sizeof(buf)); |
| 3012 |
j = copy_teraterm_dir_relative_path(pvar->settings.KnownHostsFiles, |
j = copy_teraterm_dir_relative_path(pvar->settings.KnownHostsFiles, |
| 3201 |
DeleteObject(DlgSetupFont); |
DeleteObject(DlgSetupFont); |
| 3202 |
} |
} |
| 3203 |
return TRUE; |
return TRUE; |
| 3204 |
|
// Cipher order |
| 3205 |
case IDC_SSHMOVECIPHERUP: |
case IDC_SSHMOVECIPHERUP: |
| 3206 |
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCIPHERPREFS), -1); |
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCIPHERPREFS), -1); |
| 3207 |
set_move_button_status(dlg); |
set_move_button_status(dlg, IDC_SSHCIPHERPREFS, IDC_SSHMOVECIPHERUP, IDC_SSHMOVECIPHERDOWN); |
| 3208 |
SetFocus(GetDlgItem(dlg, IDC_SSHCIPHERPREFS)); |
SetFocus(GetDlgItem(dlg, IDC_SSHCIPHERPREFS)); |
| 3209 |
return TRUE; |
return TRUE; |
| 3210 |
case IDC_SSHMOVECIPHERDOWN: |
case IDC_SSHMOVECIPHERDOWN: |
| 3211 |
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCIPHERPREFS), 1); |
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCIPHERPREFS), 1); |
| 3212 |
set_move_button_status(dlg); |
set_move_button_status(dlg, IDC_SSHCIPHERPREFS, IDC_SSHMOVECIPHERUP, IDC_SSHMOVECIPHERDOWN); |
| 3213 |
SetFocus(GetDlgItem(dlg, IDC_SSHCIPHERPREFS)); |
SetFocus(GetDlgItem(dlg, IDC_SSHCIPHERPREFS)); |
| 3214 |
return TRUE; |
return TRUE; |
| 3215 |
case IDC_SSHCIPHERPREFS: |
case IDC_SSHCIPHERPREFS: |
| 3216 |
set_move_button_status(dlg); |
set_move_button_status(dlg, IDC_SSHCIPHERPREFS, IDC_SSHMOVECIPHERUP, IDC_SSHMOVECIPHERDOWN); |
| 3217 |
|
return TRUE; |
| 3218 |
|
// KEX order |
| 3219 |
|
case IDC_SSHKEX_MOVEUP: |
| 3220 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHKEX_LIST), -1); |
| 3221 |
|
set_move_button_status(dlg, IDC_SSHKEX_LIST, IDC_SSHKEX_MOVEUP, IDC_SSHKEX_MOVEDOWN); |
| 3222 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHKEX_LIST)); |
| 3223 |
|
return TRUE; |
| 3224 |
|
case IDC_SSHKEX_MOVEDOWN: |
| 3225 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHKEX_LIST), 1); |
| 3226 |
|
set_move_button_status(dlg, IDC_SSHKEX_LIST, IDC_SSHKEX_MOVEUP, IDC_SSHKEX_MOVEDOWN); |
| 3227 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHKEX_LIST)); |
| 3228 |
|
return TRUE; |
| 3229 |
|
case IDC_SSHKEX_LIST: |
| 3230 |
|
set_move_button_status(dlg, IDC_SSHKEX_LIST, IDC_SSHKEX_MOVEUP, IDC_SSHKEX_MOVEDOWN); |
| 3231 |
|
return TRUE; |
| 3232 |
|
// Host Key order |
| 3233 |
|
case IDC_SSHHOST_KEY_MOVEUP: |
| 3234 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST), -1); |
| 3235 |
|
set_move_button_status(dlg, IDC_SSHHOST_KEY_LIST, IDC_SSHHOST_KEY_MOVEUP, IDC_SSHHOST_KEY_MOVEDOWN); |
| 3236 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST)); |
| 3237 |
|
return TRUE; |
| 3238 |
|
case IDC_SSHHOST_KEY_MOVEDOWN: |
| 3239 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST), 1); |
| 3240 |
|
set_move_button_status(dlg, IDC_SSHHOST_KEY_LIST, IDC_SSHHOST_KEY_MOVEUP, IDC_SSHHOST_KEY_MOVEDOWN); |
| 3241 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHHOST_KEY_LIST)); |
| 3242 |
|
return TRUE; |
| 3243 |
|
case IDC_SSHHOST_KEY_LIST: |
| 3244 |
|
set_move_button_status(dlg, IDC_SSHHOST_KEY_LIST, IDC_SSHHOST_KEY_MOVEUP, IDC_SSHHOST_KEY_MOVEDOWN); |
| 3245 |
|
return TRUE; |
| 3246 |
|
// Mac order |
| 3247 |
|
case IDC_SSHMAC_MOVEUP: |
| 3248 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHMAC_LIST), -1); |
| 3249 |
|
set_move_button_status(dlg, IDC_SSHMAC_LIST, IDC_SSHMAC_MOVEUP, IDC_SSHMAC_MOVEDOWN); |
| 3250 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHMAC_LIST)); |
| 3251 |
|
return TRUE; |
| 3252 |
|
case IDC_SSHMAC_MOVEDOWN: |
| 3253 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHMAC_LIST), 1); |
| 3254 |
|
set_move_button_status(dlg, IDC_SSHMAC_LIST, IDC_SSHMAC_MOVEUP, IDC_SSHMAC_MOVEDOWN); |
| 3255 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHMAC_LIST)); |
| 3256 |
|
return TRUE; |
| 3257 |
|
case IDC_SSHMAC_LIST: |
| 3258 |
|
set_move_button_status(dlg, IDC_SSHMAC_LIST, IDC_SSHMAC_MOVEUP, IDC_SSHMAC_MOVEDOWN); |
| 3259 |
|
return TRUE; |
| 3260 |
|
// Compression order |
| 3261 |
|
case IDC_SSHCOMP_MOVEUP: |
| 3262 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCOMP_LIST), -1); |
| 3263 |
|
set_move_button_status(dlg, IDC_SSHCOMP_LIST, IDC_SSHCOMP_MOVEUP, IDC_SSHCOMP_MOVEDOWN); |
| 3264 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHCOMP_LIST)); |
| 3265 |
|
return TRUE; |
| 3266 |
|
case IDC_SSHCOMP_MOVEDOWN: |
| 3267 |
|
move_cur_sel_delta(GetDlgItem(dlg, IDC_SSHCOMP_LIST), 1); |
| 3268 |
|
set_move_button_status(dlg, IDC_SSHCOMP_LIST, IDC_SSHCOMP_MOVEUP, IDC_SSHCOMP_MOVEDOWN); |
| 3269 |
|
SetFocus(GetDlgItem(dlg, IDC_SSHCOMP_LIST)); |
| 3270 |
|
return TRUE; |
| 3271 |
|
case IDC_SSHCOMP_LIST: |
| 3272 |
|
set_move_button_status(dlg, IDC_SSHCOMP_LIST, IDC_SSHCOMP_MOVEUP, IDC_SSHCOMP_MOVEDOWN); |
| 3273 |
return TRUE; |
return TRUE; |
| 3274 |
case IDC_CHOOSEREADWRITEFILE: |
case IDC_CHOOSEREADWRITEFILE: |
| 3275 |
choose_read_write_file(dlg); |
choose_read_write_file(dlg); |