From 87ce845b68a1a0314b3ce5dd61ee386f744b2f85 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 11 Feb 2014 14:00:05 +0100 Subject: [PATCH] m_sqlauth Allow the client certificate fingerprint to be used in the SQL query Idea by @m4z --- src/modules/m_sqlauth.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.5