• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Tera Termの個人的な作業用リポジトリ


コミットメタ情報

リビジョン06ab4e9e01afcc92563c5c9d3a913ccf7f1a5227 (tree)
日時2022-09-06 23:12:11
作者IWAMOTO Kouichi <sue@iwmt...>
コミッターIWAMOTO Kouichi

ログメッセージ

Debugビルド時のみKexKeyLoggingが有効になるように変更した

変更サマリ

差分

--- a/ttssh2/ttxssh/ssh.c
+++ b/ttssh2/ttxssh/ssh.c
@@ -64,7 +64,9 @@
6464
6565 #include <direct.h>
6666 #include <io.h>
67+#ifdef _DEBUG // KEX logging
6768 #include <fcntl.h>
69+#endif
6870
6971 // SSH2 macro
7072 #ifdef _DEBUG
@@ -648,6 +650,7 @@ void push_bignum_memdump(char *name, char *desc, BIGNUM *bignum)
648650
649651 void log_kex_key(PTInstVar pvar, const BIGNUM *secret)
650652 {
653+#ifdef _DEBUG // KEX logging
651654 int fd, i;
652655 unsigned char buff[4], *cookie;
653656 char *hexstr;
@@ -673,6 +676,7 @@ void log_kex_key(PTInstVar pvar, const BIGNUM *secret)
673676 }
674677 OPENSSL_free(hexstr);
675678 }
679+#endif
676680 }
677681
678682 static unsigned int get_predecryption_amount(PTInstVar pvar)
@@ -5334,7 +5338,6 @@ static BOOL handle_SSH2_dh_gex_group(PTInstVar pvar)
53345338
53355339 // 秘密にすべき乱数(X)を生成
53365340 dh_gen_key(pvar, dh, pvar->we_need);
5337-
53385341 log_kex_key(pvar, dh->priv_key);
53395342
53405343 // 公開鍵をサーバへ送信
@@ -5413,7 +5416,6 @@ static void SSH2_ecdh_kex_init(PTInstVar pvar)
54135416 goto error;
54145417 }
54155418 group = EC_KEY_get0_group(client_key);
5416-
54175419 log_kex_key(pvar, EC_KEY_get0_private_key(client_key));
54185420
54195421 msg = buffer_init();
--- a/ttssh2/ttxssh/ttxssh.c
+++ b/ttssh2/ttxssh/ttxssh.c
@@ -373,6 +373,7 @@ static void read_ssh_options(PTInstVar pvar, const wchar_t *fileName)
373373
374374 settings->AuthBanner = GetPrivateProfileInt("TTSSH", "AuthBanner", 1, fileName);
375375
376+#ifdef _DEBUG
376377 read_string_option(fileName, "KexKeyLogFile", "", settings->KexKeyLogFile, sizeof(settings->KexKeyLogFile));
377378 if (settings->KexKeyLogFile[0] == 0) {
378379 settings->KexKeyLogging = 0;
@@ -380,6 +381,10 @@ static void read_ssh_options(PTInstVar pvar, const wchar_t *fileName)
380381 else {
381382 settings->KexKeyLogging = GetPrivateProfileInt("TTSSH", "KexKeyLogging", 0, fileName);
382383 }
384+#else
385+ settings->KexKeyLogFile[0] = 0;
386+ settings->KexKeyLogging = 0;
387+#endif
383388
384389 clear_local_settings(pvar);
385390 }
@@ -513,9 +518,11 @@ static void write_ssh_options(PTInstVar pvar, const wchar_t *fileName,
513518 _itoa_s(settings->AuthBanner, buf, sizeof(buf), 10);
514519 WritePrivateProfileString("TTSSH", "AuthBanner", buf, fileName);
515520
521+#ifdef _DEBUG
516522 WritePrivateProfileString("TTSSH", "KexKeyLogFile", settings->KexKeyLogFile, fileName);
517523 WritePrivateProfileString("TTSSH", "KexKeyLogging",
518524 settings->KexKeyLogging ? "1" : "0", fileName);
525+#endif
519526 }
520527
521528