From ec6955f28ba9423828ac24ef83caee09ffa6b52c Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 26 Nov 2018 15:15:18 +0000 Subject: Fix detecting secure clients connecting through HAProxy/WEBIRC. --- src/modules/m_sqlauth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_sqlauth.cpp') diff --git a/src/modules/m_sqlauth.cpp b/src/modules/m_sqlauth.cpp index 5c3c5a84e..d2466f719 100644 --- a/src/modules/m_sqlauth.cpp +++ b/src/modules/m_sqlauth.cpp @@ -116,6 +116,7 @@ class ModuleSQLAuth : public Module { LocalIntExt pendingExt; dynamic_reference SQL; + UserCertificateAPI sslapi; std::string freeformquery; std::string killreason; @@ -129,6 +130,7 @@ class ModuleSQLAuth : public Module ModuleSQLAuth() : pendingExt("sqlauth-wait", ExtensionItem::EXT_USER, this) , SQL(this, "SQL") + , sslapi(this) { } @@ -179,6 +181,7 @@ class ModuleSQLAuth : public Module SQL::ParamMap userinfo; SQL::PopulateUserInfo(user, userinfo); userinfo["pass"] = user->password; + userinfo["certfp"] = sslapi ? sslapi->GetFingerprint(user) : ""; for (std::vector::const_iterator it = hash_algos.begin(); it != hash_algos.end(); ++it) { @@ -187,9 +190,6 @@ class ModuleSQLAuth : public Module userinfo[*it + "pass"] = hashprov->Generate(user->password); } - const std::string certfp = SSLClientCert::GetFingerprint(&user->eh); - userinfo["certfp"] = certfp; - SQL->Submit(new AuthQuery(this, user->uuid, pendingExt, verbose, kdf, pwcolumn), freeformquery, userinfo); return MOD_RES_PASSTHRU; -- cgit v1.3.1-10-gc9f91