b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek/*
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek Authors:
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek Sumit Bose <sbose@redhat.com>
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek Jakub Hrozek <jhrozek@redhat.com>
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek Copyright (C) 2015 Red Hat
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek SSSD tests: Tests keytab utilities
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek This program is free software; you can redistribute it and/or modify
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek it under the terms of the GNU General Public License as published by
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek the Free Software Foundation; either version 3 of the License, or
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek (at your option) any later version.
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek This program is distributed in the hope that it will be useful,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek GNU General Public License for more details.
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek You should have received a copy of the GNU General Public License
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek*/
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek#ifndef __COMMON_MOCK_KRB5_H_
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek#define __COMMON_MOCK_KRB5_H_
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek#include "util/sss_krb5.h"
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek#include "tests/cmocka/common_mock.h"
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozekvoid mock_krb5_keytab_entry(krb5_keytab_entry *kent,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek krb5_principal principal,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek krb5_timestamp timestamp,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek krb5_kvno vno,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek krb5_enctype enctype,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek const char *key);
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozekint mock_keytab(krb5_context kctx,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek const char *kt_path,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek krb5_keytab_entry *kt_keys,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek size_t nkeys);
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek/* Dummy keys with user-selected principal */
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozekint mock_keytab_with_contents(TALLOC_CTX *mem_ctx,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek const char *keytab_path,
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek const char *keytab_princ);
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek
b1a822a16e3ef97e31d167f9e97efec06fc121dcJakub Hrozek#endif /* __COMMON_MOCK_KRB5_H_ */