Files
heimdal/appl/test/Makefile.am
Taylor R Campbell ad23636db8 Add a test for potential DNS leaks via symbol interposition.
We build variants of kinit and test_acquire_cred that define their
own symbols rk_dns_lookup, gethostbyname, gethostbyname2, and
getaddrinfo to print a message and abort.  For getaddrinfo, we abort
only if the caller failed to specify AI_NUMERICHOST; otherwise we use
dlsym(RTLD_NEXT, "getaddrinfo") instead.

The new test tests/gss/check-nodns is like tests/gss/check-basic, but
uses kinit_auditdns and test_acquire_cred_auditdns to verify that no
DNS resolution happens.

This test should work and be effective on ELF platforms where the
getaddrinfo function is implemented by the symbol `getaddrinfo'.  On
non-ELF platforms it may not be effective -- and on platforms where
the getaddrinfo function is implemented by another symbol (like
`__getaddrinfo50') it may not work, but we can cross that bridge when
we come to it.

Verified manually that the test fails, with the expected error
message and abort, without `block_dns = yes' in krb5-nodns.conf.  No
automatic test of the mechanism for now because it might not work on
some platforms.

XXX check-nodns.in is copypasta of check-basic.in, should factor out
the common parts so they don't get out of sync.
2024-01-08 10:22:02 -06:00

67 lines
1.8 KiB
Makefile

# $Id$
include $(top_srcdir)/Makefile.am.common
WFLAGS += $(WFLAGS_LITE)
noinst_PROGRAMS = tcp_client tcp_server gssapi_server gssapi_client \
uu_server uu_client nt_gss_server nt_gss_client http_client \
kinit_auditdns
tcp_client_SOURCES = tcp_client.c common.c test_locl.h
tcp_server_SOURCES = tcp_server.c common.c test_locl.h
gssapi_server_SOURCES = gssapi_server.c gss_common.c common.c \
gss_common.h test_locl.h
gssapi_client_SOURCES = gssapi_client.c gss_common.c common.c \
gss_common.h test_locl.h
http_client_SOURCES = http_client.c gss_common.c common.c \
gss_common.h test_locl.h
uu_server_SOURCES = uu_server.c common.c test_locl.h
uu_client_SOURCES = uu_client.c common.c test_locl.h
gssapi_server_LDADD = $(top_builddir)/lib/gssapi/libgssapi.la $(LDADD)
gssapi_client_LDADD = $(gssapi_server_LDADD)
http_client_LDADD = $(top_builddir)/lib/gssapi/libgssapi.la $(LDADD)
nt_gss_client_SOURCES = nt_gss_client.c nt_gss_common.c nt_gss_common.h common.c
nt_gss_server_SOURCES = nt_gss_server.c nt_gss_common.c nt_gss_common.h
nt_gss_client_LDADD = $(gssapi_server_LDADD)
nt_gss_server_LDADD = $(nt_gss_client_LDADD)
kinit_auditdns_SOURCES = ../../kuser/kinit.c auditdns.c
kinit_auditdns_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../lib/krb5
# sync with kinit_LDADD in kuser/Makefile.am
if !NO_AFS
afs_lib = $(LIB_kafs)
endif
kinit_auditdns_LDADD = \
$(afs_lib) \
$(top_builddir)/lib/krb5/libkrb5.la \
$(top_builddir)/lib/gssapi/libgssapi.la \
$(top_builddir)/lib/gss_preauth/libgss_preauth.la \
$(top_builddir)/lib/ntlm/libheimntlm.la \
$(LIB_hcrypto) \
$(top_builddir)/lib/asn1/libasn1.la \
$(LIB_libintl) \
$(LIB_roken)
LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
$(LIB_hcrypto) \
$(top_builddir)/lib/asn1/libasn1.la \
$(LIB_roken)
EXTRA_DIST = NTMakefile jgssapi_server.java