Tera Termの個人的な作業用リポジトリ
リビジョン | d370b734880cb161d644f7cb601a0919dc4148b9 (tree) |
---|---|
日時 | 2018-02-21 12:02:02 |
作者 | IWAMOTO Kouichi <sue@iwmt...> |
コミッター | IWAMOTO Kouichi |
設定で 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
また、メッセージボックスでの表示にも対応した。
メッセージの表示されるタイミングが気に入らないけれど、対応が難しい……
git-svn-id: svn+ssh://svn.osdn.net/svnroot/ttssh2/trunk@7048 f5f01b69-1e22-0410-acbf-894ab4bd6246
@@ -901,6 +901,13 @@ ForwardAgentNotify=1 | ||
901 | 901 | ; Verify host key by DNS (1=enabled 0=disabled) |
902 | 902 | VerifyHostKeyDNS=0 |
903 | 903 | |
904 | +; Authentication Banner | |
905 | +; 0 ... ignore | |
906 | +; 1 ... display in VT window | |
907 | +; 2 ... display by popup message box | |
908 | +; 3 ... display by balloon tip | |
909 | +AuthBanner=1 | |
910 | + | |
904 | 911 | ; SSH Icon |
905 | 912 | SSHIcon=Default |
906 | 913 |
@@ -6951,9 +6951,20 @@ static BOOL handle_SSH2_userauth_banner(PTInstVar pvar) | ||
6951 | 6951 | } |
6952 | 6952 | |
6953 | 6953 | if (msglen > 0) { |
6954 | - pvar->ssh_state.payload_datastart = 4; | |
6955 | - pvar->ssh_state.payload_datalen = msglen; | |
6956 | - NotifyInfoMessage(pvar->cv, buff, "Authentication Banner"); | |
6954 | + switch (pvar->settings.AuthBanner) { | |
6955 | + case 0: | |
6956 | + break; | |
6957 | + case 1: | |
6958 | + pvar->ssh_state.payload_datastart = 4; | |
6959 | + pvar->ssh_state.payload_datalen = msglen; | |
6960 | + break; | |
6961 | + case 2: | |
6962 | + MessageBox(pvar->cv->HWin, buff, "Authentication Banner", MB_OK | MB_ICONINFORMATION); | |
6963 | + break; | |
6964 | + case 3: | |
6965 | + NotifyInfoMessage(pvar->cv, buff, "Authentication Banner"); | |
6966 | + break; | |
6967 | + } | |
6957 | 6968 | logprintf(LOG_LEVEL_NOTICE, "Banner len: %d, Banner message: %s.", msglen, buff); |
6958 | 6969 | } |
6959 | 6970 | else { |
@@ -542,6 +542,8 @@ static void read_ssh_options(PTInstVar pvar, PCHAR fileName) | ||
542 | 542 | |
543 | 543 | settings->GexMinimalGroupSize = GetPrivateProfileInt("TTSSH", "GexMinimalGroupSize", 0, fileName); |
544 | 544 | |
545 | + settings->AuthBanner = GetPrivateProfileInt("TTSSH", "AuthBanner", 1, fileName); | |
546 | + | |
545 | 547 | clear_local_settings(pvar); |
546 | 548 | } |
547 | 549 |
@@ -665,6 +667,9 @@ static void write_ssh_options(PTInstVar pvar, PCHAR fileName, | ||
665 | 667 | |
666 | 668 | _itoa_s(settings->GexMinimalGroupSize, buf, sizeof(buf), 10); |
667 | 669 | WritePrivateProfileString("TTSSH", "GexMinimalGroupSize", buf, fileName); |
670 | + | |
671 | + _itoa_s(settings->AuthBanner, buf, sizeof(buf), 10); | |
672 | + WritePrivateProfileString("TTSSH", "AuthBanner", buf, fileName); | |
668 | 673 | } |
669 | 674 | |
670 | 675 |
@@ -192,6 +192,8 @@ typedef struct _TS_SSH { | ||
192 | 192 | int UpdateHostkeys; |
193 | 193 | |
194 | 194 | int GexMinimalGroupSize; |
195 | + | |
196 | + int AuthBanner; | |
195 | 197 | } TS_SSH; |
196 | 198 | |
197 | 199 | typedef struct _TInstVar { |