[ttssh2-commit] [10069] 関数名を他に合わせて変更した

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2022年 7月 18日 (月) 00:40:06 JST


Revision: 10069
          https://osdn.net/projects/ttssh2/scm/svn/commits/10069
Author:   doda
Date:     2022-07-18 00:40:06 +0900 (Mon, 18 Jul 2022)
Log Message:
-----------
関数名を他に合わせて変更した

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/hostkey.c
    trunk/ttssh2/ttxssh/hostkey.h
    trunk/ttssh2/ttxssh/key.c
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/hostkey.c
===================================================================
--- trunk/ttssh2/ttxssh/hostkey.c	2022-07-17 15:39:53 UTC (rev 10068)
+++ trunk/ttssh2/ttxssh/hostkey.c	2022-07-17 15:40:06 UTC (rev 10069)
@@ -113,7 +113,7 @@
 	return get_ssh2_hostkey_type_name(key->type);
 }
 
-char* get_ssh2_keyalgo_name(ssh_keyalgo algo)
+char* get_ssh2_hostkey_algorithm_name(ssh_keyalgo algo)
 {
 	const struct ssh2_host_key_t *ptr = ssh2_host_key;
 
@@ -128,7 +128,7 @@
 	return "ssh-unknown";
 }
 
-ssh_keyalgo get_ssh2_keyalgo_from_name(const char *name)
+ssh_keyalgo get_ssh2_hostkey_algorithm_from_name(const char *name)
 {
 	const struct ssh2_host_key_t *ptr = ssh2_host_key;
 
@@ -158,7 +158,7 @@
 	return NID_sha1;
 }
 
-ssh_keytype get_ssh2_keytype_from_keyalgo(ssh_keyalgo algo)
+ssh_keytype get_ssh2_hostkey_type_from_algorithm(ssh_keyalgo algo)
 {
 	const struct ssh2_host_key_t *ptr = ssh2_host_key;
 
@@ -173,9 +173,9 @@
 	return KEY_UNSPEC;
 }
 
-const char* get_ssh2_keytype_name_from_keyalgo(ssh_keyalgo algo)
+const char* get_ssh2_hostkey_type_name_from_algorithm(ssh_keyalgo algo)
 {
-	return get_ssh2_hostkey_type_name(get_ssh2_keytype_from_keyalgo(algo));
+	return get_ssh2_hostkey_type_name(get_ssh2_hostkey_type_from_algorithm(algo));
 }
 
 char* get_digest_algorithm_name(digest_algorithm id)
@@ -218,7 +218,7 @@
 
 	choose_SSH2_proposal(server_proposal, my_proposal, str_keytype, sizeof(str_keytype));
 
-	return get_ssh2_keyalgo_from_name(str_keytype);
+	return get_ssh2_hostkey_algorithm_from_name(str_keytype);
 }
 
 // Host Key\x83A\x83\x8B\x83S\x83\x8A\x83Y\x83\x80\x97D\x90揇\x88ʂɉ\x9E\x82\xB6\x82āAmyproposal[]\x82\xF0\x8F\x91\x82\xAB\x8A\xB7\x82\xA6\x82\xE9\x81B
@@ -239,7 +239,7 @@
 		index = pvar->settings.HostKeyOrder[i] - '0';
 		if (index == KEY_NONE) // disabled line
 			break;
-		strncat_s(buf, sizeof(buf), get_ssh2_keyalgo_name(index), _TRUNCATE);
+		strncat_s(buf, sizeof(buf), get_ssh2_hostkey_algorithm_name(index), _TRUNCATE);
 		strncat_s(buf, sizeof(buf), ",", _TRUNCATE);
 	}
 	len = strlen(buf);
@@ -267,7 +267,7 @@
 			}
 			else {
 				logprintf(LOG_LEVEL_VERBOSE, "%s: %s is selected.", __FUNCTION__, buff);
-				return get_ssh2_keyalgo_from_name(buff);
+				return get_ssh2_hostkey_algorithm_from_name(buff);
 			}
 		}
 	}

Modified: trunk/ttssh2/ttxssh/hostkey.h
===================================================================
--- trunk/ttssh2/ttxssh/hostkey.h	2022-07-17 15:39:53 UTC (rev 10068)
+++ trunk/ttssh2/ttxssh/hostkey.h	2022-07-17 15:40:06 UTC (rev 10069)
@@ -91,11 +91,11 @@
 ssh_keytype get_hostkey_type_from_name(char *name);
 char* get_ssh2_hostkey_type_name(ssh_keytype type);
 char *get_ssh2_hostkey_type_name_from_key(Key *key);
-ssh_keyalgo get_ssh2_keyalgo_from_name(const char *name);
-char* get_ssh2_keyalgo_name(ssh_keyalgo algo);
+ssh_keyalgo get_ssh2_hostkey_algorithm_from_name(const char *name);
+char* get_ssh2_hostkey_algorithm_name(ssh_keyalgo algo);
 int get_ssh2_key_hashtype(ssh_keyalgo algo);
-ssh_keytype get_ssh2_keytype_from_keyalgo(ssh_keyalgo algo);
-const char* get_ssh2_keytype_name_from_keyalgo(ssh_keyalgo algo);
+ssh_keytype get_ssh2_hostkey_type_from_algorithm(ssh_keyalgo algo);
+const char* get_ssh2_hostkey_type_name_from_algorithm(ssh_keyalgo algo);
 char* get_digest_algorithm_name(digest_algorithm id);
 
 void normalize_host_key_order(char *buf);

Modified: trunk/ttssh2/ttxssh/key.c
===================================================================
--- trunk/ttssh2/ttxssh/key.c	2022-07-17 15:39:53 UTC (rev 10068)
+++ trunk/ttssh2/ttxssh/key.c	2022-07-17 15:40:06 UTC (rev 10069)
@@ -340,7 +340,7 @@
 	}
 	//debug_print(41, signature, signaturelen);
 	ptr = signature;
-	algo_name = get_ssh2_keyalgo_name(keyalgo);
+	algo_name = get_ssh2_hostkey_algorithm_name(keyalgo);
 
 	// step1
 	len = get_uint32_MSBfirst(ptr);
@@ -1638,7 +1638,7 @@
 
 		}
 
-		s = get_ssh2_keyalgo_name(keyalgo);
+		s = get_ssh2_hostkey_algorithm_name(keyalgo);
 		buffer_put_string(msg, s, strlen(s));
 		buffer_append_length(msg, sig, slen);
 		len = buffer_len(msg);
@@ -2261,7 +2261,7 @@
 		if (index == KEY_ALGO_NONE) // disabled line
 			break;
 
-		if (key->type == get_ssh2_keytype_from_keyalgo(index))
+		if (key->type == get_ssh2_hostkey_type_from_algorithm(index))
 			return 1;
 	}
 

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2022-07-17 15:39:53 UTC (rev 10068)
+++ trunk/ttssh2/ttxssh/ssh.c	2022-07-17 15:40:06 UTC (rev 10069)
@@ -4974,7 +4974,7 @@
 		get_kex_algorithm_name(pvar->kex_type));
 
 	logprintf(LOG_LEVEL_VERBOSE, "server host key algorithm: %s",
-		get_ssh2_keyalgo_name(pvar->hostkey_type));
+		get_ssh2_hostkey_algorithm_name(pvar->hostkey_type));
 
 	logprintf(LOG_LEVEL_VERBOSE, "encryption algorithm client to server: %s",
 		get_cipher_string(pvar->ciphers[MODE_OUT]));
@@ -5602,12 +5602,12 @@
 	data += bloblen;
 
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_dh_kex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -5707,12 +5707,12 @@
 	}
 	data += bloblen;
 
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_dh_kex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -5873,12 +5873,12 @@
 	data += bloblen;
 
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_dh_gex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -5985,12 +5985,12 @@
 	data += bloblen;
 
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_dh_gex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -6152,12 +6152,12 @@
 	data += bloblen;
 
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_ecdh_kex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -6263,12 +6263,12 @@
 	data += bloblen;
 
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
-	if (hostkey->type != get_ssh2_keytype_from_keyalgo(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
+	if (hostkey->type != get_ssh2_hostkey_type_from_algorithm(pvar->hostkey_type)) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
 		            "%s: type mismatch for decoded server_host_key_blob (kex:%s(%s) blob:%s)",
 		            /*__FUNCTION__*/"handle_SSH2_ecdh_kex_reply",
-		            get_ssh2_keytype_name_from_keyalgo(pvar->hostkey_type),
-		            get_ssh2_keyalgo_name(pvar->hostkey_type),
+		            get_ssh2_hostkey_type_name_from_algorithm(pvar->hostkey_type),
+		            get_ssh2_hostkey_algorithm_name(pvar->hostkey_type),
 		            get_ssh2_hostkey_type_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -6728,7 +6728,7 @@
 		}
 
 		keyalgo = choose_SSH2_keysign_algorithm(pvar->server_sig_algs, keypair->type);
-		keyalgo_name = get_ssh2_keyalgo_name(keyalgo);
+		keyalgo_name = get_ssh2_hostkey_algorithm_name(keyalgo);
 
 		// step1
 		signbuf = buffer_init();

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2022-07-17 15:39:53 UTC (rev 10068)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2022-07-17 15:40:06 UTC (rev 10069)
@@ -1928,7 +1928,7 @@
 			UTIL_get_lang_msgU8("DLG_ABOUT_HOSTKEY", pvar, "Host Key:");
 			strncat_s(buf2, sizeof(buf2), pvar->ts->UIMsg, _TRUNCATE);
 			strncat_s(buf2, sizeof(buf2), " ", _TRUNCATE);
-			strncat_s(buf2, sizeof(buf2), get_ssh2_keyalgo_name(pvar->hostkey_type), _TRUNCATE);
+			strncat_s(buf2, sizeof(buf2), get_ssh2_hostkey_algorithm_name(pvar->hostkey_type), _TRUNCATE);
 			strncat_s(buf2, sizeof(buf2), "\r\n", _TRUNCATE);
 
 			UTIL_get_lang_msgU8("DLG_ABOUT_ENCRYPTION", pvar, "Encryption:");
@@ -2287,7 +2287,7 @@
 			                   L"<Host Keys below this line are disabled>", uimsg);
 			SendMessageW(hostkeyControl, LB_ADDSTRING, 0, (LPARAM)uimsg);
 		} else {
-			const char *name = get_ssh2_keyalgo_name(index);
+			const char *name = get_ssh2_hostkey_algorithm_name(index);
 			if (name != NULL) {
 				SendMessageA(hostkeyControl, LB_ADDSTRING, 0, (LPARAM) name);
 			}
@@ -2592,7 +2592,7 @@
 			SendMessage(cipherControl, LB_GETTEXT, i, (LPARAM) buf);
 			for (j = 0;
 				j <= KEY_ALGO_MAX
-				 && strcmp(buf, get_ssh2_keyalgo_name(j)) != 0; j++) {
+				 && strcmp(buf, get_ssh2_hostkey_algorithm_name(j)) != 0; j++) {
 			}
 			if (j <= KEY_ALGO_MAX) {
 				buf2[buf2index] = '0' + j;


ttssh2-commit メーリングリストの案内
Back to archive index