Files
heimdal/lib/krb5/Makefile.am
Nicolas Williams ea90ca8666 Move some infra bits of lib/krb5/ to lib/base/ (2)
This is the second of two commits in a series that must be picked together.

This series of two commits moves parts of lib/krb5/ infrastructure
functionality to lib/base/, leaving behind wrappers.

Some parts of libkrb5 are entirely generic or easily made so, and could
be useful in various parts of Heimdal that are not specific to the krb5
API, such as:

 - lib/gssapi/  (especially since the integration of NegoEx)
 - lib/hx509/
 - bx509d       (which should really move out of kdc/)

For the above we need to move these bits of lib/krb5/:

 - lib/krb5/config_file.c   (all of it, leaving forwardings behind)
 - lib/krb5/config_reg.c    (all of it)
 - lib/krb5/plugin.c        (all of it, leaving forwardings behind)
 - lib/krb5/log.c           (all of it, ditto)
 - lib/krb5/heim_err.et     (all of it)

And because of those two, these too must also move:

 - lib/krb5/expand_path.c   (all of it, leaving forwardings behind)
 - lib/krb5/warn.c          (just the warning functions, ditto)

The changes to the moved files are mostly quite straightforward and are
best reviewed with --word-diff=color.

We're also creating a heim_context and a heim API to go with it.  But
it's as thin as possible, with as little state as necessary to enable
this move.  Functions for dealing with error messages use callbacks.

Moving plugin.c does have one knock-on effect on all users of the old
krb5 plugin API (which remains), which is that a global search and
replace of struct krb5_plugin_data to struct heim_plugin_data was
needed, though the layout and size of that structure doesn't change, so
the ABI doesn't either.

As well, we now build lib/vers/ and lib/com_err/ before lib/base/ so as
to be able to move lib/krb5/heim_err.et to lib/base/ so that we can make
use of HEIM_ERR_* in lib/base/, specifically in the files that moved.

Once this is all done we'll be able to use config files and plugins in
lib/hx509/, we'll be able to move bx509d out of kdc/, and so on.

Most if not all of the new functions in lib/base/ are Heimdal-private,
thus calling conventions for them are not declared.

Status:

 - builds and passes CIs (Travis, Appveyor)
 - ran make check-valgrind and no new leaks or other memory errors
 - ready for review

HOW TO REVIEW:

     $ # Review file moves:
     $ git log --stat -n1 HEAD^
     $
     $ # Review changes to moved files using --word-diff=color
     $ git log -p -b -w --word-diff=color HEAD^..HEAD   \
               lib/base/config_file.c                   \
               lib/base/config_reg.c                    \
               lib/base/expand_path.c                   \
               lib/base/warn.c                          \
               lib/krb5/config_file.c                   \
               lib/krb5/config_reg.c                    \
               lib/krb5/expand_path.c                   \
               lib/krb5/warn.c
     $
     $ # Review the whole thing, possibly adding -b and/or -w, and
     $ # maybe --word-diff=color:
     $ git log -p origin/master..HEAD
     $ git log -p -b -w origin/master..HEAD
     $ git log -p -b -w --word-diff=color origin/master..HEAD

TBD (future commits):

 - make lib/gssapi use the new heimbase functions
 - move kx509/bx509d common code to lib/hx509/ or other approp. location
 - move bx509d out of kdc/
2020-03-02 10:56:13 -06:00

446 lines
9.1 KiB
Makefile

# $Id$
include $(top_srcdir)/Makefile.am.common
AM_CPPFLAGS += -I../com_err -I$(srcdir)/../com_err $(INCLUDE_sqlite3) $(INCLUDE_libintl) $(INCLUDE_openssl_crypto)
bin_PROGRAMS = verify_krb5_conf
noinst_PROGRAMS = \
krbhst-test \
test_alname \
test_crypto \
test_forward \
test_get_addrs \
test_gic \
test_kuserok \
test_renew \
test_rfc3961
noinst_LTLIBRARIES = \
librfc3961.la
TESTS = \
aes-test \
derived-key-test \
n-fold-test \
parse-name-test \
pseudo-random-test \
store-test \
string-to-key-test \
test_acl \
test_addr \
test_cc \
test_config \
test_fx \
test_prf \
test_store \
test_crypto_wrapping \
test_keytab \
test_mem \
test_pac \
test_plugin \
test_princ \
test_pkinit_dh2key \
test_pknistkdf \
test_time \
test_expand_toks \
test_x500
check_DATA = test_config_strings.out
check_PROGRAMS = $(TESTS) test_hostname test_ap-req test_canon test_set_kvno0
LDADD = libkrb5.la \
$(LIB_hcrypto) \
$(top_builddir)/lib/asn1/libasn1.la \
$(top_builddir)/lib/wind/libwind.la \
$(LIB_heimbase) $(LIB_roken)
if PKINIT
LIB_pkinit = ../hx509/libhx509.la
endif
if have_scc
use_sqlite = $(LIB_sqlite3)
endif
libkrb5_la_LIBADD = \
$(top_builddir)/lib/asn1/libasn1.la \
$(top_builddir)/lib/ipc/libheim-ipcc.la \
$(top_builddir)/lib/wind/libwind.la \
$(top_builddir)/lib/base/libheimbase.la \
$(top_builddir)/lib/hx509/libhx509.la \
$(LIB_openssl_crypto) \
$(use_sqlite) \
$(LIB_com_err) \
$(LIB_hcrypto) \
$(LIB_libintl) \
$(LIBADD_roken) \
$(PTHREAD_LIBADD) \
$(LIB_add_key) \
$(LIB_door_create)
librfc3961_la_LIBADD = \
$(top_builddir)/lib/asn1/libasn1.la \
$(top_builddir)/lib/ipc/libheim-ipcc.la \
$(top_builddir)/lib/wind/libwind.la \
$(LIB_pkinit) \
$(use_sqlite) \
$(LIB_com_err) \
$(LIB_hcrypto) \
$(LIB_libintl) \
$(LIBADD_roken) \
$(PTHREAD_LIBADD) \
$(LIB_add_key) \
$(LIB_door_create)
lib_LTLIBRARIES = libkrb5.la
ERR_FILES = krb5_err.c krb_err.c k524_err.c k5e1_err.c kx509_err.c
libkrb5_la_CPPFLAGS = \
-DBUILD_KRB5_LIB \
$(AM_CPPFLAGS) \
-DHEIMDAL_LOCALEDIR='"$(localedir)"'
librfc3961_la_CPPFLAGS = \
-DBUILD_KRB5_LIB \
$(AM_CPPFLAGS) \
-DHEIMDAL_LOCALEDIR='"$(localedir)"'
dist_libkrb5_la_SOURCES = \
acache.c \
acl.c \
add_et_list.c \
addr_families.c \
an2ln_plugin.h \
aname_to_localname.c \
appdefault.c \
asn1_glue.c \
auth_context.c \
build_ap_req.c \
build_auth.c \
cache.c \
ccache_plugin.h \
changepw.c \
codec.c \
config_file.c \
convert_creds.c \
constants.c \
context.c \
copy_host_realm.c \
crc.c \
creds.c \
crypto.c \
crypto.h \
crypto-aes-sha1.c \
crypto-aes-sha2.c \
crypto-algs.c \
crypto-arcfour.c \
crypto-des.c \
crypto-des-common.c \
crypto-des3.c \
crypto-evp.c \
crypto-null.c \
crypto-pk.c \
crypto-rand.c \
doxygen.c \
data.c \
db_plugin.c \
db_plugin.h \
dcache.c \
deprecated.c \
digest.c \
eai_to_heim_errno.c \
enomem.c \
error_string.c \
expand_hostname.c \
expand_path.c \
fast.c \
fcache.c \
free.c \
free_host_realm.c \
generate_seq_number.c \
generate_subkey.c \
get_addrs.c \
get_cred.c \
get_default_principal.c \
get_default_realm.c \
get_for_creds.c \
get_host_realm.c \
get_in_tkt.c \
get_port.c \
init_creds.c \
init_creds_pw.c \
kcm.c \
kcm.h \
keyblock.c \
keytab.c \
keytab_any.c \
keytab_file.c \
keytab_keyfile.c \
keytab_memory.c \
krb5_locl.h \
krb5-v4compat.h \
krcache.c \
krbhst.c \
kuserok.c \
kuserok_plugin.h \
kx509.c \
log.c \
mcache.c \
misc.c \
mk_cred.c \
mk_error.c \
mk_priv.c \
mk_rep.c \
mk_req.c \
mk_req_ext.c \
mk_safe.c \
mit_glue.c \
net_read.c \
net_write.c \
n-fold.c \
pac.c \
padata.c \
pcache.c \
pkinit.c \
pkinit-ec.c \
principal.c \
prog_setup.c \
prompter_posix.c \
rd_cred.c \
rd_error.c \
rd_priv.c \
rd_rep.c \
rd_req.c \
rd_safe.c \
read_message.c \
recvauth.c \
replay.c \
salt.c \
salt-aes-sha1.c \
salt-aes-sha2.c \
salt-arcfour.c \
salt-des.c \
salt-des3.c \
sp800-108-kdf.c \
scache.c \
send_to_kdc.c \
sendauth.c \
set_default_realm.c \
sock_principal.c \
store.c \
store-int.c \
store-int.h \
store_emem.c \
store_fd.c \
store_mem.c \
store_sock.c \
store_stdio.c \
plugin.c \
ticket.c \
time.c \
transited.c \
verify_init.c \
verify_user.c \
version.c \
warn.c \
write_message.c
nodist_libkrb5_la_SOURCES = \
$(ERR_FILES)
libkrb5_la_DEPENDENCIES = \
version-script.map
libkrb5_la_LDFLAGS = -version-info 26:0:0
if FRAMEWORK_COREFOUNDATION
libkrb5_la_LDFLAGS += -framework CoreFoundation
endif
if versionscript
libkrb5_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
endif
ALL_OBJECTS = $(libkrb5_la_OBJECTS)
ALL_OBJECTS += $(verify_krb5_conf_OBJECTS)
ALL_OBJECTS += $(librfc3961_la_OBJECTS)
ALL_OBJECTS += $(librfc3961_la_OBJECTS)
ALL_OBJECTS += $(krbhst_test_OBJECTS)
ALL_OBJECTS += $(test_alname_OBJECTS)
ALL_OBJECTS += $(test_crypto_OBJECTS)
ALL_OBJECTS += $(test_forward_OBJECTS)
ALL_OBJECTS += $(test_get_addrs_OBJECTS)
ALL_OBJECTS += $(test_gic_OBJECTS)
ALL_OBJECTS += $(test_kuserok_OBJECTS)
ALL_OBJECTS += $(test_renew_OBJECTS)
ALL_OBJECTS += $(test_rfc3961_OBJECTS)
$(ALL_OBJECTS): $(srcdir)/krb5-protos.h $(srcdir)/krb5-private.h
$(ALL_OBJECTS): krb5_err.h k524_err.h k5e1_err.h \
krb_err.h k524_err.h kx509_err.h
librfc3961_la_SOURCES = \
crc.c \
crypto.c \
crypto.h \
crypto-aes-sha1.c \
crypto-aes-sha2.c \
crypto-algs.c \
crypto-arcfour.c \
crypto-des.c \
crypto-des-common.c \
crypto-des3.c \
crypto-evp.c \
crypto-null.c \
crypto-pk.c \
crypto-rand.c \
crypto-stubs.c \
data.c \
enomem.c \
error_string.c \
keyblock.c \
n-fold.c \
salt.c \
salt-aes-sha1.c \
salt-aes-sha2.c \
salt-arcfour.c \
salt-des.c \
salt-des3.c \
sp800-108-kdf.c \
store-int.c \
warn.c
test_rfc3961_LDADD = \
librfc3961.la \
$(top_builddir)/lib/asn1/libasn1.la \
$(top_builddir)/lib/wind/libwind.la \
$(LIB_hcrypto) \
$(LIB_roken)
if DEVELOPER_MODE
headerdeps = $(dist_libkrb5_la_SOURCES)
endif
$(srcdir)/krb5-protos.h: $(headerdeps)
@cd $(srcdir) && perl ../../cf/make-proto.pl -E KRB5_LIB -q -P comment -o krb5-protos.h $(dist_libkrb5_la_SOURCES) || rm -f krb5-protos.h
$(srcdir)/krb5-private.h: $(headerdeps)
@cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5-private.h $(dist_libkrb5_la_SOURCES) || rm -f krb5-private.h
man_MANS = \
kerberos.8 \
krb5.conf.5 \
krb5-plugin.7 \
krb524_convert_creds_kdc.3 \
krb5_425_conv_principal.3 \
krb5_acl_match_file.3 \
krb5_aname_to_localname.3 \
krb5_appdefault.3 \
krb5_auth_context.3 \
krb5_c_make_checksum.3 \
krb5_check_transited.3 \
krb5_create_checksum.3 \
krb5_creds.3 \
krb5_digest.3 \
krb5_eai_to_heim_errno.3 \
krb5_encrypt.3 \
krb5_find_padata.3 \
krb5_generate_random_block.3 \
krb5_get_all_client_addrs.3 \
krb5_get_credentials.3 \
krb5_get_creds.3 \
krb5_get_forwarded_creds.3 \
krb5_get_in_cred.3 \
krb5_get_init_creds.3 \
krb5_get_krbhst.3 \
krb5_getportbyname.3 \
krb5_init_context.3 \
krb5_is_thread_safe.3 \
krb5_krbhst_init.3 \
krb5_mk_req.3 \
krb5_mk_safe.3 \
krb5_openlog.3 \
krb5_parse_name.3 \
krb5_principal.3 \
krb5_rcache.3 \
krb5_rd_error.3 \
krb5_rd_safe.3 \
krb5_set_default_realm.3 \
krb5_set_password.3 \
krb5_string_to_key.3 \
krb5_timeofday.3 \
krb5_verify_init_creds.3 \
krb5_verify_user.3 \
verify_krb5_conf.8
dist_include_HEADERS = \
krb5.h \
$(srcdir)/krb5-protos.h \
krb5_ccapi.h
noinst_HEADERS = $(srcdir)/krb5-private.h
nodist_include_HEADERS = krb5_err.h k524_err.h k5e1_err.h kx509_err.h
# XXX use nobase_include_HEADERS = krb5/locate_plugin.h
krb5dir = $(includedir)/krb5
krb5_HEADERS = \
an2ln_plugin.h \
ccache_plugin.h \
db_plugin.h \
kuserok_plugin.h \
locate_plugin.h \
send_to_kdc_plugin.h
build_HEADERZ = \
$(krb5_HEADERS) \
krb_err.h
CLEANFILES = \
test_config_strings.out \
test-store-data \
krb5_err.c krb5_err.h \
krb_err.c krb_err.h \
k524_err.c k524_err.h \
k5e1_err.c k5e1_err.h \
kx509_err.c kx509_err.h
$(libkrb5_la_OBJECTS): krb5_err.h krb_err.h k524_err.h k5e1_err.h kx509_err.h
test_config_strings.out: test_config_strings.cfg
$(CP) $(srcdir)/test_config_strings.cfg test_config_strings.out
EXTRA_DIST = \
NTMakefile \
dll.c \
libkrb5-exports.def.in \
verify_krb5_conf-version.rc \
krb5_err.et \
krb_err.et \
k524_err.et \
k5e1_err.et \
kx509_err.et \
$(man_MANS) \
version-script.map \
test_config_strings.cfg \
krb5.moduli
#sysconf_DATA = krb5.moduli
# to help stupid solaris make
krb5_err.h: krb5_err.et
krb_err.h: krb_err.et
k524_err.h: k524_err.et
k5e1_err.h: k5e1_err.et
kx509_err.h: kx509_err.et