[Ttssh2-commit] [7048] 設定で SSH_MSG_USERAUTH_BANNER の表示方法を設定できるようにした

Back to archive index

scmno****@osdn***** scmno****@osdn*****
2018年 2月 21日 (水) 12:02:02 JST


Revision: 7048
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7048
Author:   doda
Date:     2018-02-21 12:02:02 +0900 (Wed, 21 Feb 2018)
Log Message:
-----------
設定で SSH_MSG_USERAUTH_BANNER の表示方法を設定できるようにした

[TTSSH]
; Authentication Banner
;  0 ... ignore
;  1 ... display in VT window
;  2 ... display by popup message box
;  3 ... display by balloon tip
AuthBanner=1

また、メッセージボックスでの表示にも対応した。

メッセージの表示されるタイミングが気に入らないけれど、対応が難しい……

Modified Paths:
--------------
    trunk/installer/release/TERATERM.INI
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.h

-------------- next part --------------
Modified: trunk/installer/release/TERATERM.INI
===================================================================
--- trunk/installer/release/TERATERM.INI	2018-02-21 03:01:58 UTC (rev 7047)
+++ trunk/installer/release/TERATERM.INI	2018-02-21 03:02:02 UTC (rev 7048)
@@ -901,6 +901,13 @@
 ; Verify host key by DNS (1=enabled 0=disabled)
 VerifyHostKeyDNS=0
 
+; Authentication Banner
+;  0 ... ignore
+;  1 ... display in VT window
+;  2 ... display by popup message box
+;  3 ... display by balloon tip
+AuthBanner=1
+
 ; SSH Icon
 SSHIcon=Default
 

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2018-02-21 03:01:58 UTC (rev 7047)
+++ trunk/ttssh2/ttxssh/ssh.c	2018-02-21 03:02:02 UTC (rev 7048)
@@ -6951,9 +6951,20 @@
 	}
 
 	if (msglen > 0) {
-		pvar->ssh_state.payload_datastart = 4;
-		pvar->ssh_state.payload_datalen = msglen;
-		NotifyInfoMessage(pvar->cv, buff, "Authentication Banner");
+		switch (pvar->settings.AuthBanner) {
+		case 0:
+			break;
+		case 1:
+			pvar->ssh_state.payload_datastart = 4;
+			pvar->ssh_state.payload_datalen = msglen;
+			break;
+		case 2:
+			MessageBox(pvar->cv->HWin, buff, "Authentication Banner", MB_OK | MB_ICONINFORMATION);
+			break;
+		case 3:
+			NotifyInfoMessage(pvar->cv, buff, "Authentication Banner");
+			break;
+		}
 		logprintf(LOG_LEVEL_NOTICE, "Banner len: %d, Banner message: %s.", msglen, buff);
 	}
 	else {

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2018-02-21 03:01:58 UTC (rev 7047)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2018-02-21 03:02:02 UTC (rev 7048)
@@ -542,6 +542,8 @@
 
 	settings->GexMinimalGroupSize = GetPrivateProfileInt("TTSSH", "GexMinimalGroupSize", 0, fileName);
 
+	settings->AuthBanner = GetPrivateProfileInt("TTSSH", "AuthBanner", 1, fileName);
+
 	clear_local_settings(pvar);
 }
 
@@ -665,6 +667,9 @@
 
 	_itoa_s(settings->GexMinimalGroupSize, buf, sizeof(buf), 10);
 	WritePrivateProfileString("TTSSH", "GexMinimalGroupSize", buf, fileName);
+
+	_itoa_s(settings->AuthBanner, buf, sizeof(buf), 10);
+	WritePrivateProfileString("TTSSH", "AuthBanner", buf, fileName);
 }
 
 

Modified: trunk/ttssh2/ttxssh/ttxssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.h	2018-02-21 03:01:58 UTC (rev 7047)
+++ trunk/ttssh2/ttxssh/ttxssh.h	2018-02-21 03:02:02 UTC (rev 7048)
@@ -192,6 +192,8 @@
 	int UpdateHostkeys;
 
 	int GexMinimalGroupSize;
+
+	int AuthBanner;
 } TS_SSH;
 
 typedef struct _TInstVar {



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