]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/subversion/subversion/include/private/ra_svn_sasl.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / subversion / subversion / include / private / ra_svn_sasl.h
1 /*
2  * ra_svn_sasl.h :  SASL-related declarations shared between the
3  * ra_svn and svnserve module
4  *
5  * ====================================================================
6  *    Licensed to the Apache Software Foundation (ASF) under one
7  *    or more contributor license agreements.  See the NOTICE file
8  *    distributed with this work for additional information
9  *    regarding copyright ownership.  The ASF licenses this file
10  *    to you under the Apache License, Version 2.0 (the
11  *    "License"); you may not use this file except in compliance
12  *    with the License.  You may obtain a copy of the License at
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
16  *    Unless required by applicable law or agreed to in writing,
17  *    software distributed under the License is distributed on an
18  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  *    KIND, either express or implied.  See the License for the
20  *    specific language governing permissions and limitations
21  *    under the License.
22  * ====================================================================
23  */
24
25
26
27 #ifndef RA_SVN_SASL_H
28 #define RA_SVN_SASL_H
29
30 #ifdef WIN32
31 /* This prevents sasl.h from redefining iovec, which is always defined by APR
32    on win32. */
33 #define STRUCT_IOVEC_DEFINED
34 #include <sasl.h>
35 #else
36 #include <sasl/sasl.h>
37 #endif
38
39 #include <apr_errno.h>
40 #include <apr_pools.h>
41
42 #include "svn_error.h"
43 #include "svn_ra_svn.h"
44
45 #include "private/svn_atomic.h"
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50
51 /** The application and service name used for sasl_client_new,
52  * sasl_server_init, and sasl_server_new. */
53 #define SVN_RA_SVN_SASL_NAME "svn"
54
55 extern volatile svn_atomic_t svn_ra_svn__sasl_status;
56
57 /* Initialize secprops with default values. */
58 void
59 svn_ra_svn__default_secprops(sasl_security_properties_t *secprops);
60
61 /* This function is called by the client and the server before
62    calling sasl_{client, server}_init, pool is used for allocations. */
63 svn_error_t *
64 svn_ra_svn__sasl_common_init(apr_pool_t *pool);
65
66 /* Sets local_addrport and remote_addrport to a string containing the
67    remote and local IP address and port, formatted like this: a.b.c.d;port. */
68 svn_error_t *
69 svn_ra_svn__get_addresses(const char **local_addrport,
70                           const char **remote_addrport,
71                           svn_ra_svn_conn_t *conn,
72                           apr_pool_t *pool);
73
74 /* If a security layer was negotiated during the authentication exchange,
75    create an encrypted stream for conn. */
76 svn_error_t *
77 svn_ra_svn__enable_sasl_encryption(svn_ra_svn_conn_t *conn,
78                                    sasl_conn_t *sasl_ctx,
79                                    apr_pool_t *pool);
80
81
82 #ifdef __cplusplus
83 }
84 #endif /* __cplusplus */
85
86 #endif  /* RA_SVN_SASL_H */