/*
SSSD
Kerberos Backend, common header file
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2009 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __KRB5_COMMON_H__
#define __KRB5_COMMON_H__
#include "config.h"
#include <stdbool.h>
#include "util/sss_krb5.h"
enum krb5_opts {
KRB5_KDC = 0,
};
struct krb5_service {
char *name;
char *realm;
bool write_kdcinfo;
};
struct fo_service;
struct deferred_auth_ctx;
struct renew_tgt_ctx;
enum krb5_config_type {
};
struct map_id_name_to_krb_primary {
const char *id_name;
const char* krb_primary;
};
struct krb5_ctx {
/* opts taken from kinit */
/* in seconds */
char *lifetime_str;
char *rlife_str;
int forwardable;
int proxiable;
int addresses;
int not_forwardable;
int not_proxiable;
int no_addresses;
int verbose;
char* principal_name;
char* service_name;
char* keytab_name;
char* k5_cache_name;
char* k4_cache_name;
int child_debug_fd;
bool use_fast;
bool sss_creds_password;
char *realm;
const char *use_fast_str;
const char *fast_principal;
bool canonicalize;
};
struct remove_info_files_ctx {
char *realm;
const char *kdc_service_name;
const char *kpasswd_service_name;
};
struct sss_domain_info *dom,
const char *service);
const char *service_name,
const char *primary_servers,
const char *backup_servers,
const char *realm,
bool use_kdcinfo,
struct krb5_service **_service);
void remove_krb5_info_files_callback(void *pvt);
struct tevent_signal *se,
int signum,
int count,
void *siginfo,
void *private_data);
bool *different_realm);
/* from krb5_keytab.c */
/**
* @brief Copy given keytab into a MEMORY keytab
*
* @param[in] mem_ctx Talloc memory context the new keytab name should be
* allocated on
* @param[in] kctx Kerberos context
* @param[in] inp_keytab_file Existing keytab, if set to NULL the default
* keytab will be used
* @param[out] _mem_name Name of the new MEMORY keytab
* @param[out] _mem_keytab Krb5 keytab handle for the new MEMORY keytab, NULL
* may be passed here if the caller has no use for the
* handle
*
* The memory for the MEMORY keytab is handled by libkrb5 internally and
* a reference counter is used. If the reference counter of the specific
* MEMORY keytab reaches 0, i.e. no open ones are left, the memory is free.
* This means we cannot call krb5_kt_close() for the new MEMORY keytab in
* copy_keytab_into_memory() because this would destroy it immediately. Hence
* we have to return the handle so that the caller can safely remove the
* MEMORY keytab if the is not needed anymore. Since libkrb5 frees the
* internal memory when the library is unloaded short running processes can
* safely pass NULL as the 5th argument because on exit all memory is freed.
* Long running processes which need more control over the memory consumption
* should close the handle for free the memory at runtime.
*/
const char *inp_keytab_file,
char **_mem_name,
const char ***krb5_child_extra_args);
#endif /* __KRB5_COMMON_H__ */