Relax auth parameter sanitation
Since more authentication modes have been added, it's no longer a requirement to have key files set.detached-mode
parent
b4c234b3fa
commit
6470dfef5f
15
src/main.c
15
src/main.c
|
@ -1017,18 +1017,14 @@ int check_cfg_sanity(struct cfg* cfg)
|
||||||
|
|
||||||
if (!nvnc_has_auth()) {
|
if (!nvnc_has_auth()) {
|
||||||
nvnc_log(NVNC_LOG_ERROR, "Authentication can't be enabled because it was not selected during build");
|
nvnc_log(NVNC_LOG_ERROR, "Authentication can't be enabled because it was not selected during build");
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cfg->certificate_file && !cfg->rsa_private_key_file) {
|
|
||||||
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing certificate_file");
|
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cfg->private_key_file && !cfg->rsa_private_key_file) {
|
if (!!cfg->certificate_file != !!cfg->private_key_file) {
|
||||||
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing private_key_file");
|
nvnc_log(NVNC_LOG_ERROR, "Need both certificate_file and private_key_file for TLS");
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cfg->username && !cfg->enable_pam) {
|
if (!cfg->username && !cfg->enable_pam) {
|
||||||
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing username");
|
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing username");
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
@ -1038,6 +1034,11 @@ int check_cfg_sanity(struct cfg* cfg)
|
||||||
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing password");
|
nvnc_log(NVNC_LOG_ERROR, "Authentication enabled, but missing password");
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg->relax_encryption) {
|
||||||
|
nvnc_log(NVNC_LOG_WARNING, "Authentication enabled with relaxed encryption; not all sessions are guaranteed to be encrypted");
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue