svnno****@sourc*****
svnno****@sourc*****
2012年 9月 29日 (土) 23:10:30 JST
Revision: 5027 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5027 Author: doda Date: 2012-09-29 23:10:29 +0900 (Sat, 29 Sep 2012) Log Message: ----------- DSA 鍵の生成で、鍵長を 1024 ビットに固定した。 Modified Paths: -------------- trunk/ttssh2/ttxssh/ssh.h trunk/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/ssh.h =================================================================== --- trunk/ttssh2/ttxssh/ssh.h 2012-09-28 15:42:51 UTC (rev 5026) +++ trunk/ttssh2/ttxssh/ssh.h 2012-09-29 14:10:29 UTC (rev 5027) @@ -245,7 +245,7 @@ KEY_UNSPEC, KEY_MAX = KEY_UNSPEC, } ssh_keytype; -#define isECDSAkey(type) ((type) >= KEY_ECDSA256 && (type) <= KEY_ECDSA521) +#define isFixedLengthKey(type) ((type) >= KEY_DSA && (type) <= KEY_ECDSA521) typedef struct ssh2_host_key { ssh_keytype type; Modified: trunk/ttssh2/ttxssh/ttxssh.c =================================================================== --- trunk/ttssh2/ttxssh/ttxssh.c 2012-09-28 15:42:51 UTC (rev 5026) +++ trunk/ttssh2/ttxssh/ttxssh.c 2012-09-29 14:10:29 UTC (rev 5027) @@ -4197,7 +4197,7 @@ EnableWindow(GetDlgItem(dlg, IDC_ECDSA256_TYPE), TRUE); EnableWindow(GetDlgItem(dlg, IDC_ECDSA384_TYPE), TRUE); EnableWindow(GetDlgItem(dlg, IDC_ECDSA521_TYPE), TRUE); - if (!isECDSAkey(key_type)) { + if (!isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); } EnableWindow(GetDlgItem(dlg, IDOK), TRUE); @@ -4220,7 +4220,7 @@ // if radio button pressed... case IDC_RSA1_TYPE | (BN_CLICKED << 16): - if (isECDSAkey(key_type)) { + if (isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); SetDlgItemInt(dlg, IDC_KEYBITS, saved_key_bits, FALSE); } @@ -4228,7 +4228,7 @@ break; case IDC_RSA_TYPE | (BN_CLICKED << 16): - if (isECDSAkey(key_type)) { + if (isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); SetDlgItemInt(dlg, IDC_KEYBITS, saved_key_bits, FALSE); } @@ -4236,15 +4236,16 @@ break; case IDC_DSA_TYPE | (BN_CLICKED << 16): - if (isECDSAkey(key_type)) { - EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), TRUE); - SetDlgItemInt(dlg, IDC_KEYBITS, saved_key_bits, FALSE); + if (!isFixedLengthKey(key_type)) { + EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); + saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } key_type = KEY_DSA; + SetDlgItemInt(dlg, IDC_KEYBITS, 1024, FALSE); break; case IDC_ECDSA256_TYPE | (BN_CLICKED << 16): - if (!isECDSAkey(key_type)) { + if (!isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } @@ -4253,7 +4254,7 @@ break; case IDC_ECDSA384_TYPE | (BN_CLICKED << 16): - if (!isECDSAkey(key_type)) { + if (!isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); } @@ -4262,7 +4263,7 @@ break; case IDC_ECDSA521_TYPE | (BN_CLICKED << 16): - if (!isECDSAkey(key_type)) { + if (!isFixedLengthKey(key_type)) { EnableWindow(GetDlgItem(dlg, IDC_KEYBITS), FALSE); saved_key_bits = GetDlgItemInt(dlg, IDC_KEYBITS, NULL, FALSE); }