mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
empty passwords will no longer allow any password to pass DS HTTP auth
This commit is contained in:
parent
207c13c3c3
commit
8a8f971186
2 changed files with 6 additions and 5 deletions
|
@ -157,7 +157,8 @@
|
|||
"name": "http_password",
|
||||
"label": "HTTP Password",
|
||||
"type": "password",
|
||||
"help": "Password used for basic HTTP authentication. Leave this blank if you do not want to change it.",
|
||||
"help": "Password used for basic HTTP authentication. Leave this alone if you do not want to change it.",
|
||||
"default" : "password",
|
||||
"value-hidden": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -2114,10 +2114,10 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
|||
const QVariant* settingsPasswordVariant = valueForKeyPath(settingsMap, BASIC_AUTH_PASSWORD_KEY_PATH);
|
||||
|
||||
QString settingsPassword = settingsPasswordVariant ? settingsPasswordVariant->toString() : "";
|
||||
QString hexHeaderPassword = QCryptographicHash::hash(headerPassword.toUtf8(), QCryptographicHash::Sha256).toHex();
|
||||
|
||||
if (settingsUsername == headerUsername
|
||||
&& (settingsPassword.isEmpty() || hexHeaderPassword == settingsPassword)) {
|
||||
QString hexHeaderPassword = headerPassword.isEmpty() ?
|
||||
"" : QCryptographicHash::hash(headerPassword.toUtf8(), QCryptographicHash::Sha256).toHex();
|
||||
|
||||
if (settingsUsername == headerUsername && hexHeaderPassword == settingsPassword) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue