ra_svn_sasl.h revision 362181
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/* Keep this include statement at the top of this file. */
31#include "private/ra_svn_wrapped_sasl.h"
32
33#include <apr_errno.h>
34#include <apr_pools.h>
35
36#include "svn_error.h"
37#include "svn_ra_svn.h"
38
39#include "private/svn_atomic.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45/** The application and service name used for sasl_client_new,
46 * sasl_server_init, and sasl_server_new. */
47#define SVN_RA_SVN_SASL_NAME "svn"
48
49extern volatile svn_atomic_t svn_ra_svn__sasl_status;
50
51/* Initialize secprops with default values. */
52void
53svn_ra_svn__default_secprops(sasl_security_properties_t *secprops);
54
55/* This function is called by the client and the server before
56   calling sasl_{client, server}_init, pool is used for allocations. */
57svn_error_t *
58svn_ra_svn__sasl_common_init(apr_pool_t *pool);
59
60/* Sets local_addrport and remote_addrport to a string containing the
61   remote and local IP address and port, formatted like this: a.b.c.d;port. */
62svn_error_t *
63svn_ra_svn__get_addresses(const char **local_addrport,
64                          const char **remote_addrport,
65                          svn_ra_svn_conn_t *conn,
66                          apr_pool_t *pool);
67
68/* If a security layer was negotiated during the authentication exchange,
69   create an encrypted stream for conn. */
70svn_error_t *
71svn_ra_svn__enable_sasl_encryption(svn_ra_svn_conn_t *conn,
72                                   sasl_conn_t *sasl_ctx,
73                                   apr_pool_t *pool);
74
75
76#ifdef __cplusplus
77}
78#endif /* __cplusplus */
79
80#endif  /* RA_SVN_SASL_H */
81