From: Attila Molnar Date: Tue, 11 Feb 2014 13:00:05 +0000 (+0100) Subject: m_sqlauth Allow the client certificate fingerprint to be used in the SQL query X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=87ce845b68a1a0314b3ce5dd61ee386f744b2f85;p=user%2Fhenk%2Fcode%2Finspircd.git m_sqlauth Allow the client certificate fingerprint to be used in the SQL query Idea by @m4z --- diff --git a/src/modules/m_sqlauth.cpp b/src/modules/m_sqlauth.cpp index 0c055a085..1ffb3305a 100644 --- a/src/modules/m_sqlauth.cpp +++ b/src/modules/m_sqlauth.cpp @@ -20,6 +20,7 @@ #include "inspircd.h" #include "modules/sql.h" #include "modules/hash.h" +#include "modules/ssl.h" enum AuthState { AUTH_STATE_NONE = 0, @@ -129,6 +130,9 @@ class ModuleSQLAuth : public Module if (sha256) userinfo["sha256pass"] = sha256->hexsum(user->password); + const std::string certfp = SSLClientCert::GetFingerprint(&user->eh); + userinfo["certfp"] = certfp; + SQL->submit(new AuthQuery(this, user->uuid, pendingExt, verbose), freeformquery, userinfo); return MOD_RES_PASSTHRU;