aboutsummaryrefslogtreecommitdiff
path: root/subversion/libsvn_ra_svn/wrapped_sasl.c
blob: e20fc98689a9c0e564bde8f72e3d0fe1c961ccac (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
 * wrapped_sasl.c :  wrapped SASL API
 *
 * ====================================================================
 *    Licensed to the Apache Software Foundation (ASF) under one
 *    or more contributor license agreements.  See the NOTICE file
 *    distributed with this work for additional information
 *    regarding copyright ownership.  The ASF licenses this file
 *    to you under the Apache License, Version 2.0 (the
 *    "License"); you may not use this file except in compliance
 *    with the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing,
 *    software distributed under the License is distributed on an
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *    KIND, either express or implied.  See the License for the
 *    specific language governing permissions and limitations
 *    under the License.
 * ====================================================================
 */

#include "svn_private_config.h"
#ifdef SVN_HAVE_SASL

#include "private/ra_svn_wrapped_sasl.h"

/* See the comment at the top of svn_wrapped_sasl.h */
#ifdef __APPLE__
#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
#    pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#  endif
#endif /* __APPLE__ */

void
svn_sasl__set_mutex(sasl_mutex_alloc_t *alloc,
                    sasl_mutex_lock_t *lock,
                    sasl_mutex_unlock_t *unlock,
                    sasl_mutex_free_t *free)
{
  sasl_set_mutex(alloc, lock, unlock, free);
}

void
svn_sasl__done(void)
{
  sasl_done();
}

void
svn_sasl__dispose(sasl_conn_t **pconn)
{
  sasl_dispose(pconn);
}

const char *
svn_sasl__errstring(int saslerr, const char *langlist, const char **outlang)
{
  return sasl_errstring(saslerr, langlist, outlang);
}

const char *
svn_sasl__errdetail(sasl_conn_t *conn)
{
  return sasl_errdetail(conn);
}

int
svn_sasl__getprop(sasl_conn_t *conn, int propnum, const void **pvalue)
{
  return sasl_getprop(conn, propnum, pvalue);
}

int
svn_sasl__setprop(sasl_conn_t *conn, int propnum, const void *value)
{
  return sasl_setprop(conn, propnum, value);
}

int
svn_sasl__client_init(const sasl_callback_t *callbacks)
{
  return sasl_client_init(callbacks);
}

int
svn_sasl__client_new(const char *service,
                     const char *serverFQDN,
                     const char *iplocalport,
                     const char *ipremoteport,
                     const sasl_callback_t *prompt_supp,
                     unsigned flags,
                     sasl_conn_t **pconn)
{
  return sasl_client_new(service, serverFQDN, iplocalport, ipremoteport,
                         prompt_supp, flags, pconn);
}

int
svn_sasl__client_start(sasl_conn_t *conn,
                       const char *mechlist,
                       sasl_interact_t **prompt_need,
                       const char **clientout,
                       unsigned *clientoutlen,
                       const char **mech)
{
  return sasl_client_start(conn, mechlist, prompt_need,
                           clientout, clientoutlen, mech);
}

int
svn_sasl__client_step(sasl_conn_t *conn,
                      const char *serverin,
                      unsigned serverinlen,
                      sasl_interact_t **prompt_need,
                      const char **clientout,
                      unsigned *clientoutlen)
{
  return sasl_client_step(conn, serverin, serverinlen, prompt_need,
                          clientout, clientoutlen);
}

int
svn_sasl__server_init(const sasl_callback_t *callbacks,
                      const char *appname)
{
  return sasl_server_init(callbacks, appname);
}

int
svn_sasl__server_new(const char *service,
                     const char *serverFQDN,
                     const char *user_realm,
                     const char *iplocalport,
                     const char *ipremoteport,
                     const sasl_callback_t *callbacks,
                     unsigned flags,
                     sasl_conn_t **pconn)
{
  return sasl_server_new(service, serverFQDN, user_realm,
                         iplocalport, ipremoteport, callbacks, flags, pconn);
}

int
svn_sasl__listmech(sasl_conn_t *conn,
                   const char *user,
                   const char *prefix,
                   const char *sep,
                   const char *suffix,
                   const char **result,
                   unsigned *plen,
                   int *pcount)
{
  return sasl_listmech(conn, user, prefix, sep, suffix, result, plen, pcount);
}

int
svn_sasl__server_start(sasl_conn_t *conn,
                       const char *mech,
                       const char *clientin,
                       unsigned clientinlen,
                       const char **serverout,
                       unsigned *serveroutlen)
{
  return sasl_server_start(conn, mech, clientin, clientinlen,
                           serverout, serveroutlen);
}

int
svn_sasl__server_step(sasl_conn_t *conn,
                      const char *clientin,
                      unsigned clientinlen,
                      const char **serverout,
                      unsigned *serveroutlen)
{
  return sasl_server_step(conn, clientin, clientinlen,
                          serverout, serveroutlen);
}

int
svn_sasl__encode(sasl_conn_t *conn,
                 const char *input, unsigned inputlen,
                 const char **output, unsigned *outputlen)
{
  return sasl_encode(conn, input, inputlen, output, outputlen);
}

int
svn_sasl__decode(sasl_conn_t *conn,
                 const char *input, unsigned inputlen,
                 const char **output, unsigned *outputlen)
{
  return sasl_decode(conn, input, inputlen, output, outputlen);
}

#endif /* SVN_HAVE_SASL */