[ttssh2-commit] [10949] 最初の KEX のときには "ext-info-c" を送信するが、Rekey のときには送信しないようにした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 9月 29日 (金) 17:35:23 JST


Revision: 10949
          https://osdn.net/projects/ttssh2/scm/svn/commits/10949
Author:   nmaya
Date:     2023-09-29 17:35:23 +0900 (Fri, 29 Sep 2023)
Log Message:
-----------
最初の KEX のときには "ext-info-c" を送信するが、Rekey のときには送信しないようにした

ticket: #36111

Ticket Links:
------------
    https://osdn.net/projects/ttssh2/tracker/detail/36111

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/cipher.c
    trunk/ttssh2/ttxssh/comp.c
    trunk/ttssh2/ttxssh/hostkey.c
    trunk/ttssh2/ttxssh/kex.c
    trunk/ttssh2/ttxssh/mac.c
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/cipher.c
===================================================================
--- trunk/ttssh2/ttxssh/cipher.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/cipher.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -385,7 +385,8 @@
 	int len, i;
 	char *c_str;
 
-	// \x92ʐM\x92\x86\x82ɂ͌Ă΂\xEA\x82Ȃ\xA2\x82͂\xB8\x82\xBE\x82\xAA\x81A\x94O\x82̂\xBD\x82߁B(2006.6.26 maya)
+	// \x92ʐM\x92\x86\x82ɌĂ΂\xEA\x82\xE9\x82Ƃ\xA2\x82\xA4\x82\xB1\x82Ƃ̓L\x81[\x8Dč쐬
+	// \x83L\x81[\x8Dč쐬\x82̏ꍇ\x82͉\xBD\x82\xE0\x82\xB5\x82Ȃ\xA2
 	if (pvar->socket != INVALID_SOCKET) {
 		return;
 	}

Modified: trunk/ttssh2/ttxssh/comp.c
===================================================================
--- trunk/ttssh2/ttxssh/comp.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/comp.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -96,7 +96,8 @@
 	int index;
 	int len, i;
 
-	// \x92ʐM\x92\x86\x82ɂ͌Ă΂\xEA\x82Ȃ\xA2\x82͂\xB8\x82\xBE\x82\xAA\x81A\x94O\x82̂\xBD\x82߁B(2006.6.26 maya)
+	// \x92ʐM\x92\x86\x82ɌĂ΂\xEA\x82\xE9\x82Ƃ\xA2\x82\xA4\x82\xB1\x82Ƃ̓L\x81[\x8Dč쐬
+	// \x83L\x81[\x8Dč쐬\x82̏ꍇ\x82͉\xBD\x82\xE0\x82\xB5\x82Ȃ\xA2
 	if (pvar->socket != INVALID_SOCKET) {
 		return;
 	}

Modified: trunk/ttssh2/ttxssh/hostkey.c
===================================================================
--- trunk/ttssh2/ttxssh/hostkey.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/hostkey.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -244,8 +244,9 @@
 	static char buf[256]; // TODO: malloc()\x82ɂ\xB7\x82ׂ\xAB
 	int index;
 	int len, i;
-
-	// \x92ʐM\x92\x86\x82ɂ͌Ă΂\xEA\x82Ȃ\xA2\x82͂\xB8\x82\xBE\x82\xAA\x81A\x94O\x82̂\xBD\x82߁B(2006.6.26 maya)
+
+	// \x92ʐM\x92\x86\x82ɌĂ΂\xEA\x82\xE9\x82Ƃ\xA2\x82\xA4\x82\xB1\x82Ƃ̓L\x81[\x8Dč쐬
+	// \x83L\x81[\x8Dč쐬\x82̏ꍇ\x82͉\xBD\x82\xE0\x82\xB5\x82Ȃ\xA2
 	if (pvar->socket != INVALID_SOCKET) {
 		return;
 	}

Modified: trunk/ttssh2/ttxssh/kex.c
===================================================================
--- trunk/ttssh2/ttxssh/kex.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/kex.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -140,8 +140,18 @@
 	int index;
 	int i;
 
-	// \x92ʐM\x92\x86\x82ɂ͌Ă΂\xEA\x82Ȃ\xA2\x82͂\xB8\x82\xBE\x82\xAA\x81A\x94O\x82̂\xBD\x82߁B(2006.6.26 maya)
+	// \x92ʐM\x92\x86\x82ɌĂ΂\xEA\x82\xE9\x82Ƃ\xA2\x82\xA4\x82\xB1\x82Ƃ̓L\x81[\x8Dč쐬
 	if (pvar->socket != INVALID_SOCKET) {
+		if (pvar->kex_status & KEX_FLAG_REKEYING) {
+			// \x83L\x81[\x8Dč쐬\x82̏ꍇ\x82ɂ́A\x82\xB7\x82łɑg\x82ݗ\xA7\x82Ă\xE7\x82\xEA\x82Ă\xA2\x82\xE9 myproposal \x82\xF0\x8F\x91\x82\xAB\x8A\xB7\x82\xA6\x82\xE9
+			//   pvar->settings \x82\xE0 pvar->session_settings \x82\xE0\x81A
+			//   \x90ڑ\xB1\x8E\x9E\x82\xC9 myproposal \x82\xF0\x8D쐬\x82\xB5\x82\xBD\x90ݒ\xE8\x92l\x82\xA9\x82\xE7\x95ς\xED\x82\xC1\x82Ă\xA2\x82Ȃ\xA2\x95ۏ؂\xAA\x82Ȃ\xA2\x81B
+			//   \x8Dēx\x91g\x82ݗ\xA7\x82Ă\xE9\x82̂ł͂Ȃ\xAD\x8A\xF9\x91\xB6\x82\xCC myproposal \x82\xF0\x8F\x91\x82\xAB\x8A\xB7\x82\xA6\x82邱\x82Ƃɂ\xB5\x82\xBD\x81B
+			int pos = strlen(myproposal[PROPOSAL_KEX_ALGS]) - strlen(",ext-info-c");
+			if (strcmp(myproposal[PROPOSAL_KEX_ALGS] + pos, ",ext-info-c") == 0) {
+				myproposal[PROPOSAL_KEX_ALGS][pos] = '\0';
+			}
+		}
 		return;
 	}
 
@@ -153,7 +163,10 @@
 		strncat_s(buf, sizeof(buf), get_kex_algorithm_name(index), _TRUNCATE);
 		strncat_s(buf, sizeof(buf), ",", _TRUNCATE);
 	}
+
+	// RFC 8308 Extension Negotiation
 	strncat_s(buf, sizeof(buf), "ext-info-c", _TRUNCATE);
+
 	myproposal[PROPOSAL_KEX_ALGS] = buf; 
 }
 

Modified: trunk/ttssh2/ttxssh/mac.c
===================================================================
--- trunk/ttssh2/ttxssh/mac.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/mac.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -169,8 +169,9 @@
 	static char buf[256]; // TODO: malloc()\x82ɂ\xB7\x82ׂ\xAB
 	int index;
 	int len, i;
-
-	// \x92ʐM\x92\x86\x82ɂ͌Ă΂\xEA\x82Ȃ\xA2\x82͂\xB8\x82\xBE\x82\xAA\x81A\x94O\x82̂\xBD\x82߁B(2006.6.26 maya)
+
+	// \x92ʐM\x92\x86\x82ɌĂ΂\xEA\x82\xE9\x82Ƃ\xA2\x82\xA4\x82\xB1\x82Ƃ̓L\x81[\x8Dč쐬
+	// \x83L\x81[\x8Dč쐬\x82̏ꍇ\x82͉\xBD\x82\xE0\x82\xB5\x82Ȃ\xA2
 	if (pvar->socket != INVALID_SOCKET) {
 		return;
 	}

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/ssh.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -4780,6 +4780,10 @@
 	if (pvar->kex_status == KEX_FLAG_KEXDONE) {
 		pvar->kex_status = KEX_FLAG_REKEYING;
 
+		// \x83L\x81[\x8Dč쐬\x8E\x9E\x82\xCD myproposal \x82\xA9\x82\xE7 ",ext-info-c" \x82\xF0\x8D폜\x82\xB7\x82\xE9
+		// \x8DX\x90V\x82\xB7\x82\xE9\x82̂\xCD KEX \x82݂̂ł悢
+		SSH2_update_kex_myproposal(pvar);
+
 		// \x83T\x81[\x83o\x82\xD6SSH2_MSG_KEXINIT \x82𑗂\xE9
 		SSH2_send_kexinit(pvar);
 	}

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2023-09-26 14:52:52 UTC (rev 10948)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2023-09-29 08:35:23 UTC (rev 10949)
@@ -979,7 +979,9 @@
 		HOSTS_open(pvar);
 		FWDUI_open(pvar);
 
-		// \x90ݒ\xE8\x82\xF0 myproposal \x82ɔ\xBD\x89f\x82\xB7\x82\xE9\x82̂́A\x90ڑ\xB1\x92\xBC\x91O\x82̂\xB1\x82\xB1\x82\xBE\x82\xAF\x81B
+		// \x90ڑ\xB1\x92\xBC\x91O\x82̂\xB1\x82\xB1\x82ŁA\x90ݒ\xE8\x82\xF0 myproposal \x82ɔ\xBD\x89f\x82\xB5\x82Ă\xA2\x82\xE9
+		//   \x83L\x81[\x8Dč쐬\x82̂Ƃ\xAB\x82́A\x93\xAF\x82\xB6 SSH2_update_kex_myproposal() \x82\xF0\x8CĂяo\x82\xB5\x82\xC4
+		//   myproposal \x82\xA9\x82\xE7 ",ext-info-c" \x82\xF0\x8D폜\x82\xB5\x82Ă\xA2\x82\xE9
 		SSH2_update_kex_myproposal(pvar);
 		SSH2_update_host_key_myproposal(pvar);
 		SSH2_update_cipher_myproposal(pvar);


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