File: lcmaps_openssl.h

package info (click to toggle)
lcmaps 1.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,016 kB
  • ctags: 1,428
  • sloc: sh: 11,191; ansic: 9,519; makefile: 530; lex: 184; perl: 92; yacc: 60
file content (102 lines) | stat: -rw-r--r-- 3,879 bytes parent folder | download | duplicates (2)
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
/*
 * Copyright (c) Members of the EGEE Collaboration. 2004-2010. 
 * See http://www.eu-egee.org/partners/ for details on the copyright
 * holders.  
 * 
 * Licensed 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.
 *
 */

/**
   \defgroup LcmapsOpensslInterface LCMAPS openssl dependent interfaces
   
    \brief  This is a collection of interfaces that use openssl types
            and functions.

    The interface function is declared as a type, since the function is not
    pre-defined when using dlopen().

    -# lcmaps_run_with_stack_of_x509_and_return_account():
        To do the user mapping, based on a certificate chain and return the account information

    \ingroup LcmapsInterface
*/

/**
   \file   lcmaps_openssl.h
   \brief  Stack of X509 interface of the LCMAPS library.
   \author Oscar Koeroo for the EGEE project.
   \author Martijn Steenbakkers for the EU DataGrid.
  
    This header contains the declarations of the LCMAPS library functions:
    -# lcmaps_run_with_stack_of_x509_and_return_account():
	To do the user mapping, based on a certificate chain and return the
	account information
    \ingroup LcmapsOpensslInterface
*/

#ifndef LCMAPS_X509_H
#define LCMAPS_X509_H

/******************************************************************************
                             Include header files
******************************************************************************/
#include <sys/types.h>
#include <openssl/x509.h>
#include "lcmaps_basic.h"

/******************************************************************************
 *                 Module definition
 *****************************************************************************/


/**
   \brief Run LCMAPS and map to an account based on the supplied certificate chain.
   
   LCMAPS runs receiving a certificate chain, containing at least an
   End-Entity Certificate.  A list of policies may be provided. The
   allocated uid, gids and the poolindex will be returned to the
   calling application.

    \param cert_chain   The certificate chain to use for the mapping
    \param request      RSL string (input)
    \param npols        number of policies to be considered for evaluation (input)
    \param policynames  the names of the policies to be considered for evaluation (input)
    \param puid         the uid of the account
    \param ppgid_list   the list of primary gids of the account
    \param pnpgid       the number of primary gids of the account
    \param psgid_list   the list of secondary gids of the account
    \param pnsgid       the number of secondary gids of the account
    \param poolindexp   poolindex string of the account

    \retval 0 mapping succeeded
    \retval 1 mapping failed
*/
typedef int lcmaps_run_with_stack_of_x509_and_return_account_t(
        STACK_OF(X509) *  cert_chain,
        int               mapcounter,
        lcmaps_request_t  request,
        int               npols,
        char **           policynames,
        uid_t *           puid,
        gid_t **          ppgid_list,
        int *             pnpgid,
        gid_t **          psgid_list,
        int *             pnsgid,
        char **           poolindexp
);
#ifndef LCMAPS_USE_DLOPEN
lcmaps_run_with_stack_of_x509_and_return_account_t lcmaps_run_with_stack_of_x509_and_return_account;
#endif /* LCMAPS_USE_DLOPEN */

#endif /* LCMAPS_X509_H */