gsasl  2.2.1
scram.h
Go to the documentation of this file.
1 /* scram.h --- Prototypes for 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 #ifndef SCRAM_H
24 # define SCRAM_H
25 
26 # include <gsasl.h>
27 
28 # ifdef USE_SCRAM_SHA1
29 
30 # define GSASL_SCRAM_SHA1_NAME "SCRAM-SHA-1"
31 # define GSASL_SCRAM_SHA1_PLUS_NAME "SCRAM-SHA-1-PLUS"
32 
33 extern Gsasl_mechanism _gsasl_scram_sha1_mechanism;
34 extern Gsasl_mechanism _gsasl_scram_sha1_plus_mechanism;
35 
36 int _gsasl_scram_sha1_client_start (Gsasl_session * sctx, void **mech_data);
37 
38 int
39 _gsasl_scram_sha1_plus_client_start (Gsasl_session * sctx, void **mech_data);
40 
41 int
43  void *mech_data,
44  const char *input, size_t input_len,
45  char **output, size_t *output_len);
46 
47 void _gsasl_scram_client_finish (Gsasl_session * sctx, void *mech_data);
48 
49 
50 int _gsasl_scram_sha1_server_start (Gsasl_session * sctx, void **mech_data);
51 
52 int
53 _gsasl_scram_sha1_plus_server_start (Gsasl_session * sctx, void **mech_data);
54 
56  void *mech_data,
57  const char *input,
58  size_t input_len,
59  char **output, size_t *output_len);
60 
61 void _gsasl_scram_server_finish (Gsasl_session * sctx, void *mech_data);
62 
63 # endif
64 
65 # ifdef USE_SCRAM_SHA256
66 
67 # define GSASL_SCRAM_SHA256_NAME "SCRAM-SHA-256"
68 # define GSASL_SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS"
69 
70 extern Gsasl_mechanism _gsasl_scram_sha256_mechanism;
71 extern Gsasl_mechanism _gsasl_scram_sha256_plus_mechanism;
72 
73 int _gsasl_scram_sha256_client_start (Gsasl_session * sctx, void **mech_data);
74 
75 int
76 _gsasl_scram_sha256_plus_client_start (Gsasl_session * sctx,
77  void **mech_data);
78 
79 int
81  void *mech_data,
82  const char *input, size_t input_len,
83  char **output, size_t *output_len);
84 
85 void _gsasl_scram_client_finish (Gsasl_session * sctx, void *mech_data);
86 
87 
88 int _gsasl_scram_sha256_server_start (Gsasl_session * sctx, void **mech_data);
89 
90 int
91 _gsasl_scram_sha256_plus_server_start (Gsasl_session * sctx,
92  void **mech_data);
93 
95  void *mech_data,
96  const char *input,
97  size_t input_len,
98  char **output, size_t *output_len);
99 
100 void _gsasl_scram_server_finish (Gsasl_session * sctx, void *mech_data);
101 
102 # endif
103 
104 #endif /* SCRAM_H */
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