2
2
* auth.c: authentication support functions for Subversion
4
4
* ====================================================================
5
* Copyright (c) 2000-2009 CollabNet. All rights reserved.
7
* This software is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at http://subversion.tigris.org/license-1.html.
10
* If newer versions of this license are posted there, you may use a
11
* newer version instead, at your option.
13
* This software consists of voluntary contributions made by many
14
* individuals. For exact contribution history, see the revision
15
* history and logs, available at http://subversion.tigris.org/.
5
* Licensed to the Apache Software Foundation (ASF) under one
6
* or more contributor license agreements. See the NOTICE file
7
* distributed with this work for additional information
8
* regarding copyright ownership. The ASF licenses this file
9
* to you under the Apache License, Version 2.0 (the
10
* "License"); you may not use this file except in compliance
11
* with the License. You may obtain a copy of the License at
13
* http://www.apache.org/licenses/LICENSE-2.0
15
* Unless required by applicable law or agreed to in writing,
16
* software distributed under the License is distributed on an
17
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
* KIND, either express or implied. See the License for the
19
* specific language governing permissions and limitations
16
21
* ====================================================================
56
62
/* This effectively defines a single table. Every provider in this
57
63
array returns the same kind of credentials. */
64
typedef struct provider_set_t
60
66
/* ordered array of svn_auth_provider_object_t */
61
67
apr_array_header_t *providers;
98
104
svn_auth_open(svn_auth_baton_t **auth_baton,
99
apr_array_header_t *providers,
105
const apr_array_header_t *providers,
100
106
apr_pool_t *pool)
102
108
svn_auth_baton_t *ab;
178
184
table = apr_hash_get(auth_baton->tables, cred_kind, APR_HASH_KEY_STRING);
180
186
return svn_error_createf(SVN_ERR_AUTHN_NO_PROVIDER, NULL,
181
"No provider registered for '%s' credentials",
187
_("No provider registered for '%s' credentials"),
184
190
/* First, see if we have cached creds in the auth_baton. */
185
cache_key = apr_pstrcat(pool, cred_kind, ":", realmstring, NULL);
191
cache_key = apr_pstrcat(pool, cred_kind, ":", realmstring, (char *)NULL);
186
192
creds = apr_hash_get(auth_baton->creds_cache,
187
193
cache_key, APR_HASH_KEY_STRING);
411
417
version_function_name) == 0)
413
svn_version_func_t version_function;
414
version_function = (svn_version_func_t) version_function_symbol;
419
svn_version_func_t version_function
420
= version_function_symbol;
415
421
const svn_version_checklist_t check_list[] =
417
423
{ library_label, version_function },
426
432
if (strcmp(provider_type, "simple") == 0)
428
svn_auth_simple_provider_func_t provider_function;
430
(svn_auth_simple_provider_func_t)
431
provider_function_symbol;
434
svn_auth_simple_provider_func_t provider_function
435
= provider_function_symbol;
432
436
provider_function(provider, pool);
434
438
else if (strcmp(provider_type, "ssl_client_cert_pw") == 0)
436
svn_auth_ssl_client_cert_pw_provider_func_t provider_function;
438
(svn_auth_ssl_client_cert_pw_provider_func_t)
439
provider_function_symbol;
440
svn_auth_ssl_client_cert_pw_provider_func_t provider_function
441
= provider_function_symbol;
440
442
provider_function(provider, pool);