[ttssh2-commit] [10387] 公開鍵認証(RSA鍵)の署名に使われるダイジェスト方式を About TTSSH ダイアログに表示するようにした

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
2022年 11月 27日 (日) 22:51:05 JST


Revision: 10387
          https://osdn.net/projects/ttssh2/scm/svn/commits/10387
Author:   nmaya
Date:     2022-11-27 22:51:05 +0900 (Sun, 27 Nov 2022)
Log Message:
-----------
公開鍵認証(RSA鍵)の署名に使われるダイジェスト方式を About TTSSH ダイアログに表示するようにした

Modified Paths:
--------------
    branches/4-stable/installer/release/lang/English.lng
    branches/4-stable/installer/release/lang/French.lng
    branches/4-stable/installer/release/lang/German.lng
    branches/4-stable/installer/release/lang/Japanese.lng
    branches/4-stable/installer/release/lang/Korean.lng
    branches/4-stable/installer/release/lang/Russian.lng
    branches/4-stable/installer/release/lang/Simplified Chinese.lng
    branches/4-stable/installer/release/lang/Traditional Chinese.lng
    branches/4-stable/ttssh2/ttxssh/auth.c
    branches/4-stable/ttssh2/ttxssh/hostkey.c
    branches/4-stable/ttssh2/ttxssh/hostkey.h

-------------- next part --------------
Modified: branches/4-stable/installer/release/lang/English.lng
===================================================================
--- branches/4-stable/installer/release/lang/English.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/English.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 
 [Tera Term]
 DLG_SYSTEM_FONT=System,14,0
@@ -583,7 +583,9 @@
 DLG_ABOUT_COMP_INFO2=level %d
 DLG_ABOUT_COMP_NONE=none
 DLG_ABOUT_COMP_UPDOWN=Upstream %s; Downstream %s
-DLG_ABOUT_AUTH_INFO=User '%s', using %s
+DLG_ABOUT_AUTH_INFO=User '%s', %s authentication
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/French.lng
===================================================================
--- branches/4-stable/installer/release/lang/French.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/French.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (French language) by Francois MOCQ (2010-07-21)
 
 [Tera Term]
@@ -584,7 +584,9 @@
 DLG_ABOUT_COMP_INFO2=niveau %d
 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_AUTH_INFO=Utilisateur '%s', %s authentication
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/German.lng
===================================================================
--- branches/4-stable/installer/release/lang/German.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/German.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (German language) by Frederik Schwarzer (2010-05-17)
 
 [Tera Term]
@@ -584,7 +584,9 @@
 DLG_ABOUT_COMP_INFO2=level %d
 DLG_ABOUT_COMP_NONE=Keiner
 DLG_ABOUT_COMP_UPDOWN=Upstream %s; Downstream %s
-DLG_ABOUT_AUTH_INFO=Benutzer '%s' verwendet %s
+DLG_ABOUT_AUTH_INFO=Benutzer '%s', %s authentication
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/Japanese.lng
===================================================================
--- branches/4-stable/installer/release/lang/Japanese.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/Japanese.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 
 [Tera Term]
 DLG_SYSTEM_FONT=\x82l\x82r \x82o\x83S\x83V\x83b\x83N,12,128
@@ -584,6 +584,8 @@
 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_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=\x83z\x83X\x83g\x8C\xAE\x82̎w\x96\xE4:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/Korean.lng
===================================================================
--- branches/4-stable/installer/release/lang/Korean.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/Korean.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (Korean language) by Daehong Kim (2013-07-25)
 
 [Tera Term]
@@ -584,7 +584,9 @@
 DLG_ABOUT_COMP_INFO2=\xBC\xF6\xC1\xD8 %d
 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_AUTH_INFO=\xBB\xE7\xBF\xEB\xC0\xDA '%s', %s authentication
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/Russian.lng
===================================================================
--- branches/4-stable/installer/release/lang/Russian.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/Russian.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (Russian language) by Ryumik Sergey (2017-07-19)
 
 [Tera Term]
@@ -584,7 +584,9 @@
 DLG_ABOUT_COMP_INFO2=\xF3\xF0\xEE\xE2\xE5\xED\xFC %d
 DLG_ABOUT_COMP_NONE=\xED\xE5\xF2
 DLG_ABOUT_COMP_UPDOWN=\xCD\xE0\xEF\xF0\xE0\xE2\xEB\xE5\xED\xE8\xE5 \xE2\xE2\xE5\xF0\xF5 %s; \xE2\xED\xE8\xE7 %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_AUTH_INFO=\xCF\xEE\xEB\xFC\xE7\xEE\xE2\xE0\xF2\xE5\xEB\xFC '%s', %s authentication
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=\xCE\xF2\xEF\xE5\xF7\xE0\xF2\xEE\xEA \xEA\xEB\xFE\xF7\xE0 \xF5\xEE\xF1\xF2\xE0:
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/Simplified Chinese.lng
===================================================================
--- branches/4-stable/installer/release/lang/Simplified Chinese.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/Simplified Chinese.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (Simplified Chinese language) by LiShaohui (2017-04-11)
 
 [Tera Term]
@@ -585,6 +585,8 @@
 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_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=\xD6\xF7\xBB\xFA\xC3\xDCԿָ\xCEƣ\xBA
 
 ; dlg auth

Modified: branches/4-stable/installer/release/lang/Traditional Chinese.lng
===================================================================
--- branches/4-stable/installer/release/lang/Traditional Chinese.lng	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/installer/release/lang/Traditional Chinese.lng	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-11-22)
+; Updated by TeraTerm Project (2022-11-27)
 ; Last translated (Traditional Chinese language) by kikiqqp (2014-09-20)
 
 [Tera Term]
@@ -585,6 +585,8 @@
 DLG_ABOUT_COMP_NONE=\xB5L
 DLG_ABOUT_COMP_UPDOWN=\xA4W\xB6\xC7 %s; \xA4U\xB8\xFC %s
 DLG_ABOUT_AUTH_INFO=\xA5Τ\xE1 '%s'\xA1A%s\xBB{\xC3\xD2
+DLG_ABOUT_AUTH_INFO2=, %s key
+DLG_ABOUT_AUTH_INFO3=, %s key with %s
 DLG_ABOUT_FINGERPRINT=Host key's fingerprint:
 
 ; dlg auth

Modified: branches/4-stable/ttssh2/ttxssh/auth.c
===================================================================
--- branches/4-stable/ttssh2/ttxssh/auth.c	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/ttssh2/ttxssh/auth.c	2022-11-27 13:51:05 UTC (rev 10387)
@@ -1761,22 +1761,25 @@
 		strncpy_s(dest, len, "None", _TRUNCATE);
 	} else if (pvar->auth_state.cur_cred.method != SSH_AUTH_NONE) {
 		if (SSHv1(pvar)) {
-			UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
+			UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', %s authentication");
 			_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg,
 			            pvar->auth_state.user,
 			            get_auth_method_name(pvar->auth_state.cur_cred.method));
 
 			if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, " with %s key");
+				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, ", %s key");
 				_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
 				            "RSA");
 				strncat_s(dest, len, buf, _TRUNCATE);
 			}
 			else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) {
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO3", pvar, " with %s key from Pageant");
+				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, ", %s key");
 				_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
 				            "RSA");
 				strncat_s(dest, len, buf, _TRUNCATE);
+
+				_snprintf_s(buf, sizeof(buf), _TRUNCATE, " (from Pageant)");
+				strncat_s(dest, len, buf, _TRUNCATE);
 			}
 		} else { 
 			// SSH2:\x94F\x8F؃\x81\x83\\x83b\x83h\x82̔\xBB\x95\xCA (2004.12.23 yutaka)
@@ -1789,28 +1792,45 @@
 				} else {
 					method = get_auth_method_name(pvar->auth_state.cur_cred.method);
 				}
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
+				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', %s authentication");
 				_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg,
 				            pvar->auth_state.user, method);
 			}
 			else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {
+				ssh_keyalgo pubkey_algo;
+				char *digest_name;
+
 				method = get_auth_method_name(pvar->auth_state.cur_cred.method);
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
+				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', %s authentication");
 				_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg,
 				            pvar->auth_state.user,
 				            get_auth_method_name(pvar->auth_state.cur_cred.method));
 
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, " with %s key");
-				_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
-				            ssh_key_type(pvar->auth_state.cur_cred.key_pair->type));
-				strncat_s(dest, len, buf, _TRUNCATE);
+				pubkey_algo = choose_SSH2_keysign_algorithm(pvar, pvar->auth_state.cur_cred.key_pair->type);
+				digest_name = get_ssh2_hostkey_algorithm_digest_name(pubkey_algo);
+				if (strlen(digest_name) == 0) {
+					UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, ", %s key");
+					_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
+					            ssh_key_type(pvar->auth_state.cur_cred.key_pair->type));
+					strncat_s(dest, len, buf, _TRUNCATE);
+				}
+				else {
+					UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO3", pvar, ", %s key with %s");
+					_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
+					            ssh_key_type(pvar->auth_state.cur_cred.key_pair->type),
+					            digest_name);
+					strncat_s(dest, len, buf, _TRUNCATE);
+				}
 			}
 			else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) {
 				int key_len = get_uint32_MSBfirst(pvar->pageant_curkey + 4);
 				char *s = (char *)malloc(key_len+1);
+				ssh_keytype keytype;
+				ssh_keyalgo pubkey_algo;
+				char *digest_name;
 
 				method = get_auth_method_name(pvar->auth_state.cur_cred.method);
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
+				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', %s authentication");
 				_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg,
 				            pvar->auth_state.user,
 				            get_auth_method_name(pvar->auth_state.cur_cred.method));
@@ -1817,9 +1837,24 @@
 
 				memcpy(s, pvar->pageant_curkey+4+4, key_len);
 				s[key_len] = '\0';
-				UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO3", pvar, " with %s key from Pageant");
-				_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
-				            ssh_key_type(get_hostkey_type_from_name(s)));
+				keytype = get_hostkey_type_from_name(s);
+				pubkey_algo = choose_SSH2_keysign_algorithm(pvar, keytype);
+				digest_name = get_ssh2_hostkey_algorithm_digest_name(pubkey_algo);
+				if (strlen(digest_name) == 0) {
+					UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO2", pvar, ", %s key");
+					_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
+					            ssh_key_type(get_hostkey_type_from_name(s)));
+					strncat_s(dest, len, buf, _TRUNCATE);
+				}
+				else {
+					UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO3", pvar, ", %s key with %s");
+					_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg,
+					            ssh_key_type(get_hostkey_type_from_name(s)),
+					            digest_name);
+					strncat_s(dest, len, buf, _TRUNCATE);
+				}
+
+				_snprintf_s(buf, sizeof(buf), _TRUNCATE, " (from Pageant)");
 				strncat_s(dest, len, buf, _TRUNCATE);
 
 				free(s);

Modified: branches/4-stable/ttssh2/ttxssh/hostkey.c
===================================================================
--- branches/4-stable/ttssh2/ttxssh/hostkey.c	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/ttssh2/ttxssh/hostkey.c	2022-11-27 13:51:05 UTC (rev 10387)
@@ -345,3 +345,19 @@
 
 	normalize_generic_order(buf, default_strings, NUM_ELEM(default_strings));
 }
+
+/*
+ * ssh_keyalgo \x82\xA9\x82\xE7\x81A\x8C\xAE\x82ɑ΂\xB5\x82ĕW\x8F\x80\x82ł͂Ȃ\xA2\x83_\x83C\x83W\x83F\x83X\x83g\x95\x{33AE5BC}\x82\xF0\x95Ԃ\xB7
+ *   \x8D\xA1\x82̂Ƃ\xB1\x82\xEB rsa-sha2-256, rsa-sha2-512 \x82̂Ƃ\xAB\x82\xBE\x82\xAF "SHA-256", "SHA-512" \x82\xF0\x95Ԃ\xB7
+ *   About \x83_\x83C\x83A\x83\x8D\x83O\x82ŁA\x94\xF1\x95W\x8F\x80\x82̃_\x83C\x83W\x83F\x83X\x83g\x95\xFB\x8E\xAE\x82̂Ƃ\xAB\x82\xBE\x82\xAF\x95\\x8E\xA6\x82\xB7\x82邽\x82\xDF
+ */
+char* get_ssh2_hostkey_algorithm_digest_name(ssh_keyalgo algo)
+{
+	switch (algo) {
+		case KEY_ALGO_RSASHA256:
+			return "SHA-256";
+		case KEY_ALGO_RSASHA512:
+			return "SHA-512";
+	}
+	return "";
+}

Modified: branches/4-stable/ttssh2/ttxssh/hostkey.h
===================================================================
--- branches/4-stable/ttssh2/ttxssh/hostkey.h	2022-11-27 13:50:38 UTC (rev 10386)
+++ branches/4-stable/ttssh2/ttxssh/hostkey.h	2022-11-27 13:51:05 UTC (rev 10387)
@@ -118,5 +118,6 @@
 ssh_keyalgo choose_SSH2_host_key_algorithm(char *server_proposal, char *my_proposal);
 ssh_keyalgo choose_SSH2_keysign_algorithm(PTInstVar pvar, ssh_keytype keytype);
 void SSH2_update_host_key_myproposal(PTInstVar pvar);
+char* get_ssh2_hostkey_algorithm_digest_name(ssh_keyalgo algo);
 
 #endif /* SSHCMAC_H */


ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る