summaryrefslogtreecommitdiff
path: root/distfoldd/agent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'distfoldd/agent.cc')
-rw-r--r--distfoldd/agent.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/distfoldd/agent.cc b/distfoldd/agent.cc
index 8baa85b..1087889 100644
--- a/distfoldd/agent.cc
+++ b/distfoldd/agent.cc
@@ -175,9 +175,12 @@ QByteArray Agent::generateChallenge()
return QCA::Random::randomArray(challenge_size).toByteArray();
}
-QByteArray Agent::generateChallengeResponse(const QByteArray& server_challenge, const QByteArray& client_challenge)
+QByteArray Agent::generateChallengeResponse(const QByteArray& server_challenge, const QByteArray& client_challenge, const QSslCertificate& server_cert, const QSslCertificate& client_cert)
{
- return hmacSha1(_passwd.toUtf8(), server_challenge + client_challenge);
+ QByteArray server_digest = server_cert.digest(QCryptographicHash::Sha1);
+ QByteArray client_digest = client_cert.digest(QCryptographicHash::Sha1);
+ return hmacSha1(_passwd.toUtf8(), server_challenge + server_digest +
+ client_challenge + client_digest);
}
QByteArray Agent::encodeAuthReply(AuthResult result)