ad_pac.h revision 3d29430867cf92b2d71afa95abb679711231117c
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/*
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding SSSD
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding Authors:
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding Sumit Bose <sbose@redhat.com>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Copyright (C) 2016 Red Hat
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding This program is free software; you can redistribute it and/or modify
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding it under the terms of the GNU General Public License as published by
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding the Free Software Foundation; either version 3 of the License, or
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding (at your option) any later version.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding This program is distributed in the hope that it will be useful,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding but WITHOUT ANY WARRANTY; without even the implied warranty of
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding GNU General Public License for more details.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding You should have received a copy of the GNU General Public License
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding along with this program. If not, see <http://www.gnu.org/licenses/>.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding*/
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#ifndef AD_PAC_H_
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#define AD_PAC_H_
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include <stdbool.h>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include <stdint.h>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding/* ldb_val is defined as datablob in the Samba header files data_blob.h which
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * is included via ndr.h -> samba_util.h -> data_blob.h.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * To allow proper type checking we have to make sure to keep the original
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * definition from ldb.h */
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#ifdef ldb_val
64185f9824e42f21ca7b9ae6c004484215c031a7rbb#error Please make sure to include ad_pac.h before ldb.h
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include <ndr.h>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include <gen_ndr/krb5pac.h>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include <gen_ndr/ndr_krb5pac.h>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#undef ldb_val
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include "util/util.h"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding#include "providers/ldap/ldap_common.h"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingerrno_t check_if_pac_is_available(TALLOC_CTX *mem_ctx,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding struct sss_domain_info *dom,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding struct dp_id_data *ar,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding struct ldb_message **_msg);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingerrno_t ad_get_data_from_pac(TALLOC_CTX *mem_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding uint8_t *pac_blob, size_t pac_len,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding struct PAC_LOGON_INFO **_logon_info);
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingerrno_t ad_get_sids_from_pac(TALLOC_CTX *mem_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sss_idmap_ctx *idmap_ctx,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding struct PAC_LOGON_INFO *logon_info,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding char **_user_sid_str,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding char **_primary_group_sid_str,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding size_t *_num_sids,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char *** _sid_list);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingerrno_t ad_get_pac_data_from_user_entry(TALLOC_CTX *mem_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct ldb_message *msg,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sss_idmap_ctx *idmap_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char **username,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char **user_sid,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char **primary_group_sid,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding size_t *num_sids,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char ***group_sids);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstruct tevent_req *ad_handle_pac_initgr_send(TALLOC_CTX *mem_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct be_ctx *be_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct dp_id_data *ar,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sdap_id_ctx *id_ctx,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sdap_domain *sdom,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sdap_id_conn_ctx *conn,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding bool noexist_delete,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct ldb_message *msg);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingerrno_t ad_handle_pac_initgr_recv(struct tevent_req *req,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int *_dp_error, const char **_err,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int *sdap_ret);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#endif /* AD_PAC_H_ */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding