]> git.ipfire.org Git - thirdparty/squid.git/blame - src/auth/digest/Scheme.cc
Source Format Enforcement (#963)
[thirdparty/squid.git] / src / auth / digest / Scheme.cc
CommitLineData
f5691f9c 1/*
bf95c10a 2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
f5691f9c 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
f5691f9c 7 */
8
f7f3304a 9#include "squid.h"
12daeef6 10#include "auth/digest/Config.h"
616cfc4c 11#include "auth/digest/Scheme.h"
582c2af2 12#include "Debug.h"
c59baaa8 13#include "DebugMessages.h"
582c2af2 14#include "globals.h"
5817ee13 15#include "helper.h"
f5691f9c 16
c6cf8dee 17Auth::Scheme::Pointer Auth::Digest::Scheme::_instance = NULL;
d6374be6 18
c6cf8dee 19Auth::Scheme::Pointer
d6374be6 20Auth::Digest::Scheme::GetInstance()
f5691f9c 21{
5817ee13 22 if (_instance == NULL) {
d6374be6 23 _instance = new Auth::Digest::Scheme();
5817ee13
AJ
24 AddScheme(_instance);
25 }
26 return _instance;
f5691f9c 27}
28
29char const *
d6374be6 30Auth::Digest::Scheme::type() const
f5691f9c 31{
32 return "digest";
33}
34
d6374be6 35void
c6cf8dee 36Auth::Digest::Scheme::shutdownCleanup()
d6374be6
AJ
37{
38 if (_instance == NULL)
39 return;
40
d6374be6
AJ
41 authenticateDigestNonceShutdown();
42
43 _instance = NULL;
c59baaa8 44 debugs(29, Critical(59), "Shutdown: Digest authentication.");
d6374be6 45}
5817ee13 46
dc79fed8 47Auth::SchemeConfig *
d6374be6 48Auth::Digest::Scheme::createConfig()
5817ee13 49{
372fccd6 50 Auth::Digest::Config *digestCfg = new Auth::Digest::Config;
dc79fed8 51 return dynamic_cast<Auth::SchemeConfig*>(digestCfg);
5817ee13 52}
7512e3f9 53