Allow KDC to always return the salt in the PA-ETYPE-INFO[2]
[heimdal.git] / kdc / csr_authorizer_plugin.h
blob45f42014b60b1052273b5597b90205e82c6f539e
1 /*
2 * Copyright (c) 2019 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 #ifndef HEIMDAL_KDC_CSR_AUTHORIZER_PLUGIN_H
35 #define HEIMDAL_KDC_CSR_AUTHORIZER_PLUGIN_H 1
37 #define KDC_CSR_AUTHORIZER "kdc_csr_authorizer"
38 #define KDC_CSR_AUTHORIZER_VERSION_0 0
41 * @param init Plugin initialization function (see krb5-plugin(7))
42 * @param minor_version The plugin minor version number (0)
43 * @param fini Plugin finalization function
44 * @param authorize Plugin CSR authorization function
46 * The authorize field is the plugin entry point that performs authorization of
47 * CSRs for kx509 however the plugin desires. It is invoked in no particular
48 * order relative to other CSR authorization plugins. The plugin authorize
49 * function must return KRB5_PLUGIN_NO_HANDLE if the rule is not applicable to
50 * it.
52 * The plugin authorize function has the following arguments, in this
53 * order:
55 * -# plug_ctx, the context value output by the plugin's init function
56 * -# context, a krb5_context
57 * -# app, the name of the application
58 * -# csr, a hx509_request
59 * -# client, a krb5_const_principal
60 * -# authorization_result, a pointer to a krb5_boolean
62 * @ingroup krb5_support
64 typedef struct krb5plugin_csr_authorizer_ftable_desc {
65 int minor_version;
66 krb5_error_code (KRB5_LIB_CALL *init)(krb5_context, void **);
67 void (KRB5_LIB_CALL *fini)(void *);
68 krb5_error_code (KRB5_LIB_CALL *authorize)(void *, /*plug_ctx*/
69 krb5_context, /*context*/
70 const char *, /*app*/
71 hx509_request, /*CSR*/
72 krb5_const_principal,/*client*/
73 krb5_boolean *); /*authorized*/
74 } krb5plugin_csr_authorizer_ftable;
76 #endif /* HEIMDAL_KDC_CSR_AUTHORIZER_PLUGIN_H */