]> git.ipfire.org Git - thirdparty/squid.git/blame - src/auth/digest/Scheme.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / auth / digest / Scheme.cc
CommitLineData
f5691f9c 1/*
5b74111a 2 * Copyright (C) 1996-2018 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
FC
12#include "Debug.h"
13#include "globals.h"
5817ee13 14#include "helper.h"
f5691f9c 15
c6cf8dee 16Auth::Scheme::Pointer Auth::Digest::Scheme::_instance = NULL;
d6374be6 17
c6cf8dee 18Auth::Scheme::Pointer
d6374be6 19Auth::Digest::Scheme::GetInstance()
f5691f9c 20{
5817ee13 21 if (_instance == NULL) {
d6374be6 22 _instance = new Auth::Digest::Scheme();
5817ee13
AJ
23 AddScheme(_instance);
24 }
25 return _instance;
f5691f9c 26}
27
28char const *
d6374be6 29Auth::Digest::Scheme::type() const
f5691f9c 30{
31 return "digest";
32}
33
d6374be6 34void
c6cf8dee 35Auth::Digest::Scheme::shutdownCleanup()
d6374be6
AJ
36{
37 if (_instance == NULL)
38 return;
39
d6374be6
AJ
40 authenticateDigestNonceShutdown();
41
42 _instance = NULL;
43 debugs(29, DBG_CRITICAL, "Shutdown: Digest authentication.");
44}
5817ee13 45
dc79fed8 46Auth::SchemeConfig *
d6374be6 47Auth::Digest::Scheme::createConfig()
5817ee13 48{
372fccd6 49 Auth::Digest::Config *digestCfg = new Auth::Digest::Config;
dc79fed8 50 return dynamic_cast<Auth::SchemeConfig*>(digestCfg);
5817ee13 51}
7512e3f9 52