[Ttssh2-commit] [5575] #33743: ホスト鍵のfingerprint

svnno****@sourc***** svnno****@sourc*****
2014年 5月 1日 (木) 23:09:20 JST


Revision: 5575
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5575
Author:   yutakapon
Date:     2014-05-01 23:09:18 +0900 (Thu, 01 May 2014)
Log Message:
-----------
#33743: ホスト鍵のfingerprint

TTSSHのバージョン情報に、ホストの公開鍵の指紋(fingerprint)およびランダムアートを表示する。

Ticket Links:
------------
    http://sourceforge.jp/projects/ttssh2/tracker/detail/33743

Modified Paths:
--------------
    trunk/installer/release/lang/English.lng
    trunk/installer/release/lang/French.lng
    trunk/installer/release/lang/German.lng
    trunk/installer/release/lang/Japanese.lng
    trunk/installer/release/lang/Korean.lng
    trunk/installer/release/lang/Russian.lng
    trunk/installer/release/lang/Simplified Chinese.lng
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.rc

-------------- next part --------------
Modified: trunk/installer/release/lang/English.lng
===================================================================
--- trunk/installer/release/lang/English.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/English.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -516,6 +516,7 @@
 DLG_ABOUT_COMP_NONE=none
 DLG_ABOUT_COMP_UPDOWN=Upstream %s; Downstream %s
 DLG_ABOUT_AUTH_INFO=User '%s', using %s
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH Authentication

Modified: trunk/installer/release/lang/French.lng
===================================================================
--- trunk/installer/release/lang/French.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/French.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -517,6 +517,7 @@
 DLG_ABOUT_COMP_NONE=aucun
 DLG_ABOUT_COMP_UPDOWN=D\xE9bit montant %s; D\xE9dit descendant %s
 DLG_ABOUT_AUTH_INFO=Utilisateur '%s', utilisant %s
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH Authentification

Modified: trunk/installer/release/lang/German.lng
===================================================================
--- trunk/installer/release/lang/German.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/German.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -516,6 +516,7 @@
 DLG_ABOUT_COMP_NONE=Keiner
 DLG_ABOUT_COMP_UPDOWN=Upstream %s; Downstream %s
 DLG_ABOUT_AUTH_INFO=Benutzer '%s' verwendet %s
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH-Authentifikation

Modified: trunk/installer/release/lang/Japanese.lng
===================================================================
--- trunk/installer/release/lang/Japanese.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/Japanese.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -515,6 +515,7 @@
 DLG_ABOUT_COMP_NONE=\x82Ȃ\xB5
 DLG_ABOUT_COMP_UPDOWN=\x83A\x83b\x83v\x83\x8D\x81[\x83h %s; \x83_\x83E\x83\x93\x83\x8D\x81[\x83h %s
 DLG_ABOUT_AUTH_INFO=\x83\x86\x81[\x83U\x81[ '%s', %s\x94F\x8F\xD8
+DLG_ABOUT_FINGERPRINT=\x83z\x83X\x83g\x8C\xAE\x82̎w\x96\xE4:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH\x94F\x8F\xD8

Modified: trunk/installer/release/lang/Korean.lng
===================================================================
--- trunk/installer/release/lang/Korean.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/Korean.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -517,6 +517,7 @@
 DLG_ABOUT_COMP_NONE=\xBE\xF8\xBD\xBF
 DLG_ABOUT_COMP_UPDOWN=\xBFø\xB2 %s; \xB3\xBB\xB8\xB2 %s
 DLG_ABOUT_AUTH_INFO=\xBB\xE7\xBF\xEB\xC0\xDA '%s', %s \xBB\xE7\xBF\xEB \xC1\xDF
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH \xC0\xCE\xC1\xF5

Modified: trunk/installer/release/lang/Russian.lng
===================================================================
--- trunk/installer/release/lang/Russian.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/Russian.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -516,6 +516,7 @@
 DLG_ABOUT_COMP_NONE=\xED\xE5\xF2
 DLG_ABOUT_COMP_UPDOWN=Upstream %s; Downstream %s
 DLG_ABOUT_AUTH_INFO=\xCF\xEE\xEB\xFC\xE7\xEE\xE2\xE0\xF2\xE5\xEB\xFC '%s', \xE8\xF1\xEF\xEE\xEB\xFC\xE7\xEE\xE2\xE0\xED\xEE %s
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=\xC0\xF3\xF2\xE5\xED\xF2\xE8\xF4\xE8\xEA\xE0\xF6\xE8\xFF SSH

Modified: trunk/installer/release/lang/Simplified Chinese.lng
===================================================================
--- trunk/installer/release/lang/Simplified Chinese.lng	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/installer/release/lang/Simplified Chinese.lng	2014-05-01 14:09:18 UTC (rev 5575)
@@ -517,6 +517,7 @@
 DLG_ABOUT_COMP_NONE=\xCE\xDE
 DLG_ABOUT_COMP_UPDOWN=\xC9ϴ\xAB %s; \xCF\xC2\xD4\xD8 %s
 DLG_ABOUT_AUTH_INFO=\xD3û\xA7 '%s'\xA3\xAC%s\xC8\xCF֤
+DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth
 DLG_AUTH_TITLE=SSH\xC8\xCF֤

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2014-05-01 14:09:18 UTC (rev 5575)
@@ -2346,6 +2346,7 @@
 	char buf[1024];
 	int a, b, c, d;
 	char uimsg[MAX_UIMSG];
+	char *fp = NULL;
 
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
 	UTIL_get_lang_msg("DLG_ABOUT_TITLE", pvar, uimsg);
@@ -2449,10 +2450,34 @@
 				UTIL_get_lang_msg("DLG_ABOUT_COMP", pvar, "Compression:");
 				append_about_text(dlg, pvar->ts->UIMsg, buf);
 			}
+
+			// \x83z\x83X\x83g\x8C\xF6\x8AJ\x8C\xAE\x82\xCCfingerprint\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9\x81B
+			// Random art\x82̕\\x8E\xA6\x82\xAA\x95\xF6\x82\xEA\x82Ă\xB5\x82܂\xA4\x82̂\xAA\x89ۑ\xE8\x81B
+			// (2014.5.1 yutaka)
+			fp = key_fingerprint(&pvar->hosts_state.hostkey, SSH_FP_HEX);
+			UTIL_get_lang_msg("DLG_ABOUT_FINGERPRINT", pvar, "Host key's fingerprint:");
+			append_about_text(dlg, pvar->ts->UIMsg, fp);
+			free(fp);
+
+			fp = key_fingerprint(&pvar->hosts_state.hostkey, SSH_FP_RANDOMART);
+			append_about_text(dlg, "", fp);
+			free(fp);
 		}
 	}
 }
 
+static WNDPROC g_defAboutDlgEditWndProc;
+
+static LRESULT CALLBACK AboutDlgEditWindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) 
+{
+	// Edit control\x8F\xE3\x82\xC5 CTRL+A \x82\xF0\x89\x9F\x89\xBA\x82\xB7\x82\xE9\x82ƁA\x83e\x83L\x83X\x83g\x82\xF0\x91S\x91I\x91\xF0\x82\xB7\x82\xE9\x81B
+	if (msg == WM_KEYDOWN && wp == 'A' && GetKeyState(VK_CONTROL) < 0) {
+		PostMessage(hWnd, EM_SETSEL, 0, -1);
+		return 0;
+    }
+    return CallWindowProc(g_defAboutDlgEditWndProc, hWnd, msg, wp, lp);
+}
+
 static BOOL CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam,
                                  LPARAM lParam)
 {
@@ -2495,7 +2520,12 @@
 
 		init_about_dlg((PTInstVar) lParam, dlg);
 		SetFocus(GetDlgItem(dlg, IDOK));
+
+		// Edit control\x82\xF0\x83T\x83u\x83N\x83\x89\x83X\x89\xBB\x82\xB7\x82\xE9\x81B
+		g_defAboutDlgEditWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(dlg, IDC_ABOUTTEXT), GWLP_WNDPROC, (LONG_PTR)AboutDlgEditWindowProc);
+
 		return FALSE;
+
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: trunk/ttssh2/ttxssh/ttxssh.rc
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.rc	2014-04-30 13:30:48 UTC (rev 5574)
+++ trunk/ttssh2/ttxssh/ttxssh.rc	2014-05-01 14:09:18 UTC (rev 5575)
@@ -87,7 +87,7 @@
     LTEXT           "Tera Term Project:     http://ttssh2.sourceforge.jp/",IDC_WEBSITES,6,99,248,13,SS_SUNKEN
     LTEXT           "THIS EXTENSION INCORPORATES STRONG CRYPTOGRAPHY. POSESSION, USE, AND/OR EXPORT OF THIS EXTENSION MAY BE ILLEGAL IN YOUR COUNTRY.",IDC_CRYPTOGRAPHY,6,116,248,26
     LTEXT           "This extension uses OpenSSH code by OpenBSD Project. Thanks also to Ian Goldberg for his Pilot SSH code, which was a very handy reference. Special thanks to Takashi Teranishi for his cooperation.",IDC_CREDIT,6,140,248,27
-    EDITTEXT        IDC_ABOUTTEXT,6,171,248,87,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY
+    EDITTEXT        IDC_ABOUTTEXT,6,171,248,87,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL
     DEFPUSHBUTTON   "OK",IDOK,106,263,50,14
 END
 
@@ -107,7 +107,8 @@
     CONTROL         "F&orward agent",IDC_FORWARD_AGENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,74,132,10
     CONTROL         "Use p&lain password to log in",IDC_SSHUSEPASSWORD,
                     "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,94,219,10
-    CONTROL         "Use &RSA/DSA/ECDSA/ED25519 key to log in",IDC_SSHUSERSA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,122,152,10
+    CONTROL         "Use &RSA/DSA/ECDSA/ED25519 key to log in",IDC_SSHUSERSA,
+                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,122,152,10
     CONTROL         "Use r&hosts to log in (SSH1)",IDC_SSHUSERHOSTS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,149,99,10
     CONTROL         "Use challenge/response to log in (SSH1:&TIS, SSH2:keyboard-interactive)",IDC_SSHUSETIS,
                     "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,193,276,10
@@ -252,7 +253,8 @@
     EDITTEXT        IDC_SSHUSERNAME,75,22,145,12,ES_AUTOHSCROLL
     CONTROL         "Use p&lain password to log in",IDC_SSHUSEPASSWORD,
                     "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,45,120,10
-    CONTROL         "Use &RSA/DSA/ECDSA/ED25519 key to log in",IDC_SSHUSERSA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,73,152,10
+    CONTROL         "Use &RSA/DSA/ECDSA/ED25519 key to log in",IDC_SSHUSERSA,
+                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,73,152,10
     CONTROL         "Use r&hosts to log in (SSH1)",IDC_SSHUSERHOSTS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,100,99,10
     CONTROL         "Use challenge/response to log in (SSH1:&TIS, SSH2:keyboard-interactive)",IDC_SSHUSETIS,
                     "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,144,278,10



Ttssh2-commit メーリングリストの案内