#include "inspircd.h"
#include "modules/sql.h"
#include "modules/hash.h"
+#include "modules/ssl.h"
enum AuthState {
AUTH_STATE_NONE = 0,
bool verbose;
public:
- ModuleSQLAuth() : pendingExt("sqlauth-wait", this), SQL(this, "SQL")
+ ModuleSQLAuth()
+ : pendingExt("sqlauth-wait", ExtensionItem::EXT_USER, this)
+ , SQL(this, "SQL")
{
}
HashProvider* md5 = ServerInstance->Modules->FindDataService<HashProvider>("hash/md5");
if (md5)
- userinfo["md5pass"] = md5->hexsum(user->password);
+ userinfo["md5pass"] = md5->Generate(user->password);
HashProvider* sha256 = ServerInstance->Modules->FindDataService<HashProvider>("hash/sha256");
if (sha256)
- userinfo["sha256pass"] = sha256->hexsum(user->password);
+ userinfo["sha256pass"] = sha256->Generate(user->password);
+
+ const std::string certfp = SSLClientCert::GetFingerprint(&user->eh);
+ userinfo["certfp"] = certfp;
SQL->submit(new AuthQuery(this, user->uuid, pendingExt, verbose), freeformquery, userinfo);