Try to explain to people that symmetric encryption works with keys (:D)

This commit is contained in:
Bram Matthys 2021-06-05 19:02:09 +02:00
parent 173af8c88c
commit 20c20b3053
No known key found for this signature in database
GPG key ID: BF8116B163EAAE98
2 changed files with 11 additions and 0 deletions
include
src

View file

@ -447,6 +447,7 @@ extern void Auth_FreeAuthConfig(AuthConfig *as);
extern int Auth_Check(Client *cptr, AuthConfig *as, char *para);
extern char *Auth_Hash(int type, char *para);
extern int Auth_CheckError(ConfigEntry *ce);
extern int Auth_AutoDetectHashType(char *hash);
extern void make_cloakedhost(Client *client, char *curr, char *buf, size_t buflen);
extern int channel_canjoin(Client *client, char *name);

View file

@ -10513,8 +10513,18 @@ int _test_secret(ConfigFile *conf, ConfigEntry *ce)
{
if (!strcmp(cep->ce_varname, "password"))
{
int n;
has_password = 1;
CheckNull(cep);
if (cep->ce_entries ||
(((n = Auth_AutoDetectHashType(cep->ce_vardata))) && ((n == AUTHTYPE_BCRYPT) || (n == AUTHTYPE_ARGON2))))
{
config_error("%s:%d: you cannot use hashed passwords here, see "
"https://www.unrealircd.org/docs/Secret_block#secret-plaintext",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
errors++;
continue;
}
if (!valid_secret_password(cep->ce_vardata, &err))
{
config_error("%s:%d: secret::password does not meet password complexity requirements: %s",