aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/digestauth.h
blob: e8844f2725ceebca0e9df18a44abbac259a69184 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
     This file is part of libmicrohttpd
     Copyright (C) 2010, 2011, 2012, 2015, 2018 Daniel Pittman and Christian Grothoff
     Copyright (C) 2014-2022 Evgeny Grin (Karlson2k)

     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
     version 2.1 of the License, or (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
/**
 * @file digestauth.c
 * @brief Implements HTTP digest authentication
 * @author Amr Ali
 * @author Matthieu Speder
 * @author Christian Grothoff (RFC 7616 support)
 * @author Karlson2k (Evgeny Grin)
 */

#ifndef MHD_DIGESTAUTH_H
#define MHD_DIGESTAUTH_H 1

#include "mhd_options.h"
#include "mhd_str.h"
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif /* HAVE_STDBOOL_H */


/**
 * The maximum supported size for Digest Auth parameters, like "real",
 * "username" etc. This limitation is used only for quoted parameters.
 * Parameters without quoted backslash character will be processed as long
 * as they fit connection pool (buffer) size.
 */
#define _MHD_AUTH_DIGEST_MAX_PARAM_SIZE (65535)

/**
 * Beginning string for any valid Digest Authentication header.
 */
#define _MHD_AUTH_DIGEST_BASE   "Digest"

/**
 * The token for MD5 algorithm.
 */
#define _MHD_MD5_TOKEN "MD5"

/**
 * The token for SHA-256 algorithm.
 */
#define _MHD_SHA256_TOKEN "SHA-256"

/**
 * The token for SHA-512/256 algorithm.
 * Unsupported currently by MHD for authentication.
 */
#define _MHD_SHA512_256_TOKEN "SHA-512-256"

/**
 * The suffix token for "session" algorithms.
 */
#define _MHD_SESS_TOKEN "-sess"

/**
 * The "auth" token for QOP
 */
#define MHD_TOKEN_AUTH_ "auth"

/**
 * The "auth-int" token for QOP
 */
#define MHD_TOKEN_AUTH_INT_ "auth-int"

#endif /* ! MHD_DIGESTAUTH_H */

/* end of digestauth.h */