|
|
@@ -138,8 +138,8 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
|
|
|
#define CONF_ssh_cipherlist_MAX CIPHER_MAX
|
|
|
#define CONF_DEF_INT_NONE(KEY) conf_set_int(conf, KEY, 0);
|
|
|
#define CONF_DEF_STR_NONE(KEY) conf_set_str(conf, KEY, "");
|
|
|
- // noop, used only for these and we set the first three explicitly below and latter two are not used in our code
|
|
|
- #define CONF_DEF_INT_INT(KEY) DebugAssert((KEY == CONF_ssh_cipherlist) || (KEY == CONF_ssh_kexlist) || (KEY == CONF_ssh_gsslist) || (KEY == CONF_colours) || (KEY == CONF_wordness));
|
|
|
+ // noop, used only for these and we set the first four explicitly below and latter two are not used in our code
|
|
|
+ #define CONF_DEF_INT_INT(KEY) DebugAssert((KEY == CONF_ssh_cipherlist) || (KEY == CONF_ssh_kexlist) || (KEY == CONF_ssh_gsslist) || (KEY == CONF_ssh_hklist) || (KEY == CONF_colours) || (KEY == CONF_wordness));
|
|
|
// noop, used only for these three and they all can handle undef value
|
|
|
#define CONF_DEF_STR_STR(KEY) DebugAssert((KEY == CONF_ttymodes) || (KEY == CONF_portfwd) || (KEY == CONF_environmt) || (KEY == CONF_ssh_manual_hostkeys));
|
|
|
// noop, not used in our code
|
|
|
@@ -344,6 +344,14 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
|
|
|
conf_set_int_int(conf, CONF_ssh_gsslist, Index, gsslibkeywords[Index].v);
|
|
|
}
|
|
|
conf_set_int(conf, CONF_proxy_log_to_term, FORCE_OFF);
|
|
|
+
|
|
|
+ conf_set_int_int(conf, CONF_ssh_hklist, 0, HK_ED25519);
|
|
|
+ conf_set_int_int(conf, CONF_ssh_hklist, 1, HK_ECDSA);
|
|
|
+ conf_set_int_int(conf, CONF_ssh_hklist, 2, HK_RSA);
|
|
|
+ conf_set_int_int(conf, CONF_ssh_hklist, 3, HK_DSA);
|
|
|
+ conf_set_int_int(conf, CONF_ssh_hklist, 4, HK_WARN);
|
|
|
+ DebugAssert(HK_MAX == 5);
|
|
|
+
|
|
|
return conf;
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
@@ -2329,6 +2337,11 @@ void __fastcall TSecureShell::AskAlg(const UnicodeString AlgType,
|
|
|
Msg = FMTLOAD(KEX_BELOW_TRESHOLD, (AlgName));
|
|
|
Error = FMTLOAD(KEX_NOT_VERIFIED, (AlgName));
|
|
|
}
|
|
|
+ else if (AlgType == L"hostkey type")
|
|
|
+ {
|
|
|
+ // noop as we do not allow host key algorithm configuration,
|
|
|
+ // so no algorithm can get below WARN level
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
int CipherType;
|
|
|
@@ -2347,15 +2360,22 @@ void __fastcall TSecureShell::AskAlg(const UnicodeString AlgType,
|
|
|
else
|
|
|
{
|
|
|
DebugFail();
|
|
|
+ CipherType = 0;
|
|
|
}
|
|
|
|
|
|
- Msg = FMTLOAD(CIPHER_BELOW_TRESHOLD, (LoadStr(CipherType), AlgName));
|
|
|
- Error = FMTLOAD(CIPHER_NOT_VERIFIED, (AlgName));
|
|
|
+ if (CipherType != 0)
|
|
|
+ {
|
|
|
+ Msg = FMTLOAD(CIPHER_BELOW_TRESHOLD, (LoadStr(CipherType), AlgName));
|
|
|
+ Error = FMTLOAD(CIPHER_NOT_VERIFIED, (AlgName));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if (FUI->QueryUser(Msg, NULL, qaYes | qaNo, NULL, qtWarning) == qaNo)
|
|
|
+ if (!Msg.IsEmpty())
|
|
|
{
|
|
|
- FUI->FatalError(NULL, Error);
|
|
|
+ if (FUI->QueryUser(Msg, NULL, qaYes | qaNo, NULL, qtWarning) == qaNo)
|
|
|
+ {
|
|
|
+ FUI->FatalError(NULL, Error);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|