pam_pkcs11  0.6.10
mapper_mgr.h
Go to the documentation of this file.
1 /*
2  * PKCS #11 PAM Login Module
3  * Copyright (C) 2003 Mario Strasser <mast@gmx.net>,
4  * Mapper module copyright (c) 2005 Juan Antonio Martinez <jonsito@teleline.es>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This 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  * $Id$
17  */
18 
19 /*
20 * this module manages dynamic load of mapping modules
21 * also is used as entry point for cert matching routines
22 */
23 
24 #ifndef _MAPPER_MGR_H_
25 #define _MAPPER_MGR_H_
26 
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30 
31 #include "../common/cert_st.h"
32 #include "../scconf/scconf.h"
33 #include "../mappers/mapper.h"
34 
35 /*
36 * mapper module descriptor
37 */
40  const char *module_name;
41  const char *module_path;
43 };
44 
45 /*
46 * mapper module list
47 */
51 };
52 
53 /*
54 * load and initialize a module
55 * returns descriptor on success, null on fail
56 */
57 struct mapper_instance *load_module(scconf_context *ctx, const char * name);
58 
62 void unload_module( struct mapper_instance *module );
63 
68 
72 void unload_mappers(void);
73 
74 /*
75 * this function search mapper module list until
76 * find a module that returns a login name for
77 * provided certificate
78 */
79 char * find_user(X509 *x509);
80 
89 int match_user(X509 *x509, const char *login);
90 
91 /*
92 * This funcions goest throught the mapper list
93 * and trying to get the certificate strings to be used on each
94 * module to perform find/match functions.
95 * No map / match are done: just print found strings on stdout.
96 * This function is mostly used in pkcert_view toool
97 */
98 void inspect_certificate(X509 *x509);
99 
100 #endif
mapper_module * module_data
Definition: mapper_mgr.h:42
void unload_mappers(void)
unload mapper module chain
char * find_user(X509 *x509)
void unload_module(struct mapper_instance *module)
Unload a module.
struct mapper_listitem * next
Definition: mapper_mgr.h:50
void inspect_certificate(X509 *x509)
int match_user(X509 *x509, const char *login)
This function search mapper module list until find a module that match provided login name if login i...
Structure to be filled on mapper module initialization.
Definition: mapper.h:40
void * module_handler
Definition: mapper_mgr.h:39
struct mapper_instance * module
Definition: mapper_mgr.h:49
const char * module_path
Definition: mapper_mgr.h:41
struct mapper_instance * load_module(scconf_context *ctx, const char *name)
struct mapper_listitem * load_mappers(scconf_context *ctx)
compose mapper module chain
const char * module_name
Definition: mapper_mgr.h:40