gsasl  2.2.1
scram/mechinfo.c
Go to the documentation of this file.
1 /* mechinfo.c --- Definition of SCRAM mechanism.
2  * Copyright (C) 2009-2024 Simon Josefsson
3  *
4  * This file is part of GNU SASL Library.
5  *
6  * GNU SASL Library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * GNU SASL Library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with GNU SASL Library; if not, write to the Free
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include <config.h>
24 
25 /* Get specification. */
26 #include "scram.h"
27 
28 #ifdef USE_SCRAM_SHA1
29 Gsasl_mechanism _gsasl_scram_sha1_mechanism = {
30  GSASL_SCRAM_SHA1_NAME,
31  {
32  NULL,
33  NULL,
34 # ifdef USE_CLIENT
35  _gsasl_scram_sha1_client_start,
38 # else
39  NULL,
40  NULL,
41  NULL,
42 # endif
43  NULL,
44  NULL}
45  ,
46  {
47  NULL,
48  NULL,
49 # ifdef USE_SERVER
50  _gsasl_scram_sha1_server_start,
53 # else
54  NULL,
55  NULL,
56  NULL,
57 # endif
58  NULL,
59  NULL}
60 };
61 #endif
62 
63 
64 #ifdef USE_SCRAM_SHA1
65 Gsasl_mechanism _gsasl_scram_sha1_plus_mechanism = {
66  GSASL_SCRAM_SHA1_PLUS_NAME,
67  {
68  NULL,
69  NULL,
70 # ifdef USE_CLIENT
71  _gsasl_scram_sha1_plus_client_start,
74 # else
75  NULL,
76  NULL,
77  NULL,
78 # endif
79  NULL,
80  NULL}
81  ,
82  {
83  NULL,
84  NULL,
85 # ifdef USE_SERVER
86  _gsasl_scram_sha1_plus_server_start,
89 # else
90  NULL,
91  NULL,
92  NULL,
93 # endif
94  NULL,
95  NULL}
96 };
97 #endif
98 
99 #ifdef USE_SCRAM_SHA256
100 Gsasl_mechanism _gsasl_scram_sha256_mechanism = {
101  GSASL_SCRAM_SHA256_NAME,
102  {
103  NULL,
104  NULL,
105 # ifdef USE_CLIENT
106  _gsasl_scram_sha256_client_start,
109 # else
110  NULL,
111  NULL,
112  NULL,
113 # endif
114  NULL,
115  NULL}
116  ,
117  {
118  NULL,
119  NULL,
120 # ifdef USE_SERVER
121  _gsasl_scram_sha256_server_start,
124 # else
125  NULL,
126  NULL,
127  NULL,
128 # endif
129  NULL,
130  NULL}
131 };
132 #endif
133 
134 
135 #ifdef USE_SCRAM_SHA256
136 Gsasl_mechanism _gsasl_scram_sha256_plus_mechanism = {
137  GSASL_SCRAM_SHA256_PLUS_NAME,
138  {
139  NULL,
140  NULL,
141 # ifdef USE_CLIENT
142  _gsasl_scram_sha256_plus_client_start,
145 # else
146  NULL,
147  NULL,
148  NULL,
149 # endif
150  NULL,
151  NULL}
152  ,
153  {
154  NULL,
155  NULL,
156 # ifdef USE_SERVER
157  _gsasl_scram_sha256_plus_server_start,
160 # else
161  NULL,
162  NULL,
163  NULL,
164 # endif
165  NULL,
166  NULL}
167 };
168 #endif
int _gsasl_scram_client_step(Gsasl_session *sctx, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
Definition: scram/client.c:125
void _gsasl_scram_client_finish(Gsasl_session *sctx _GL_UNUSED, void *mech_data)
Definition: scram/client.c:423
void _gsasl_scram_server_finish(Gsasl_session *sctx _GL_UNUSED, void *mech_data)
Definition: scram/server.c:581
int _gsasl_scram_server_step(Gsasl_session *sctx, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
Definition: scram/server.c:169