1/* internal.h --- Internal header with hidden library handle structures.
2 * Copyright (C) 2002-2012 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 License along with GNU SASL Library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef INTERNAL_H
24#define INTERNAL_H
25
26#include "config.h"
27
28/* Get specifications. */
29#include "gsasl.h"
30
31/* Get malloc, free, ... */
32#include <stdlib.h>
33
34/* Get strlen, strcpy, ... */
35#include <string.h>
36
37/* Main library handle. */
38struct Gsasl
39{
40 size_t n_client_mechs;
41 Gsasl_mechanism *client_mechs;
42 size_t n_server_mechs;
43 Gsasl_mechanism *server_mechs;
44 /* Callback. */
45 Gsasl_callback_function cb;
46 void *application_hook;
47#ifndef GSASL_NO_OBSOLETE
48 /* Obsolete stuff. */
49 Gsasl_client_callback_authorization_id cbc_authorization_id;
50 Gsasl_client_callback_authentication_id cbc_authentication_id;
51 Gsasl_client_callback_password cbc_password;
52 Gsasl_client_callback_passcode cbc_passcode;
53 Gsasl_client_callback_pin cbc_pin;
54 Gsasl_client_callback_anonymous cbc_anonymous;
55 Gsasl_client_callback_qop cbc_qop;
56 Gsasl_client_callback_maxbuf cbc_maxbuf;
57 Gsasl_client_callback_service cbc_service;
58 Gsasl_client_callback_realm cbc_realm;
59 Gsasl_server_callback_validate cbs_validate;
60 Gsasl_server_callback_securid cbs_securid;
61 Gsasl_server_callback_retrieve cbs_retrieve;
62 Gsasl_server_callback_cram_md5 cbs_cram_md5;
63 Gsasl_server_callback_digest_md5 cbs_digest_md5;
64 Gsasl_server_callback_external cbs_external;
65 Gsasl_server_callback_anonymous cbs_anonymous;
66 Gsasl_server_callback_realm cbs_realm;
67 Gsasl_server_callback_qop cbs_qop;
68 Gsasl_server_callback_maxbuf cbs_maxbuf;
69 Gsasl_server_callback_cipher cbs_cipher;
70 Gsasl_server_callback_service cbs_service;
71 Gsasl_server_callback_gssapi cbs_gssapi;
72#endif
73};
74
75/* Per-session library handle. */
76struct Gsasl_session
77{
78 Gsasl *ctx;
79 int clientp;
80 Gsasl_mechanism *mech;
81 void *mech_data;
82 void *application_hook;
83
84 /* Properties. */
85 char *anonymous_token;
86 char *authid;
87 char *authzid;
88 char *password;
89 char *passcode;
90 char *pin;
91 char *suggestedpin;
92 char *service;
93 char *hostname;
94 char *gssapi_display_name;
95 char *realm;
96 char *digest_md5_hashed_password;
97 char *qops;
98 char *qop;
99 char *scram_iter;
100 char *scram_salt;
101 char *scram_salted_password;
102 char *cb_tls_unique;
103 char *saml20_idp_identifier;
104 char *saml20_redirect_url;
105 char *openid20_redirect_url;
106 char *openid20_outcome_data;
107 /* If you add anything here, remember to change change
108 gsasl_finish() in xfinish.c and map() in property.c. */
109
110#ifndef GSASL_NO_OBSOLETE
111 /* Obsolete stuff. */
112 void *application_data;
113#endif
114};
115
116#ifndef GSASL_NO_OBSOLETE
117const char *_gsasl_obsolete_property_map (Gsasl_session * sctx,
118 Gsasl_property prop);
119int _gsasl_obsolete_callback (Gsasl * ctx, Gsasl_session * sctx,
120 Gsasl_property prop);
121#endif
122
123#endif /* INTERNAL_H */
124