xref: /freebsd/contrib/pam-krb5/m4/krb5-pkinit.m4 (revision 4757b351ea9d59d71d4a38b82506d2d16fcd560d)
1dnl Additional probes for Kerberos PKINIT support.
2dnl
3dnl Additional Kerberos library probes that check behavior of the library
4dnl relevant to PKINIT support.  Provides the macro:
5dnl
6dnl     RRA_FUNC_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_ARGS
7dnl
8dnl and defines HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_9_ARGS if it takes
9dnl only nine arguments.
10dnl
11dnl Written by Russ Allbery <eagle@eyrie.org>
12dnl Copyright 2007, 2018, 2020-2021 Russ Allbery <eagle@eyrie.org>
13dnl Copyright 2011
14dnl     The Board of Trustees of the Leland Stanford Junior University
15dnl
16dnl This file is free software; the authors give unlimited permission to copy
17dnl and/or distribute it, with or without modifications, as long as this
18dnl notice is preserved.
19dnl
20dnl SPDX-License-Identifier: FSFULLR
21
22dnl Source used by RRA_FUNC_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_ARGS.
23AC_DEFUN([_RRA_FUNC_KRB5_PKINIT_ARGS_SOURCE], [RRA_INCLUDES_KRB5] [[
24int
25main(void)
26{
27    krb5_context c;
28    krb5_get_init_creds_opt *o;
29    krb5_principal p;
30
31    krb5_get_init_creds_opt_set_pkinit(c, o, p, NULL, NULL, 0, NULL, NULL,
32                                       NULL);
33}
34]])
35
36dnl Check whether krb5_get_init_creds_opt_set_pkinit takes eleven arguments
37dnl (0.8 release candidates and later) or only nine (0.7).  Defines
38dnl HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_9_ARGS if it takes nine arguments.
39AC_DEFUN([RRA_FUNC_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_ARGS],
40[AC_CACHE_CHECK([if krb5_get_init_creds_opt_set_pkinit takes 9 arguments],
41    [rra_cv_func_krb5_get_init_creds_opt_set_pkinit_args],
42    [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_RRA_FUNC_KRB5_PKINIT_ARGS_SOURCE])],
43        [rra_cv_func_krb5_get_init_creds_opt_set_pkinit_args=yes],
44        [rra_cv_func_krb5_get_init_creds_opt_set_pkinit_args=no])])
45AS_IF([test $rra_cv_func_krb5_get_init_creds_opt_set_pkinit_args = yes],
46    [AC_DEFINE([HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PKINIT_9_ARGS], 1,
47        [Define if krb5_get_init_creds_opt_set_pkinit takes 9 arguments.])])])
48