Skip to content

Commit

Permalink
API: Ensure that empty passwords w/ client_cn are properly checked
Browse files Browse the repository at this point in the history
fixes #11482
  • Loading branch information
Michael Friedrich committed Apr 4, 2016
1 parent 3715f30 commit d2f5008
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/remote/httpserverconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)

ApiUser::Ptr user;

/* client_cn matched. */
if (m_ApiUser)
user = m_ApiUser;
else {
user = ApiUser::GetByName(username);

if (user && user->GetPassword() != password)
/* Deny authentication if 1) given password is empty 2) configured password does not match. */
if (password.IsEmpty())
user.reset();
else if (user && user->GetPassword() != password)
user.reset();
}

Expand Down

0 comments on commit d2f5008

Please sign in to comment.