diff options
Diffstat (limited to 'crypto/heimdal/lib/krb5')
77 files changed, 5133 insertions, 3078 deletions
diff --git a/crypto/heimdal/lib/krb5/Makefile b/crypto/heimdal/lib/krb5/Makefile new file mode 100644 index 0000000..3bdc8a7 --- /dev/null +++ b/crypto/heimdal/lib/krb5/Makefile @@ -0,0 +1,1141 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# lib/krb5/Makefile. Generated from Makefile.in by configure. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# $Id: Makefile.am,v 1.145 2002/08/29 04:02:24 assar Exp $ + +# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $ + +# $Id: Makefile.am.common,v 1.36 2002/08/19 16:10:25 joda Exp $ +SHELL = /bin/sh + +srcdir = . +top_srcdir = ../.. + +prefix = /usr/heimdal +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = /etc +sharedstatedir = ${prefix}/com +localstatedir = /var/heimdal +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/heimdal +pkglibdir = $(libdir)/heimdal +pkgincludedir = $(includedir)/heimdal +top_builddir = ../.. + +ACLOCAL = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run aclocal-1.6 +AUTOCONF = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run autoconf +AUTOMAKE = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run automake-1.6 +AUTOHEADER = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run autoheader + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i386-unknown-freebsd5.0 + +EXEEXT = +OBJEXT = o +PATH_SEPARATOR = : +AIX_EXTRA_KAFS = +AMTAR = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run tar +AS = @AS@ +AWK = gawk +CANONICAL_HOST = i386-unknown-freebsd5.0 +CATMAN = /usr/bin/nroff -mdoc $< > $@ +CATMANEXT = $$section +CC = gcc +COMPILE_ET = compile_et +CPP = gcc -E +DBLIB = +DEPDIR = .deps +DIR_com_err = +DIR_des = +DIR_roken = roken +DLLTOOL = @DLLTOOL@ +ECHO = echo +EXTRA_LIB45 = +GROFF = /usr/bin/groff +INCLUDES_roken = -I$(top_builddir)/lib/roken -I$(top_srcdir)/lib/roken +INCLUDE_ = @INCLUDE_@ +INCLUDE_des = +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +LEX = flex + +LEXLIB = -lfl +LEX_OUTPUT_ROOT = lex.yy +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIB_ = @LIB_@ +LIB_AUTH_SUBDIRS = +LIB_NDBM = +LIB_com_err = -lcom_err +LIB_com_err_a = +LIB_com_err_so = +LIB_des = -lcrypto +LIB_des_a = -lcrypto +LIB_des_appl = -lcrypto +LIB_des_so = -lcrypto +LIB_kdb = +LIB_otp = $(top_builddir)/lib/otp/libotp.la +LIB_roken = $(top_builddir)/lib/vers/libvers.la $(top_builddir)/lib/roken/libroken.la $(LIB_crypt) $(LIB_dbopen) +LIB_security = +LN_S = ln -s +LTLIBOBJS = copyhostent.lo ecalloc.lo emalloc.lo erealloc.lo estrdup.lo strlwr.lo strndup.lo strnlen.lo strsep_copy.lo strupr.lo +NEED_WRITEAUTH_FALSE = +NEED_WRITEAUTH_TRUE = # +NROFF = /usr/bin/nroff +OBJDUMP = @OBJDUMP@ +PACKAGE = heimdal +RANLIB = ranlib +STRIP = strip +VERSION = 0.4f +VOID_RETSIGTYPE = +WFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs +WFLAGS_NOIMPLICITINT = +WFLAGS_NOUNUSED = +X_CFLAGS = -I/usr/X11R6/include +X_EXTRA_LIBS = +X_LIBS = -L/usr/X11R6/lib +X_PRE_LIBS = -lSM -lICE +YACC = bison -y +am__include = include +am__quote = +dpagaix_cflags = -D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce +dpagaix_ldadd = -L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r +dpagaix_ldflags = -Wl,-bI:dfspag.exp +install_sh = /usr/home/nectar/devel/heimdal/install-sh + +AUTOMAKE_OPTIONS = foreign no-dependencies 1.6 + +SUFFIXES = .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 + +INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_krb4) $(INCLUDE_des) -I../com_err -I$(srcdir)/../com_err + +ROKEN_RENAME = -DROKEN_RENAME + +AM_CFLAGS = $(WFLAGS) + +CP = cp + +buildinclude = $(top_builddir)/include + +LIB_XauReadAuth = -lXau +LIB_crypt = -lcrypt +LIB_dbm_firstkey = +LIB_dbopen = +LIB_dlopen = +LIB_dn_expand = +LIB_el_init = -ledit +LIB_getattr = @LIB_getattr@ +LIB_gethostbyname = +LIB_getpwent_r = @LIB_getpwent_r@ +LIB_getpwnam_r = +LIB_getsockopt = +LIB_logout = -lutil +LIB_logwtmp = -lutil +LIB_odm_initialize = @LIB_odm_initialize@ +LIB_openpty = -lutil +LIB_pidfile = +LIB_res_search = +LIB_setpcred = @LIB_setpcred@ +LIB_setsockopt = +LIB_socket = +LIB_syslog = +LIB_tgetent = -ltermcap + +HESIODLIB = @HESIODLIB@ +HESIODINCLUDE = @HESIODINCLUDE@ +INCLUDE_hesiod = +LIB_hesiod = + +INCLUDE_krb4 = +LIB_krb4 = + +INCLUDE_openldap = +LIB_openldap = + +INCLUDE_readline = +LIB_readline = $(top_builddir)/lib/editline/libel_compat.la $(LIB_el_init) $(LIB_tgetent) + +NROFF_MAN = groff -mandoc -Tascii + +#LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) + +LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la + +LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la + +#LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la + +bin_PROGRAMS = verify_krb5_conf + +noinst_PROGRAMS = dump_config test_get_addrs krbhst-test + +TESTS = \ + n-fold-test \ + string-to-key-test \ + derived-key-test \ + store-test \ + parse-name-test + + +check_PROGRAMS = $(TESTS) + +LDADD = libkrb5.la \ + $(LIB_des) \ + $(top_builddir)/lib/asn1/libasn1.la \ + $(LIB_roken) + + +libkrb5_la_LIBADD = \ + ../com_err/error.lo ../com_err/com_err.lo \ + $(LIB_des) \ + $(top_builddir)/lib/asn1/libasn1.la \ + $(LIB_roken) + + +lib_LTLIBRARIES = libkrb5.la + +ERR_FILES = krb5_err.c heim_err.c k524_err.c + +libkrb5_la_SOURCES = \ + acl.c \ + add_et_list.c \ + addr_families.c \ + aname_to_localname.c \ + appdefault.c \ + asn1_glue.c \ + auth_context.c \ + build_ap_req.c \ + build_auth.c \ + cache.c \ + changepw.c \ + codec.c \ + config_file.c \ + config_file_netinfo.c \ + convert_creds.c \ + constants.c \ + context.c \ + copy_host_realm.c \ + crc.c \ + creds.c \ + crypto.c \ + data.c \ + eai_to_heim_errno.c \ + error_string.c \ + expand_hostname.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_in_tkt_pw.c \ + get_in_tkt_with_keytab.c \ + get_in_tkt_with_skey.c \ + get_port.c \ + init_creds.c \ + init_creds_pw.c \ + keyblock.c \ + keytab.c \ + keytab_any.c \ + keytab_file.c \ + keytab_memory.c \ + keytab_keyfile.c \ + keytab_krb4.c \ + krbhst.c \ + kuserok.c \ + log.c \ + mcache.c \ + misc.c \ + mk_error.c \ + mk_priv.c \ + mk_rep.c \ + mk_req.c \ + mk_req_ext.c \ + mk_safe.c \ + net_read.c \ + net_write.c \ + n-fold.c \ + padata.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 \ + send_to_kdc.c \ + sendauth.c \ + set_default_realm.c \ + sock_principal.c \ + store.c \ + store-int.h \ + store_emem.c \ + store_fd.c \ + store_mem.c \ + ticket.c \ + time.c \ + transited.c \ + verify_init.c \ + verify_user.c \ + version.c \ + warn.c \ + write_message.c \ + $(ERR_FILES) + + +libkrb5_la_LDFLAGS = -version-info 18:3:1 + + +#libkrb5_la_LIBADD = ../com_err/error.lo ../com_err/com_err.lo +man_MANS = \ + kerberos.8 \ + krb5.3 \ + krb5.conf.5 \ + krb5_425_conv_principal.3 \ + krb5_appdefault.3 \ + krb5_auth_context.3 \ + krb5_build_principal.3 \ + krb5_config.3 \ + krb5_context.3 \ + krb5_create_checksum.3 \ + krb5_crypto_init.3 \ + krb5_encrypt.3 \ + krb5_free_addresses.3 \ + krb5_free_principal.3 \ + krb5_get_all_client_addrs.3 \ + krb5_get_krbhst.3 \ + krb5_init_context.3 \ + krb5_keytab.3 \ + krb5_krbhst_init.3 \ + krb5_openlog.3 \ + krb5_parse_name.3 \ + krb5_principal_get_realm.3 \ + krb5_sname_to_principal.3 \ + krb5_timeofday.3 \ + krb5_unparse_name.3 \ + krb5_verify_user.3 \ + krb5_warn.3 \ + verify_krb5_conf.8 + + +include_HEADERS = krb5.h krb5-protos.h krb5-private.h krb5_err.h heim_err.h k524_err.h + +CLEANFILES = krb5_err.c krb5_err.h heim_err.c heim_err.h k524_err.c k524_err.h +subdir = lib/krb5 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + +libkrb5_la_DEPENDENCIES = ../com_err/error.lo ../com_err/com_err.lo \ + $(top_builddir)/lib/asn1/libasn1.la +am__objects_1 = krb5_err.lo heim_err.lo k524_err.lo +am_libkrb5_la_OBJECTS = acl.lo add_et_list.lo addr_families.lo \ + aname_to_localname.lo appdefault.lo asn1_glue.lo \ + auth_context.lo build_ap_req.lo build_auth.lo cache.lo \ + changepw.lo codec.lo config_file.lo config_file_netinfo.lo \ + convert_creds.lo constants.lo context.lo copy_host_realm.lo \ + crc.lo creds.lo crypto.lo data.lo eai_to_heim_errno.lo \ + error_string.lo expand_hostname.lo fcache.lo free.lo \ + free_host_realm.lo generate_seq_number.lo generate_subkey.lo \ + get_addrs.lo get_cred.lo get_default_principal.lo \ + get_default_realm.lo get_for_creds.lo get_host_realm.lo \ + get_in_tkt.lo get_in_tkt_pw.lo get_in_tkt_with_keytab.lo \ + get_in_tkt_with_skey.lo get_port.lo init_creds.lo \ + init_creds_pw.lo keyblock.lo keytab.lo keytab_any.lo \ + keytab_file.lo keytab_memory.lo keytab_keyfile.lo \ + keytab_krb4.lo krbhst.lo kuserok.lo log.lo mcache.lo misc.lo \ + mk_error.lo mk_priv.lo mk_rep.lo mk_req.lo mk_req_ext.lo \ + mk_safe.lo net_read.lo net_write.lo n-fold.lo padata.lo \ + principal.lo prog_setup.lo prompter_posix.lo rd_cred.lo \ + rd_error.lo rd_priv.lo rd_rep.lo rd_req.lo rd_safe.lo \ + read_message.lo recvauth.lo replay.lo send_to_kdc.lo \ + sendauth.lo set_default_realm.lo sock_principal.lo store.lo \ + store_emem.lo store_fd.lo store_mem.lo ticket.lo time.lo \ + transited.lo verify_init.lo verify_user.lo version.lo warn.lo \ + write_message.lo $(am__objects_1) +libkrb5_la_OBJECTS = $(am_libkrb5_la_OBJECTS) +bin_PROGRAMS = verify_krb5_conf$(EXEEXT) +check_PROGRAMS = n-fold-test$(EXEEXT) string-to-key-test$(EXEEXT) \ + derived-key-test$(EXEEXT) store-test$(EXEEXT) \ + parse-name-test$(EXEEXT) +noinst_PROGRAMS = dump_config$(EXEEXT) test_get_addrs$(EXEEXT) \ + krbhst-test$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) + +derived_key_test_SOURCES = derived-key-test.c +derived_key_test_OBJECTS = derived-key-test.$(OBJEXT) +derived_key_test_LDADD = $(LDADD) +derived_key_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +derived_key_test_LDFLAGS = +dump_config_SOURCES = dump_config.c +dump_config_OBJECTS = dump_config.$(OBJEXT) +dump_config_LDADD = $(LDADD) +dump_config_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +dump_config_LDFLAGS = +krbhst_test_SOURCES = krbhst-test.c +krbhst_test_OBJECTS = krbhst-test.$(OBJEXT) +krbhst_test_LDADD = $(LDADD) +krbhst_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +krbhst_test_LDFLAGS = +n_fold_test_SOURCES = n-fold-test.c +n_fold_test_OBJECTS = n-fold-test.$(OBJEXT) +n_fold_test_LDADD = $(LDADD) +n_fold_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +n_fold_test_LDFLAGS = +parse_name_test_SOURCES = parse-name-test.c +parse_name_test_OBJECTS = parse-name-test.$(OBJEXT) +parse_name_test_LDADD = $(LDADD) +parse_name_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +parse_name_test_LDFLAGS = +store_test_SOURCES = store-test.c +store_test_OBJECTS = store-test.$(OBJEXT) +store_test_LDADD = $(LDADD) +store_test_DEPENDENCIES = libkrb5.la $(top_builddir)/lib/asn1/libasn1.la +store_test_LDFLAGS = +string_to_key_test_SOURCES = string-to-key-test.c +string_to_key_test_OBJECTS = string-to-key-test.$(OBJEXT) +string_to_key_test_LDADD = $(LDADD) +string_to_key_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +string_to_key_test_LDFLAGS = +test_get_addrs_SOURCES = test_get_addrs.c +test_get_addrs_OBJECTS = test_get_addrs.$(OBJEXT) +test_get_addrs_LDADD = $(LDADD) +test_get_addrs_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +test_get_addrs_LDFLAGS = +verify_krb5_conf_SOURCES = verify_krb5_conf.c +verify_krb5_conf_OBJECTS = verify_krb5_conf.$(OBJEXT) +verify_krb5_conf_LDADD = $(LDADD) +verify_krb5_conf_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +verify_krb5_conf_LDFLAGS = + +DEFS = -DHAVE_CONFIG_H +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include +CPPFLAGS = +LDFLAGS = +LIBS = +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = -DINET6 -g -O2 +DIST_SOURCES = $(libkrb5_la_SOURCES) derived-key-test.c dump_config.c \ + krbhst-test.c n-fold-test.c parse-name-test.c store-test.c \ + string-to-key-test.c test_get_addrs.c verify_krb5_conf.c +MANS = $(man_MANS) +HEADERS = $(include_HEADERS) + +DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in +SOURCES = $(libkrb5_la_SOURCES) derived-key-test.c dump_config.c krbhst-test.c n-fold-test.c parse-name-test.c store-test.c string-to-key-test.c test_get_addrs.c verify_krb5_conf.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign lib/krb5/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +libLTLIBRARIES_INSTALL = $(INSTALL) +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test -z "$dir" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libkrb5.la: $(libkrb5_la_OBJECTS) $(libkrb5_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libkrb5_la_LDFLAGS) $(libkrb5_la_OBJECTS) $(libkrb5_la_LIBADD) $(LIBS) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +derived-key-test$(EXEEXT): $(derived_key_test_OBJECTS) $(derived_key_test_DEPENDENCIES) + @rm -f derived-key-test$(EXEEXT) + $(LINK) $(derived_key_test_LDFLAGS) $(derived_key_test_OBJECTS) $(derived_key_test_LDADD) $(LIBS) +dump_config$(EXEEXT): $(dump_config_OBJECTS) $(dump_config_DEPENDENCIES) + @rm -f dump_config$(EXEEXT) + $(LINK) $(dump_config_LDFLAGS) $(dump_config_OBJECTS) $(dump_config_LDADD) $(LIBS) +krbhst-test$(EXEEXT): $(krbhst_test_OBJECTS) $(krbhst_test_DEPENDENCIES) + @rm -f krbhst-test$(EXEEXT) + $(LINK) $(krbhst_test_LDFLAGS) $(krbhst_test_OBJECTS) $(krbhst_test_LDADD) $(LIBS) +n-fold-test$(EXEEXT): $(n_fold_test_OBJECTS) $(n_fold_test_DEPENDENCIES) + @rm -f n-fold-test$(EXEEXT) + $(LINK) $(n_fold_test_LDFLAGS) $(n_fold_test_OBJECTS) $(n_fold_test_LDADD) $(LIBS) +parse-name-test$(EXEEXT): $(parse_name_test_OBJECTS) $(parse_name_test_DEPENDENCIES) + @rm -f parse-name-test$(EXEEXT) + $(LINK) $(parse_name_test_LDFLAGS) $(parse_name_test_OBJECTS) $(parse_name_test_LDADD) $(LIBS) +store-test$(EXEEXT): $(store_test_OBJECTS) $(store_test_DEPENDENCIES) + @rm -f store-test$(EXEEXT) + $(LINK) $(store_test_LDFLAGS) $(store_test_OBJECTS) $(store_test_LDADD) $(LIBS) +string-to-key-test$(EXEEXT): $(string_to_key_test_OBJECTS) $(string_to_key_test_DEPENDENCIES) + @rm -f string-to-key-test$(EXEEXT) + $(LINK) $(string_to_key_test_LDFLAGS) $(string_to_key_test_OBJECTS) $(string_to_key_test_LDADD) $(LIBS) +test_get_addrs$(EXEEXT): $(test_get_addrs_OBJECTS) $(test_get_addrs_DEPENDENCIES) + @rm -f test_get_addrs$(EXEEXT) + $(LINK) $(test_get_addrs_LDFLAGS) $(test_get_addrs_OBJECTS) $(test_get_addrs_LDADD) $(LIBS) +verify_krb5_conf$(EXEEXT): $(verify_krb5_conf_OBJECTS) $(verify_krb5_conf_DEPENDENCIES) + @rm -f verify_krb5_conf$(EXEEXT) + $(LINK) $(verify_krb5_conf_LDFLAGS) $(verify_krb5_conf_OBJECTS) $(verify_krb5_conf_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.c.lo: + $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +man3dir = $(mandir)/man3 +install-man3: $(man3_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man3dir) + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \ + done +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \ + rm -f $(DESTDIR)$(man3dir)/$$inst; \ + done + +man5dir = $(mandir)/man5 +install-man5: $(man5_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man5dir) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ + done +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ + rm -f $(DESTDIR)$(man5dir)/$$inst; \ + done + +man8dir = $(mandir)/man8 +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man8dir) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + done +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ + rm -f $(DESTDIR)$(man8dir)/$$inst; \ + done +includeHEADERS_INSTALL = $(INSTALL_HEADER) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(includedir) + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ + $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(includedir)/$$f"; \ + rm -f $(DESTDIR)$(includedir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="${top_distdir}" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) all-local +install-binPROGRAMS: install-libLTLIBRARIES + + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(man3dir) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir) $(DESTDIR)$(includedir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-includeHEADERS install-man + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: install-man3 install-man5 install-man8 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-info-am uninstall-libLTLIBRARIES uninstall-man + +uninstall-man: uninstall-man3 uninstall-man5 uninstall-man8 + +.PHONY: GTAGS all all-am all-local check check-TESTS check-am \ + check-local clean clean-binPROGRAMS clean-checkPROGRAMS \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstPROGRAMS distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-data-local install-exec \ + install-exec-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man install-man3 \ + install-man5 install-man8 install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \ + uninstall-man3 uninstall-man5 uninstall-man8 + + +install-suid-programs: + @foo='$(bin_SUIDS)'; \ + for file in $$foo; do \ + x=$(DESTDIR)$(bindir)/$$file; \ + if chown 0:0 $$x && chmod u+s $$x; then :; else \ + echo "*"; \ + echo "* Failed to install $$x setuid root"; \ + echo "*"; \ + fi; done + +install-exec-hook: install-suid-programs + +install-build-headers:: $(include_HEADERS) $(build_HEADERZ) + @foo='$(include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \ + for f in $$foo; do \ + f=`basename $$f`; \ + if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ + else file="$$f"; fi; \ + if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \ + : ; else \ + echo " $(CP) $$file $(buildinclude)/$$f"; \ + $(CP) $$file $(buildinclude)/$$f; \ + fi ; \ + done + +all-local: install-build-headers + +check-local:: + @if test '$(CHECK_LOCAL)'; then \ + foo='$(CHECK_LOCAL)'; else \ + foo='$(PROGRAMS)'; fi; \ + if test "$$foo"; then \ + failed=0; all=0; \ + for i in $$foo; do \ + all=`expr $$all + 1`; \ + if ./$$i --version > /dev/null 2>&1; then \ + echo "PASS: $$i"; \ + else \ + echo "FAIL: $$i"; \ + failed=`expr $$failed + 1`; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +.x.c: + @cmp -s $< $@ 2> /dev/null || cp $< $@ +#NROFF_MAN = nroff -man +.1.cat1: + $(NROFF_MAN) $< > $@ +.3.cat3: + $(NROFF_MAN) $< > $@ +.5.cat5: + $(NROFF_MAN) $< > $@ +.8.cat8: + $(NROFF_MAN) $< > $@ + +dist-cat1-mans: + @foo='$(man1_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.1) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat3-mans: + @foo='$(man3_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.3) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat5-mans: + @foo='$(man5_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.5) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-cat8-mans: + @foo='$(man8_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.8) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + +dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans + +install-cat-mans: + $(SHELL) $(top_srcdir)/cf/install-catman.sh "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS) + +install-data-local: install-cat-mans + +.et.h: + $(COMPILE_ET) $< +.et.c: + $(COMPILE_ET) $< + +$(libkrb5_la_OBJECTS): $(srcdir)/krb5-protos.h $(srcdir)/krb5-private.h + +$(srcdir)/krb5-protos.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -o krb5-protos.h $(libkrb5_la_SOURCES) || rm -f krb5-protos.h + +$(srcdir)/krb5-private.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5-private.h $(libkrb5_la_SOURCES) || rm -f krb5-private.h + +$(libkrb5_la_OBJECTS): krb5_err.h heim_err.h k524_err.h + +# to help stupid solaris make + +krb5_err.h: krb5_err.et + +heim_err.h: heim_err.et + +k524_err.h: k524_err.et +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/crypto/heimdal/lib/krb5/Makefile.am b/crypto/heimdal/lib/krb5/Makefile.am index 8dff3d1..e88a28e 100644 --- a/crypto/heimdal/lib/krb5/Makefile.am +++ b/crypto/heimdal/lib/krb5/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.141 2001/11/20 22:19:10 assar Exp $ +# $Id: Makefile.am,v 1.145 2002/08/29 04:02:24 assar Exp $ include $(top_srcdir)/Makefile.am.common @@ -8,8 +8,14 @@ bin_PROGRAMS = verify_krb5_conf noinst_PROGRAMS = dump_config test_get_addrs krbhst-test -check_PROGRAMS = n-fold-test string-to-key-test derived-key-test store-test -TESTS = n-fold-test string-to-key-test derived-key-test store-test +TESTS = \ + n-fold-test \ + string-to-key-test \ + derived-key-test \ + store-test \ + parse-name-test + +check_PROGRAMS = $(TESTS) LDADD = libkrb5.la \ $(LIB_des) \ @@ -109,6 +115,7 @@ libkrb5_la_SOURCES = \ set_default_realm.c \ sock_principal.c \ store.c \ + store-int.h \ store_emem.c \ store_fd.c \ store_mem.c \ @@ -122,15 +129,15 @@ libkrb5_la_SOURCES = \ write_message.c \ $(ERR_FILES) -libkrb5_la_LDFLAGS = -version-info 18:2:1 +libkrb5_la_LDFLAGS = -version-info 18:3:1 $(libkrb5_la_OBJECTS): $(srcdir)/krb5-protos.h $(srcdir)/krb5-private.h -$(srcdir)/krb5-protos.h: - cd $(srcdir); perl ../../cf/make-proto.pl -o krb5-protos.h $(libkrb5_la_SOURCES) || rm -f krb5-protos.h +$(srcdir)/krb5-protos.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -o krb5-protos.h $(libkrb5_la_SOURCES) || rm -f krb5-protos.h -$(srcdir)/krb5-private.h: - cd $(srcdir); perl ../../cf/make-proto.pl -p krb5-private.h $(libkrb5_la_SOURCES) || rm -f krb5-private.h +$(srcdir)/krb5-private.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5-private.h $(libkrb5_la_SOURCES) || rm -f krb5-private.h #libkrb5_la_LIBADD = ../com_err/error.lo ../com_err/com_err.lo diff --git a/crypto/heimdal/lib/krb5/Makefile.in b/crypto/heimdal/lib/krb5/Makefile.in index 6c89b8b..7126546 100644 --- a/crypto/heimdal/lib/krb5/Makefile.in +++ b/crypto/heimdal/lib/krb5/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.5 from Makefile.am. +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,14 +14,11 @@ @SET_MAKE@ -# $Id: Makefile.am,v 1.141 2001/11/20 22:19:10 assar Exp $ +# $Id: Makefile.am,v 1.145 2002/08/29 04:02:24 assar Exp $ +# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $ -# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ - - -# $Id: Makefile.am.common,v 1.31 2001/09/01 11:12:18 assar Exp $ - +# $Id: Makefile.am.common,v 1.36 2002/08/19 16:10:25 joda Exp $ SHELL = @SHELL@ srcdir = @srcdir@ @@ -51,9 +49,13 @@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ @@ -65,6 +67,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@ AMTAR = @AMTAR@ AS = @AS@ @@ -81,7 +87,7 @@ DIR_com_err = @DIR_com_err@ DIR_des = @DIR_des@ DIR_roken = @DIR_roken@ DLLTOOL = @DLLTOOL@ -EXEEXT = @EXEEXT@ +ECHO = @ECHO@ EXTRA_LIB45 = @EXTRA_LIB45@ GROFF = @GROFF@ INCLUDES_roken = @INCLUDES_roken@ @@ -89,7 +95,9 @@ INCLUDE_ = @INCLUDE_@ INCLUDE_des = @INCLUDE_des@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LEX = @LEX@ -LIBOBJS = @LIBOBJS@ + +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBTOOL = @LIBTOOL@ LIB_ = @LIB_@ LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@ @@ -111,9 +119,9 @@ NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@ NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ +STRIP = @STRIP@ VERSION = @VERSION@ VOID_RETSIGTYPE = @VOID_RETSIGTYPE@ WFLAGS = @WFLAGS@ @@ -126,16 +134,19 @@ X_PRE_LIBS = @X_PRE_LIBS@ YACC = @YACC@ am__include = @am__include@ am__quote = @am__quote@ -dpagaix_CFLAGS = @dpagaix_CFLAGS@ -dpagaix_LDADD = @dpagaix_LDADD@ +dpagaix_cflags = @dpagaix_cflags@ +dpagaix_ldadd = @dpagaix_ldadd@ +dpagaix_ldflags = @dpagaix_ldflags@ install_sh = @install_sh@ -AUTOMAKE_OPTIONS = foreign no-dependencies 1.4b +AUTOMAKE_OPTIONS = foreign no-dependencies 1.6 -SUFFIXES = .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x +SUFFIXES = .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_krb4) $(INCLUDE_des) -I../com_err -I$(srcdir)/../com_err +@do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME + AM_CFLAGS = $(WFLAGS) CP = cp @@ -166,8 +177,6 @@ LIB_socket = @LIB_socket@ LIB_syslog = @LIB_syslog@ LIB_tgetent = @LIB_tgetent@ -LIBS = @LIBS@ - HESIODLIB = @HESIODLIB@ HESIODINCLUDE = @HESIODINCLUDE@ INCLUDE_hesiod = @INCLUDE_hesiod@ @@ -182,8 +191,6 @@ LIB_openldap = @LIB_openldap@ INCLUDE_readline = @INCLUDE_readline@ LIB_readline = @LIB_readline@ -LEXLIB = @LEXLIB@ - NROFF_MAN = groff -mandoc -Tascii @KRB4_TRUE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) @@ -195,14 +202,19 @@ NROFF_MAN = groff -mandoc -Tascii @DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la -CHECK_LOCAL = $(PROGRAMS) - bin_PROGRAMS = verify_krb5_conf noinst_PROGRAMS = dump_config test_get_addrs krbhst-test -check_PROGRAMS = n-fold-test string-to-key-test derived-key-test store-test -TESTS = n-fold-test string-to-key-test derived-key-test store-test +TESTS = \ + n-fold-test \ + string-to-key-test \ + derived-key-test \ + store-test \ + parse-name-test + + +check_PROGRAMS = $(TESTS) LDADD = libkrb5.la \ $(LIB_des) \ @@ -304,6 +316,7 @@ libkrb5_la_SOURCES = \ set_default_realm.c \ sock_principal.c \ store.c \ + store-int.h \ store_emem.c \ store_fd.c \ store_mem.c \ @@ -318,7 +331,7 @@ libkrb5_la_SOURCES = \ $(ERR_FILES) -libkrb5_la_LDFLAGS = -version-info 18:2:1 +libkrb5_la_LDFLAGS = -version-info 18:3:1 #libkrb5_la_LIBADD = ../com_err/error.lo ../com_err/com_err.lo @@ -364,6 +377,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libkrb5_la_DEPENDENCIES = ../com_err/error.lo ../com_err/com_err.lo \ $(top_builddir)/lib/asn1/libasn1.la +am__objects_1 = krb5_err.lo heim_err.lo k524_err.lo am_libkrb5_la_OBJECTS = acl.lo add_et_list.lo addr_families.lo \ aname_to_localname.lo appdefault.lo asn1_glue.lo \ auth_context.lo build_ap_req.lo build_auth.lo cache.lo \ @@ -387,11 +401,12 @@ am_libkrb5_la_OBJECTS = acl.lo add_et_list.lo addr_families.lo \ sendauth.lo set_default_realm.lo sock_principal.lo store.lo \ store_emem.lo store_fd.lo store_mem.lo ticket.lo time.lo \ transited.lo verify_init.lo verify_user.lo version.lo warn.lo \ - write_message.lo krb5_err.lo heim_err.lo k524_err.lo + write_message.lo $(am__objects_1) libkrb5_la_OBJECTS = $(am_libkrb5_la_OBJECTS) bin_PROGRAMS = verify_krb5_conf$(EXEEXT) check_PROGRAMS = n-fold-test$(EXEEXT) string-to-key-test$(EXEEXT) \ - derived-key-test$(EXEEXT) store-test$(EXEEXT) + derived-key-test$(EXEEXT) store-test$(EXEEXT) \ + parse-name-test$(EXEEXT) noinst_PROGRAMS = dump_config$(EXEEXT) test_get_addrs$(EXEEXT) \ krbhst-test$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) @@ -420,6 +435,12 @@ n_fold_test_LDADD = $(LDADD) n_fold_test_DEPENDENCIES = libkrb5.la \ $(top_builddir)/lib/asn1/libasn1.la n_fold_test_LDFLAGS = +parse_name_test_SOURCES = parse-name-test.c +parse_name_test_OBJECTS = parse-name-test.$(OBJEXT) +parse_name_test_LDADD = $(LDADD) +parse_name_test_DEPENDENCIES = libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +parse_name_test_LDFLAGS = store_test_SOURCES = store-test.c store_test_OBJECTS = store-test.$(OBJEXT) store_test_LDADD = $(LDADD) @@ -448,7 +469,9 @@ DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ depcomp = +am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ @@ -458,57 +481,54 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libkrb5_la_SOURCES) derived-key-test.c dump_config.c \ - krbhst-test.c n-fold-test.c store-test.c string-to-key-test.c \ - test_get_addrs.c verify_krb5_conf.c - -NROFF = nroff + krbhst-test.c n-fold-test.c parse-name-test.c store-test.c \ + string-to-key-test.c test_get_addrs.c verify_krb5_conf.c MANS = $(man_MANS) HEADERS = $(include_HEADERS) DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in -SOURCES = $(libkrb5_la_SOURCES) derived-key-test.c dump_config.c krbhst-test.c n-fold-test.c store-test.c string-to-key-test.c test_get_addrs.c verify_krb5_conf.c +SOURCES = $(libkrb5_la_SOURCES) derived-key-test.c dump_config.c krbhst-test.c n-fold-test.c parse-name-test.c store-test.c string-to-key-test.c test_get_addrs.c verify_krb5_conf.c all: all-am .SUFFIXES: -.SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool +.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/krb5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && \ - CONFIG_HEADERS= CONFIG_LINKS= \ - CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test -z "$dir" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done libkrb5.la: $(libkrb5_la_OBJECTS) $(libkrb5_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libkrb5_la_LDFLAGS) $(libkrb5_la_OBJECTS) $(libkrb5_la_LIBADD) $(LIBS) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @@ -517,28 +537,40 @@ install-binPROGRAMS: $(bin_PROGRAMS) if test -f $$p \ || test -f $$p1 \ ; then \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done derived-key-test$(EXEEXT): $(derived_key_test_OBJECTS) $(derived_key_test_DEPENDENCIES) @rm -f derived-key-test$(EXEEXT) $(LINK) $(derived_key_test_LDFLAGS) $(derived_key_test_OBJECTS) $(derived_key_test_LDADD) $(LIBS) @@ -551,6 +583,9 @@ krbhst-test$(EXEEXT): $(krbhst_test_OBJECTS) $(krbhst_test_DEPENDENCIES) n-fold-test$(EXEEXT): $(n_fold_test_OBJECTS) $(n_fold_test_DEPENDENCIES) @rm -f n-fold-test$(EXEEXT) $(LINK) $(n_fold_test_LDFLAGS) $(n_fold_test_OBJECTS) $(n_fold_test_LDADD) $(LIBS) +parse-name-test$(EXEEXT): $(parse_name_test_OBJECTS) $(parse_name_test_DEPENDENCIES) + @rm -f parse-name-test$(EXEEXT) + $(LINK) $(parse_name_test_LDFLAGS) $(parse_name_test_OBJECTS) $(parse_name_test_LDADD) $(LIBS) store-test$(EXEEXT): $(store_test_OBJECTS) $(store_test_DEPENDENCIES) @rm -f store-test$(EXEEXT) $(LINK) $(store_test_LDFLAGS) $(store_test_OBJECTS) $(store_test_LDADD) $(LIBS) @@ -571,13 +606,22 @@ distclean-compile: -rm -f *.tab.c .c.o: - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: - $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< + $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool uninstall-info-am: man3dir = $(mandir)/man3 @@ -595,6 +639,10 @@ install-man3: $(man3_MANS) $(man_MANS) if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ @@ -634,6 +682,10 @@ install-man5: $(man5_MANS) $(man_MANS) if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ @@ -673,6 +725,10 @@ install-man8: $(man8_MANS) $(man_MANS) if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ @@ -696,14 +752,15 @@ uninstall-man8: echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done +includeHEADERS_INSTALL = $(INSTALL_HEADER) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ - $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f; \ + echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ + $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ done uninstall-includeHEADERS: @@ -714,32 +771,36 @@ uninstall-includeHEADERS: rm -f $(DESTDIR)$(includedir)/$$f; \ done +ETAGS = etags +ETAGSFLAGS = + tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - mkid -fID $$unique $(LISP) + mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique GTAGS: - here=`CDPATH=: && cd $(top_builddir) && pwd` \ + here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here @@ -799,23 +860,27 @@ check-TESTS: $(TESTS) echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ - fi - + else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir) \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -847,6 +912,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -855,7 +921,7 @@ clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -936,7 +1002,7 @@ install-suid-programs: install-exec-hook: install-suid-programs install-build-headers:: $(include_HEADERS) $(build_HEADERZ) - @foo='$(include_HEADERS) $(build_HEADERZ)'; \ + @foo='$(include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \ for f in $$foo; do \ f=`basename $$f`; \ if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ @@ -949,6 +1015,36 @@ install-build-headers:: $(include_HEADERS) $(build_HEADERZ) done all-local: install-build-headers + +check-local:: + @if test '$(CHECK_LOCAL)'; then \ + foo='$(CHECK_LOCAL)'; else \ + foo='$(PROGRAMS)'; fi; \ + if test "$$foo"; then \ + failed=0; all=0; \ + for i in $$foo; do \ + all=`expr $$all + 1`; \ + if ./$$i --version > /dev/null 2>&1; then \ + echo "PASS: $$i"; \ + else \ + echo "FAIL: $$i"; \ + failed=`expr $$failed + 1`; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +.x.c: + @cmp -s $< $@ 2> /dev/null || cp $< $@ #NROFF_MAN = nroff -man .1.cat1: $(NROFF_MAN) $< > $@ @@ -1023,41 +1119,13 @@ install-data-local: install-cat-mans .et.c: $(COMPILE_ET) $< -.x.c: - @cmp -s $< $@ 2> /dev/null || cp $< $@ - -check-local:: - @foo='$(CHECK_LOCAL)'; \ - if test "$$foo"; then \ - failed=0; all=0; \ - for i in $$foo; do \ - all=`expr $$all + 1`; \ - if ./$$i --version > /dev/null 2>&1; then \ - echo "PASS: $$i"; \ - else \ - echo "FAIL: $$i"; \ - failed=`expr $$failed + 1`; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="$$failed of $$all tests failed"; \ - fi; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - fi - $(libkrb5_la_OBJECTS): $(srcdir)/krb5-protos.h $(srcdir)/krb5-private.h -$(srcdir)/krb5-protos.h: - cd $(srcdir); perl ../../cf/make-proto.pl -o krb5-protos.h $(libkrb5_la_SOURCES) || rm -f krb5-protos.h +$(srcdir)/krb5-protos.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -o krb5-protos.h $(libkrb5_la_SOURCES) || rm -f krb5-protos.h -$(srcdir)/krb5-private.h: - cd $(srcdir); perl ../../cf/make-proto.pl -p krb5-private.h $(libkrb5_la_SOURCES) || rm -f krb5-private.h +$(srcdir)/krb5-private.h: $(ERR_FILES) + cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5-private.h $(libkrb5_la_SOURCES) || rm -f krb5-private.h $(libkrb5_la_OBJECTS): krb5_err.h heim_err.h k524_err.h diff --git a/crypto/heimdal/lib/krb5/acl.c b/crypto/heimdal/lib/krb5/acl.c index fb22fbb..c356869 100644 --- a/crypto/heimdal/lib/krb5/acl.c +++ b/crypto/heimdal/lib/krb5/acl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -34,7 +34,7 @@ #include "krb5_locl.h" #include <fnmatch.h> -RCSID("$Id: acl.c,v 1.2 2001/05/14 06:14:43 assar Exp $"); +RCSID("$Id: acl.c,v 1.3 2002/04/18 16:16:24 joda Exp $"); struct acl_field { enum { acl_string, acl_fnmatch, acl_retval } type; @@ -129,7 +129,7 @@ acl_match_acl(krb5_context context, krb5_error_code krb5_acl_match_string(krb5_context context, - const char *acl_string, + const char *string, const char *format, ...) { @@ -144,7 +144,7 @@ krb5_acl_match_string(krb5_context context, if(ret) return ret; - found = acl_match_acl(context, acl, acl_string); + found = acl_match_acl(context, acl, string); acl_free_list(acl); if (found) { return 0; diff --git a/crypto/heimdal/lib/krb5/addr_families.c b/crypto/heimdal/lib/krb5/addr_families.c index 4343440..0fed2e7 100644 --- a/crypto/heimdal/lib/krb5/addr_families.c +++ b/crypto/heimdal/lib/krb5/addr_families.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: addr_families.c,v 1.32 2001/09/03 19:53:51 assar Exp $"); +RCSID("$Id: addr_families.c,v 1.37 2002/08/19 13:51:37 joda Exp $"); struct addr_operations { int af; @@ -42,11 +42,11 @@ struct addr_operations { krb5_error_code (*sockaddr2addr)(const struct sockaddr *, krb5_address *); krb5_error_code (*sockaddr2port)(const struct sockaddr *, int16_t *); void (*addr2sockaddr)(const krb5_address *, struct sockaddr *, - int *sa_size, int port); - void (*h_addr2sockaddr)(const char *, struct sockaddr *, int *, int); + krb5_socklen_t *sa_size, int port); + void (*h_addr2sockaddr)(const char *, struct sockaddr *, krb5_socklen_t *, int); krb5_error_code (*h_addr2addr)(const char *, krb5_address *); krb5_boolean (*uninteresting)(const struct sockaddr *); - void (*anyaddr)(struct sockaddr *, int *, int); + void (*anyaddr)(struct sockaddr *, krb5_socklen_t *, int); int (*print_addr)(const krb5_address *, char *, size_t); int (*parse_addr)(krb5_context, const char*, krb5_address *); int (*order_addr)(krb5_context, const krb5_address*, const krb5_address*); @@ -81,29 +81,33 @@ ipv4_sockaddr2port (const struct sockaddr *sa, int16_t *port) static void ipv4_addr2sockaddr (const krb5_address *a, struct sockaddr *sa, - int *sa_size, + krb5_socklen_t *sa_size, int port) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in tmp; - memset (sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - memcpy (&sin->sin_addr, a->address.data, 4); - sin->sin_port = port; - *sa_size = sizeof(*sin); + memset (&tmp, 0, sizeof(tmp)); + tmp.sin_family = AF_INET; + memcpy (&tmp.sin_addr, a->address.data, 4); + tmp.sin_port = port; + memcpy(sa, &tmp, min(sizeof(tmp), *sa_size)); + *sa_size = sizeof(tmp); } static void ipv4_h_addr2sockaddr(const char *addr, - struct sockaddr *sa, int *sa_size, int port) + struct sockaddr *sa, + krb5_socklen_t *sa_size, + int port) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in tmp; - memset (sin, 0, sizeof(*sin)); - *sa_size = sizeof(*sin); - sin->sin_family = AF_INET; - sin->sin_port = port; - sin->sin_addr = *((const struct in_addr *)addr); + memset (&tmp, 0, sizeof(tmp)); + tmp.sin_family = AF_INET; + tmp.sin_port = port; + tmp.sin_addr = *((const struct in_addr *)addr); + memcpy(sa, &tmp, min(sizeof(tmp), *sa_size)); + *sa_size = sizeof(tmp); } static krb5_error_code @@ -133,15 +137,16 @@ ipv4_uninteresting (const struct sockaddr *sa) } static void -ipv4_anyaddr (struct sockaddr *sa, int *sa_size, int port) +ipv4_anyaddr (struct sockaddr *sa, krb5_socklen_t *sa_size, int port) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in tmp; - memset (sin, 0, sizeof(*sin)); - *sa_size = sizeof(*sin); - sin->sin_family = AF_INET; - sin->sin_port = port; - sin->sin_addr.s_addr = INADDR_ANY; + memset (&tmp, 0, sizeof(tmp)); + tmp.sin_family = AF_INET; + tmp.sin_port = port; + tmp.sin_addr.s_addr = INADDR_ANY; + memcpy(sa, &tmp, min(sizeof(tmp), *sa_size)); + *sa_size = sizeof(tmp); } static int @@ -231,31 +236,33 @@ ipv6_sockaddr2port (const struct sockaddr *sa, int16_t *port) static void ipv6_addr2sockaddr (const krb5_address *a, struct sockaddr *sa, - int *sa_size, + krb5_socklen_t *sa_size, int port) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 tmp; - memset (sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - memcpy (&sin6->sin6_addr, a->address.data, sizeof(sin6->sin6_addr)); - sin6->sin6_port = port; - *sa_size = sizeof(*sin6); + memset (&tmp, 0, sizeof(tmp)); + tmp.sin6_family = AF_INET6; + memcpy (&tmp.sin6_addr, a->address.data, sizeof(tmp.sin6_addr)); + tmp.sin6_port = port; + memcpy(sa, &tmp, min(sizeof(tmp), *sa_size)); + *sa_size = sizeof(tmp); } static void ipv6_h_addr2sockaddr(const char *addr, struct sockaddr *sa, - int *sa_size, + krb5_socklen_t *sa_size, int port) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 tmp; - memset (sin6, 0, sizeof(*sin6)); - *sa_size = sizeof(*sin6); - sin6->sin6_family = AF_INET6; - sin6->sin6_port = port; - sin6->sin6_addr = *((const struct in6_addr *)addr); + memset (&tmp, 0, sizeof(tmp)); + tmp.sin6_family = AF_INET6; + tmp.sin6_port = port; + tmp.sin6_addr = *((const struct in6_addr *)addr); + memcpy(sa, &tmp, min(sizeof(tmp), *sa_size)); + *sa_size = sizeof(tmp); } static krb5_error_code @@ -282,15 +289,15 @@ ipv6_uninteresting (const struct sockaddr *sa) } static void -ipv6_anyaddr (struct sockaddr *sa, int *sa_size, int port) +ipv6_anyaddr (struct sockaddr *sa, krb5_socklen_t *sa_size, int port) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 tmp; - memset (sin6, 0, sizeof(*sin6)); - *sa_size = sizeof(*sin6); - sin6->sin6_family = AF_INET6; - sin6->sin6_port = port; - sin6->sin6_addr = in6addr_any; + memset (&tmp, 0, sizeof(tmp)); + tmp.sin6_family = AF_INET6; + tmp.sin6_port = port; + tmp.sin6_addr = in6addr_any; + *sa_size = sizeof(tmp); } static int @@ -358,7 +365,7 @@ struct arange { static int arange_parse_addr (krb5_context context, - const char *address, krb5_address *addr) + const char *address, krb5_address *addr) { char buf[1024]; krb5_addresses low, high; @@ -471,8 +478,8 @@ arange_print_addr (const krb5_address *addr, char *str, size_t len) static int arange_order_addr(krb5_context context, - const krb5_address *addr1, - const krb5_address *addr2) + const krb5_address *addr1, + const krb5_address *addr2) { int tmp1, tmp2, sign; struct arange *a; @@ -594,7 +601,7 @@ krb5_error_code krb5_addr2sockaddr (krb5_context context, const krb5_address *addr, struct sockaddr *sa, - int *sa_size, + krb5_socklen_t *sa_size, int port) { struct addr_operations *a = find_atype(addr->addr_type); @@ -637,7 +644,8 @@ krb5_sockaddr_uninteresting(const struct sockaddr *sa) krb5_error_code krb5_h_addr2sockaddr (krb5_context context, int af, - const char *addr, struct sockaddr *sa, int *sa_size, + const char *addr, struct sockaddr *sa, + krb5_socklen_t *sa_size, int port) { struct addr_operations *a = find_af(af); @@ -666,7 +674,7 @@ krb5_error_code krb5_anyaddr (krb5_context context, int af, struct sockaddr *sa, - int *sa_size, + krb5_socklen_t *sa_size, int port) { struct addr_operations *a = find_af (af); @@ -684,6 +692,7 @@ krb5_error_code krb5_print_address (const krb5_address *addr, char *str, size_t len, size_t *ret_len) { + size_t ret; struct addr_operations *a = find_atype(addr->addr_type); if (a == NULL) { @@ -704,10 +713,13 @@ krb5_print_address (const krb5_address *addr, len -= l; s += l; } - *ret_len = s - str; + if(ret_len != NULL) + *ret_len = s - str; return 0; } - *ret_len = (*a->print_addr)(addr, str, len); + ret = (*a->print_addr)(addr, str, len); + if(ret_len != NULL) + *ret_len = ret; return 0; } @@ -723,10 +735,10 @@ krb5_parse_address(krb5_context context, for(i = 0; i < num_addrs; i++) { if(at[i].parse_addr) { - krb5_address a; - if((*at[i].parse_addr)(context, string, &a) == 0) { + krb5_address addr; + if((*at[i].parse_addr)(context, string, &addr) == 0) { ALLOC_SEQ(addresses, 1); - addresses->val[0] = a; + addresses->val[0] = addr; return 0; } } @@ -745,8 +757,10 @@ krb5_parse_address(krb5_context context, ALLOC_SEQ(addresses, n); - for (a = ai, i = 0; a != NULL; a = a->ai_next, ++i) { - krb5_sockaddr2address (context, ai->ai_addr, &addresses->val[i]); + for (a = ai, i = 0; a != NULL; a = a->ai_next) { + if(krb5_sockaddr2address (context, ai->ai_addr, + &addresses->val[i]) == 0) + i++; } freeaddrinfo (ai); return 0; diff --git a/crypto/heimdal/lib/krb5/aname_to_localname.c b/crypto/heimdal/lib/krb5/aname_to_localname.c index c125580..052d4208 100644 --- a/crypto/heimdal/lib/krb5/aname_to_localname.c +++ b/crypto/heimdal/lib/krb5/aname_to_localname.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 1999, 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: aname_to_localname.c,v 1.3 1999/12/02 17:05:07 joda Exp $"); +RCSID("$Id: aname_to_localname.c,v 1.4 2002/04/18 08:56:40 joda Exp $"); krb5_error_code krb5_aname_to_localname (krb5_context context, @@ -45,7 +45,7 @@ krb5_aname_to_localname (krb5_context context, krb5_realm *lrealms, *r; int foo = 1; size_t len; - char *res; + const char *res; ret = krb5_get_default_realms (context, &lrealms); if (ret) diff --git a/crypto/heimdal/lib/krb5/auth_context.c b/crypto/heimdal/lib/krb5/auth_context.c index 5656101..3b42ce7 100644 --- a/crypto/heimdal/lib/krb5/auth_context.c +++ b/crypto/heimdal/lib/krb5/auth_context.c @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: auth_context.c,v 1.57 2001/06/17 23:12:34 assar Exp $"); +RCSID("$Id: auth_context.c,v 1.58 2002/08/15 08:23:07 joda Exp $"); krb5_error_code krb5_auth_con_init(krb5_context context, @@ -153,7 +153,8 @@ krb5_auth_con_genaddrs(krb5_context context, strerror(ret)); goto out; } - krb5_sockaddr2address (context, local, &local_k_address); + ret = krb5_sockaddr2address (context, local, &local_k_address); + if(ret) goto out; if(flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) { krb5_sockaddr2port (context, local, &auth_context->local_port); } else @@ -168,7 +169,8 @@ krb5_auth_con_genaddrs(krb5_context context, krb5_set_error_string (context, "getpeername: %s", strerror(ret)); goto out; } - krb5_sockaddr2address (context, remote, &remote_k_address); + ret = krb5_sockaddr2address (context, remote, &remote_k_address); + if(ret) goto out; if(flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) { krb5_sockaddr2port (context, remote, &auth_context->remote_port); } else diff --git a/crypto/heimdal/lib/krb5/cache.c b/crypto/heimdal/lib/krb5/cache.c index 141eb61..d25a515 100644 --- a/crypto/heimdal/lib/krb5/cache.c +++ b/crypto/heimdal/lib/krb5/cache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: cache.c,v 1.47 2001/05/14 06:14:45 assar Exp $"); +RCSID("$Id: cache.c,v 1.49 2002/05/29 16:08:23 joda Exp $"); /* * Add a new ccache type with operations `ops', overwriting any @@ -46,33 +46,25 @@ krb5_cc_register(krb5_context context, const krb5_cc_ops *ops, krb5_boolean override) { - char *prefix_copy; int i; for(i = 0; i < context->num_cc_ops && context->cc_ops[i].prefix; i++) { if(strcmp(context->cc_ops[i].prefix, ops->prefix) == 0) { - if(override) - free(context->cc_ops[i].prefix); - else { + if(!override) { krb5_set_error_string(context, "ccache type %s already exists", ops->prefix); return KRB5_CC_TYPE_EXISTS; } + break; } } - prefix_copy = strdup(ops->prefix); - if (prefix_copy == NULL) { - krb5_set_error_string(context, "malloc: out of memory"); - return KRB5_CC_NOMEM; - } if(i == context->num_cc_ops) { krb5_cc_ops *o = realloc(context->cc_ops, (context->num_cc_ops + 1) * sizeof(*context->cc_ops)); if(o == NULL) { krb5_set_error_string(context, "malloc: out of memory"); - free(prefix_copy); return KRB5_CC_NOMEM; } context->num_cc_ops++; @@ -81,7 +73,6 @@ krb5_cc_register(krb5_context context, (context->num_cc_ops - i) * sizeof(*context->cc_ops)); } memcpy(&context->cc_ops[i], ops, sizeof(context->cc_ops[i])); - context->cc_ops[i].prefix = prefix_copy; return 0; } diff --git a/crypto/heimdal/lib/krb5/changepw.c b/crypto/heimdal/lib/krb5/changepw.c index 35534f4..e930d87 100644 --- a/crypto/heimdal/lib/krb5/changepw.c +++ b/crypto/heimdal/lib/krb5/changepw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: changepw.c,v 1.34 2001/09/27 01:29:12 assar Exp $"); +RCSID("$Id: changepw.c,v 1.35 2002/06/06 13:33:13 joda Exp $"); static krb5_error_code send_request (krb5_context context, @@ -271,7 +271,7 @@ krb5_change_password (krb5_context context, if (ret) goto out; - while (krb5_krbhst_next(context, handle, &hi) == 0) { + while (!done && (ret = krb5_krbhst_next(context, handle, &hi)) == 0) { struct addrinfo *ai, *a; ret = krb5_krbhst_get_addrinfo(context, hi, &ai); diff --git a/crypto/heimdal/lib/krb5/config_file.c b/crypto/heimdal/lib/krb5/config_file.c index b53b69c..77920a8 100644 --- a/crypto/heimdal/lib/krb5/config_file.c +++ b/crypto/heimdal/lib/krb5/config_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,20 +32,43 @@ */ #include "krb5_locl.h" -RCSID("$Id: config_file.c,v 1.42 2001/05/14 06:14:45 assar Exp $"); +RCSID("$Id: config_file.c,v 1.45 2002/08/14 17:35:03 joda Exp $"); #ifndef HAVE_NETINFO static krb5_error_code parse_section(char *p, krb5_config_section **s, krb5_config_section **res, - char **error_message); + const char **error_message); static krb5_error_code parse_binding(FILE *f, unsigned *lineno, char *p, krb5_config_binding **b, krb5_config_binding **parent, - char **error_message); + const char **error_message); static krb5_error_code parse_list(FILE *f, unsigned *lineno, krb5_config_binding **parent, - char **error_message); + const char **error_message); + +static krb5_config_section * +get_entry(krb5_config_section **parent, const char *name, int type) +{ + krb5_config_section **q; + + for(q = parent; *q != NULL; q = &(*q)->next) + if(type == krb5_config_list && + type == (*q)->type && + strcmp(name, (*q)->name) == 0) + return *q; + *q = calloc(1, sizeof(**q)); + if(*q == NULL) + return NULL; + (*q)->name = strdup(name); + (*q)->type = type; + if((*q)->name == NULL) { + free(*q); + *q = NULL; + return NULL; + } + return *q; +} /* * Parse a section: @@ -64,7 +87,7 @@ static krb5_error_code parse_list(FILE *f, unsigned *lineno, static krb5_error_code parse_section(char *p, krb5_config_section **s, krb5_config_section **parent, - char **error_message) + const char **error_message) { char *p1; krb5_config_section *tmp; @@ -75,23 +98,11 @@ parse_section(char *p, krb5_config_section **s, krb5_config_section **parent, return KRB5_CONFIG_BADFORMAT; } *p1 = '\0'; - tmp = malloc(sizeof(*tmp)); - if (tmp == NULL) { - *error_message = "out of memory"; - return KRB5_CONFIG_BADFORMAT; - } - tmp->name = strdup(p+1); - if (tmp->name == NULL) { + tmp = get_entry(parent, p + 1, krb5_config_list); + if(tmp == NULL) { *error_message = "out of memory"; return KRB5_CONFIG_BADFORMAT; } - tmp->type = krb5_config_list; - tmp->u.list = NULL; - tmp->next = NULL; - if (*s) - (*s)->next = tmp; - else - *parent = tmp; *s = tmp; return 0; } @@ -104,7 +115,7 @@ parse_section(char *p, krb5_config_section **s, krb5_config_section **parent, static int parse_list(FILE *f, unsigned *lineno, krb5_config_binding **parent, - char **error_message) + const char **error_message) { char buf[BUFSIZ]; int ret; @@ -144,7 +155,7 @@ parse_list(FILE *f, unsigned *lineno, krb5_config_binding **parent, static int parse_binding(FILE *f, unsigned *lineno, char *p, krb5_config_binding **b, krb5_config_binding **parent, - char **error_message) + const char **error_message) { krb5_config_binding *tmp; char *p1, *p2; @@ -154,44 +165,40 @@ parse_binding(FILE *f, unsigned *lineno, char *p, while (*p && *p != '=' && !isspace((unsigned char)*p)) ++p; if (*p == '\0') { - *error_message = "no ="; + *error_message = "missing ="; return KRB5_CONFIG_BADFORMAT; } p2 = p; while (isspace((unsigned char)*p)) ++p; if (*p != '=') { - *error_message = "no ="; + *error_message = "missing ="; return KRB5_CONFIG_BADFORMAT; } ++p; while(isspace((unsigned char)*p)) ++p; - tmp = malloc(sizeof(*tmp)); - if (tmp == NULL) { - *error_message = "out of memory"; - return KRB5_CONFIG_BADFORMAT; - } *p2 = '\0'; - tmp->name = strdup(p1); - tmp->next = NULL; if (*p == '{') { - tmp->type = krb5_config_list; - tmp->u.list = NULL; + tmp = get_entry(parent, p1, krb5_config_list); + if (tmp == NULL) { + *error_message = "out of memory"; + return KRB5_CONFIG_BADFORMAT; + } ret = parse_list (f, lineno, &tmp->u.list, error_message); } else { + tmp = get_entry(parent, p1, krb5_config_string); + if (tmp == NULL) { + *error_message = "out of memory"; + return KRB5_CONFIG_BADFORMAT; + } p1 = p; p = p1 + strlen(p1); while(p > p1 && isspace((unsigned char)*(p-1))) --p; *p = '\0'; - tmp->type = krb5_config_string; tmp->u.string = strdup(p1); } - if (*b) - (*b)->next = tmp; - else - *parent = tmp; *b = tmp; return ret; } @@ -205,7 +212,7 @@ static krb5_error_code krb5_config_parse_file_debug (const char *fname, krb5_config_section **res, unsigned *lineno, - char **error_message) + const char **error_message) { FILE *f; krb5_config_section *s; @@ -221,7 +228,6 @@ krb5_config_parse_file_debug (const char *fname, *error_message = "cannot open file"; return ENOENT; } - *res = NULL; while (fgets(buf, sizeof(buf), f) != NULL) { char *p; @@ -255,11 +261,11 @@ out: } krb5_error_code -krb5_config_parse_file (krb5_context context, - const char *fname, - krb5_config_section **res) +krb5_config_parse_file_multi (krb5_context context, + const char *fname, + krb5_config_section **res) { - char *str; + const char *str; unsigned lineno; krb5_error_code ret; @@ -271,6 +277,15 @@ krb5_config_parse_file (krb5_context context, return 0; } +krb5_error_code +krb5_config_parse_file (krb5_context context, + const char *fname, + krb5_config_section **res) +{ + *res = NULL; + return krb5_config_parse_file_multi(context, fname, res); +} + #endif /* !HAVE_NETINFO */ static void @@ -302,8 +317,8 @@ krb5_config_file_free (krb5_context context, krb5_config_section *s) const void * krb5_config_get_next (krb5_context context, - krb5_config_section *c, - krb5_config_binding **pointer, + const krb5_config_section *c, + const krb5_config_binding **pointer, int type, ...) { @@ -316,14 +331,37 @@ krb5_config_get_next (krb5_context context, return ret; } +static const void * +vget_next(krb5_context context, + const krb5_config_binding *b, + const krb5_config_binding **pointer, + int type, + const char *name, + va_list args) +{ + const char *p = va_arg(args, const char *); + while(b != NULL) { + if(strcmp(b->name, name) == NULL) { + if(b->type == type && p == NULL) { + *pointer = b; + return b->u.generic; + } else if(b->type == krb5_config_list && p != NULL) { + return vget_next(context, b->u.list, pointer, type, p, args); + } + } + b = b->next; + } + return NULL; +} + const void * krb5_config_vget_next (krb5_context context, - krb5_config_section *c, - krb5_config_binding **pointer, + const krb5_config_section *c, + const krb5_config_binding **pointer, int type, va_list args) { - krb5_config_binding *b; + const krb5_config_binding *b; const char *p; if(c == NULL) @@ -333,32 +371,20 @@ krb5_config_vget_next (krb5_context context, return NULL; if (*pointer == NULL) { - b = (c != NULL) ? c : context->cf; + /* first time here, walk down the tree looking for the right + section */ p = va_arg(args, const char *); if (p == NULL) return NULL; - } else { - b = *pointer; - p = b->name; - b = b->next; + return vget_next(context, c, pointer, type, p, args); } - while (b) { - if (strcmp (b->name, p) == 0) { - if (*pointer == NULL) - p = va_arg(args, const char *); - else - p = NULL; - if (type == b->type && p == NULL) { - *pointer = b; - return b->u.generic; - } else if(b->type == krb5_config_list && p != NULL) { - b = b->u.list; - } else { - return NULL; - } - } else { - b = b->next; + /* we were called again, so just look for more entries with the + same name and type */ + for (b = (*pointer)->next; b != NULL; b = b->next) { + if(strcmp(b->name, (*pointer)->name) == 0 && b->type == type) { + *pointer = b; + return b->u.generic; } } return NULL; @@ -366,7 +392,7 @@ krb5_config_vget_next (krb5_context context, const void * krb5_config_get (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int type, ...) { @@ -381,18 +407,18 @@ krb5_config_get (krb5_context context, const void * krb5_config_vget (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int type, va_list args) { - krb5_config_binding *foo = NULL; + const krb5_config_binding *foo = NULL; return krb5_config_vget_next (context, c, &foo, type, args); } const krb5_config_binding * krb5_config_get_list (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { const krb5_config_binding *ret; @@ -406,7 +432,7 @@ krb5_config_get_list (krb5_context context, const krb5_config_binding * krb5_config_vget_list (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { return krb5_config_vget (context, c, krb5_config_list, args); @@ -414,7 +440,7 @@ krb5_config_vget_list (krb5_context context, const char * krb5_config_get_string (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { const char *ret; @@ -428,7 +454,7 @@ krb5_config_get_string (krb5_context context, const char * krb5_config_vget_string (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { return krb5_config_vget (context, c, krb5_config_string, args); @@ -436,7 +462,7 @@ krb5_config_vget_string (krb5_context context, const char * krb5_config_vget_string_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, const char *def_value, va_list args) { @@ -450,7 +476,7 @@ krb5_config_vget_string_default (krb5_context context, const char * krb5_config_get_string_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, const char *def_value, ...) { @@ -465,12 +491,12 @@ krb5_config_get_string_default (krb5_context context, char ** krb5_config_vget_strings(krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { char **strings = NULL; int nstr = 0; - krb5_config_binding *b = NULL; + const krb5_config_binding *b = NULL; const char *p; while((p = krb5_config_vget_next(context, c, &b, @@ -512,7 +538,7 @@ cleanup: char** krb5_config_get_strings(krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { va_list ap; @@ -536,7 +562,7 @@ krb5_config_free_strings(char **strings) krb5_boolean krb5_config_vget_bool_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, krb5_boolean def_value, va_list args) { @@ -552,7 +578,7 @@ krb5_config_vget_bool_default (krb5_context context, krb5_boolean krb5_config_vget_bool (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { return krb5_config_vget_bool_default (context, c, FALSE, args); @@ -560,7 +586,7 @@ krb5_config_vget_bool (krb5_context context, krb5_boolean krb5_config_get_bool_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, krb5_boolean def_value, ...) { @@ -574,7 +600,7 @@ krb5_config_get_bool_default (krb5_context context, krb5_boolean krb5_config_get_bool (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { va_list ap; @@ -587,7 +613,7 @@ krb5_config_get_bool (krb5_context context, int krb5_config_vget_time_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int def_value, va_list args) { @@ -600,7 +626,7 @@ krb5_config_vget_time_default (krb5_context context, int krb5_config_vget_time (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { return krb5_config_vget_time_default (context, c, -1, args); @@ -608,7 +634,7 @@ krb5_config_vget_time (krb5_context context, int krb5_config_get_time_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int def_value, ...) { @@ -622,7 +648,7 @@ krb5_config_get_time_default (krb5_context context, int krb5_config_get_time (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { va_list ap; @@ -636,7 +662,7 @@ krb5_config_get_time (krb5_context context, int krb5_config_vget_int_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int def_value, va_list args) { @@ -657,7 +683,7 @@ krb5_config_vget_int_default (krb5_context context, int krb5_config_vget_int (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, va_list args) { return krb5_config_vget_int_default (context, c, -1, args); @@ -665,7 +691,7 @@ krb5_config_vget_int (krb5_context context, int krb5_config_get_int_default (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, int def_value, ...) { @@ -679,7 +705,7 @@ krb5_config_get_int_default (krb5_context context, int krb5_config_get_int (krb5_context context, - krb5_config_section *c, + const krb5_config_section *c, ...) { va_list ap; @@ -689,103 +715,3 @@ krb5_config_get_int (krb5_context context, va_end(ap); return ret; } - -#ifdef TEST - -static int print_list (krb5_context context, FILE *f, - krb5_config_binding *l, unsigned level); -static int print_binding (krb5_context context, FILE *f, - krb5_config_binding *b, unsigned level); -static int print_section (krb5_context context, FILE *f, - krb5_config_section *s, unsigned level); -static int print_config (krb5_context context, FILE *f, - krb5_config_section *c); - -static void -tab (FILE *f, unsigned count) -{ - while(count--) - fprintf (f, "\t"); -} - -static int -print_list (krb5_context context, - FILE *f, - krb5_config_binding *l, - unsigned level) -{ - while(l) { - print_binding (context, f, l, level); - l = l->next; - } - return 0; -} - -static int -print_binding (krb5_context context, - FILE *f, - krb5_config_binding *b, - unsigned level) -{ - tab (f, level); - fprintf (f, "%s = ", b->name); - if (b->type == krb5_config_string) - fprintf (f, "%s\n", b->u.string); - else if (b->type == krb5_config_list) { - fprintf (f, "{\n"); - print_list (f, b->u.list, level + 1); - tab (f, level); - fprintf (f, "}\n"); - } else - krb5_abortx(context, "unknown binding type (%d) in print_binding", - b->type); - return 0; -} - -static int -print_section (FILE *f, krb5_config_section *s, unsigned level) -{ - fprintf (f, "[%s]\n", s->name); - print_list (f, s->u.list, level + 1); - return 0; -} - -static int -print_config (FILE *f, krb5_config_section *c) -{ - while (c) { - print_section (f, c, 0); - c = c->next; - } - return 0; -} - - -int -main(void) -{ - krb5_config_section *c; - - printf ("%d\n", krb5_config_parse_file ("/etc/krb5.conf", &c)); - print_config (stdout, c); - printf ("[libdefaults]ticket_lifetime = %s\n", - krb5_config_get_string (context, c, - "libdefaults", - "ticket_lifetime", - NULL)); - printf ("[realms]foo = %s\n", - krb5_config_get_string (context, c, - "realms", - "foo", - NULL)); - printf ("[realms]ATHENA.MIT.EDU/v4_instance_convert/lithium = %s\n", - krb5_config_get_string (context, c, - "realms", - "ATHENA.MIT.EDU", - "v4_instance_convert", - "lithium", - NULL)); - return 0; -} - -#endif /* TEST */ diff --git a/crypto/heimdal/lib/krb5/constants.c b/crypto/heimdal/lib/krb5/constants.c index 946fd4d..280bf62 100644 --- a/crypto/heimdal/lib/krb5/constants.c +++ b/crypto/heimdal/lib/krb5/constants.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: constants.c,v 1.5 2000/07/14 21:53:01 joda Exp $"); +RCSID("$Id: constants.c,v 1.7 2002/08/16 20:52:15 joda Exp $"); -const char krb5_config_file[] = "/etc/krb5.conf"; -const char krb5_defkeyname[] = KEYTAB_DEFAULT; +const char *krb5_config_file = SYSCONFDIR "/krb5.conf:/etc/krb5.conf"; +const char *krb5_defkeyname = KEYTAB_DEFAULT; diff --git a/crypto/heimdal/lib/krb5/context.c b/crypto/heimdal/lib/krb5/context.c index c890401..d21ea71 100644 --- a/crypto/heimdal/lib/krb5/context.c +++ b/crypto/heimdal/lib/krb5/context.c @@ -32,8 +32,9 @@ */ #include "krb5_locl.h" +#include <com_err.h> -RCSID("$Id: context.c,v 1.73 2002/02/12 08:24:08 joda Exp $"); +RCSID("$Id: context.c,v 1.80 2002/08/28 15:27:24 joda Exp $"); #define INIT_FIELD(C, T, E, D, F) \ (C)->E = krb5_config_get_ ## T ## _default ((C), NULL, (D), \ @@ -50,7 +51,7 @@ set_etypes (krb5_context context, krb5_enctype **ret_enctypes) { char **etypes_str; - krb5_enctype *etypes; + krb5_enctype *etypes = NULL; etypes_str = krb5_config_get_strings(context, NULL, "libdefaults", name, NULL); @@ -69,8 +70,8 @@ set_etypes (krb5_context context, } etypes[k] = ETYPE_NULL; krb5_config_free_strings(etypes_str); - *ret_enctypes = etypes; - } + } + *ret_enctypes = etypes; return 0; } @@ -83,19 +84,35 @@ init_context_from_config_file(krb5_context context) { krb5_error_code ret; const char * tmp; + krb5_enctype *tmptypes; INIT_FIELD(context, time, max_skew, 5 * 60, "clockskew"); INIT_FIELD(context, time, kdc_timeout, 3, "kdc_timeout"); INIT_FIELD(context, int, max_retries, 3, "max_retries"); INIT_FIELD(context, string, http_proxy, NULL, "http_proxy"); - - set_etypes (context, "default_etypes", &context->etypes); - set_etypes (context, "default_etypes_des", &context->etypes_des); + + ret = set_etypes (context, "default_etypes", &tmptypes); + if(ret) + return ret; + free(context->etypes); + context->etypes = tmptypes; + + ret = set_etypes (context, "default_etypes_des", &tmptypes); + if(ret) + return ret; + free(context->etypes_des); + context->etypes_des = tmptypes; /* default keytab name */ - INIT_FIELD(context, string, default_keytab, - KEYTAB_DEFAULT, "default_keytab_name"); + tmp = NULL; + if(!issuid()) + tmp = getenv("KRB5_KTNAME"); + if(tmp != NULL) + context->default_keytab = tmp; + else + INIT_FIELD(context, string, default_keytab, + KEYTAB_DEFAULT, "default_keytab_name"); INIT_FIELD(context, string, default_keytab_modify, NULL, "default_keytab_modify_name"); @@ -116,11 +133,14 @@ init_context_from_config_file(krb5_context context) "dns_proxy", NULL); if(tmp) roken_gethostby_setup(context->http_proxy, tmp); + krb5_free_host_realm (context, context->default_realms); context->default_realms = NULL; { krb5_addresses addresses; char **adr, **a; + + krb5_set_extra_addresses(context, NULL); adr = krb5_config_get_strings(context, NULL, "libdefaults", "extra_addresses", @@ -135,6 +155,7 @@ init_context_from_config_file(krb5_context context) } krb5_config_free_strings(adr); + krb5_set_ignore_addresses(context, NULL); adr = krb5_config_get_strings(context, NULL, "libdefaults", "ignore_addresses", @@ -151,22 +172,15 @@ init_context_from_config_file(krb5_context context) } INIT_FIELD(context, bool, scan_interfaces, TRUE, "scan_interfaces"); - INIT_FIELD(context, bool, srv_lookup, TRUE, "srv_lookup"); INIT_FIELD(context, int, fcache_vno, 0, "fcache_version"); - - context->cc_ops = NULL; - context->num_cc_ops = 0; - krb5_cc_register(context, &krb5_fcc_ops, TRUE); - krb5_cc_register(context, &krb5_mcc_ops, TRUE); - - context->num_kt_types = 0; - context->kt_types = NULL; - krb5_kt_register (context, &krb5_fkt_ops); - krb5_kt_register (context, &krb5_mkt_ops); - krb5_kt_register (context, &krb5_akf_ops); - krb5_kt_register (context, &krb4_fkt_ops); - krb5_kt_register (context, &krb5_srvtab_fkt_ops); - krb5_kt_register (context, &krb5_any_ops); + INIT_FIELD(context, bool, srv_lookup, TRUE, "dns_lookup_kdc"); + /* srv_lookup backwards compatibility. */ + { + const char **p; + p = krb5_config_get_strings(context, NULL, "libdefaults", "srv_lookup", NULL); + if (p != NULL) + INIT_FIELD(context, bool, srv_lookup, TRUE, "srv_lookup"); + } return 0; } @@ -174,55 +188,55 @@ krb5_error_code krb5_init_context(krb5_context *context) { krb5_context p; - const char *config_file = NULL; - krb5_config_section *tmp_cf; krb5_error_code ret; + char **files; - ALLOC(p, 1); + p = calloc(1, sizeof(*p)); if(!p) return ENOMEM; - memset(p, 0, sizeof(krb5_context_data)); + + ret = krb5_get_default_config_files(&files); + if(ret) + goto out; + ret = krb5_set_config_files(p, files); + krb5_free_config_files(files); + if(ret) + goto out; /* init error tables */ krb5_init_ets(p); - if(!issuid()) - config_file = getenv("KRB5_CONFIG"); - if (config_file == NULL) - config_file = krb5_config_file; - - ret = krb5_config_parse_file (p, config_file, &tmp_cf); - - if (ret == 0) - p->cf = tmp_cf; -#if 0 - else - krb5_warnx (p, "Unable to parse config file %s. Ignoring.", - config_file); /* XXX */ -#endif - - ret = init_context_from_config_file(p); + p->cc_ops = NULL; + p->num_cc_ops = 0; + krb5_cc_register(p, &krb5_fcc_ops, TRUE); + krb5_cc_register(p, &krb5_mcc_ops, TRUE); + + p->num_kt_types = 0; + p->kt_types = NULL; + krb5_kt_register (p, &krb5_fkt_ops); + krb5_kt_register (p, &krb5_mkt_ops); + krb5_kt_register (p, &krb5_akf_ops); + krb5_kt_register (p, &krb4_fkt_ops); + krb5_kt_register (p, &krb5_srvtab_fkt_ops); + krb5_kt_register (p, &krb5_any_ops); + +out: if(ret) { krb5_free_context(p); - return ret; + p = NULL; } - *context = p; - return 0; + return ret; } void krb5_free_context(krb5_context context) { - int i; - free(context->etypes); free(context->etypes_des); krb5_free_host_realm (context, context->default_realms); krb5_config_file_free (context, context->cf); free_error_table (context->et_list); - for(i = 0; i < context->num_cc_ops; ++i) - free(context->cc_ops[i].prefix); free(context->cc_ops); free(context->kt_types); krb5_clear_error_string(context); @@ -233,6 +247,87 @@ krb5_free_context(krb5_context context) free(context); } +krb5_error_code +krb5_set_config_files(krb5_context context, char **filenames) +{ + krb5_error_code ret; + krb5_config_binding *tmp = NULL; + while(filenames != NULL && *filenames != NULL && **filenames != '\0') { + ret = krb5_config_parse_file_multi(context, *filenames, &tmp); + if(ret != 0 && ret != ENOENT) { + krb5_config_file_free(context, tmp); + return ret; + } + filenames++; + } +#if 0 + /* with this enabled and if there are no config files, Kerberos is + considererd disabled */ + if(tmp == NULL) + return ENOENT; +#endif + krb5_config_file_free(context, context->cf); + context->cf = tmp; + ret = init_context_from_config_file(context); + return ret; +} + +krb5_error_code +krb5_get_default_config_files(char ***pfilenames) +{ + const char *p, *q; + char **pp; + int n, i; + + const char *files = NULL; + if (pfilenames == NULL) + return EINVAL; + if(!issuid()) + files = getenv("KRB5_CONFIG"); + if (files == NULL) + files = krb5_config_file; + + for(n = 0, p = files; strsep_copy(&p, ":", NULL, 0) != -1; n++); + pp = malloc((n + 1) * sizeof(*pp)); + if(pp == NULL) + return ENOMEM; + + n = 0; + p = files; + while(1) { + ssize_t l; + q = p; + l = strsep_copy(&q, ":", NULL, 0); + if(l == -1) + break; + pp[n] = malloc(l + 1); + if(pp[n] == NULL) { + krb5_free_config_files(pp); + return ENOMEM; + } + l = strsep_copy(&p, ":", pp[n], l + 1); + for(i = 0; i < n; i++) + if(strcmp(pp[i], pp[n]) == 0) { + free(pp[n]); + goto skip; + } + n++; + skip:; + } + pp[n] = NULL; + *pfilenames = pp; + return 0; +} + +void +krb5_free_config_files(char **filenames) +{ + char **p; + for(p = filenames; *p != NULL; p++) + free(*p); + free(filenames); +} + /* * set `etype' to a malloced list of the default enctypes */ diff --git a/crypto/heimdal/lib/krb5/crypto.c b/crypto/heimdal/lib/krb5/crypto.c index 7ecd458..db9e810 100644 --- a/crypto/heimdal/lib/krb5/crypto.c +++ b/crypto/heimdal/lib/krb5/crypto.c @@ -32,7 +32,7 @@ */ #include "krb5_locl.h" -RCSID("$Id: crypto.c,v 1.60 2002/01/06 23:12:51 assar Exp $"); +RCSID("$Id: crypto.c,v 1.64 2002/04/29 16:31:54 joda Exp $"); #undef CRYPTO_DEBUG #ifdef CRYPTO_DEBUG @@ -139,7 +139,7 @@ static struct key_data *_new_derived_key(krb5_crypto crypto, unsigned usage); ************************************************************/ static void -DES_random_key(krb5_context context, +krb5_DES_random_key(krb5_context context, krb5_keyblock *key) { des_cblock *k = key->keyvalue.data; @@ -150,7 +150,7 @@ DES_random_key(krb5_context context, } static void -DES_schedule(krb5_context context, +krb5_DES_schedule(krb5_context context, struct key_data *key) { des_set_key(key->key->keyvalue.data, key->schedule->data); @@ -188,7 +188,7 @@ DES_string_to_key_int(unsigned char *data, size_t length, des_cblock *key) } static krb5_error_code -DES_string_to_key(krb5_context context, +krb5_DES_string_to_key(krb5_context context, krb5_enctype enctype, krb5_data password, krb5_salt salt, @@ -225,7 +225,7 @@ DES_string_to_key(krb5_context context, * Short passwords, i.e 8 characters or less. */ static void -DES_AFS3_CMU_string_to_key (krb5_data pw, +krb5_DES_AFS3_CMU_string_to_key (krb5_data pw, krb5_data cell, des_cblock *key) { @@ -254,7 +254,7 @@ DES_AFS3_CMU_string_to_key (krb5_data pw, * Long passwords, i.e 9 characters or more. */ static void -DES_AFS3_Transarc_string_to_key (krb5_data pw, +krb5_DES_AFS3_Transarc_string_to_key (krb5_data pw, krb5_data cell, des_cblock *key) { @@ -301,9 +301,9 @@ DES_AFS3_string_to_key(krb5_context context, { des_cblock tmp; if(password.length > 8) - DES_AFS3_Transarc_string_to_key(password, salt.saltvalue, &tmp); + krb5_DES_AFS3_Transarc_string_to_key(password, salt.saltvalue, &tmp); else - DES_AFS3_CMU_string_to_key(password, salt.saltvalue, &tmp); + krb5_DES_AFS3_CMU_string_to_key(password, salt.saltvalue, &tmp); key->keytype = enctype; krb5_data_copy(&key->keyvalue, tmp, sizeof(tmp)); memset(&key, 0, sizeof(key)); @@ -385,7 +385,7 @@ DES3_string_to_key(krb5_context context, memcpy(keys + i, tmp + i * 8, sizeof(keys[i])); des_set_odd_parity(keys + i); if(des_is_weak_key(keys + i)) - xor(keys + i, (unsigned char*)"\0\0\0\0\0\0\0\xf0"); + xor(keys + i, (const unsigned char*)"\0\0\0\0\0\0\0\xf0"); des_set_key(keys + i, s[i]); } memset(&ivec, 0, sizeof(ivec)); @@ -398,7 +398,7 @@ DES3_string_to_key(krb5_context context, memcpy(keys + i, tmp + i * 8, sizeof(keys[i])); des_set_odd_parity(keys + i); if(des_is_weak_key(keys + i)) - xor(keys + i, (unsigned char*)"\0\0\0\0\0\0\0\xf0"); + xor(keys + i, (const unsigned char*)"\0\0\0\0\0\0\0\xf0"); } memset(tmp, 0, sizeof(tmp)); } @@ -508,8 +508,8 @@ struct key_type keytype_des = { 56, sizeof(des_cblock), sizeof(des_key_schedule), - DES_random_key, - DES_schedule, + krb5_DES_random_key, + krb5_DES_schedule, des_salt }; @@ -571,7 +571,7 @@ struct salt_type des_salt[] = { { KRB5_PW_SALT, "pw-salt", - DES_string_to_key + krb5_DES_string_to_key }, { KRB5_AFS3_SALT, @@ -1867,29 +1867,35 @@ ARCFOUR_subdecrypt(krb5_context context, * draft-brezak-win2k-krb-rc4-hmac-03.txt */ -static int -usage2arcfour (int usage) +static krb5_error_code +usage2arcfour (krb5_context context, int *usage) { - switch (usage) { + switch (*usage) { case KRB5_KU_PA_ENC_TIMESTAMP : - return 1; + *usage = 1; + return 0; case KRB5_KU_TICKET : - return 8; + *usage = 8; case KRB5_KU_AS_REP_ENC_PART : - return 8; + *usage = 8; + return 0; case KRB5_KU_TGS_REQ_AUTH_DAT_SESSION : case KRB5_KU_TGS_REQ_AUTH_DAT_SUBKEY : case KRB5_KU_TGS_REQ_AUTH_CKSUM : case KRB5_KU_TGS_REQ_AUTH : - return 7; + *usage = 7; + return 0; case KRB5_KU_TGS_REP_ENC_PART_SESSION : case KRB5_KU_TGS_REP_ENC_PART_SUB_KEY : - return 8; + *usage = 8; + return 0; case KRB5_KU_AP_REQ_AUTH_CKSUM : case KRB5_KU_AP_REQ_AUTH : case KRB5_KU_AP_REQ_ENC_PART : - return 11; + *usage = 11; + return 0; case KRB5_KU_KRB_PRIV : + *usage = 0; return 0; case KRB5_KU_KRB_CRED : case KRB5_KU_KRB_SAFE_CKSUM : @@ -1903,7 +1909,8 @@ usage2arcfour (int usage) case KRB5_KU_USAGE_SIGN : case KRB5_KU_USAGE_SEQ : default : - abort (); + krb5_set_error_string(context, "unknown arcfour usage type %d", *usage); + return KRB5_PROG_ETYPE_NOSUPP; } } @@ -1916,7 +1923,9 @@ ARCFOUR_encrypt(krb5_context context, int usage, void *ivec) { - usage = usage2arcfour (usage); + krb5_error_code ret; + if((ret = usage2arcfour (context, &usage)) != 0) + return ret; if (encrypt) return ARCFOUR_subencrypt (context, key, data, len, usage, ivec); @@ -3001,6 +3010,11 @@ krb5_crypto_init(krb5_context context, etype); return KRB5_PROG_ETYPE_NOSUPP; } + if((*crypto)->et->keytype->size != key->keyvalue.length) { + free(*crypto); + krb5_set_error_string (context, "encryption key has bad length"); + return KRB5_BAD_KEYSIZE; + } ret = krb5_copy_keyblock(context, key, &(*crypto)->key.key); if(ret) { free(*crypto); diff --git a/crypto/heimdal/lib/krb5/fcache.c b/crypto/heimdal/lib/krb5/fcache.c index 317f702..d166fd9 100644 --- a/crypto/heimdal/lib/krb5/fcache.c +++ b/crypto/heimdal/lib/krb5/fcache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: fcache.c,v 1.33 2001/05/14 06:14:46 assar Exp $"); +RCSID("$Id: fcache.c,v 1.34 2002/04/18 14:01:29 joda Exp $"); typedef struct krb5_fcache{ char *filename; @@ -58,7 +58,7 @@ struct fcc_cursor { #define FCC_CURSOR(C) ((struct fcc_cursor*)(C)) -static char* +static const char* fcc_get_name(krb5_context context, krb5_ccache id) { @@ -248,6 +248,7 @@ fcc_initialize(krb5_context context, { krb5_storage *sp; sp = krb5_storage_from_fd(fd); + krb5_storage_set_eof_code(sp, KRB5_CC_END); if(context->fcache_vno != 0) f->version = context->fcache_vno; else @@ -321,6 +322,7 @@ fcc_store_cred(krb5_context context, { krb5_storage *sp; sp = krb5_storage_from_fd(fd); + krb5_storage_set_eof_code(sp, KRB5_CC_END); storage_set_flags(context, sp, FCACHE(id)->version); ret = krb5_store_creds(sp, creds); krb5_storage_free(sp); @@ -366,11 +368,10 @@ init_fcc (krb5_context context, return ret; } sp = krb5_storage_from_fd(fd); + krb5_storage_set_eof_code(sp, KRB5_CC_END); ret = krb5_ret_int8(sp, &pvno); - if(ret == KRB5_CC_END) { - + if(ret == KRB5_CC_END) return ENOENT; - } if(ret) return ret; if(pvno != 5) { diff --git a/crypto/heimdal/lib/krb5/get_addrs.c b/crypto/heimdal/lib/krb5/get_addrs.c index 0638fa4..f521de8 100644 --- a/crypto/heimdal/lib/krb5/get_addrs.c +++ b/crypto/heimdal/lib/krb5/get_addrs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: get_addrs.c,v 1.43 2001/07/03 18:43:57 assar Exp $"); +RCSID("$Id: get_addrs.c,v 1.44 2002/08/16 20:50:15 joda Exp $"); #ifdef __osf__ /* hate */ @@ -229,8 +229,11 @@ get_addrs_int (krb5_context context, krb5_addresses *res, int flags) ret = find_all_addresses (context, res, flags); if(ret || res->len == 0) ret = gethostname_fallback (context, res); - } else + } else { + res->len = 0; + res->val = NULL; ret = 0; + } if(ret == 0 && (flags & EXTRA_ADDRESSES)) { krb5_addresses a; diff --git a/crypto/heimdal/lib/krb5/get_cred.c b/crypto/heimdal/lib/krb5/get_cred.c index 31aa759..256234b 100644 --- a/crypto/heimdal/lib/krb5/get_cred.c +++ b/crypto/heimdal/lib/krb5/get_cred.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: get_cred.c,v 1.87 2001/07/03 18:45:03 assar Exp $"); +RCSID("$Id: get_cred.c,v 1.88 2002/03/10 23:11:29 assar Exp $"); /* * Take the `body' and encode it into `padata' using the credentials @@ -712,8 +712,17 @@ get_cred_from_kdc_flags(krb5_context context, krb5_set_error_string(context, "malloc: out of memory"); ret = ENOMEM; } else { - ret = get_cred_kdc_la(context, ccache, flags, - in_creds, &tgts, *out_creds); + krb5_boolean noaddr; + + krb5_appdefault_boolean(context, NULL, tgts.server->realm, + "no-addresses", FALSE, &noaddr); + + if (noaddr) + ret = get_cred_kdc(context, ccache, flags, NULL, + in_creds, &tgts, *out_creds); + else + ret = get_cred_kdc_la(context, ccache, flags, + in_creds, &tgts, *out_creds); if (ret) { free (*out_creds); *out_creds = NULL; @@ -772,8 +781,16 @@ get_cred_from_kdc_flags(krb5_context context, krb5_set_error_string(context, "malloc: out of memory"); ret = ENOMEM; } else { - ret = get_cred_kdc_la(context, ccache, flags, - in_creds, tgt, *out_creds); + krb5_boolean noaddr; + + krb5_appdefault_boolean(context, NULL, tgt->server->realm, + "no-addresses", FALSE, &noaddr); + if (noaddr) + ret = get_cred_kdc (context, ccache, flags, NULL, + in_creds, tgt, *out_creds); + else + ret = get_cred_kdc_la(context, ccache, flags, + in_creds, tgt, *out_creds); if (ret) { free (*out_creds); *out_creds = NULL; diff --git a/crypto/heimdal/lib/krb5/get_for_creds.c b/crypto/heimdal/lib/krb5/get_for_creds.c index 4317423..53a3f2b 100644 --- a/crypto/heimdal/lib/krb5/get_for_creds.c +++ b/crypto/heimdal/lib/krb5/get_for_creds.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: get_for_creds.c,v 1.31 2001/07/19 17:33:22 assar Exp $"); +RCSID("$Id: get_for_creds.c,v 1.32 2002/03/10 23:12:23 assar Exp $"); static krb5_error_code add_addrs(krb5_context context, @@ -257,17 +257,34 @@ krb5_get_forwarded_creds (krb5_context context, } if (auth_context->remote_address) { - ALLOC(enc_krb_cred_part.r_address, 1); - if (enc_krb_cred_part.r_address == NULL) { - ret = ENOMEM; - krb5_set_error_string(context, "malloc: out of memory"); - goto out4; - } + if (auth_context->remote_port) { + krb5_boolean noaddr; + const krb5_realm *realm; + + realm = krb5_princ_realm(context, out_creds->server); + krb5_appdefault_boolean(context, NULL, *realm, "no-addresses", + FALSE, &noaddr); + if (!noaddr) { + ret = krb5_make_addrport (context, + &enc_krb_cred_part.r_address, + auth_context->remote_address, + auth_context->remote_port); + if (ret) + goto out4; + } + } else { + ALLOC(enc_krb_cred_part.r_address, 1); + if (enc_krb_cred_part.r_address == NULL) { + ret = ENOMEM; + krb5_set_error_string(context, "malloc: out of memory"); + goto out4; + } - ret = krb5_copy_address (context, auth_context->remote_address, - enc_krb_cred_part.r_address); - if (ret) - goto out4; + ret = krb5_copy_address (context, auth_context->remote_address, + enc_krb_cred_part.r_address); + if (ret) + goto out4; + } } /* fill ticket_info.val[0] */ diff --git a/crypto/heimdal/lib/krb5/get_host_realm.c b/crypto/heimdal/lib/krb5/get_host_realm.c index 266072e..f2b4280 100644 --- a/crypto/heimdal/lib/krb5/get_host_realm.c +++ b/crypto/heimdal/lib/krb5/get_host_realm.c @@ -34,19 +34,19 @@ #include "krb5_locl.h" #include <resolve.h> -RCSID("$Id: get_host_realm.c,v 1.28 2001/05/14 06:14:47 assar Exp $"); +RCSID("$Id: get_host_realm.c,v 1.29 2002/08/28 13:36:57 nectar Exp $"); /* To automagically find the correct realm of a host (without * [domain_realm] in krb5.conf) add a text record for your domain with * the name of your realm, like this: * - * krb5-realm IN TXT FOO.SE + * _kerberos IN TXT "FOO.SE" * * The search is recursive, so you can add entries for specific * hosts. To find the realm of host a.b.c, it first tries - * krb5-realm.a.b.c, then krb5-realm.b.c and so on. + * _kerberos.a.b.c, then _kerberos.b.c and so on. * - * Also supported is _kerberos (following draft-ietf-cat-krb-dns-locate-01.txt) + * This method is described in draft-ietf-cat-krb-dns-locate-03.txt. * */ @@ -92,23 +92,33 @@ copy_txt_to_realms (struct resource_record *head, static int dns_find_realm(krb5_context context, const char *domain, - const char *dom_string, krb5_realm **realms) { + static char *default_labels[] = { "_kerberos", NULL }; char dom[MAXHOSTNAMELEN]; struct dns_reply *r; - int ret; + char **labels; + int i, ret; + labels = krb5_config_get_strings(context, NULL, "libdefaults", + "dns_lookup_realm_labels", NULL); + if(labels == NULL) + labels = default_labels; if(*domain == '.') domain++; - snprintf(dom, sizeof(dom), "%s.%s.", dom_string, domain); - r = dns_lookup(dom, "TXT"); - if(r == NULL) - return -1; - - ret = copy_txt_to_realms (r->head, realms); - dns_free_data(r); - return ret; + for (i = 0; labels[i] != NULL; i++) { + if(snprintf(dom, sizeof(dom), "%s.%s.", labels[i], domain) >= + sizeof(dom)) + return -1; + r = dns_lookup(dom, "TXT"); + if(r != NULL) { + ret = copy_txt_to_realms (r->head, realms); + dns_free_data(r); + if(ret == 0) + return 0; + } + } + return -1; } /* @@ -145,15 +155,24 @@ krb5_get_host_realm_int (krb5_context context, krb5_boolean use_dns, krb5_realm **realms) { - const char *p; + const char *p, *q; + krb5_boolean dns_locate_enable; + dns_locate_enable = krb5_config_get_bool_default(context, NULL, TRUE, + "libdefaults", "dns_lookup_realm", NULL); for (p = host; p != NULL; p = strchr (p + 1, '.')) { - if(config_find_realm(context, p, realms) == 0) - return 0; - else if(use_dns) { - if(dns_find_realm(context, p, "krb5-realm", realms) == 0) - return 0; - if(dns_find_realm(context, p, "_kerberos", realms) == 0) + if(config_find_realm(context, p, realms) == 0) { + if(strcasecmp(*realms[0], "dns_locate") == 0) { + if(use_dns) + for (q = host; q != NULL; q = strchr(q + 1, '.')) + if(dns_find_realm(context, q, realms) == 0) + return 0; + continue; + } else + return 0; + } + else if(use_dns && dns_locate_enable) { + if(dns_find_realm(context, p, realms) == 0) return 0; } } diff --git a/crypto/heimdal/lib/krb5/get_in_tkt.c b/crypto/heimdal/lib/krb5/get_in_tkt.c index aa72bbc..04587ea 100644 --- a/crypto/heimdal/lib/krb5/get_in_tkt.c +++ b/crypto/heimdal/lib/krb5/get_in_tkt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: get_in_tkt.c,v 1.103 2002/01/06 23:10:06 assar Exp $"); +RCSID("$Id: get_in_tkt.c,v 1.104 2002/04/18 09:11:39 joda Exp $"); krb5_error_code krb5_init_etype (krb5_context context, @@ -43,19 +43,18 @@ krb5_init_etype (krb5_context context, { int i; krb5_error_code ret; - krb5_enctype *tmp; + krb5_enctype *tmp = NULL; ret = 0; - if (etypes) - tmp = (krb5_enctype*)etypes; - else { + if (etypes == NULL) { ret = krb5_get_default_in_tkt_etypes(context, &tmp); if (ret) return ret; + etypes = tmp; } - for (i = 0; tmp[i]; ++i) + for (i = 0; etypes[i]; ++i) ; *len = i; *val = malloc(i * sizeof(**val)); @@ -65,10 +64,10 @@ krb5_init_etype (krb5_context context, goto cleanup; } memmove (*val, - tmp, + etypes, i * sizeof(*tmp)); cleanup: - if (etypes == NULL) + if (tmp != NULL) free (tmp); return ret; } diff --git a/crypto/heimdal/lib/krb5/init_creds_pw.c b/crypto/heimdal/lib/krb5/init_creds_pw.c index e04d9f1..19b5b36 100644 --- a/crypto/heimdal/lib/krb5/init_creds_pw.c +++ b/crypto/heimdal/lib/krb5/init_creds_pw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: init_creds_pw.c,v 1.51 2001/09/18 09:36:39 joda Exp $"); +RCSID("$Id: init_creds_pw.c,v 1.53 2002/04/18 09:14:51 joda Exp $"); static int get_config_time (krb5_context context, @@ -125,6 +125,24 @@ out: } /* + * Print a message (str) to the user about the expiration in `lr' + */ + +static void +report_expiration (krb5_context context, + krb5_prompter_fct prompter, + krb5_data *data, + const char *str, + time_t time) +{ + char *p; + + asprintf (&p, "%s%s", str, ctime(&time)); + (*prompter) (context, data, NULL, p, 0, NULL); + free (p); +} + +/* * Parse the last_req data and show it to the user if it's interesting */ @@ -139,6 +157,7 @@ print_expire (krb5_context context, LastReq *lr = &rep->enc_part.last_req; krb5_timestamp sec; time_t t; + krb5_boolean reported = FALSE; krb5_timeofday (context, &sec); @@ -148,26 +167,30 @@ print_expire (krb5_context context, 7 * 24 * 60 * 60); for (i = 0; i < lr->len; ++i) { - if (abs(lr->val[i].lr_type) == LR_PW_EXPTIME - && lr->val[i].lr_value <= t) { - char *p; - time_t tmp = lr->val[i].lr_value; - - asprintf (&p, "Your password will expire at %s", ctime(&tmp)); - (*prompter) (context, data, NULL, p, 0, NULL); - free (p); - return; + if (lr->val[i].lr_value <= t) { + switch (abs(lr->val[i].lr_type)) { + case LR_PW_EXPTIME : + report_expiration(context, prompter, data, + "Your password will expire at ", + lr->val[i].lr_value); + reported = TRUE; + break; + case LR_ACCT_EXPTIME : + report_expiration(context, prompter, data, + "Your account will expire at ", + lr->val[i].lr_value); + reported = TRUE; + break; + } } } - if (rep->enc_part.key_expiration + if (!reported + && rep->enc_part.key_expiration && *rep->enc_part.key_expiration <= t) { - char *p; - time_t t = *rep->enc_part.key_expiration; - - asprintf (&p, "Your password/account will expire at %s", ctime(&t)); - (*prompter) (context, data, NULL, p, 0, NULL); - free (p); + report_expiration(context, prompter, data, + "Your password/account will expire at ", + *rep->enc_part.key_expiration); } } @@ -384,11 +407,12 @@ krb5_get_init_creds_password(krb5_context context, if (password == NULL) { krb5_prompt prompt; - char *p; + char *p, *q; krb5_unparse_name (context, this_cred.client, &p); - asprintf (&prompt.prompt, "%s's Password: ", p); + asprintf (&q, "%s's Password: ", p); free (p); + prompt.prompt = q; password_data.data = buf; password_data.length = sizeof(buf); prompt.hidden = 1; @@ -396,7 +420,7 @@ krb5_get_init_creds_password(krb5_context context, prompt.type = KRB5_PROMPT_TYPE_PASSWORD; ret = (*prompter) (context, data, NULL, NULL, 1, &prompt); - free (prompt.prompt); + free (q); if (ret) { memset (buf, 0, sizeof(buf)); ret = KRB5_LIBOS_PWDINTR; diff --git a/crypto/heimdal/lib/krb5/kerberos.8 b/crypto/heimdal/lib/krb5/kerberos.8 index 1d19152..5f05284 100644 --- a/crypto/heimdal/lib/krb5/kerberos.8 +++ b/crypto/heimdal/lib/krb5/kerberos.8 @@ -1,4 +1,4 @@ -.\" $Id: kerberos.8,v 1.4 2001/07/12 08:42:27 assar Exp $ +.\" $Id: kerberos.8,v 1.5 2002/08/20 17:07:17 joda Exp $ .\" .Dd September 1, 2000 .Dt KERBEROS 8 @@ -9,14 +9,14 @@ .Sh DESCRIPTION Kerberos is a network authentication system. Its purpose is to securely authenticate users and services in an insecure network -environment. +environment. .Pp This is done with a Kerberos server acting as a trusted third party, keeping a database with secret keys for all users and services (collectively called .Em principals ) . .Pp -Each principal belongs to exactly one +Each principal belongs to exactly one .Em realm , which is the administrative domain in Kerberos. A realm usually corresponds to an organisation, and the realm should normally be @@ -25,14 +25,14 @@ or more Kerberos servers. .Pp The authentication process involves exchange of .Sq tickets -and -.Sq authenticators +and +.Sq authenticators which together prove the principal's identity. .Pp When you login to the Kerberos system, either through the normal system login or with the .Xr kinit 1 -program, you acquire a +program, you acquire a .Em ticket granting ticket which allows you to get new tickets for other services, such as .Ic telnet diff --git a/crypto/heimdal/lib/krb5/keytab.c b/crypto/heimdal/lib/krb5/keytab.c index 815044b..f276d2e 100644 --- a/crypto/heimdal/lib/krb5/keytab.c +++ b/crypto/heimdal/lib/krb5/keytab.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab.c,v 1.52 2002/01/30 10:09:35 joda Exp $"); +RCSID("$Id: keytab.c,v 1.53 2002/03/10 23:14:12 assar Exp $"); /* * Register a new keytab in `ops' @@ -262,6 +262,7 @@ krb5_kt_compare(krb5_context context, /* * Retrieve the keytab entry for `principal, kvno, enctype' into `entry' * from the keytab `id'. + * kvno == 0 is a wildcard and gives the keytab with the highest vno. * Return 0 or an error. */ @@ -287,7 +288,10 @@ krb5_kt_get_entry(krb5_context context, entry->vno = 0; while (krb5_kt_next_entry(context, id, &tmp, &cursor) == 0) { if (krb5_kt_compare(context, &tmp, principal, 0, enctype)) { - if (kvno == tmp.vno) { + /* the file keytab might only store the lower 8 bits of + the kvno, so only compare those bits */ + if (kvno == tmp.vno + || (tmp.vno < 256 && kvno % 256 == tmp.vno)) { krb5_kt_copy_entry_contents (context, &tmp, entry); krb5_kt_free_entry (context, &tmp); krb5_kt_end_seq_get(context, id, &cursor); @@ -310,16 +314,19 @@ krb5_kt_get_entry(krb5_context context, krb5_kt_get_name (context, id, kt_name, sizeof(kt_name)); krb5_set_error_string (context, - "failed to find %s in keytab %s", - princ, kt_name); + "failed to find %s%s%d%s in keytab %s", + princ, + kvno ? "(" : "", + kvno, + kvno ? ")" : "", + kt_name); return KRB5_KT_NOTFOUND; } } /* * Copy the contents of `in' into `out'. - * Return 0 or an error. - */ + * Return 0 or an error. */ krb5_error_code krb5_kt_copy_entry_contents(krb5_context context, diff --git a/crypto/heimdal/lib/krb5/keytab_any.c b/crypto/heimdal/lib/krb5/keytab_any.c index 5c6dde8..268c8df 100644 --- a/crypto/heimdal/lib/krb5/keytab_any.c +++ b/crypto/heimdal/lib/krb5/keytab_any.c @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab_any.c,v 1.5 2002/02/11 14:05:37 joda Exp $"); +RCSID("$Id: keytab_any.c,v 1.6 2002/04/18 14:02:11 joda Exp $"); struct any_data { krb5_keytab kt; @@ -160,7 +160,7 @@ any_next_entry (krb5_context context, ret = krb5_kt_next_entry(context, ed->a->kt, entry, &ed->cursor); if (ret == 0) return 0; - else if (ret == KRB5_CC_END) { + else if (ret == KRB5_KT_END) { ret2 = krb5_kt_end_seq_get (context, ed->a->kt, &ed->cursor); if (ret2) return ret2; @@ -171,11 +171,11 @@ any_next_entry (krb5_context context, } if (ed->a == NULL) { krb5_clear_error_string (context); - return KRB5_CC_END; + return KRB5_KT_END; } } else return ret; - } while (ret == KRB5_CC_END); + } while (ret == KRB5_KT_END); return ret; } diff --git a/crypto/heimdal/lib/krb5/keytab_file.c b/crypto/heimdal/lib/krb5/keytab_file.c index 13b67c2..7655af5 100644 --- a/crypto/heimdal/lib/krb5/keytab_file.c +++ b/crypto/heimdal/lib/krb5/keytab_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab_file.c,v 1.8 2001/05/14 06:14:48 assar Exp $"); +RCSID("$Id: keytab_file.c,v 1.11 2002/05/28 12:57:27 joda Exp $"); #define KRB5_KT_VNO_1 1 #define KRB5_KT_VNO_2 2 @@ -61,7 +61,7 @@ krb5_kt_ret_data(krb5_context context, krb5_set_error_string (context, "malloc: out of memory"); return ENOMEM; } - ret = sp->fetch(sp, data->data, size); + ret = krb5_storage_read(sp, data->data, size); if(ret != size) return (ret < 0)? errno : KRB5_KT_END; return 0; @@ -82,7 +82,7 @@ krb5_kt_ret_string(krb5_context context, krb5_set_error_string (context, "malloc: out of memory"); return ENOMEM; } - ret = sp->fetch(sp, *data, size); + ret = krb5_storage_read(sp, *data, size); (*data)[size] = '\0'; if(ret != size) return (ret < 0)? errno : KRB5_KT_END; @@ -98,7 +98,7 @@ krb5_kt_store_data(krb5_context context, ret = krb5_store_int16(sp, data.length); if(ret < 0) return ret; - ret = sp->store(sp, data.data, data.length); + ret = krb5_storage_write(sp, data.data, data.length); if(ret != data.length){ if(ret < 0) return errno; @@ -116,7 +116,7 @@ krb5_kt_store_string(krb5_storage *sp, ret = krb5_store_int16(sp, len); if(ret < 0) return ret; - ret = sp->store(sp, data, len); + ret = krb5_storage_write(sp, data, len); if(ret != len){ if(ret < 0) return errno; @@ -171,7 +171,7 @@ krb5_kt_ret_principal(krb5_context context, ret = krb5_ret_int16(sp, &tmp); if(ret) return ret; - if (sp->flags & KRB5_STORAGE_PRINCIPAL_WRONG_NUM_COMPONENTS) + if(krb5_storage_is_flags(sp, KRB5_STORAGE_PRINCIPAL_WRONG_NUM_COMPONENTS)) tmp--; p->name.name_string.len = tmp; ret = krb5_kt_ret_string(context, sp, &p->realm); @@ -284,8 +284,8 @@ storage_set_flags(krb5_context context, krb5_storage *sp, int vno) case KRB5_KT_VNO_2: break; default: - krb5_abortx(context, - "storage_set_flags called with bad vno (%x)", vno); + krb5_warnx(context, + "storage_set_flags called with bad vno (%d)", vno); } krb5_storage_set_flags(sp, flags); } @@ -308,6 +308,7 @@ fkt_start_seq_get_int(krb5_context context, return ret; } c->sp = krb5_storage_from_fd(c->fd); + krb5_storage_set_eof_code(c->sp, KRB5_KT_END); ret = krb5_ret_int8(c->sp, &pvno); if(ret) { krb5_storage_free(c->sp); @@ -351,15 +352,15 @@ fkt_next_entry_int(krb5_context context, int ret; int8_t tmp8; int32_t tmp32; - off_t pos; + off_t pos, curpos; - pos = cursor->sp->seek(cursor->sp, 0, SEEK_CUR); + pos = krb5_storage_seek(cursor->sp, 0, SEEK_CUR); loop: ret = krb5_ret_int32(cursor->sp, &len); if (ret) return ret; if(len < 0) { - pos = cursor->sp->seek(cursor->sp, -len, SEEK_CUR); + pos = krb5_storage_seek(cursor->sp, -len, SEEK_CUR); goto loop; } ret = krb5_kt_ret_principal (context, cursor->sp, &entry->principal); @@ -376,10 +377,20 @@ loop: ret = krb5_kt_ret_keyblock (context, cursor->sp, &entry->keyblock); if (ret) goto out; + /* there might be a 32 bit kvno here + * if it's zero, assume that the 8bit one was right, + * otherwise trust the new value */ + curpos = krb5_storage_seek(cursor->sp, 0, SEEK_CUR); + if(len + 4 + pos - curpos == 4) { + ret = krb5_ret_int32(cursor->sp, &tmp32); + if (ret == 0 && tmp32 != 0) { + entry->vno = tmp32; + } + } if(start) *start = pos; if(end) *end = *start + 4 + len; out: - cursor->sp->seek(cursor->sp, pos + 4 + len, SEEK_SET); + krb5_storage_seek(cursor->sp, pos + 4 + len, SEEK_SET); return ret; } @@ -403,6 +414,20 @@ fkt_end_seq_get(krb5_context context, } static krb5_error_code +fkt_setup_keytab(krb5_context context, + krb5_keytab id, + krb5_storage *sp) +{ + krb5_error_code ret; + ret = krb5_store_int8(sp, 5); + if(ret) + return ret; + if(id->version == 0) + id->version = KRB5_KT_VNO; + return krb5_store_int8 (sp, id->version); +} + +static krb5_error_code fkt_add_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) @@ -424,44 +449,52 @@ fkt_add_entry(krb5_context context, return ret; } sp = krb5_storage_from_fd(fd); - ret = krb5_store_int8(sp, 5); + krb5_storage_set_eof_code(sp, KRB5_KT_END); + ret = fkt_setup_keytab(context, id, sp); if(ret) { krb5_storage_free(sp); close(fd); return ret; } - if(id->version == 0) - id->version = KRB5_KT_VNO; - ret = krb5_store_int8 (sp, id->version); - if (ret) { - krb5_storage_free(sp); - close(fd); - return ret; - } storage_set_flags(context, sp, id->version); } else { int8_t pvno, tag; sp = krb5_storage_from_fd(fd); + krb5_storage_set_eof_code(sp, KRB5_KT_END); ret = krb5_ret_int8(sp, &pvno); if(ret) { - krb5_storage_free(sp); - close(fd); - return ret; - } - if(pvno != 5) { - krb5_storage_free(sp); - close(fd); - krb5_clear_error_string (context); - return KRB5_KEYTAB_BADVNO; - } - ret = krb5_ret_int8 (sp, &tag); - if (ret) { - krb5_storage_free(sp); - close(fd); - return ret; + /* we probably have a zero byte file, so try to set it up + properly */ + ret = fkt_setup_keytab(context, id, sp); + if(ret) { + krb5_set_error_string(context, "%s: keytab is corrupted: %s", + d->filename, strerror(ret)); + krb5_storage_free(sp); + close(fd); + return ret; + } + storage_set_flags(context, sp, id->version); + } else { + if(pvno != 5) { + krb5_storage_free(sp); + close(fd); + krb5_clear_error_string (context); + ret = KRB5_KEYTAB_BADVNO; + krb5_set_error_string(context, "%s: %s", + d->filename, strerror(ret)); + return ret; + } + ret = krb5_ret_int8 (sp, &tag); + if (ret) { + krb5_set_error_string(context, "%s: reading tag: %s", + d->filename, strerror(ret)); + krb5_storage_free(sp); + close(fd); + return ret; + } + id->version = tag; + storage_set_flags(context, sp, id->version); } - id->version = tag; - storage_set_flags(context, sp, id->version); } { @@ -482,7 +515,7 @@ fkt_add_entry(krb5_context context, krb5_storage_free(emem); goto out; } - ret = krb5_store_int8 (emem, entry->vno); + ret = krb5_store_int8 (emem, entry->vno % 256); if(ret) { krb5_storage_free(emem); goto out; @@ -492,6 +525,12 @@ fkt_add_entry(krb5_context context, krb5_storage_free(emem); goto out; } + ret = krb5_store_int32 (emem, entry->vno); + if (ret) { + krb5_storage_free(emem); + goto out; + } + ret = krb5_storage_to_data(emem, &keytab); krb5_storage_free(emem); if(ret) @@ -500,25 +539,25 @@ fkt_add_entry(krb5_context context, while(1) { ret = krb5_ret_int32(sp, &len); - if(ret == KRB5_CC_END) { + if(ret == KRB5_KT_END) { len = keytab.length; break; } if(len < 0) { len = -len; if(len >= keytab.length) { - sp->seek(sp, -4, SEEK_CUR); + krb5_storage_seek(sp, -4, SEEK_CUR); break; } } - sp->seek(sp, len, SEEK_CUR); + krb5_storage_seek(sp, len, SEEK_CUR); } ret = krb5_store_int32(sp, len); - if(sp->store(sp, keytab.data, keytab.length) < 0) + if(krb5_storage_write(sp, keytab.data, keytab.length) < 0) ret = errno; memset(keytab.data, 0, keytab.length); krb5_data_free(&keytab); - out: + out: krb5_storage_free(sp); close(fd); return ret; @@ -542,12 +581,12 @@ fkt_remove_entry(krb5_context context, int32_t len; unsigned char buf[128]; found = 1; - cursor.sp->seek(cursor.sp, pos_start, SEEK_SET); + krb5_storage_seek(cursor.sp, pos_start, SEEK_SET); len = pos_end - pos_start - 4; krb5_store_int32(cursor.sp, -len); memset(buf, 0, sizeof(buf)); while(len > 0) { - cursor.sp->store(cursor.sp, buf, min(len, sizeof(buf))); + krb5_storage_write(cursor.sp, buf, min(len, sizeof(buf))); len -= min(len, sizeof(buf)); } } diff --git a/crypto/heimdal/lib/krb5/keytab_keyfile.c b/crypto/heimdal/lib/krb5/keytab_keyfile.c index 61e2bca..7dd0cd9 100644 --- a/crypto/heimdal/lib/krb5/keytab_keyfile.c +++ b/crypto/heimdal/lib/krb5/keytab_keyfile.c @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab_keyfile.c,v 1.12 2002/02/15 14:32:52 joda Exp $"); +RCSID("$Id: keytab_keyfile.c,v 1.13 2002/04/18 14:04:21 joda Exp $"); /* afs keyfile operations --------------------------------------- */ @@ -208,7 +208,7 @@ akf_start_seq_get(krb5_context context, krb5_storage_free(c->sp); close(c->fd); krb5_clear_error_string (context); - if(ret == KRB5_CC_END) + if(ret == KRB5_KT_END) return KRB5_KT_NOTFOUND; return ret; } @@ -227,7 +227,7 @@ akf_next_entry(krb5_context context, off_t pos; int ret; - pos = cursor->sp->seek(cursor->sp, 0, SEEK_CUR); + pos = krb5_storage_seek(cursor->sp, 0, SEEK_CUR); if ((pos - 4) / (4 + 8) >= d->num_entries) return KRB5_KT_END; @@ -255,7 +255,7 @@ akf_next_entry(krb5_context context, goto out; } - ret = cursor->sp->fetch(cursor->sp, entry->keyblock.keyvalue.data, 8); + ret = krb5_storage_read(cursor->sp, entry->keyblock.keyvalue.data, 8); if(ret != 8) ret = (ret < 0) ? errno : KRB5_KT_END; else @@ -264,7 +264,7 @@ akf_next_entry(krb5_context context, entry->timestamp = time(NULL); out: - cursor->sp->seek(cursor->sp, pos + 4 + 8, SEEK_SET); + krb5_storage_seek(cursor->sp, pos + 4 + 8, SEEK_SET); return ret; } @@ -316,7 +316,7 @@ akf_add_entry(krb5_context context, if (created) len = 0; else { - if((*sp->seek)(sp, 0, SEEK_SET) < 0) { + if(krb5_storage_seek(sp, 0, SEEK_SET) < 0) { ret = errno; krb5_storage_free(sp); close(fd); @@ -333,7 +333,7 @@ akf_add_entry(krb5_context context, } len++; - if((*sp->seek)(sp, 0, SEEK_SET) < 0) { + if(krb5_storage_seek(sp, 0, SEEK_SET) < 0) { ret = errno; krb5_storage_free(sp); close(fd); @@ -349,7 +349,7 @@ akf_add_entry(krb5_context context, } - if((*sp->seek)(sp, (len - 1) * (8 + 4), SEEK_CUR) < 0) { + if(krb5_storage_seek(sp, (len - 1) * (8 + 4), SEEK_CUR) < 0) { ret = errno; krb5_storage_free(sp); close(fd); @@ -363,8 +363,8 @@ akf_add_entry(krb5_context context, close(fd); return ret; } - ret = sp->store(sp, entry->keyblock.keyvalue.data, - entry->keyblock.keyvalue.length); + ret = krb5_storage_write(sp, entry->keyblock.keyvalue.data, + entry->keyblock.keyvalue.length); if(ret != entry->keyblock.keyvalue.length) { krb5_storage_free(sp); close(fd); diff --git a/crypto/heimdal/lib/krb5/keytab_krb4.c b/crypto/heimdal/lib/krb5/keytab_krb4.c index 3fc955d..2405f82 100644 --- a/crypto/heimdal/lib/krb5/keytab_krb4.c +++ b/crypto/heimdal/lib/krb5/keytab_krb4.c @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab_krb4.c,v 1.9 2002/02/11 14:05:10 joda Exp $"); +RCSID("$Id: keytab_krb4.c,v 1.10 2002/04/18 14:04:46 joda Exp $"); struct krb4_kt_data { char *filename; @@ -139,6 +139,7 @@ krb4_kt_start_seq_get_int (krb5_context context, return ret; } c->sp = krb5_storage_from_fd(c->fd); + krb5_storage_set_eof_code(c->sp, KRB5_KT_END); return 0; } @@ -187,7 +188,7 @@ read_v4_entry (krb5_context context, krb5_free_principal (context, ed->entry.principal); return ret; } - ret = c->sp->fetch(c->sp, key, 8); + ret = krb5_storage_read(c->sp, key, 8); if (ret < 0) { krb5_free_principal(context, ed->entry.principal); return ret; @@ -274,7 +275,7 @@ krb4_store_keytab_entry(krb5_context context, ret = krb5_store_stringz(sp, instance); ret = krb5_store_stringz(sp, realm); ret = krb5_store_int8(sp, entry->vno); - ret = (*sp->store)(sp, entry->keyblock.keyvalue.data, 8); + ret = krb5_storage_write(sp, entry->keyblock.keyvalue.data, 8); } return 0; } @@ -301,6 +302,7 @@ krb4_kt_add_entry (krb5_context context, } } sp = krb5_storage_from_fd(fd); + krb5_storage_set_eof_code(sp, KRB5_KT_END); if(sp == NULL) { close(fd); return ENOMEM; diff --git a/crypto/heimdal/lib/krb5/krb5-private.h b/crypto/heimdal/lib/krb5/krb5-private.h index c653695..6abac50 100644 --- a/crypto/heimdal/lib/krb5/krb5-private.h +++ b/crypto/heimdal/lib/krb5/krb5-private.h @@ -2,58 +2,49 @@ #ifndef __krb5_private_h__ #define __krb5_private_h__ -#ifdef __STDC__ #include <stdarg.h> -#ifndef __P -#define __P(x) x -#endif -#else -#ifndef __P -#define __P(x) () -#endif -#endif void -_krb5_crc_init_table __P((void)); +_krb5_crc_init_table (void); u_int32_t -_krb5_crc_update __P(( - const char *p, - size_t len, - u_int32_t res)); +_krb5_crc_update ( + const char */*p*/, + size_t /*len*/, + u_int32_t /*res*/); int -_krb5_extract_ticket __P(( - krb5_context context, - krb5_kdc_rep *rep, - krb5_creds *creds, - krb5_keyblock *key, - krb5_const_pointer keyseed, - krb5_key_usage key_usage, - krb5_addresses *addrs, - unsigned nonce, - krb5_boolean allow_server_mismatch, - krb5_boolean ignore_cname, - krb5_decrypt_proc decrypt_proc, - krb5_const_pointer decryptarg)); - -ssize_t -_krb5_get_int __P(( - void *buffer, - unsigned long *value, - size_t size)); +_krb5_extract_ticket ( + krb5_context /*context*/, + krb5_kdc_rep */*rep*/, + krb5_creds */*creds*/, + krb5_keyblock */*key*/, + krb5_const_pointer /*keyseed*/, + krb5_key_usage /*key_usage*/, + krb5_addresses */*addrs*/, + unsigned /*nonce*/, + krb5_boolean /*allow_server_mismatch*/, + krb5_boolean /*ignore_cname*/, + krb5_decrypt_proc /*decrypt_proc*/, + krb5_const_pointer /*decryptarg*/); + +krb5_ssize_t +_krb5_get_int ( + void */*buffer*/, + unsigned long */*value*/, + size_t /*size*/); void -_krb5_n_fold __P(( - const void *str, - size_t len, - void *key, - size_t size)); - -ssize_t -_krb5_put_int __P(( - void *buffer, - unsigned long value, - size_t size)); +_krb5_n_fold ( + const void */*str*/, + size_t /*len*/, + void */*key*/, + size_t /*size*/); + +krb5_ssize_t +_krb5_put_int ( + void */*buffer*/, + unsigned long /*value*/, + size_t /*size*/); #endif /* __krb5_private_h__ */ diff --git a/crypto/heimdal/lib/krb5/krb5-protos.h b/crypto/heimdal/lib/krb5/krb5-protos.h index d40889c..30ebf50 100644 --- a/crypto/heimdal/lib/krb5/krb5-protos.h +++ b/crypto/heimdal/lib/krb5/krb5-protos.h @@ -2,2856 +2,2887 @@ #ifndef __krb5_protos_h__ #define __krb5_protos_h__ -#ifdef __STDC__ #include <stdarg.h> -#ifndef __P -#define __P(x) x -#endif -#else -#ifndef __P -#define __P(x) () -#endif -#endif #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(x) #endif krb5_error_code -krb524_convert_creds_kdc __P(( - krb5_context context, - krb5_creds *in_cred, - struct credentials *v4creds)); +krb524_convert_creds_kdc ( + krb5_context /*context*/, + krb5_creds */*in_cred*/, + struct credentials */*v4creds*/); krb5_error_code -krb524_convert_creds_kdc_ccache __P(( - krb5_context context, - krb5_ccache ccache, - krb5_creds *in_cred, - struct credentials *v4creds)); +krb524_convert_creds_kdc_ccache ( + krb5_context /*context*/, + krb5_ccache /*ccache*/, + krb5_creds */*in_cred*/, + struct credentials */*v4creds*/); krb5_error_code -krb5_425_conv_principal __P(( - krb5_context context, - const char *name, - const char *instance, - const char *realm, - krb5_principal *princ)); +krb5_425_conv_principal ( + krb5_context /*context*/, + const char */*name*/, + const char */*instance*/, + const char */*realm*/, + krb5_principal */*princ*/); krb5_error_code -krb5_425_conv_principal_ext __P(( - krb5_context context, - const char *name, - const char *instance, - const char *realm, - krb5_boolean (*func)(krb5_context, krb5_principal), - krb5_boolean resolve, - krb5_principal *princ)); +krb5_425_conv_principal_ext ( + krb5_context /*context*/, + const char */*name*/, + const char */*instance*/, + const char */*realm*/, + krb5_boolean (*/*func*/)(krb5_context, krb5_principal), + krb5_boolean /*resolve*/, + krb5_principal */*princ*/); krb5_error_code -krb5_524_conv_principal __P(( - krb5_context context, - const krb5_principal principal, - char *name, - char *instance, - char *realm)); +krb5_524_conv_principal ( + krb5_context /*context*/, + const krb5_principal /*principal*/, + char */*name*/, + char */*instance*/, + char */*realm*/); krb5_error_code -krb5_abort __P(( - krb5_context context, - krb5_error_code code, - const char *fmt, - ...)) +krb5_abort ( + krb5_context /*context*/, + krb5_error_code /*code*/, + const char */*fmt*/, + ...) __attribute__ ((noreturn, format (printf, 3, 4))); krb5_error_code -krb5_abortx __P(( - krb5_context context, - const char *fmt, - ...)) +krb5_abortx ( + krb5_context /*context*/, + const char */*fmt*/, + ...) __attribute__ ((noreturn, format (printf, 2, 3))); krb5_error_code -krb5_acl_match_file __P(( - krb5_context context, - const char *file, - const char *format, - ...)); +krb5_acl_match_file ( + krb5_context /*context*/, + const char */*file*/, + const char */*format*/, + ...); krb5_error_code -krb5_acl_match_string __P(( - krb5_context context, - const char *acl_string, - const char *format, - ...)); +krb5_acl_match_string ( + krb5_context /*context*/, + const char */*string*/, + const char */*format*/, + ...); krb5_error_code -krb5_add_et_list __P(( - krb5_context context, - void (*func)(struct et_list **))); +krb5_add_et_list ( + krb5_context /*context*/, + void (*/*func*/)(struct et_list **)); krb5_error_code -krb5_add_extra_addresses __P(( - krb5_context context, - krb5_addresses *addresses)); +krb5_add_extra_addresses ( + krb5_context /*context*/, + krb5_addresses */*addresses*/); krb5_error_code -krb5_add_ignore_addresses __P(( - krb5_context context, - krb5_addresses *addresses)); +krb5_add_ignore_addresses ( + krb5_context /*context*/, + krb5_addresses */*addresses*/); krb5_error_code -krb5_addlog_dest __P(( - krb5_context context, - krb5_log_facility *f, - const char *orig)); +krb5_addlog_dest ( + krb5_context /*context*/, + krb5_log_facility */*f*/, + const char */*orig*/); krb5_error_code -krb5_addlog_func __P(( - krb5_context context, - krb5_log_facility *fac, - int min, - int max, - krb5_log_log_func_t log, - krb5_log_close_func_t close, - void *data)); +krb5_addlog_func ( + krb5_context /*context*/, + krb5_log_facility */*fac*/, + int /*min*/, + int /*max*/, + krb5_log_log_func_t /*log*/, + krb5_log_close_func_t /*close*/, + void */*data*/); krb5_error_code -krb5_addr2sockaddr __P(( - krb5_context context, - const krb5_address *addr, - struct sockaddr *sa, - int *sa_size, - int port)); +krb5_addr2sockaddr ( + krb5_context /*context*/, + const krb5_address */*addr*/, + struct sockaddr */*sa*/, + krb5_socklen_t */*sa_size*/, + int /*port*/); krb5_boolean -krb5_address_compare __P(( - krb5_context context, - const krb5_address *addr1, - const krb5_address *addr2)); +krb5_address_compare ( + krb5_context /*context*/, + const krb5_address */*addr1*/, + const krb5_address */*addr2*/); int -krb5_address_order __P(( - krb5_context context, - const krb5_address *addr1, - const krb5_address *addr2)); +krb5_address_order ( + krb5_context /*context*/, + const krb5_address */*addr1*/, + const krb5_address */*addr2*/); krb5_boolean -krb5_address_search __P(( - krb5_context context, - const krb5_address *addr, - const krb5_addresses *addrlist)); +krb5_address_search ( + krb5_context /*context*/, + const krb5_address */*addr*/, + const krb5_addresses */*addrlist*/); krb5_error_code -krb5_aname_to_localname __P(( - krb5_context context, - krb5_const_principal aname, - size_t lnsize, - char *lname)); +krb5_aname_to_localname ( + krb5_context /*context*/, + krb5_const_principal /*aname*/, + size_t /*lnsize*/, + char */*lname*/); krb5_error_code -krb5_anyaddr __P(( - krb5_context context, - int af, - struct sockaddr *sa, - int *sa_size, - int port)); +krb5_anyaddr ( + krb5_context /*context*/, + int /*af*/, + struct sockaddr */*sa*/, + krb5_socklen_t */*sa_size*/, + int /*port*/); void -krb5_appdefault_boolean __P(( - krb5_context context, - const char *appname, - krb5_const_realm realm, - const char *option, - krb5_boolean def_val, - krb5_boolean *ret_val)); +krb5_appdefault_boolean ( + krb5_context /*context*/, + const char */*appname*/, + krb5_const_realm /*realm*/, + const char */*option*/, + krb5_boolean /*def_val*/, + krb5_boolean */*ret_val*/); void -krb5_appdefault_string __P(( - krb5_context context, - const char *appname, - krb5_const_realm realm, - const char *option, - const char *def_val, - char **ret_val)); +krb5_appdefault_string ( + krb5_context /*context*/, + const char */*appname*/, + krb5_const_realm /*realm*/, + const char */*option*/, + const char */*def_val*/, + char **/*ret_val*/); void -krb5_appdefault_time __P(( - krb5_context context, - const char *appname, - krb5_const_realm realm, - const char *option, - time_t def_val, - time_t *ret_val)); +krb5_appdefault_time ( + krb5_context /*context*/, + const char */*appname*/, + krb5_const_realm /*realm*/, + const char */*option*/, + time_t /*def_val*/, + time_t */*ret_val*/); krb5_error_code -krb5_append_addresses __P(( - krb5_context context, - krb5_addresses *dest, - const krb5_addresses *source)); +krb5_append_addresses ( + krb5_context /*context*/, + krb5_addresses */*dest*/, + const krb5_addresses */*source*/); krb5_error_code -krb5_auth_con_free __P(( - krb5_context context, - krb5_auth_context auth_context)); +krb5_auth_con_free ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/); krb5_error_code -krb5_auth_con_genaddrs __P(( - krb5_context context, - krb5_auth_context auth_context, - int fd, - int flags)); +krb5_auth_con_genaddrs ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int /*fd*/, + int /*flags*/); krb5_error_code -krb5_auth_con_getaddrs __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_address **local_addr, - krb5_address **remote_addr)); +krb5_auth_con_getaddrs ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_address **/*local_addr*/, + krb5_address **/*remote_addr*/); krb5_error_code -krb5_auth_con_getauthenticator __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_authenticator *authenticator)); +krb5_auth_con_getauthenticator ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_authenticator */*authenticator*/); krb5_error_code -krb5_auth_con_getcksumtype __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_cksumtype *cksumtype)); +krb5_auth_con_getcksumtype ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_cksumtype */*cksumtype*/); krb5_error_code -krb5_auth_con_getflags __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t *flags)); +krb5_auth_con_getflags ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t */*flags*/); krb5_error_code -krb5_auth_con_getkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock **keyblock)); +krb5_auth_con_getkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock **/*keyblock*/); krb5_error_code -krb5_auth_con_getkeytype __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keytype *keytype)); +krb5_auth_con_getkeytype ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keytype */*keytype*/); krb5_error_code -krb5_auth_con_getlocalseqnumber __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t *seqnumber)); +krb5_auth_con_getlocalseqnumber ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t */*seqnumber*/); krb5_error_code -krb5_auth_con_getlocalsubkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock **keyblock)); +krb5_auth_con_getlocalsubkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock **/*keyblock*/); krb5_error_code -krb5_auth_con_getrcache __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_rcache *rcache)); +krb5_auth_con_getrcache ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_rcache */*rcache*/); krb5_error_code -krb5_auth_con_getremotesubkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock **keyblock)); +krb5_auth_con_getremotesubkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock **/*keyblock*/); krb5_error_code -krb5_auth_con_init __P(( - krb5_context context, - krb5_auth_context *auth_context)); +krb5_auth_con_init ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/); krb5_error_code -krb5_auth_con_setaddrs __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_address *local_addr, - krb5_address *remote_addr)); +krb5_auth_con_setaddrs ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_address */*local_addr*/, + krb5_address */*remote_addr*/); krb5_error_code -krb5_auth_con_setaddrs_from_fd __P(( - krb5_context context, - krb5_auth_context auth_context, - void *p_fd)); +krb5_auth_con_setaddrs_from_fd ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + void */*p_fd*/); krb5_error_code -krb5_auth_con_setcksumtype __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_cksumtype cksumtype)); +krb5_auth_con_setcksumtype ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_cksumtype /*cksumtype*/); krb5_error_code -krb5_auth_con_setflags __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t flags)); +krb5_auth_con_setflags ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t /*flags*/); krb5_error_code -krb5_auth_con_setkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock *keyblock)); +krb5_auth_con_setkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock */*keyblock*/); krb5_error_code -krb5_auth_con_setkeytype __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keytype keytype)); +krb5_auth_con_setkeytype ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keytype /*keytype*/); krb5_error_code -krb5_auth_con_setlocalseqnumber __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t seqnumber)); +krb5_auth_con_setlocalseqnumber ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t /*seqnumber*/); krb5_error_code -krb5_auth_con_setlocalsubkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock *keyblock)); +krb5_auth_con_setlocalsubkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock */*keyblock*/); krb5_error_code -krb5_auth_con_setrcache __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_rcache rcache)); +krb5_auth_con_setrcache ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_rcache /*rcache*/); krb5_error_code -krb5_auth_con_setremoteseqnumber __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t seqnumber)); +krb5_auth_con_setremoteseqnumber ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t /*seqnumber*/); krb5_error_code -krb5_auth_con_setremotesubkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock *keyblock)); +krb5_auth_con_setremotesubkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock */*keyblock*/); krb5_error_code -krb5_auth_con_setuserkey __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_keyblock *keyblock)); +krb5_auth_con_setuserkey ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_keyblock */*keyblock*/); krb5_error_code -krb5_auth_getremoteseqnumber __P(( - krb5_context context, - krb5_auth_context auth_context, - int32_t *seqnumber)); +krb5_auth_getremoteseqnumber ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + int32_t */*seqnumber*/); krb5_error_code -krb5_build_ap_req __P(( - krb5_context context, - krb5_enctype enctype, - krb5_creds *cred, - krb5_flags ap_options, - krb5_data authenticator, - krb5_data *retdata)); +krb5_build_ap_req ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + krb5_creds */*cred*/, + krb5_flags /*ap_options*/, + krb5_data /*authenticator*/, + krb5_data */*retdata*/); krb5_error_code -krb5_build_authenticator __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_enctype enctype, - krb5_creds *cred, - Checksum *cksum, - Authenticator **auth_result, - krb5_data *result, - krb5_key_usage usage)); +krb5_build_authenticator ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_enctype /*enctype*/, + krb5_creds */*cred*/, + Checksum */*cksum*/, + Authenticator **/*auth_result*/, + krb5_data */*result*/, + krb5_key_usage /*usage*/); krb5_error_code -krb5_build_principal __P(( - krb5_context context, - krb5_principal *principal, - int rlen, - krb5_const_realm realm, - ...)); +krb5_build_principal ( + krb5_context /*context*/, + krb5_principal */*principal*/, + int /*rlen*/, + krb5_const_realm /*realm*/, + ...); krb5_error_code -krb5_build_principal_ext __P(( - krb5_context context, - krb5_principal *principal, - int rlen, - krb5_const_realm realm, - ...)); +krb5_build_principal_ext ( + krb5_context /*context*/, + krb5_principal */*principal*/, + int /*rlen*/, + krb5_const_realm /*realm*/, + ...); krb5_error_code -krb5_build_principal_va __P(( - krb5_context context, - krb5_principal *principal, - int rlen, - krb5_const_realm realm, - va_list ap)); +krb5_build_principal_va ( + krb5_context /*context*/, + krb5_principal */*principal*/, + int /*rlen*/, + krb5_const_realm /*realm*/, + va_list /*ap*/); krb5_error_code -krb5_build_principal_va_ext __P(( - krb5_context context, - krb5_principal *principal, - int rlen, - krb5_const_realm realm, - va_list ap)); +krb5_build_principal_va_ext ( + krb5_context /*context*/, + krb5_principal */*principal*/, + int /*rlen*/, + krb5_const_realm /*realm*/, + va_list /*ap*/); krb5_error_code -krb5_cc_close __P(( - krb5_context context, - krb5_ccache id)); +krb5_cc_close ( + krb5_context /*context*/, + krb5_ccache /*id*/); krb5_error_code -krb5_cc_copy_cache __P(( - krb5_context context, - const krb5_ccache from, - krb5_ccache to)); +krb5_cc_copy_cache ( + krb5_context /*context*/, + const krb5_ccache /*from*/, + krb5_ccache /*to*/); krb5_error_code -krb5_cc_default __P(( - krb5_context context, - krb5_ccache *id)); +krb5_cc_default ( + krb5_context /*context*/, + krb5_ccache */*id*/); const char* -krb5_cc_default_name __P((krb5_context context)); +krb5_cc_default_name (krb5_context /*context*/); krb5_error_code -krb5_cc_destroy __P(( - krb5_context context, - krb5_ccache id)); +krb5_cc_destroy ( + krb5_context /*context*/, + krb5_ccache /*id*/); krb5_error_code -krb5_cc_end_seq_get __P(( - krb5_context context, - const krb5_ccache id, - krb5_cc_cursor *cursor)); +krb5_cc_end_seq_get ( + krb5_context /*context*/, + const krb5_ccache /*id*/, + krb5_cc_cursor */*cursor*/); krb5_error_code -krb5_cc_gen_new __P(( - krb5_context context, - const krb5_cc_ops *ops, - krb5_ccache *id)); +krb5_cc_gen_new ( + krb5_context /*context*/, + const krb5_cc_ops */*ops*/, + krb5_ccache */*id*/); const char* -krb5_cc_get_name __P(( - krb5_context context, - krb5_ccache id)); +krb5_cc_get_name ( + krb5_context /*context*/, + krb5_ccache /*id*/); krb5_error_code -krb5_cc_get_principal __P(( - krb5_context context, - krb5_ccache id, - krb5_principal *principal)); +krb5_cc_get_principal ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_principal */*principal*/); const char* -krb5_cc_get_type __P(( - krb5_context context, - krb5_ccache id)); +krb5_cc_get_type ( + krb5_context /*context*/, + krb5_ccache /*id*/); krb5_error_code -krb5_cc_get_version __P(( - krb5_context context, - const krb5_ccache id)); +krb5_cc_get_version ( + krb5_context /*context*/, + const krb5_ccache /*id*/); krb5_error_code -krb5_cc_initialize __P(( - krb5_context context, - krb5_ccache id, - krb5_principal primary_principal)); +krb5_cc_initialize ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_principal /*primary_principal*/); krb5_error_code -krb5_cc_next_cred __P(( - krb5_context context, - const krb5_ccache id, - krb5_cc_cursor *cursor, - krb5_creds *creds)); +krb5_cc_next_cred ( + krb5_context /*context*/, + const krb5_ccache /*id*/, + krb5_cc_cursor */*cursor*/, + krb5_creds */*creds*/); krb5_error_code -krb5_cc_register __P(( - krb5_context context, - const krb5_cc_ops *ops, - krb5_boolean override)); +krb5_cc_register ( + krb5_context /*context*/, + const krb5_cc_ops */*ops*/, + krb5_boolean /*override*/); krb5_error_code -krb5_cc_remove_cred __P(( - krb5_context context, - krb5_ccache id, - krb5_flags which, - krb5_creds *cred)); +krb5_cc_remove_cred ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_flags /*which*/, + krb5_creds */*cred*/); krb5_error_code -krb5_cc_resolve __P(( - krb5_context context, - const char *name, - krb5_ccache *id)); +krb5_cc_resolve ( + krb5_context /*context*/, + const char */*name*/, + krb5_ccache */*id*/); krb5_error_code -krb5_cc_retrieve_cred __P(( - krb5_context context, - krb5_ccache id, - krb5_flags whichfields, - const krb5_creds *mcreds, - krb5_creds *creds)); +krb5_cc_retrieve_cred ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_flags /*whichfields*/, + const krb5_creds */*mcreds*/, + krb5_creds */*creds*/); krb5_error_code -krb5_cc_set_flags __P(( - krb5_context context, - krb5_ccache id, - krb5_flags flags)); +krb5_cc_set_flags ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_flags /*flags*/); krb5_error_code -krb5_cc_start_seq_get __P(( - krb5_context context, - const krb5_ccache id, - krb5_cc_cursor *cursor)); +krb5_cc_start_seq_get ( + krb5_context /*context*/, + const krb5_ccache /*id*/, + krb5_cc_cursor */*cursor*/); krb5_error_code -krb5_cc_store_cred __P(( - krb5_context context, - krb5_ccache id, - krb5_creds *creds)); +krb5_cc_store_cred ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_creds */*creds*/); krb5_error_code -krb5_change_password __P(( - krb5_context context, - krb5_creds *creds, - char *newpw, - int *result_code, - krb5_data *result_code_string, - krb5_data *result_string)); +krb5_change_password ( + krb5_context /*context*/, + krb5_creds */*creds*/, + char */*newpw*/, + int */*result_code*/, + krb5_data */*result_code_string*/, + krb5_data */*result_string*/); krb5_error_code -krb5_check_transited_realms __P(( - krb5_context context, - const char *const *realms, - int num_realms, - int *bad_realm)); +krb5_check_transited_realms ( + krb5_context /*context*/, + const char *const */*realms*/, + int /*num_realms*/, + int */*bad_realm*/); krb5_boolean -krb5_checksum_is_collision_proof __P(( - krb5_context context, - krb5_cksumtype type)); +krb5_checksum_is_collision_proof ( + krb5_context /*context*/, + krb5_cksumtype /*type*/); krb5_boolean -krb5_checksum_is_keyed __P(( - krb5_context context, - krb5_cksumtype type)); +krb5_checksum_is_keyed ( + krb5_context /*context*/, + krb5_cksumtype /*type*/); krb5_error_code -krb5_checksumsize __P(( - krb5_context context, - krb5_cksumtype type, - size_t *size)); +krb5_checksumsize ( + krb5_context /*context*/, + krb5_cksumtype /*type*/, + size_t */*size*/); void -krb5_clear_error_string __P((krb5_context context)); +krb5_clear_error_string (krb5_context /*context*/); krb5_error_code -krb5_closelog __P(( - krb5_context context, - krb5_log_facility *fac)); +krb5_closelog ( + krb5_context /*context*/, + krb5_log_facility */*fac*/); krb5_boolean -krb5_compare_creds __P(( - krb5_context context, - krb5_flags whichfields, - const krb5_creds *mcreds, - const krb5_creds *creds)); +krb5_compare_creds ( + krb5_context /*context*/, + krb5_flags /*whichfields*/, + const krb5_creds */*mcreds*/, + const krb5_creds */*creds*/); krb5_error_code -krb5_config_file_free __P(( - krb5_context context, - krb5_config_section *s)); +krb5_config_file_free ( + krb5_context /*context*/, + krb5_config_section */*s*/); void -krb5_config_free_strings __P((char **strings)); +krb5_config_free_strings (char **/*strings*/); const void * -krb5_config_get __P(( - krb5_context context, - krb5_config_section *c, - int type, - ...)); +krb5_config_get ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*type*/, + ...); krb5_boolean -krb5_config_get_bool __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_bool ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); krb5_boolean -krb5_config_get_bool_default __P(( - krb5_context context, - krb5_config_section *c, - krb5_boolean def_value, - ...)); +krb5_config_get_bool_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + krb5_boolean /*def_value*/, + ...); int -krb5_config_get_int __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_int ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); int -krb5_config_get_int_default __P(( - krb5_context context, - krb5_config_section *c, - int def_value, - ...)); +krb5_config_get_int_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*def_value*/, + ...); const krb5_config_binding * -krb5_config_get_list __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_list ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); const void * -krb5_config_get_next __P(( - krb5_context context, - krb5_config_section *c, - krb5_config_binding **pointer, - int type, - ...)); +krb5_config_get_next ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + const krb5_config_binding **/*pointer*/, + int /*type*/, + ...); const char * -krb5_config_get_string __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_string ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); const char * -krb5_config_get_string_default __P(( - krb5_context context, - krb5_config_section *c, - const char *def_value, - ...)); +krb5_config_get_string_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + const char */*def_value*/, + ...); char** -krb5_config_get_strings __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_strings ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); int -krb5_config_get_time __P(( - krb5_context context, - krb5_config_section *c, - ...)); +krb5_config_get_time ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + ...); int -krb5_config_get_time_default __P(( - krb5_context context, - krb5_config_section *c, - int def_value, - ...)); +krb5_config_get_time_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*def_value*/, + ...); krb5_error_code -krb5_config_parse_file __P(( - krb5_context context, - const char *fname, - krb5_config_section **res)); +krb5_config_parse_file ( + krb5_context /*context*/, + const char */*fname*/, + krb5_config_section **/*res*/); + +krb5_error_code +krb5_config_parse_file_multi ( + krb5_context /*context*/, + const char */*fname*/, + krb5_config_section **/*res*/); const void * -krb5_config_vget __P(( - krb5_context context, - krb5_config_section *c, - int type, - va_list args)); +krb5_config_vget ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*type*/, + va_list /*args*/); krb5_boolean -krb5_config_vget_bool __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_bool ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); krb5_boolean -krb5_config_vget_bool_default __P(( - krb5_context context, - krb5_config_section *c, - krb5_boolean def_value, - va_list args)); +krb5_config_vget_bool_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + krb5_boolean /*def_value*/, + va_list /*args*/); int -krb5_config_vget_int __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_int ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); int -krb5_config_vget_int_default __P(( - krb5_context context, - krb5_config_section *c, - int def_value, - va_list args)); +krb5_config_vget_int_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*def_value*/, + va_list /*args*/); const krb5_config_binding * -krb5_config_vget_list __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_list ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); const void * -krb5_config_vget_next __P(( - krb5_context context, - krb5_config_section *c, - krb5_config_binding **pointer, - int type, - va_list args)); +krb5_config_vget_next ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + const krb5_config_binding **/*pointer*/, + int /*type*/, + va_list /*args*/); const char * -krb5_config_vget_string __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_string ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); const char * -krb5_config_vget_string_default __P(( - krb5_context context, - krb5_config_section *c, - const char *def_value, - va_list args)); +krb5_config_vget_string_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + const char */*def_value*/, + va_list /*args*/); char ** -krb5_config_vget_strings __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_strings ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); int -krb5_config_vget_time __P(( - krb5_context context, - krb5_config_section *c, - va_list args)); +krb5_config_vget_time ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + va_list /*args*/); int -krb5_config_vget_time_default __P(( - krb5_context context, - krb5_config_section *c, - int def_value, - va_list args)); +krb5_config_vget_time_default ( + krb5_context /*context*/, + const krb5_config_section */*c*/, + int /*def_value*/, + va_list /*args*/); krb5_error_code -krb5_copy_address __P(( - krb5_context context, - const krb5_address *inaddr, - krb5_address *outaddr)); +krb5_copy_address ( + krb5_context /*context*/, + const krb5_address */*inaddr*/, + krb5_address */*outaddr*/); krb5_error_code -krb5_copy_addresses __P(( - krb5_context context, - const krb5_addresses *inaddr, - krb5_addresses *outaddr)); +krb5_copy_addresses ( + krb5_context /*context*/, + const krb5_addresses */*inaddr*/, + krb5_addresses */*outaddr*/); krb5_error_code -krb5_copy_creds __P(( - krb5_context context, - const krb5_creds *incred, - krb5_creds **outcred)); +krb5_copy_creds ( + krb5_context /*context*/, + const krb5_creds */*incred*/, + krb5_creds **/*outcred*/); krb5_error_code -krb5_copy_creds_contents __P(( - krb5_context context, - const krb5_creds *incred, - krb5_creds *c)); +krb5_copy_creds_contents ( + krb5_context /*context*/, + const krb5_creds */*incred*/, + krb5_creds */*c*/); krb5_error_code -krb5_copy_data __P(( - krb5_context context, - const krb5_data *indata, - krb5_data **outdata)); +krb5_copy_data ( + krb5_context /*context*/, + const krb5_data */*indata*/, + krb5_data **/*outdata*/); krb5_error_code -krb5_copy_host_realm __P(( - krb5_context context, - const krb5_realm *from, - krb5_realm **to)); +krb5_copy_host_realm ( + krb5_context /*context*/, + const krb5_realm */*from*/, + krb5_realm **/*to*/); krb5_error_code -krb5_copy_keyblock __P(( - krb5_context context, - const krb5_keyblock *inblock, - krb5_keyblock **to)); +krb5_copy_keyblock ( + krb5_context /*context*/, + const krb5_keyblock */*inblock*/, + krb5_keyblock **/*to*/); krb5_error_code -krb5_copy_keyblock_contents __P(( - krb5_context context, - const krb5_keyblock *inblock, - krb5_keyblock *to)); +krb5_copy_keyblock_contents ( + krb5_context /*context*/, + const krb5_keyblock */*inblock*/, + krb5_keyblock */*to*/); krb5_error_code -krb5_copy_principal __P(( - krb5_context context, - krb5_const_principal inprinc, - krb5_principal *outprinc)); +krb5_copy_principal ( + krb5_context /*context*/, + krb5_const_principal /*inprinc*/, + krb5_principal */*outprinc*/); krb5_error_code -krb5_copy_ticket __P(( - krb5_context context, - const krb5_ticket *from, - krb5_ticket **to)); +krb5_copy_ticket ( + krb5_context /*context*/, + const krb5_ticket */*from*/, + krb5_ticket **/*to*/); krb5_error_code -krb5_create_checksum __P(( - krb5_context context, - krb5_crypto crypto, - krb5_key_usage usage, - int type, - void *data, - size_t len, - Checksum *result)); +krb5_create_checksum ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + krb5_key_usage /*usage*/, + int /*type*/, + void */*data*/, + size_t /*len*/, + Checksum */*result*/); krb5_error_code -krb5_crypto_destroy __P(( - krb5_context context, - krb5_crypto crypto)); +krb5_crypto_destroy ( + krb5_context /*context*/, + krb5_crypto /*crypto*/); krb5_error_code -krb5_crypto_init __P(( - krb5_context context, - const krb5_keyblock *key, - krb5_enctype etype, - krb5_crypto *crypto)); +krb5_crypto_init ( + krb5_context /*context*/, + const krb5_keyblock */*key*/, + krb5_enctype /*etype*/, + krb5_crypto */*crypto*/); krb5_error_code -krb5_data_alloc __P(( - krb5_data *p, - int len)); +krb5_data_alloc ( + krb5_data */*p*/, + int /*len*/); krb5_error_code -krb5_data_copy __P(( - krb5_data *p, - const void *data, - size_t len)); +krb5_data_copy ( + krb5_data */*p*/, + const void */*data*/, + size_t /*len*/); void -krb5_data_free __P((krb5_data *p)); +krb5_data_free (krb5_data */*p*/); krb5_error_code -krb5_data_realloc __P(( - krb5_data *p, - int len)); +krb5_data_realloc ( + krb5_data */*p*/, + int /*len*/); void -krb5_data_zero __P((krb5_data *p)); +krb5_data_zero (krb5_data */*p*/); krb5_error_code -krb5_decode_Authenticator __P(( - krb5_context context, - const void *data, - size_t length, - Authenticator *t, - size_t *len)); +krb5_decode_Authenticator ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + Authenticator */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_ETYPE_INFO __P(( - krb5_context context, - const void *data, - size_t length, - ETYPE_INFO *t, - size_t *len)); +krb5_decode_ETYPE_INFO ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + ETYPE_INFO */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_EncAPRepPart __P(( - krb5_context context, - const void *data, - size_t length, - EncAPRepPart *t, - size_t *len)); +krb5_decode_EncAPRepPart ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + EncAPRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_EncASRepPart __P(( - krb5_context context, - const void *data, - size_t length, - EncASRepPart *t, - size_t *len)); +krb5_decode_EncASRepPart ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + EncASRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_EncKrbCredPart __P(( - krb5_context context, - const void *data, - size_t length, - EncKrbCredPart *t, - size_t *len)); +krb5_decode_EncKrbCredPart ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + EncKrbCredPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_EncTGSRepPart __P(( - krb5_context context, - const void *data, - size_t length, - EncTGSRepPart *t, - size_t *len)); +krb5_decode_EncTGSRepPart ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + EncTGSRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_EncTicketPart __P(( - krb5_context context, - const void *data, - size_t length, - EncTicketPart *t, - size_t *len)); +krb5_decode_EncTicketPart ( + krb5_context /*context*/, + const void */*data*/, + size_t /*length*/, + EncTicketPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_decode_ap_req __P(( - krb5_context context, - const krb5_data *inbuf, - krb5_ap_req *ap_req)); +krb5_decode_ap_req ( + krb5_context /*context*/, + const krb5_data */*inbuf*/, + krb5_ap_req */*ap_req*/); krb5_error_code -krb5_decrypt __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - void *data, - size_t len, - krb5_data *result)); +krb5_decrypt ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + void */*data*/, + size_t /*len*/, + krb5_data */*result*/); krb5_error_code -krb5_decrypt_EncryptedData __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - const EncryptedData *e, - krb5_data *result)); +krb5_decrypt_EncryptedData ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + const EncryptedData */*e*/, + krb5_data */*result*/); krb5_error_code -krb5_decrypt_ivec __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - void *data, - size_t len, - krb5_data *result, - void *ivec)); +krb5_decrypt_ivec ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + void */*data*/, + size_t /*len*/, + krb5_data */*result*/, + void */*ivec*/); krb5_error_code -krb5_decrypt_ticket __P(( - krb5_context context, - Ticket *ticket, - krb5_keyblock *key, - EncTicketPart *out, - krb5_flags flags)); +krb5_decrypt_ticket ( + krb5_context /*context*/, + Ticket */*ticket*/, + krb5_keyblock */*key*/, + EncTicketPart */*out*/, + krb5_flags /*flags*/); krb5_error_code -krb5_derive_key __P(( - krb5_context context, - const krb5_keyblock *key, - krb5_enctype etype, - const void *constant, - size_t constant_len, - krb5_keyblock **derived_key)); +krb5_derive_key ( + krb5_context /*context*/, + const krb5_keyblock */*key*/, + krb5_enctype /*etype*/, + const void */*constant*/, + size_t /*constant_len*/, + krb5_keyblock **/*derived_key*/); krb5_error_code -krb5_domain_x500_decode __P(( - krb5_context context, - krb5_data tr, - char ***realms, - int *num_realms, - const char *client_realm, - const char *server_realm)); +krb5_domain_x500_decode ( + krb5_context /*context*/, + krb5_data /*tr*/, + char ***/*realms*/, + int */*num_realms*/, + const char */*client_realm*/, + const char */*server_realm*/); krb5_error_code -krb5_domain_x500_encode __P(( - char **realms, - int num_realms, - krb5_data *encoding)); +krb5_domain_x500_encode ( + char **/*realms*/, + int /*num_realms*/, + krb5_data */*encoding*/); krb5_error_code -krb5_eai_to_heim_errno __P(( - int eai_errno, - int system_error)); +krb5_eai_to_heim_errno ( + int /*eai_errno*/, + int /*system_error*/); krb5_error_code -krb5_encode_Authenticator __P(( - krb5_context context, - void *data, - size_t length, - Authenticator *t, - size_t *len)); +krb5_encode_Authenticator ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + Authenticator */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_ETYPE_INFO __P(( - krb5_context context, - void *data, - size_t length, - ETYPE_INFO *t, - size_t *len)); +krb5_encode_ETYPE_INFO ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + ETYPE_INFO */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_EncAPRepPart __P(( - krb5_context context, - void *data, - size_t length, - EncAPRepPart *t, - size_t *len)); +krb5_encode_EncAPRepPart ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + EncAPRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_EncASRepPart __P(( - krb5_context context, - void *data, - size_t length, - EncASRepPart *t, - size_t *len)); +krb5_encode_EncASRepPart ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + EncASRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_EncKrbCredPart __P(( - krb5_context context, - void *data, - size_t length, - EncKrbCredPart *t, - size_t *len)); +krb5_encode_EncKrbCredPart ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + EncKrbCredPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_EncTGSRepPart __P(( - krb5_context context, - void *data, - size_t length, - EncTGSRepPart *t, - size_t *len)); +krb5_encode_EncTGSRepPart ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + EncTGSRepPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_encode_EncTicketPart __P(( - krb5_context context, - void *data, - size_t length, - EncTicketPart *t, - size_t *len)); +krb5_encode_EncTicketPart ( + krb5_context /*context*/, + void */*data*/, + size_t /*length*/, + EncTicketPart */*t*/, + size_t */*len*/); krb5_error_code -krb5_encrypt __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - void *data, - size_t len, - krb5_data *result)); +krb5_encrypt ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + void */*data*/, + size_t /*len*/, + krb5_data */*result*/); krb5_error_code -krb5_encrypt_EncryptedData __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - void *data, - size_t len, - int kvno, - EncryptedData *result)); +krb5_encrypt_EncryptedData ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + void */*data*/, + size_t /*len*/, + int /*kvno*/, + EncryptedData */*result*/); krb5_error_code -krb5_encrypt_ivec __P(( - krb5_context context, - krb5_crypto crypto, - unsigned usage, - void *data, - size_t len, - krb5_data *result, - void *ivec)); +krb5_encrypt_ivec ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + unsigned /*usage*/, + void */*data*/, + size_t /*len*/, + krb5_data */*result*/, + void */*ivec*/); krb5_error_code -krb5_enctype_to_keytype __P(( - krb5_context context, - krb5_enctype etype, - krb5_keytype *keytype)); +krb5_enctype_to_keytype ( + krb5_context /*context*/, + krb5_enctype /*etype*/, + krb5_keytype */*keytype*/); krb5_error_code -krb5_enctype_to_string __P(( - krb5_context context, - krb5_enctype etype, - char **string)); +krb5_enctype_to_string ( + krb5_context /*context*/, + krb5_enctype /*etype*/, + char **/*string*/); krb5_error_code -krb5_enctype_valid __P(( - krb5_context context, - krb5_enctype etype)); +krb5_enctype_valid ( + krb5_context /*context*/, + krb5_enctype /*etype*/); krb5_boolean -krb5_enctypes_compatible_keys __P(( - krb5_context context, - krb5_enctype etype1, - krb5_enctype etype2)); - -krb5_error_code -krb5_err __P(( - krb5_context context, - int eval, - krb5_error_code code, - const char *fmt, - ...)) +krb5_enctypes_compatible_keys ( + krb5_context /*context*/, + krb5_enctype /*etype1*/, + krb5_enctype /*etype2*/); + +krb5_error_code +krb5_err ( + krb5_context /*context*/, + int /*eval*/, + krb5_error_code /*code*/, + const char */*fmt*/, + ...) __attribute__ ((noreturn, format (printf, 4, 5))); krb5_error_code -krb5_error_from_rd_error __P(( - krb5_context context, - const krb5_error *error, - const krb5_creds *creds)); +krb5_error_from_rd_error ( + krb5_context /*context*/, + const krb5_error */*error*/, + const krb5_creds */*creds*/); krb5_error_code -krb5_errx __P(( - krb5_context context, - int eval, - const char *fmt, - ...)) +krb5_errx ( + krb5_context /*context*/, + int /*eval*/, + const char */*fmt*/, + ...) __attribute__ ((noreturn, format (printf, 3, 4))); krb5_error_code -krb5_expand_hostname __P(( - krb5_context context, - const char *orig_hostname, - char **new_hostname)); +krb5_expand_hostname ( + krb5_context /*context*/, + const char */*orig_hostname*/, + char **/*new_hostname*/); krb5_error_code -krb5_expand_hostname_realms __P(( - krb5_context context, - const char *orig_hostname, - char **new_hostname, - char ***realms)); +krb5_expand_hostname_realms ( + krb5_context /*context*/, + const char */*orig_hostname*/, + char **/*new_hostname*/, + char ***/*realms*/); PA_DATA * -krb5_find_padata __P(( - PA_DATA *val, - unsigned len, - int type, - int *index)); +krb5_find_padata ( + PA_DATA */*val*/, + unsigned /*len*/, + int /*type*/, + int */*index*/); krb5_error_code -krb5_format_time __P(( - krb5_context context, - time_t t, - char *s, - size_t len, - krb5_boolean include_time)); +krb5_format_time ( + krb5_context /*context*/, + time_t /*t*/, + char */*s*/, + size_t /*len*/, + krb5_boolean /*include_time*/); krb5_error_code -krb5_free_address __P(( - krb5_context context, - krb5_address *address)); +krb5_free_address ( + krb5_context /*context*/, + krb5_address */*address*/); krb5_error_code -krb5_free_addresses __P(( - krb5_context context, - krb5_addresses *addresses)); +krb5_free_addresses ( + krb5_context /*context*/, + krb5_addresses */*addresses*/); + +void +krb5_free_ap_rep_enc_part ( + krb5_context /*context*/, + krb5_ap_rep_enc_part */*val*/); void -krb5_free_ap_rep_enc_part __P(( - krb5_context context, - krb5_ap_rep_enc_part *val)); +krb5_free_authenticator ( + krb5_context /*context*/, + krb5_authenticator */*authenticator*/); void -krb5_free_authenticator __P(( - krb5_context context, - krb5_authenticator *authenticator)); +krb5_free_config_files (char **/*filenames*/); void -krb5_free_context __P((krb5_context context)); +krb5_free_context (krb5_context /*context*/); krb5_error_code -krb5_free_cred_contents __P(( - krb5_context context, - krb5_creds *c)); +krb5_free_cred_contents ( + krb5_context /*context*/, + krb5_creds */*c*/); krb5_error_code -krb5_free_creds __P(( - krb5_context context, - krb5_creds *c)); +krb5_free_creds ( + krb5_context /*context*/, + krb5_creds */*c*/); krb5_error_code -krb5_free_creds_contents __P(( - krb5_context context, - krb5_creds *c)); +krb5_free_creds_contents ( + krb5_context /*context*/, + krb5_creds */*c*/); void -krb5_free_data __P(( - krb5_context context, - krb5_data *p)); +krb5_free_data ( + krb5_context /*context*/, + krb5_data */*p*/); void -krb5_free_error __P(( - krb5_context context, - krb5_error *error)); +krb5_free_error ( + krb5_context /*context*/, + krb5_error */*error*/); void -krb5_free_error_contents __P(( - krb5_context context, - krb5_error *error)); +krb5_free_error_contents ( + krb5_context /*context*/, + krb5_error */*error*/); void -krb5_free_error_string __P(( - krb5_context context, - char *str)); +krb5_free_error_string ( + krb5_context /*context*/, + char */*str*/); krb5_error_code -krb5_free_host_realm __P(( - krb5_context context, - krb5_realm *realmlist)); +krb5_free_host_realm ( + krb5_context /*context*/, + krb5_realm */*realmlist*/); krb5_error_code -krb5_free_kdc_rep __P(( - krb5_context context, - krb5_kdc_rep *rep)); +krb5_free_kdc_rep ( + krb5_context /*context*/, + krb5_kdc_rep */*rep*/); void -krb5_free_keyblock __P(( - krb5_context context, - krb5_keyblock *keyblock)); +krb5_free_keyblock ( + krb5_context /*context*/, + krb5_keyblock */*keyblock*/); void -krb5_free_keyblock_contents __P(( - krb5_context context, - krb5_keyblock *keyblock)); +krb5_free_keyblock_contents ( + krb5_context /*context*/, + krb5_keyblock */*keyblock*/); krb5_error_code -krb5_free_krbhst __P(( - krb5_context context, - char **hostlist)); +krb5_free_krbhst ( + krb5_context /*context*/, + char **/*hostlist*/); void -krb5_free_principal __P(( - krb5_context context, - krb5_principal p)); +krb5_free_principal ( + krb5_context /*context*/, + krb5_principal /*p*/); krb5_error_code -krb5_free_salt __P(( - krb5_context context, - krb5_salt salt)); +krb5_free_salt ( + krb5_context /*context*/, + krb5_salt /*salt*/); krb5_error_code -krb5_free_ticket __P(( - krb5_context context, - krb5_ticket *ticket)); +krb5_free_ticket ( + krb5_context /*context*/, + krb5_ticket */*ticket*/); krb5_error_code -krb5_fwd_tgt_creds __P(( - krb5_context context, - krb5_auth_context auth_context, - const char *hostname, - krb5_principal client, - krb5_principal server, - krb5_ccache ccache, - int forwardable, - krb5_data *out_data)); +krb5_fwd_tgt_creds ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const char */*hostname*/, + krb5_principal /*client*/, + krb5_principal /*server*/, + krb5_ccache /*ccache*/, + int /*forwardable*/, + krb5_data */*out_data*/); void -krb5_generate_random_block __P(( - void *buf, - size_t len)); +krb5_generate_random_block ( + void */*buf*/, + size_t /*len*/); krb5_error_code -krb5_generate_random_keyblock __P(( - krb5_context context, - krb5_enctype type, - krb5_keyblock *key)); +krb5_generate_random_keyblock ( + krb5_context /*context*/, + krb5_enctype /*type*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_generate_seq_number __P(( - krb5_context context, - const krb5_keyblock *key, - u_int32_t *seqno)); +krb5_generate_seq_number ( + krb5_context /*context*/, + const krb5_keyblock */*key*/, + u_int32_t */*seqno*/); krb5_error_code -krb5_generate_subkey __P(( - krb5_context context, - const krb5_keyblock *key, - krb5_keyblock **subkey)); +krb5_generate_subkey ( + krb5_context /*context*/, + const krb5_keyblock */*key*/, + krb5_keyblock **/*subkey*/); krb5_error_code -krb5_get_all_client_addrs __P(( - krb5_context context, - krb5_addresses *res)); +krb5_get_all_client_addrs ( + krb5_context /*context*/, + krb5_addresses */*res*/); krb5_error_code -krb5_get_all_server_addrs __P(( - krb5_context context, - krb5_addresses *res)); +krb5_get_all_server_addrs ( + krb5_context /*context*/, + krb5_addresses */*res*/); krb5_error_code -krb5_get_cred_from_kdc __P(( - krb5_context context, - krb5_ccache ccache, - krb5_creds *in_creds, - krb5_creds **out_creds, - krb5_creds ***ret_tgts)); +krb5_get_cred_from_kdc ( + krb5_context /*context*/, + krb5_ccache /*ccache*/, + krb5_creds */*in_creds*/, + krb5_creds **/*out_creds*/, + krb5_creds ***/*ret_tgts*/); krb5_error_code -krb5_get_cred_from_kdc_opt __P(( - krb5_context context, - krb5_ccache ccache, - krb5_creds *in_creds, - krb5_creds **out_creds, - krb5_creds ***ret_tgts, - krb5_flags flags)); +krb5_get_cred_from_kdc_opt ( + krb5_context /*context*/, + krb5_ccache /*ccache*/, + krb5_creds */*in_creds*/, + krb5_creds **/*out_creds*/, + krb5_creds ***/*ret_tgts*/, + krb5_flags /*flags*/); krb5_error_code -krb5_get_credentials __P(( - krb5_context context, - krb5_flags options, - krb5_ccache ccache, - krb5_creds *in_creds, - krb5_creds **out_creds)); +krb5_get_credentials ( + krb5_context /*context*/, + krb5_flags /*options*/, + krb5_ccache /*ccache*/, + krb5_creds */*in_creds*/, + krb5_creds **/*out_creds*/); krb5_error_code -krb5_get_credentials_with_flags __P(( - krb5_context context, - krb5_flags options, - krb5_kdc_flags flags, - krb5_ccache ccache, - krb5_creds *in_creds, - krb5_creds **out_creds)); +krb5_get_credentials_with_flags ( + krb5_context /*context*/, + krb5_flags /*options*/, + krb5_kdc_flags /*flags*/, + krb5_ccache /*ccache*/, + krb5_creds */*in_creds*/, + krb5_creds **/*out_creds*/); krb5_error_code -krb5_get_default_in_tkt_etypes __P(( - krb5_context context, - krb5_enctype **etypes)); +krb5_get_default_config_files (char ***/*pfilenames*/); krb5_error_code -krb5_get_default_principal __P(( - krb5_context context, - krb5_principal *princ)); +krb5_get_default_in_tkt_etypes ( + krb5_context /*context*/, + krb5_enctype **/*etypes*/); krb5_error_code -krb5_get_default_realm __P(( - krb5_context context, - krb5_realm *realm)); +krb5_get_default_principal ( + krb5_context /*context*/, + krb5_principal */*princ*/); krb5_error_code -krb5_get_default_realms __P(( - krb5_context context, - krb5_realm **realms)); +krb5_get_default_realm ( + krb5_context /*context*/, + krb5_realm */*realm*/); + +krb5_error_code +krb5_get_default_realms ( + krb5_context /*context*/, + krb5_realm **/*realms*/); const char * -krb5_get_err_text __P(( - krb5_context context, - krb5_error_code code)); +krb5_get_err_text ( + krb5_context /*context*/, + krb5_error_code /*code*/); char* -krb5_get_error_string __P((krb5_context context)); - -krb5_error_code -krb5_get_extra_addresses __P(( - krb5_context context, - krb5_addresses *addresses)); - -krb5_error_code -krb5_get_fcache_version __P(( - krb5_context context, - int *version)); - -krb5_error_code -krb5_get_forwarded_creds __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_ccache ccache, - krb5_flags flags, - const char *hostname, - krb5_creds *in_creds, - krb5_data *out_data)); - -krb5_error_code -krb5_get_host_realm __P(( - krb5_context context, - const char *host, - krb5_realm **realms)); - -krb5_error_code -krb5_get_host_realm_int __P(( - krb5_context context, - const char *host, - krb5_boolean use_dns, - krb5_realm **realms)); - -krb5_error_code -krb5_get_ignore_addresses __P(( - krb5_context context, - krb5_addresses *addresses)); - -krb5_error_code -krb5_get_in_cred __P(( - krb5_context context, - krb5_flags options, - const krb5_addresses *addrs, - const krb5_enctype *etypes, - const krb5_preauthtype *ptypes, - const krb5_preauthdata *preauth, - krb5_key_proc key_proc, - krb5_const_pointer keyseed, - krb5_decrypt_proc decrypt_proc, - krb5_const_pointer decryptarg, - krb5_creds *creds, - krb5_kdc_rep *ret_as_reply)); - -krb5_error_code -krb5_get_in_tkt __P(( - krb5_context context, - krb5_flags options, - const krb5_addresses *addrs, - const krb5_enctype *etypes, - const krb5_preauthtype *ptypes, - krb5_key_proc key_proc, - krb5_const_pointer keyseed, - krb5_decrypt_proc decrypt_proc, - krb5_const_pointer decryptarg, - krb5_creds *creds, - krb5_ccache ccache, - krb5_kdc_rep *ret_as_reply)); - -krb5_error_code -krb5_get_in_tkt_with_keytab __P(( - krb5_context context, - krb5_flags options, - krb5_addresses *addrs, - const krb5_enctype *etypes, - const krb5_preauthtype *pre_auth_types, - krb5_keytab keytab, - krb5_ccache ccache, - krb5_creds *creds, - krb5_kdc_rep *ret_as_reply)); - -krb5_error_code -krb5_get_in_tkt_with_password __P(( - krb5_context context, - krb5_flags options, - krb5_addresses *addrs, - const krb5_enctype *etypes, - const krb5_preauthtype *pre_auth_types, - const char *password, - krb5_ccache ccache, - krb5_creds *creds, - krb5_kdc_rep *ret_as_reply)); - -krb5_error_code -krb5_get_in_tkt_with_skey __P(( - krb5_context context, - krb5_flags options, - krb5_addresses *addrs, - const krb5_enctype *etypes, - const krb5_preauthtype *pre_auth_types, - const krb5_keyblock *key, - krb5_ccache ccache, - krb5_creds *creds, - krb5_kdc_rep *ret_as_reply)); - -krb5_error_code -krb5_get_init_creds_keytab __P(( - krb5_context context, - krb5_creds *creds, - krb5_principal client, - krb5_keytab keytab, - krb5_deltat start_time, - const char *in_tkt_service, - krb5_get_init_creds_opt *options)); +krb5_get_error_string (krb5_context /*context*/); + +krb5_error_code +krb5_get_extra_addresses ( + krb5_context /*context*/, + krb5_addresses */*addresses*/); + +krb5_error_code +krb5_get_fcache_version ( + krb5_context /*context*/, + int */*version*/); + +krb5_error_code +krb5_get_forwarded_creds ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_ccache /*ccache*/, + krb5_flags /*flags*/, + const char */*hostname*/, + krb5_creds */*in_creds*/, + krb5_data */*out_data*/); + +krb5_error_code +krb5_get_host_realm ( + krb5_context /*context*/, + const char */*host*/, + krb5_realm **/*realms*/); + +krb5_error_code +krb5_get_host_realm_int ( + krb5_context /*context*/, + const char */*host*/, + krb5_boolean /*use_dns*/, + krb5_realm **/*realms*/); + +krb5_error_code +krb5_get_ignore_addresses ( + krb5_context /*context*/, + krb5_addresses */*addresses*/); + +krb5_error_code +krb5_get_in_cred ( + krb5_context /*context*/, + krb5_flags /*options*/, + const krb5_addresses */*addrs*/, + const krb5_enctype */*etypes*/, + const krb5_preauthtype */*ptypes*/, + const krb5_preauthdata */*preauth*/, + krb5_key_proc /*key_proc*/, + krb5_const_pointer /*keyseed*/, + krb5_decrypt_proc /*decrypt_proc*/, + krb5_const_pointer /*decryptarg*/, + krb5_creds */*creds*/, + krb5_kdc_rep */*ret_as_reply*/); + +krb5_error_code +krb5_get_in_tkt ( + krb5_context /*context*/, + krb5_flags /*options*/, + const krb5_addresses */*addrs*/, + const krb5_enctype */*etypes*/, + const krb5_preauthtype */*ptypes*/, + krb5_key_proc /*key_proc*/, + krb5_const_pointer /*keyseed*/, + krb5_decrypt_proc /*decrypt_proc*/, + krb5_const_pointer /*decryptarg*/, + krb5_creds */*creds*/, + krb5_ccache /*ccache*/, + krb5_kdc_rep */*ret_as_reply*/); + +krb5_error_code +krb5_get_in_tkt_with_keytab ( + krb5_context /*context*/, + krb5_flags /*options*/, + krb5_addresses */*addrs*/, + const krb5_enctype */*etypes*/, + const krb5_preauthtype */*pre_auth_types*/, + krb5_keytab /*keytab*/, + krb5_ccache /*ccache*/, + krb5_creds */*creds*/, + krb5_kdc_rep */*ret_as_reply*/); + +krb5_error_code +krb5_get_in_tkt_with_password ( + krb5_context /*context*/, + krb5_flags /*options*/, + krb5_addresses */*addrs*/, + const krb5_enctype */*etypes*/, + const krb5_preauthtype */*pre_auth_types*/, + const char */*password*/, + krb5_ccache /*ccache*/, + krb5_creds */*creds*/, + krb5_kdc_rep */*ret_as_reply*/); + +krb5_error_code +krb5_get_in_tkt_with_skey ( + krb5_context /*context*/, + krb5_flags /*options*/, + krb5_addresses */*addrs*/, + const krb5_enctype */*etypes*/, + const krb5_preauthtype */*pre_auth_types*/, + const krb5_keyblock */*key*/, + krb5_ccache /*ccache*/, + krb5_creds */*creds*/, + krb5_kdc_rep */*ret_as_reply*/); + +krb5_error_code +krb5_get_init_creds_keytab ( + krb5_context /*context*/, + krb5_creds */*creds*/, + krb5_principal /*client*/, + krb5_keytab /*keytab*/, + krb5_deltat /*start_time*/, + const char */*in_tkt_service*/, + krb5_get_init_creds_opt */*options*/); void -krb5_get_init_creds_opt_init __P((krb5_get_init_creds_opt *opt)); +krb5_get_init_creds_opt_init (krb5_get_init_creds_opt */*opt*/); void -krb5_get_init_creds_opt_set_address_list __P(( - krb5_get_init_creds_opt *opt, - krb5_addresses *addresses)); +krb5_get_init_creds_opt_set_address_list ( + krb5_get_init_creds_opt */*opt*/, + krb5_addresses */*addresses*/); void -krb5_get_init_creds_opt_set_anonymous __P(( - krb5_get_init_creds_opt *opt, - int anonymous)); +krb5_get_init_creds_opt_set_anonymous ( + krb5_get_init_creds_opt */*opt*/, + int /*anonymous*/); void -krb5_get_init_creds_opt_set_default_flags __P(( - krb5_context context, - const char *appname, - krb5_const_realm realm, - krb5_get_init_creds_opt *opt)); +krb5_get_init_creds_opt_set_default_flags ( + krb5_context /*context*/, + const char */*appname*/, + krb5_const_realm /*realm*/, + krb5_get_init_creds_opt */*opt*/); void -krb5_get_init_creds_opt_set_etype_list __P(( - krb5_get_init_creds_opt *opt, - krb5_enctype *etype_list, - int etype_list_length)); +krb5_get_init_creds_opt_set_etype_list ( + krb5_get_init_creds_opt */*opt*/, + krb5_enctype */*etype_list*/, + int /*etype_list_length*/); void -krb5_get_init_creds_opt_set_forwardable __P(( - krb5_get_init_creds_opt *opt, - int forwardable)); +krb5_get_init_creds_opt_set_forwardable ( + krb5_get_init_creds_opt */*opt*/, + int /*forwardable*/); void -krb5_get_init_creds_opt_set_preauth_list __P(( - krb5_get_init_creds_opt *opt, - krb5_preauthtype *preauth_list, - int preauth_list_length)); +krb5_get_init_creds_opt_set_preauth_list ( + krb5_get_init_creds_opt */*opt*/, + krb5_preauthtype */*preauth_list*/, + int /*preauth_list_length*/); void -krb5_get_init_creds_opt_set_proxiable __P(( - krb5_get_init_creds_opt *opt, - int proxiable)); +krb5_get_init_creds_opt_set_proxiable ( + krb5_get_init_creds_opt */*opt*/, + int /*proxiable*/); void -krb5_get_init_creds_opt_set_renew_life __P(( - krb5_get_init_creds_opt *opt, - krb5_deltat renew_life)); +krb5_get_init_creds_opt_set_renew_life ( + krb5_get_init_creds_opt */*opt*/, + krb5_deltat /*renew_life*/); void -krb5_get_init_creds_opt_set_salt __P(( - krb5_get_init_creds_opt *opt, - krb5_data *salt)); +krb5_get_init_creds_opt_set_salt ( + krb5_get_init_creds_opt */*opt*/, + krb5_data */*salt*/); void -krb5_get_init_creds_opt_set_tkt_life __P(( - krb5_get_init_creds_opt *opt, - krb5_deltat tkt_life)); +krb5_get_init_creds_opt_set_tkt_life ( + krb5_get_init_creds_opt */*opt*/, + krb5_deltat /*tkt_life*/); krb5_error_code -krb5_get_init_creds_password __P(( - krb5_context context, - krb5_creds *creds, - krb5_principal client, - const char *password, - krb5_prompter_fct prompter, - void *data, - krb5_deltat start_time, - const char *in_tkt_service, - krb5_get_init_creds_opt *options)); +krb5_get_init_creds_password ( + krb5_context /*context*/, + krb5_creds */*creds*/, + krb5_principal /*client*/, + const char */*password*/, + krb5_prompter_fct /*prompter*/, + void */*data*/, + krb5_deltat /*start_time*/, + const char */*in_tkt_service*/, + krb5_get_init_creds_opt */*options*/); krb5_error_code -krb5_get_kdc_cred __P(( - krb5_context context, - krb5_ccache id, - krb5_kdc_flags flags, - krb5_addresses *addresses, - Ticket *second_ticket, - krb5_creds *in_creds, - krb5_creds **out_creds )); +krb5_get_kdc_cred ( + krb5_context /*context*/, + krb5_ccache /*id*/, + krb5_kdc_flags /*flags*/, + krb5_addresses */*addresses*/, + Ticket */*second_ticket*/, + krb5_creds */*in_creds*/, + krb5_creds **out_creds ); krb5_error_code -krb5_get_krb524hst __P(( - krb5_context context, - const krb5_realm *realm, - char ***hostlist)); +krb5_get_krb524hst ( + krb5_context /*context*/, + const krb5_realm */*realm*/, + char ***/*hostlist*/); krb5_error_code -krb5_get_krb_admin_hst __P(( - krb5_context context, - const krb5_realm *realm, - char ***hostlist)); +krb5_get_krb_admin_hst ( + krb5_context /*context*/, + const krb5_realm */*realm*/, + char ***/*hostlist*/); krb5_error_code -krb5_get_krb_changepw_hst __P(( - krb5_context context, - const krb5_realm *realm, - char ***hostlist)); +krb5_get_krb_changepw_hst ( + krb5_context /*context*/, + const krb5_realm */*realm*/, + char ***/*hostlist*/); krb5_error_code -krb5_get_krbhst __P(( - krb5_context context, - const krb5_realm *realm, - char ***hostlist)); +krb5_get_krbhst ( + krb5_context /*context*/, + const krb5_realm */*realm*/, + char ***/*hostlist*/); krb5_error_code -krb5_get_pw_salt __P(( - krb5_context context, - krb5_const_principal principal, - krb5_salt *salt)); +krb5_get_pw_salt ( + krb5_context /*context*/, + krb5_const_principal /*principal*/, + krb5_salt */*salt*/); krb5_error_code -krb5_get_server_rcache __P(( - krb5_context context, - const krb5_data *piece, - krb5_rcache *id)); +krb5_get_server_rcache ( + krb5_context /*context*/, + const krb5_data */*piece*/, + krb5_rcache */*id*/); krb5_boolean -krb5_get_use_admin_kdc __P((krb5_context context)); +krb5_get_use_admin_kdc (krb5_context /*context*/); size_t -krb5_get_wrapped_length __P(( - krb5_context context, - krb5_crypto crypto, - size_t data_len)); +krb5_get_wrapped_length ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + size_t /*data_len*/); int -krb5_getportbyname __P(( - krb5_context context, - const char *service, - const char *proto, - int default_port)); +krb5_getportbyname ( + krb5_context /*context*/, + const char */*service*/, + const char */*proto*/, + int /*default_port*/); krb5_error_code -krb5_h_addr2addr __P(( - krb5_context context, - int af, - const char *haddr, - krb5_address *addr)); +krb5_h_addr2addr ( + krb5_context /*context*/, + int /*af*/, + const char */*haddr*/, + krb5_address */*addr*/); krb5_error_code -krb5_h_addr2sockaddr __P(( - krb5_context context, - int af, - const char *addr, - struct sockaddr *sa, - int *sa_size, - int port)); +krb5_h_addr2sockaddr ( + krb5_context /*context*/, + int /*af*/, + const char */*addr*/, + struct sockaddr */*sa*/, + krb5_socklen_t */*sa_size*/, + int /*port*/); krb5_error_code -krb5_h_errno_to_heim_errno __P((int eai_errno)); +krb5_h_errno_to_heim_errno (int /*eai_errno*/); krb5_boolean -krb5_have_error_string __P((krb5_context context)); +krb5_have_error_string (krb5_context /*context*/); krb5_error_code -krb5_init_context __P((krb5_context *context)); +krb5_init_context (krb5_context */*context*/); void -krb5_init_ets __P((krb5_context context)); +krb5_init_ets (krb5_context /*context*/); krb5_error_code -krb5_init_etype __P(( - krb5_context context, - unsigned *len, - krb5_enctype **val, - const krb5_enctype *etypes)); +krb5_init_etype ( + krb5_context /*context*/, + unsigned */*len*/, + krb5_enctype **/*val*/, + const krb5_enctype */*etypes*/); krb5_error_code -krb5_initlog __P(( - krb5_context context, - const char *program, - krb5_log_facility **fac)); +krb5_initlog ( + krb5_context /*context*/, + const char */*program*/, + krb5_log_facility **/*fac*/); krb5_error_code -krb5_keyblock_key_proc __P(( - krb5_context context, - krb5_keytype type, - krb5_data *salt, - krb5_const_pointer keyseed, - krb5_keyblock **key)); +krb5_keyblock_key_proc ( + krb5_context /*context*/, + krb5_keytype /*type*/, + krb5_data */*salt*/, + krb5_const_pointer /*keyseed*/, + krb5_keyblock **/*key*/); krb5_error_code -krb5_keytab_key_proc __P(( - krb5_context context, - krb5_enctype enctype, - krb5_salt salt, - krb5_const_pointer keyseed, - krb5_keyblock **key)); +krb5_keytab_key_proc ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + krb5_salt /*salt*/, + krb5_const_pointer /*keyseed*/, + krb5_keyblock **/*key*/); krb5_error_code -krb5_keytype_to_enctypes __P(( - krb5_context context, - krb5_keytype keytype, - unsigned *len, - krb5_enctype **val)); +krb5_keytype_to_enctypes ( + krb5_context /*context*/, + krb5_keytype /*keytype*/, + unsigned */*len*/, + krb5_enctype **/*val*/); krb5_error_code -krb5_keytype_to_enctypes_default __P(( - krb5_context context, - krb5_keytype keytype, - unsigned *len, - krb5_enctype **val)); +krb5_keytype_to_enctypes_default ( + krb5_context /*context*/, + krb5_keytype /*keytype*/, + unsigned */*len*/, + krb5_enctype **/*val*/); krb5_error_code -krb5_keytype_to_string __P(( - krb5_context context, - krb5_keytype keytype, - char **string)); +krb5_keytype_to_string ( + krb5_context /*context*/, + krb5_keytype /*keytype*/, + char **/*string*/); krb5_error_code -krb5_krbhst_format_string __P(( - krb5_context context, - const krb5_krbhst_info *host, - char *hostname, - size_t hostlen)); +krb5_krbhst_format_string ( + krb5_context /*context*/, + const krb5_krbhst_info */*host*/, + char */*hostname*/, + size_t /*hostlen*/); void -krb5_krbhst_free __P(( - krb5_context context, - krb5_krbhst_handle handle)); +krb5_krbhst_free ( + krb5_context /*context*/, + krb5_krbhst_handle /*handle*/); krb5_error_code -krb5_krbhst_get_addrinfo __P(( - krb5_context context, - krb5_krbhst_info *host, - struct addrinfo **ai)); +krb5_krbhst_get_addrinfo ( + krb5_context /*context*/, + krb5_krbhst_info */*host*/, + struct addrinfo **/*ai*/); krb5_error_code -krb5_krbhst_init __P(( - krb5_context context, - const char *realm, - unsigned int type, - krb5_krbhst_handle *handle)); +krb5_krbhst_init ( + krb5_context /*context*/, + const char */*realm*/, + unsigned int /*type*/, + krb5_krbhst_handle */*handle*/); krb5_error_code -krb5_krbhst_next __P(( - krb5_context context, - krb5_krbhst_handle handle, - krb5_krbhst_info **host)); +krb5_krbhst_next ( + krb5_context /*context*/, + krb5_krbhst_handle /*handle*/, + krb5_krbhst_info **/*host*/); krb5_error_code -krb5_krbhst_next_as_string __P(( - krb5_context context, - krb5_krbhst_handle handle, - char *hostname, - size_t hostlen)); +krb5_krbhst_next_as_string ( + krb5_context /*context*/, + krb5_krbhst_handle /*handle*/, + char */*hostname*/, + size_t /*hostlen*/); void -krb5_krbhst_reset __P(( - krb5_context context, - krb5_krbhst_handle handle)); +krb5_krbhst_reset ( + krb5_context /*context*/, + krb5_krbhst_handle /*handle*/); krb5_error_code -krb5_kt_add_entry __P(( - krb5_context context, - krb5_keytab id, - krb5_keytab_entry *entry)); +krb5_kt_add_entry ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_keytab_entry */*entry*/); krb5_error_code -krb5_kt_close __P(( - krb5_context context, - krb5_keytab id)); +krb5_kt_close ( + krb5_context /*context*/, + krb5_keytab /*id*/); krb5_boolean -krb5_kt_compare __P(( - krb5_context context, - krb5_keytab_entry *entry, - krb5_const_principal principal, - krb5_kvno vno, - krb5_enctype enctype)); +krb5_kt_compare ( + krb5_context /*context*/, + krb5_keytab_entry */*entry*/, + krb5_const_principal /*principal*/, + krb5_kvno /*vno*/, + krb5_enctype /*enctype*/); krb5_error_code -krb5_kt_copy_entry_contents __P(( - krb5_context context, - const krb5_keytab_entry *in, - krb5_keytab_entry *out)); +krb5_kt_copy_entry_contents ( + krb5_context /*context*/, + const krb5_keytab_entry */*in*/, + krb5_keytab_entry */*out*/); krb5_error_code -krb5_kt_default __P(( - krb5_context context, - krb5_keytab *id)); +krb5_kt_default ( + krb5_context /*context*/, + krb5_keytab */*id*/); krb5_error_code -krb5_kt_default_modify_name __P(( - krb5_context context, - char *name, - size_t namesize)); +krb5_kt_default_modify_name ( + krb5_context /*context*/, + char */*name*/, + size_t /*namesize*/); krb5_error_code -krb5_kt_default_name __P(( - krb5_context context, - char *name, - size_t namesize)); +krb5_kt_default_name ( + krb5_context /*context*/, + char */*name*/, + size_t /*namesize*/); krb5_error_code -krb5_kt_end_seq_get __P(( - krb5_context context, - krb5_keytab id, - krb5_kt_cursor *cursor)); +krb5_kt_end_seq_get ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_kt_cursor */*cursor*/); krb5_error_code -krb5_kt_free_entry __P(( - krb5_context context, - krb5_keytab_entry *entry)); +krb5_kt_free_entry ( + krb5_context /*context*/, + krb5_keytab_entry */*entry*/); krb5_error_code -krb5_kt_get_entry __P(( - krb5_context context, - krb5_keytab id, - krb5_const_principal principal, - krb5_kvno kvno, - krb5_enctype enctype, - krb5_keytab_entry *entry)); +krb5_kt_get_entry ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_const_principal /*principal*/, + krb5_kvno /*kvno*/, + krb5_enctype /*enctype*/, + krb5_keytab_entry */*entry*/); krb5_error_code -krb5_kt_get_name __P(( - krb5_context context, - krb5_keytab keytab, - char *name, - size_t namesize)); +krb5_kt_get_name ( + krb5_context /*context*/, + krb5_keytab /*keytab*/, + char */*name*/, + size_t /*namesize*/); krb5_error_code -krb5_kt_next_entry __P(( - krb5_context context, - krb5_keytab id, - krb5_keytab_entry *entry, - krb5_kt_cursor *cursor)); +krb5_kt_next_entry ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_keytab_entry */*entry*/, + krb5_kt_cursor */*cursor*/); krb5_error_code -krb5_kt_read_service_key __P(( - krb5_context context, - krb5_pointer keyprocarg, - krb5_principal principal, - krb5_kvno vno, - krb5_enctype enctype, - krb5_keyblock **key)); +krb5_kt_read_service_key ( + krb5_context /*context*/, + krb5_pointer /*keyprocarg*/, + krb5_principal /*principal*/, + krb5_kvno /*vno*/, + krb5_enctype /*enctype*/, + krb5_keyblock **/*key*/); krb5_error_code -krb5_kt_register __P(( - krb5_context context, - const krb5_kt_ops *ops)); +krb5_kt_register ( + krb5_context /*context*/, + const krb5_kt_ops */*ops*/); krb5_error_code -krb5_kt_remove_entry __P(( - krb5_context context, - krb5_keytab id, - krb5_keytab_entry *entry)); +krb5_kt_remove_entry ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_keytab_entry */*entry*/); krb5_error_code -krb5_kt_resolve __P(( - krb5_context context, - const char *name, - krb5_keytab *id)); +krb5_kt_resolve ( + krb5_context /*context*/, + const char */*name*/, + krb5_keytab */*id*/); krb5_error_code -krb5_kt_start_seq_get __P(( - krb5_context context, - krb5_keytab id, - krb5_kt_cursor *cursor)); +krb5_kt_start_seq_get ( + krb5_context /*context*/, + krb5_keytab /*id*/, + krb5_kt_cursor */*cursor*/); krb5_boolean -krb5_kuserok __P(( - krb5_context context, - krb5_principal principal, - const char *luser)); - -krb5_error_code -krb5_log __P(( - krb5_context context, - krb5_log_facility *fac, - int level, - const char *fmt, - ...)) +krb5_kuserok ( + krb5_context /*context*/, + krb5_principal /*principal*/, + const char */*luser*/); + +krb5_error_code +krb5_log ( + krb5_context /*context*/, + krb5_log_facility */*fac*/, + int /*level*/, + const char */*fmt*/, + ...) __attribute__((format (printf, 4, 5))); krb5_error_code -krb5_log_msg __P(( - krb5_context context, - krb5_log_facility *fac, - int level, - char **reply, - const char *fmt, - ...)) +krb5_log_msg ( + krb5_context /*context*/, + krb5_log_facility */*fac*/, + int /*level*/, + char **/*reply*/, + const char */*fmt*/, + ...) __attribute__((format (printf, 5, 6))); krb5_error_code -krb5_make_addrport __P(( - krb5_context context, - krb5_address **res, - const krb5_address *addr, - int16_t port)); +krb5_make_addrport ( + krb5_context /*context*/, + krb5_address **/*res*/, + const krb5_address */*addr*/, + int16_t /*port*/); krb5_error_code -krb5_make_principal __P(( - krb5_context context, - krb5_principal *principal, - krb5_const_realm realm, - ...)); +krb5_make_principal ( + krb5_context /*context*/, + krb5_principal */*principal*/, + krb5_const_realm /*realm*/, + ...); size_t -krb5_max_sockaddr_size __P((void)); - -krb5_error_code -krb5_mk_error __P(( - krb5_context context, - krb5_error_code error_code, - const char *e_text, - const krb5_data *e_data, - const krb5_principal client, - const krb5_principal server, - time_t *ctime, - int *cusec, - krb5_data *reply)); - -krb5_error_code -krb5_mk_priv __P(( - krb5_context context, - krb5_auth_context auth_context, - const krb5_data *userdata, - krb5_data *outbuf, - void *outdata)); - -krb5_error_code -krb5_mk_rep __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_data *outbuf)); - -krb5_error_code -krb5_mk_req __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_flags ap_req_options, - const char *service, - const char *hostname, - krb5_data *in_data, - krb5_ccache ccache, - krb5_data *outbuf)); - -krb5_error_code -krb5_mk_req_exact __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_flags ap_req_options, - const krb5_principal server, - krb5_data *in_data, - krb5_ccache ccache, - krb5_data *outbuf)); - -krb5_error_code -krb5_mk_req_extended __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_flags ap_req_options, - krb5_data *in_data, - krb5_creds *in_creds, - krb5_data *outbuf)); - -krb5_error_code -krb5_mk_req_internal __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_flags ap_req_options, - krb5_data *in_data, - krb5_creds *in_creds, - krb5_data *outbuf, - krb5_key_usage checksum_usage, - krb5_key_usage encrypt_usage)); - -krb5_error_code -krb5_mk_safe __P(( - krb5_context context, - krb5_auth_context auth_context, - const krb5_data *userdata, - krb5_data *outbuf, - void *outdata)); - -ssize_t -krb5_net_read __P(( - krb5_context context, - void *p_fd, - void *buf, - size_t len)); - -ssize_t -krb5_net_write __P(( - krb5_context context, - void *p_fd, - const void *buf, - size_t len)); - -krb5_error_code -krb5_openlog __P(( - krb5_context context, - const char *program, - krb5_log_facility **fac)); - -krb5_error_code -krb5_parse_address __P(( - krb5_context context, - const char *string, - krb5_addresses *addresses)); - -krb5_error_code -krb5_parse_name __P(( - krb5_context context, - const char *name, - krb5_principal *principal)); +krb5_max_sockaddr_size (void); + +krb5_error_code +krb5_mk_error ( + krb5_context /*context*/, + krb5_error_code /*error_code*/, + const char */*e_text*/, + const krb5_data */*e_data*/, + const krb5_principal /*client*/, + const krb5_principal /*server*/, + time_t */*client_time*/, + int */*client_usec*/, + krb5_data */*reply*/); + +krb5_error_code +krb5_mk_priv ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const krb5_data */*userdata*/, + krb5_data */*outbuf*/, + void */*outdata*/); + +krb5_error_code +krb5_mk_rep ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_data */*outbuf*/); + +krb5_error_code +krb5_mk_req ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_flags /*ap_req_options*/, + const char */*service*/, + const char */*hostname*/, + krb5_data */*in_data*/, + krb5_ccache /*ccache*/, + krb5_data */*outbuf*/); + +krb5_error_code +krb5_mk_req_exact ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_flags /*ap_req_options*/, + const krb5_principal /*server*/, + krb5_data */*in_data*/, + krb5_ccache /*ccache*/, + krb5_data */*outbuf*/); + +krb5_error_code +krb5_mk_req_extended ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_flags /*ap_req_options*/, + krb5_data */*in_data*/, + krb5_creds */*in_creds*/, + krb5_data */*outbuf*/); + +krb5_error_code +krb5_mk_req_internal ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_flags /*ap_req_options*/, + krb5_data */*in_data*/, + krb5_creds */*in_creds*/, + krb5_data */*outbuf*/, + krb5_key_usage /*checksum_usage*/, + krb5_key_usage /*encrypt_usage*/); + +krb5_error_code +krb5_mk_safe ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const krb5_data */*userdata*/, + krb5_data */*outbuf*/, + void */*outdata*/); + +krb5_ssize_t +krb5_net_read ( + krb5_context /*context*/, + void */*p_fd*/, + void */*buf*/, + size_t /*len*/); + +krb5_ssize_t +krb5_net_write ( + krb5_context /*context*/, + void */*p_fd*/, + const void */*buf*/, + size_t /*len*/); + +krb5_error_code +krb5_openlog ( + krb5_context /*context*/, + const char */*program*/, + krb5_log_facility **/*fac*/); + +krb5_error_code +krb5_parse_address ( + krb5_context /*context*/, + const char */*string*/, + krb5_addresses */*addresses*/); + +krb5_error_code +krb5_parse_name ( + krb5_context /*context*/, + const char */*name*/, + krb5_principal */*principal*/); const char * -krb5_passwd_result_to_string __P(( - krb5_context context, - int result)); +krb5_passwd_result_to_string ( + krb5_context /*context*/, + int /*result*/); krb5_error_code -krb5_password_key_proc __P(( - krb5_context context, - krb5_enctype type, - krb5_salt salt, - krb5_const_pointer keyseed, - krb5_keyblock **key)); +krb5_password_key_proc ( + krb5_context /*context*/, + krb5_enctype /*type*/, + krb5_salt /*salt*/, + krb5_const_pointer /*keyseed*/, + krb5_keyblock **/*key*/); krb5_realm* -krb5_princ_realm __P(( - krb5_context context, - krb5_principal principal)); +krb5_princ_realm ( + krb5_context /*context*/, + krb5_principal /*principal*/); void -krb5_princ_set_realm __P(( - krb5_context context, - krb5_principal principal, - krb5_realm *realm)); +krb5_princ_set_realm ( + krb5_context /*context*/, + krb5_principal /*principal*/, + krb5_realm */*realm*/); krb5_error_code -krb5_principal2principalname __P(( - PrincipalName *p, - const krb5_principal from)); +krb5_principal2principalname ( + PrincipalName */*p*/, + const krb5_principal /*from*/); krb5_boolean -krb5_principal_compare __P(( - krb5_context context, - krb5_const_principal princ1, - krb5_const_principal princ2)); +krb5_principal_compare ( + krb5_context /*context*/, + krb5_const_principal /*princ1*/, + krb5_const_principal /*princ2*/); krb5_boolean -krb5_principal_compare_any_realm __P(( - krb5_context context, - krb5_const_principal princ1, - krb5_const_principal princ2)); +krb5_principal_compare_any_realm ( + krb5_context /*context*/, + krb5_const_principal /*princ1*/, + krb5_const_principal /*princ2*/); const char * -krb5_principal_get_comp_string __P(( - krb5_context context, - krb5_principal principal, - unsigned int component)); +krb5_principal_get_comp_string ( + krb5_context /*context*/, + krb5_principal /*principal*/, + unsigned int /*component*/); const char * -krb5_principal_get_realm __P(( - krb5_context context, - krb5_principal principal)); +krb5_principal_get_realm ( + krb5_context /*context*/, + krb5_principal /*principal*/); int -krb5_principal_get_type __P(( - krb5_context context, - krb5_principal principal)); +krb5_principal_get_type ( + krb5_context /*context*/, + krb5_principal /*principal*/); krb5_boolean -krb5_principal_match __P(( - krb5_context context, - krb5_const_principal princ, - krb5_const_principal pattern)); +krb5_principal_match ( + krb5_context /*context*/, + krb5_const_principal /*princ*/, + krb5_const_principal /*pattern*/); krb5_error_code -krb5_print_address __P(( - const krb5_address *addr, - char *str, - size_t len, - size_t *ret_len)); +krb5_print_address ( + const krb5_address */*addr*/, + char */*str*/, + size_t /*len*/, + size_t */*ret_len*/); int -krb5_program_setup __P(( - krb5_context *context, - int argc, - char **argv, - struct getargs *args, - int num_args, - void (*usage)(int, struct getargs*, int))); +krb5_program_setup ( + krb5_context */*context*/, + int /*argc*/, + char **/*argv*/, + struct getargs */*args*/, + int /*num_args*/, + void (*/*usage*/)(int, struct getargs*, int)); int -krb5_prompter_posix __P(( - krb5_context context, - void *data, - const char *name, - const char *banner, - int num_prompts, - krb5_prompt prompts[])); +krb5_prompter_posix ( + krb5_context /*context*/, + void */*data*/, + const char */*name*/, + const char */*banner*/, + int /*num_prompts*/, + krb5_prompt prompts[]); krb5_error_code -krb5_rc_close __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_close ( + krb5_context /*context*/, + krb5_rcache /*id*/); krb5_error_code -krb5_rc_default __P(( - krb5_context context, - krb5_rcache *id)); +krb5_rc_default ( + krb5_context /*context*/, + krb5_rcache */*id*/); const char * -krb5_rc_default_name __P((krb5_context context)); +krb5_rc_default_name (krb5_context /*context*/); const char * -krb5_rc_default_type __P((krb5_context context)); +krb5_rc_default_type (krb5_context /*context*/); krb5_error_code -krb5_rc_destroy __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_destroy ( + krb5_context /*context*/, + krb5_rcache /*id*/); krb5_error_code -krb5_rc_expunge __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_expunge ( + krb5_context /*context*/, + krb5_rcache /*id*/); krb5_error_code -krb5_rc_get_lifespan __P(( - krb5_context context, - krb5_rcache id, - krb5_deltat *auth_lifespan)); +krb5_rc_get_lifespan ( + krb5_context /*context*/, + krb5_rcache /*id*/, + krb5_deltat */*auth_lifespan*/); const char* -krb5_rc_get_name __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_get_name ( + krb5_context /*context*/, + krb5_rcache /*id*/); const char* -krb5_rc_get_type __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_get_type ( + krb5_context /*context*/, + krb5_rcache /*id*/); krb5_error_code -krb5_rc_initialize __P(( - krb5_context context, - krb5_rcache id, - krb5_deltat auth_lifespan)); +krb5_rc_initialize ( + krb5_context /*context*/, + krb5_rcache /*id*/, + krb5_deltat /*auth_lifespan*/); krb5_error_code -krb5_rc_recover __P(( - krb5_context context, - krb5_rcache id)); +krb5_rc_recover ( + krb5_context /*context*/, + krb5_rcache /*id*/); krb5_error_code -krb5_rc_resolve __P(( - krb5_context context, - krb5_rcache id, - const char *name)); +krb5_rc_resolve ( + krb5_context /*context*/, + krb5_rcache /*id*/, + const char */*name*/); krb5_error_code -krb5_rc_resolve_full __P(( - krb5_context context, - krb5_rcache *id, - const char *string_name)); +krb5_rc_resolve_full ( + krb5_context /*context*/, + krb5_rcache */*id*/, + const char */*string_name*/); krb5_error_code -krb5_rc_resolve_type __P(( - krb5_context context, - krb5_rcache *id, - const char *type)); +krb5_rc_resolve_type ( + krb5_context /*context*/, + krb5_rcache */*id*/, + const char */*type*/); krb5_error_code -krb5_rc_store __P(( - krb5_context context, - krb5_rcache id, - krb5_donot_replay *rep)); +krb5_rc_store ( + krb5_context /*context*/, + krb5_rcache /*id*/, + krb5_donot_replay */*rep*/); krb5_error_code -krb5_rd_cred __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_data *in_data, - krb5_creds ***ret_creds, - krb5_replay_data *out_data)); +krb5_rd_cred ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_data */*in_data*/, + krb5_creds ***/*ret_creds*/, + krb5_replay_data */*out_data*/); krb5_error_code -krb5_rd_cred2 __P(( - krb5_context context, - krb5_auth_context auth_context, - krb5_ccache ccache, - krb5_data *in_data)); +krb5_rd_cred2 ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + krb5_ccache /*ccache*/, + krb5_data */*in_data*/); krb5_error_code -krb5_rd_error __P(( - krb5_context context, - krb5_data *msg, - KRB_ERROR *result)); +krb5_rd_error ( + krb5_context /*context*/, + krb5_data */*msg*/, + KRB_ERROR */*result*/); krb5_error_code -krb5_rd_priv __P(( - krb5_context context, - krb5_auth_context auth_context, - const krb5_data *inbuf, - krb5_data *outbuf, - void *outdata)); +krb5_rd_priv ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const krb5_data */*inbuf*/, + krb5_data */*outbuf*/, + void */*outdata*/); krb5_error_code -krb5_rd_rep __P(( - krb5_context context, - krb5_auth_context auth_context, - const krb5_data *inbuf, - krb5_ap_rep_enc_part **repl)); +krb5_rd_rep ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const krb5_data */*inbuf*/, + krb5_ap_rep_enc_part **/*repl*/); krb5_error_code -krb5_rd_req __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_data *inbuf, - krb5_const_principal server, - krb5_keytab keytab, - krb5_flags *ap_req_options, - krb5_ticket **ticket)); +krb5_rd_req ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_data */*inbuf*/, + krb5_const_principal /*server*/, + krb5_keytab /*keytab*/, + krb5_flags */*ap_req_options*/, + krb5_ticket **/*ticket*/); krb5_error_code -krb5_rd_req_with_keyblock __P(( - krb5_context context, - krb5_auth_context *auth_context, - const krb5_data *inbuf, - krb5_const_principal server, - krb5_keyblock *keyblock, - krb5_flags *ap_req_options, - krb5_ticket **ticket)); +krb5_rd_req_with_keyblock ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + const krb5_data */*inbuf*/, + krb5_const_principal /*server*/, + krb5_keyblock */*keyblock*/, + krb5_flags */*ap_req_options*/, + krb5_ticket **/*ticket*/); krb5_error_code -krb5_rd_safe __P(( - krb5_context context, - krb5_auth_context auth_context, - const krb5_data *inbuf, - krb5_data *outbuf, - void *outdata)); +krb5_rd_safe ( + krb5_context /*context*/, + krb5_auth_context /*auth_context*/, + const krb5_data */*inbuf*/, + krb5_data */*outbuf*/, + void */*outdata*/); krb5_error_code -krb5_read_message __P(( - krb5_context context, - krb5_pointer p_fd, - krb5_data *data)); +krb5_read_message ( + krb5_context /*context*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_error_code -krb5_read_priv_message __P(( - krb5_context context, - krb5_auth_context ac, - krb5_pointer p_fd, - krb5_data *data)); +krb5_read_priv_message ( + krb5_context /*context*/, + krb5_auth_context /*ac*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_error_code -krb5_read_safe_message __P(( - krb5_context context, - krb5_auth_context ac, - krb5_pointer p_fd, - krb5_data *data)); +krb5_read_safe_message ( + krb5_context /*context*/, + krb5_auth_context /*ac*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_boolean -krb5_realm_compare __P(( - krb5_context context, - krb5_const_principal princ1, - krb5_const_principal princ2)); +krb5_realm_compare ( + krb5_context /*context*/, + krb5_const_principal /*princ1*/, + krb5_const_principal /*princ2*/); + +krb5_error_code +krb5_recvauth ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + krb5_pointer /*p_fd*/, + const char */*appl_version*/, + krb5_principal /*server*/, + int32_t /*flags*/, + krb5_keytab /*keytab*/, + krb5_ticket **/*ticket*/); krb5_error_code -krb5_recvauth __P(( - krb5_context context, - krb5_auth_context *auth_context, - krb5_pointer p_fd, - char *appl_version, - krb5_principal server, - int32_t flags, - krb5_keytab keytab, - krb5_ticket **ticket)); +krb5_recvauth_match_version ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + krb5_pointer /*p_fd*/, + krb5_boolean (*/*match_appl_version*/)(const void *, const char*), + const void */*match_data*/, + krb5_principal /*server*/, + int32_t /*flags*/, + krb5_keytab /*keytab*/, + krb5_ticket **/*ticket*/); krb5_error_code -krb5_recvauth_match_version __P(( - krb5_context context, - krb5_auth_context *auth_context, - krb5_pointer p_fd, - krb5_boolean (*match_appl_version)(void *, const char*), - void *match_data, - krb5_principal server, - int32_t flags, - krb5_keytab keytab, - krb5_ticket **ticket)); +krb5_ret_address ( + krb5_storage */*sp*/, + krb5_address */*adr*/); krb5_error_code -krb5_ret_address __P(( - krb5_storage *sp, - krb5_address *adr)); +krb5_ret_addrs ( + krb5_storage */*sp*/, + krb5_addresses */*adr*/); krb5_error_code -krb5_ret_addrs __P(( - krb5_storage *sp, - krb5_addresses *adr)); +krb5_ret_authdata ( + krb5_storage */*sp*/, + krb5_authdata */*auth*/); krb5_error_code -krb5_ret_authdata __P(( - krb5_storage *sp, - krb5_authdata *auth)); +krb5_ret_creds ( + krb5_storage */*sp*/, + krb5_creds */*creds*/); krb5_error_code -krb5_ret_creds __P(( - krb5_storage *sp, - krb5_creds *creds)); +krb5_ret_data ( + krb5_storage */*sp*/, + krb5_data */*data*/); krb5_error_code -krb5_ret_data __P(( - krb5_storage *sp, - krb5_data *data)); +krb5_ret_int16 ( + krb5_storage */*sp*/, + int16_t */*value*/); krb5_error_code -krb5_ret_int16 __P(( - krb5_storage *sp, - int16_t *value)); +krb5_ret_int32 ( + krb5_storage */*sp*/, + int32_t */*value*/); krb5_error_code -krb5_ret_int32 __P(( - krb5_storage *sp, - int32_t *value)); +krb5_ret_int8 ( + krb5_storage */*sp*/, + int8_t */*value*/); krb5_error_code -krb5_ret_int8 __P(( - krb5_storage *sp, - int8_t *value)); +krb5_ret_keyblock ( + krb5_storage */*sp*/, + krb5_keyblock */*p*/); krb5_error_code -krb5_ret_keyblock __P(( - krb5_storage *sp, - krb5_keyblock *p)); +krb5_ret_principal ( + krb5_storage */*sp*/, + krb5_principal */*princ*/); krb5_error_code -krb5_ret_principal __P(( - krb5_storage *sp, - krb5_principal *princ)); +krb5_ret_string ( + krb5_storage */*sp*/, + char **/*string*/); krb5_error_code -krb5_ret_string __P(( - krb5_storage *sp, - char **string)); +krb5_ret_stringz ( + krb5_storage */*sp*/, + char **/*string*/); krb5_error_code -krb5_ret_stringz __P(( - krb5_storage *sp, - char **string)); +krb5_ret_times ( + krb5_storage */*sp*/, + krb5_times */*times*/); krb5_error_code -krb5_ret_times __P(( - krb5_storage *sp, - krb5_times *times)); +krb5_salttype_to_string ( + krb5_context /*context*/, + krb5_enctype /*etype*/, + krb5_salttype /*stype*/, + char **/*string*/); krb5_error_code -krb5_salttype_to_string __P(( - krb5_context context, - krb5_enctype etype, - krb5_salttype stype, - char **string)); +krb5_sendauth ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + krb5_pointer /*p_fd*/, + const char */*appl_version*/, + krb5_principal /*client*/, + krb5_principal /*server*/, + krb5_flags /*ap_req_options*/, + krb5_data */*in_data*/, + krb5_creds */*in_creds*/, + krb5_ccache /*ccache*/, + krb5_error **/*ret_error*/, + krb5_ap_rep_enc_part **/*rep_result*/, + krb5_creds **/*out_creds*/); krb5_error_code -krb5_sendauth __P(( - krb5_context context, - krb5_auth_context *auth_context, - krb5_pointer p_fd, - const char *appl_version, - krb5_principal client, - krb5_principal server, - krb5_flags ap_req_options, - krb5_data *in_data, - krb5_creds *in_creds, - krb5_ccache ccache, - krb5_error **ret_error, - krb5_ap_rep_enc_part **rep_result, - krb5_creds **out_creds)); +krb5_sendto ( + krb5_context /*context*/, + const krb5_data */*send_data*/, + krb5_krbhst_handle /*handle*/, + krb5_data */*receive*/); krb5_error_code -krb5_sendto __P(( - krb5_context context, - const krb5_data *send, - krb5_krbhst_handle handle, - krb5_data *receive)); +krb5_sendto_kdc ( + krb5_context /*context*/, + const krb5_data */*send_data*/, + const krb5_realm */*realm*/, + krb5_data */*receive*/); krb5_error_code -krb5_sendto_kdc __P(( - krb5_context context, - const krb5_data *send, - const krb5_realm *realm, - krb5_data *receive)); +krb5_sendto_kdc2 ( + krb5_context /*context*/, + const krb5_data */*send_data*/, + const krb5_realm */*realm*/, + krb5_data */*receive*/, + krb5_boolean /*master*/); krb5_error_code -krb5_sendto_kdc2 __P(( - krb5_context context, - const krb5_data *send, - const krb5_realm *realm, - krb5_data *receive, - krb5_boolean master)); +krb5_set_config_files ( + krb5_context /*context*/, + char **/*filenames*/); krb5_error_code -krb5_set_default_in_tkt_etypes __P(( - krb5_context context, - const krb5_enctype *etypes)); +krb5_set_default_in_tkt_etypes ( + krb5_context /*context*/, + const krb5_enctype */*etypes*/); krb5_error_code -krb5_set_default_realm __P(( - krb5_context context, - const char *realm)); +krb5_set_default_realm ( + krb5_context /*context*/, + const char */*realm*/); krb5_error_code -krb5_set_error_string __P(( - krb5_context context, - const char *fmt, - ...)) +krb5_set_error_string ( + krb5_context /*context*/, + const char */*fmt*/, + ...) __attribute__((format (printf, 2, 3))); krb5_error_code -krb5_set_extra_addresses __P(( - krb5_context context, - const krb5_addresses *addresses)); +krb5_set_extra_addresses ( + krb5_context /*context*/, + const krb5_addresses */*addresses*/); krb5_error_code -krb5_set_fcache_version __P(( - krb5_context context, - int version)); +krb5_set_fcache_version ( + krb5_context /*context*/, + int /*version*/); krb5_error_code -krb5_set_ignore_addresses __P(( - krb5_context context, - const krb5_addresses *addresses)); +krb5_set_ignore_addresses ( + krb5_context /*context*/, + const krb5_addresses */*addresses*/); void -krb5_set_use_admin_kdc __P(( - krb5_context context, - krb5_boolean flag)); +krb5_set_use_admin_kdc ( + krb5_context /*context*/, + krb5_boolean /*flag*/); krb5_error_code -krb5_set_warn_dest __P(( - krb5_context context, - krb5_log_facility *fac)); +krb5_set_warn_dest ( + krb5_context /*context*/, + krb5_log_facility */*fac*/); krb5_error_code -krb5_sname_to_principal __P(( - krb5_context context, - const char *hostname, - const char *sname, - int32_t type, - krb5_principal *ret_princ)); +krb5_sname_to_principal ( + krb5_context /*context*/, + const char */*hostname*/, + const char */*sname*/, + int32_t /*type*/, + krb5_principal */*ret_princ*/); krb5_error_code -krb5_sock_to_principal __P(( - krb5_context context, - int sock, - const char *sname, - int32_t type, - krb5_principal *ret_princ)); +krb5_sock_to_principal ( + krb5_context /*context*/, + int /*sock*/, + const char */*sname*/, + int32_t /*type*/, + krb5_principal */*ret_princ*/); krb5_error_code -krb5_sockaddr2address __P(( - krb5_context context, - const struct sockaddr *sa, - krb5_address *addr)); +krb5_sockaddr2address ( + krb5_context /*context*/, + const struct sockaddr */*sa*/, + krb5_address */*addr*/); krb5_error_code -krb5_sockaddr2port __P(( - krb5_context context, - const struct sockaddr *sa, - int16_t *port)); +krb5_sockaddr2port ( + krb5_context /*context*/, + const struct sockaddr */*sa*/, + int16_t */*port*/); krb5_boolean -krb5_sockaddr_uninteresting __P((const struct sockaddr *sa)); +krb5_sockaddr_uninteresting (const struct sockaddr */*sa*/); void -krb5_std_usage __P(( - int code, - struct getargs *args, - int num_args)); +krb5_std_usage ( + int /*code*/, + struct getargs */*args*/, + int /*num_args*/); void -krb5_storage_clear_flags __P(( - krb5_storage *sp, - krb5_flags flags)); +krb5_storage_clear_flags ( + krb5_storage */*sp*/, + krb5_flags /*flags*/); krb5_storage * -krb5_storage_emem __P((void)); +krb5_storage_emem (void); krb5_error_code -krb5_storage_free __P((krb5_storage *sp)); +krb5_storage_free (krb5_storage */*sp*/); krb5_storage * -krb5_storage_from_data __P((krb5_data *data)); +krb5_storage_from_data (krb5_data */*data*/); krb5_storage * -krb5_storage_from_fd __P((int fd)); +krb5_storage_from_fd (int /*fd*/); krb5_storage * -krb5_storage_from_mem __P(( - void *buf, - size_t len)); +krb5_storage_from_mem ( + void */*buf*/, + size_t /*len*/); krb5_flags -krb5_storage_get_byteorder __P(( - krb5_storage *sp, - krb5_flags byteorder)); +krb5_storage_get_byteorder ( + krb5_storage */*sp*/, + krb5_flags /*byteorder*/); krb5_boolean -krb5_storage_is_flags __P(( - krb5_storage *sp, - krb5_flags flags)); +krb5_storage_is_flags ( + krb5_storage */*sp*/, + krb5_flags /*flags*/); + +krb5_ssize_t +krb5_storage_read ( + krb5_storage */*sp*/, + void */*buf*/, + size_t /*len*/); + +off_t +krb5_storage_seek ( + krb5_storage */*sp*/, + off_t /*offset*/, + int /*whence*/); void -krb5_storage_set_byteorder __P(( - krb5_storage *sp, - krb5_flags byteorder)); +krb5_storage_set_byteorder ( + krb5_storage */*sp*/, + krb5_flags /*byteorder*/); void -krb5_storage_set_flags __P(( - krb5_storage *sp, - krb5_flags flags)); +krb5_storage_set_eof_code ( + krb5_storage */*sp*/, + int /*code*/); + +void +krb5_storage_set_flags ( + krb5_storage */*sp*/, + krb5_flags /*flags*/); krb5_error_code -krb5_storage_to_data __P(( - krb5_storage *sp, - krb5_data *data)); +krb5_storage_to_data ( + krb5_storage */*sp*/, + krb5_data */*data*/); + +krb5_ssize_t +krb5_storage_write ( + krb5_storage */*sp*/, + const void */*buf*/, + size_t /*len*/); krb5_error_code -krb5_store_address __P(( - krb5_storage *sp, - krb5_address p)); +krb5_store_address ( + krb5_storage */*sp*/, + krb5_address /*p*/); krb5_error_code -krb5_store_addrs __P(( - krb5_storage *sp, - krb5_addresses p)); +krb5_store_addrs ( + krb5_storage */*sp*/, + krb5_addresses /*p*/); krb5_error_code -krb5_store_authdata __P(( - krb5_storage *sp, - krb5_authdata auth)); +krb5_store_authdata ( + krb5_storage */*sp*/, + krb5_authdata /*auth*/); krb5_error_code -krb5_store_creds __P(( - krb5_storage *sp, - krb5_creds *creds)); +krb5_store_creds ( + krb5_storage */*sp*/, + krb5_creds */*creds*/); krb5_error_code -krb5_store_data __P(( - krb5_storage *sp, - krb5_data data)); +krb5_store_data ( + krb5_storage */*sp*/, + krb5_data /*data*/); krb5_error_code -krb5_store_int16 __P(( - krb5_storage *sp, - int16_t value)); +krb5_store_int16 ( + krb5_storage */*sp*/, + int16_t /*value*/); krb5_error_code -krb5_store_int32 __P(( - krb5_storage *sp, - int32_t value)); +krb5_store_int32 ( + krb5_storage */*sp*/, + int32_t /*value*/); krb5_error_code -krb5_store_int8 __P(( - krb5_storage *sp, - int8_t value)); +krb5_store_int8 ( + krb5_storage */*sp*/, + int8_t /*value*/); krb5_error_code -krb5_store_keyblock __P(( - krb5_storage *sp, - krb5_keyblock p)); +krb5_store_keyblock ( + krb5_storage */*sp*/, + krb5_keyblock /*p*/); krb5_error_code -krb5_store_principal __P(( - krb5_storage *sp, - krb5_principal p)); +krb5_store_principal ( + krb5_storage */*sp*/, + krb5_principal /*p*/); krb5_error_code -krb5_store_string __P(( - krb5_storage *sp, - const char *s)); +krb5_store_string ( + krb5_storage */*sp*/, + const char */*s*/); krb5_error_code -krb5_store_stringz __P(( - krb5_storage *sp, - const char *s)); +krb5_store_stringz ( + krb5_storage */*sp*/, + const char */*s*/); krb5_error_code -krb5_store_times __P(( - krb5_storage *sp, - krb5_times times)); +krb5_store_times ( + krb5_storage */*sp*/, + krb5_times /*times*/); krb5_error_code -krb5_string_to_deltat __P(( - const char *string, - krb5_deltat *deltat)); +krb5_string_to_deltat ( + const char */*string*/, + krb5_deltat */*deltat*/); krb5_error_code -krb5_string_to_enctype __P(( - krb5_context context, - const char *string, - krb5_enctype *etype)); +krb5_string_to_enctype ( + krb5_context /*context*/, + const char */*string*/, + krb5_enctype */*etype*/); krb5_error_code -krb5_string_to_key __P(( - krb5_context context, - krb5_enctype enctype, - const char *password, - krb5_principal principal, - krb5_keyblock *key)); +krb5_string_to_key ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + const char */*password*/, + krb5_principal /*principal*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_string_to_key_data __P(( - krb5_context context, - krb5_enctype enctype, - krb5_data password, - krb5_principal principal, - krb5_keyblock *key)); +krb5_string_to_key_data ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + krb5_data /*password*/, + krb5_principal /*principal*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_string_to_key_data_salt __P(( - krb5_context context, - krb5_enctype enctype, - krb5_data password, - krb5_salt salt, - krb5_keyblock *key)); +krb5_string_to_key_data_salt ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + krb5_data /*password*/, + krb5_salt /*salt*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_string_to_key_derived __P(( - krb5_context context, - const void *str, - size_t len, - krb5_enctype etype, - krb5_keyblock *key)); +krb5_string_to_key_derived ( + krb5_context /*context*/, + const void */*str*/, + size_t /*len*/, + krb5_enctype /*etype*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_string_to_key_salt __P(( - krb5_context context, - krb5_enctype enctype, - const char *password, - krb5_salt salt, - krb5_keyblock *key)); +krb5_string_to_key_salt ( + krb5_context /*context*/, + krb5_enctype /*enctype*/, + const char */*password*/, + krb5_salt /*salt*/, + krb5_keyblock */*key*/); krb5_error_code -krb5_string_to_keytype __P(( - krb5_context context, - const char *string, - krb5_keytype *keytype)); +krb5_string_to_keytype ( + krb5_context /*context*/, + const char */*string*/, + krb5_keytype */*keytype*/); krb5_error_code -krb5_string_to_salttype __P(( - krb5_context context, - krb5_enctype etype, - const char *string, - krb5_salttype *salttype)); +krb5_string_to_salttype ( + krb5_context /*context*/, + krb5_enctype /*etype*/, + const char */*string*/, + krb5_salttype */*salttype*/); krb5_error_code -krb5_timeofday __P(( - krb5_context context, - krb5_timestamp *timeret)); +krb5_timeofday ( + krb5_context /*context*/, + krb5_timestamp */*timeret*/); krb5_error_code -krb5_unparse_name __P(( - krb5_context context, - krb5_const_principal principal, - char **name)); +krb5_unparse_name ( + krb5_context /*context*/, + krb5_const_principal /*principal*/, + char **/*name*/); krb5_error_code -krb5_unparse_name_fixed __P(( - krb5_context context, - krb5_const_principal principal, - char *name, - size_t len)); +krb5_unparse_name_fixed ( + krb5_context /*context*/, + krb5_const_principal /*principal*/, + char */*name*/, + size_t /*len*/); krb5_error_code -krb5_unparse_name_fixed_short __P(( - krb5_context context, - krb5_const_principal principal, - char *name, - size_t len)); +krb5_unparse_name_fixed_short ( + krb5_context /*context*/, + krb5_const_principal /*principal*/, + char */*name*/, + size_t /*len*/); krb5_error_code -krb5_unparse_name_short __P(( - krb5_context context, - krb5_const_principal principal, - char **name)); +krb5_unparse_name_short ( + krb5_context /*context*/, + krb5_const_principal /*principal*/, + char **/*name*/); krb5_error_code -krb5_us_timeofday __P(( - krb5_context context, - int32_t *sec, - int32_t *usec)); +krb5_us_timeofday ( + krb5_context /*context*/, + int32_t */*sec*/, + int32_t */*usec*/); krb5_error_code -krb5_vabort __P(( - krb5_context context, - krb5_error_code code, - const char *fmt, - va_list ap)) +krb5_vabort ( + krb5_context /*context*/, + krb5_error_code /*code*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((noreturn, format (printf, 3, 0))); krb5_error_code -krb5_vabortx __P(( - krb5_context context, - const char *fmt, - va_list ap)) +krb5_vabortx ( + krb5_context /*context*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((noreturn, format (printf, 2, 0))); krb5_error_code -krb5_verify_ap_req __P(( - krb5_context context, - krb5_auth_context *auth_context, - krb5_ap_req *ap_req, - krb5_const_principal server, - krb5_keyblock *keyblock, - krb5_flags flags, - krb5_flags *ap_req_options, - krb5_ticket **ticket)); - -krb5_error_code -krb5_verify_ap_req2 __P(( - krb5_context context, - krb5_auth_context *auth_context, - krb5_ap_req *ap_req, - krb5_const_principal server, - krb5_keyblock *keyblock, - krb5_flags flags, - krb5_flags *ap_req_options, - krb5_ticket **ticket, - krb5_key_usage usage)); - -krb5_error_code -krb5_verify_authenticator_checksum __P(( - krb5_context context, - krb5_auth_context ac, - void *data, - size_t len)); - -krb5_error_code -krb5_verify_checksum __P(( - krb5_context context, - krb5_crypto crypto, - krb5_key_usage usage, - void *data, - size_t len, - Checksum *cksum)); - -krb5_error_code -krb5_verify_init_creds __P(( - krb5_context context, - krb5_creds *creds, - krb5_principal ap_req_server, - krb5_keytab ap_req_keytab, - krb5_ccache *ccache, - krb5_verify_init_creds_opt *options)); +krb5_verify_ap_req ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + krb5_ap_req */*ap_req*/, + krb5_const_principal /*server*/, + krb5_keyblock */*keyblock*/, + krb5_flags /*flags*/, + krb5_flags */*ap_req_options*/, + krb5_ticket **/*ticket*/); + +krb5_error_code +krb5_verify_ap_req2 ( + krb5_context /*context*/, + krb5_auth_context */*auth_context*/, + krb5_ap_req */*ap_req*/, + krb5_const_principal /*server*/, + krb5_keyblock */*keyblock*/, + krb5_flags /*flags*/, + krb5_flags */*ap_req_options*/, + krb5_ticket **/*ticket*/, + krb5_key_usage /*usage*/); + +krb5_error_code +krb5_verify_authenticator_checksum ( + krb5_context /*context*/, + krb5_auth_context /*ac*/, + void */*data*/, + size_t /*len*/); + +krb5_error_code +krb5_verify_checksum ( + krb5_context /*context*/, + krb5_crypto /*crypto*/, + krb5_key_usage /*usage*/, + void */*data*/, + size_t /*len*/, + Checksum */*cksum*/); + +krb5_error_code +krb5_verify_init_creds ( + krb5_context /*context*/, + krb5_creds */*creds*/, + krb5_principal /*ap_req_server*/, + krb5_keytab /*ap_req_keytab*/, + krb5_ccache */*ccache*/, + krb5_verify_init_creds_opt */*options*/); void -krb5_verify_init_creds_opt_init __P((krb5_verify_init_creds_opt *options)); +krb5_verify_init_creds_opt_init (krb5_verify_init_creds_opt */*options*/); void -krb5_verify_init_creds_opt_set_ap_req_nofail __P(( - krb5_verify_init_creds_opt *options, - int ap_req_nofail)); +krb5_verify_init_creds_opt_set_ap_req_nofail ( + krb5_verify_init_creds_opt */*options*/, + int /*ap_req_nofail*/); void -krb5_verify_opt_init __P((krb5_verify_opt *opt)); +krb5_verify_opt_init (krb5_verify_opt */*opt*/); void -krb5_verify_opt_set_ccache __P(( - krb5_verify_opt *opt, - krb5_ccache ccache)); +krb5_verify_opt_set_ccache ( + krb5_verify_opt */*opt*/, + krb5_ccache /*ccache*/); void -krb5_verify_opt_set_flags __P(( - krb5_verify_opt *opt, - unsigned int flags)); +krb5_verify_opt_set_flags ( + krb5_verify_opt */*opt*/, + unsigned int /*flags*/); void -krb5_verify_opt_set_keytab __P(( - krb5_verify_opt *opt, - krb5_keytab keytab)); +krb5_verify_opt_set_keytab ( + krb5_verify_opt */*opt*/, + krb5_keytab /*keytab*/); void -krb5_verify_opt_set_secure __P(( - krb5_verify_opt *opt, - krb5_boolean secure)); +krb5_verify_opt_set_secure ( + krb5_verify_opt */*opt*/, + krb5_boolean /*secure*/); void -krb5_verify_opt_set_service __P(( - krb5_verify_opt *opt, - const char *service)); - -krb5_error_code -krb5_verify_user __P(( - krb5_context context, - krb5_principal principal, - krb5_ccache ccache, - const char *password, - krb5_boolean secure, - const char *service)); - -krb5_error_code -krb5_verify_user_lrealm __P(( - krb5_context context, - krb5_principal principal, - krb5_ccache ccache, - const char *password, - krb5_boolean secure, - const char *service)); - -krb5_error_code -krb5_verify_user_opt __P(( - krb5_context context, - krb5_principal principal, - const char *password, - krb5_verify_opt *opt)); - -krb5_error_code -krb5_verr __P(( - krb5_context context, - int eval, - krb5_error_code code, - const char *fmt, - va_list ap)) +krb5_verify_opt_set_service ( + krb5_verify_opt */*opt*/, + const char */*service*/); + +krb5_error_code +krb5_verify_user ( + krb5_context /*context*/, + krb5_principal /*principal*/, + krb5_ccache /*ccache*/, + const char */*password*/, + krb5_boolean /*secure*/, + const char */*service*/); + +krb5_error_code +krb5_verify_user_lrealm ( + krb5_context /*context*/, + krb5_principal /*principal*/, + krb5_ccache /*ccache*/, + const char */*password*/, + krb5_boolean /*secure*/, + const char */*service*/); + +krb5_error_code +krb5_verify_user_opt ( + krb5_context /*context*/, + krb5_principal /*principal*/, + const char */*password*/, + krb5_verify_opt */*opt*/); + +krb5_error_code +krb5_verr ( + krb5_context /*context*/, + int /*eval*/, + krb5_error_code /*code*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((noreturn, format (printf, 4, 0))); krb5_error_code -krb5_verrx __P(( - krb5_context context, - int eval, - const char *fmt, - va_list ap)) +krb5_verrx ( + krb5_context /*context*/, + int /*eval*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((noreturn, format (printf, 3, 0))); krb5_error_code -krb5_vlog __P(( - krb5_context context, - krb5_log_facility *fac, - int level, - const char *fmt, - va_list ap)) +krb5_vlog ( + krb5_context /*context*/, + krb5_log_facility */*fac*/, + int /*level*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__((format (printf, 4, 0))); krb5_error_code -krb5_vlog_msg __P(( - krb5_context context, - krb5_log_facility *fac, - char **reply, - int level, - const char *fmt, - va_list ap)) +krb5_vlog_msg ( + krb5_context /*context*/, + krb5_log_facility */*fac*/, + char **/*reply*/, + int /*level*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__((format (printf, 5, 0))); krb5_error_code -krb5_vset_error_string __P(( - krb5_context context, - const char *fmt, - va_list args)) +krb5_vset_error_string ( + krb5_context /*context*/, + const char */*fmt*/, + va_list /*args*/) __attribute__ ((format (printf, 2, 0))); krb5_error_code -krb5_vwarn __P(( - krb5_context context, - krb5_error_code code, - const char *fmt, - va_list ap)) +krb5_vwarn ( + krb5_context /*context*/, + krb5_error_code /*code*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((format (printf, 3, 0))); krb5_error_code -krb5_vwarnx __P(( - krb5_context context, - const char *fmt, - va_list ap)) +krb5_vwarnx ( + krb5_context /*context*/, + const char */*fmt*/, + va_list /*ap*/) __attribute__ ((format (printf, 2, 0))); krb5_error_code -krb5_warn __P(( - krb5_context context, - krb5_error_code code, - const char *fmt, - ...)) +krb5_warn ( + krb5_context /*context*/, + krb5_error_code /*code*/, + const char */*fmt*/, + ...) __attribute__ ((format (printf, 3, 4))); krb5_error_code -krb5_warnx __P(( - krb5_context context, - const char *fmt, - ...)) +krb5_warnx ( + krb5_context /*context*/, + const char */*fmt*/, + ...) __attribute__ ((format (printf, 2, 3))); krb5_error_code -krb5_write_message __P(( - krb5_context context, - krb5_pointer p_fd, - krb5_data *data)); +krb5_write_message ( + krb5_context /*context*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_error_code -krb5_write_priv_message __P(( - krb5_context context, - krb5_auth_context ac, - krb5_pointer p_fd, - krb5_data *data)); +krb5_write_priv_message ( + krb5_context /*context*/, + krb5_auth_context /*ac*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_error_code -krb5_write_safe_message __P(( - krb5_context context, - krb5_auth_context ac, - krb5_pointer p_fd, - krb5_data *data)); +krb5_write_safe_message ( + krb5_context /*context*/, + krb5_auth_context /*ac*/, + krb5_pointer /*p_fd*/, + krb5_data */*data*/); krb5_error_code -krb5_xfree __P((void *ptr)); +krb5_xfree (void */*ptr*/); krb5_error_code -principalname2krb5_principal __P(( - krb5_principal *principal, - const PrincipalName from, - const Realm realm)); +principalname2krb5_principal ( + krb5_principal */*principal*/, + const PrincipalName /*from*/, + const Realm /*realm*/); #endif /* __krb5_protos_h__ */ diff --git a/crypto/heimdal/lib/krb5/krb5.conf.5 b/crypto/heimdal/lib/krb5/krb5.conf.5 index c87526a..0fc856a 100644 --- a/crypto/heimdal/lib/krb5/krb5.conf.5 +++ b/crypto/heimdal/lib/krb5/krb5.conf.5 @@ -1,4 +1,4 @@ -.\" $Id: krb5.conf.5,v 1.22 2001/08/30 18:54:01 joda Exp $ +.\" $Id: krb5.conf.5,v 1.25 2002/08/28 15:33:59 nectar Exp $ .\" .Dd April 11, 1999 .Dt KRB5.CONF 5 @@ -7,7 +7,7 @@ .Nm /etc/krb5.conf .Nd configuration file for Kerberos 5 .Sh DESCRIPTION -The +The .Nm file specifies several configuration parameters for the Kerberos 5 library, as well as for some programs. @@ -78,7 +78,7 @@ Default renewable ticket lifetime. .It Li [libdefaults] .Bl -tag -width "xxx" -offset indent .It Li default_realm = Va REALM -Default realm to use, this is also known as your +Default realm to use, this is also known as your .Dq local realm . The default is the result of .Fn krb5_get_host_realm "local hostname" . @@ -89,7 +89,7 @@ times. Default is 300 seconds (five minutes). Maximum time to wait for a reply from the kdc, default is 3 seconds. .It v4_name_convert .It v4_instance_resolve -These are decribed in the +These are decribed in the .Xr krb5_425_conv_principal 3 manual page. .It Li capath = { @@ -117,6 +117,10 @@ A list of default etypes to use when requesting a DES credential. .It Li default_keytab_name = Va keytab The keytab to use if none other is specified, default is .Dq FILE:/etc/krb5.keytab . +.It Li dns_lookup_kdc = Va boolean +Use DNS SRV records to lookup KDC services location. +.It Li dns_lookup_realm = Va boolean +Use DNS TXT records to lookup domain to realm mappings. .It Li kdc_timesync = Va boolean Try to keep track of the time differential between the local machine and the KDC, and then compensate for that when issuing requests. @@ -133,8 +137,11 @@ This option is also valid in the [realms] section. When obtaining initial credentials, make the credentials proxiable. This option is also valid in the [realms] section. .It Li verify_ap_req_nofail = Va boolean -Enable to make a failure to verify obtained credentials -non-fatal. This can be useful if there is no keytab on a host. +If enabled, failure to verify credentials against a local key is a +fatal error. The application has to be able to read the corresponding +service key for this to work. Some applications, like +.Xr su 8 , +enable this option unconditionally. .It Li warn_pwexpire = Va time How soon to warn for expiring password. Default is seven days. .It Li http_proxy = Va proxy-spec @@ -151,8 +158,6 @@ How to print date strings in logs, this string is passed to .Xr strftime 3 . .It Li log_utc = Va boolean Write log-entries using UTC instead of your local time zone. -.It Li srv_lookup = Va boolean -Use DNS SRV records to lookup realm configuration information. .It Li scan_interfaces = Va boolean Scan all network interfaces for addresses, as opposed to simply using the address associated with the system's host name. @@ -174,6 +179,9 @@ binding in this section looks like: The domain can be either a full name of a host or a trailing component, in the latter case the domain-string should start with a perid. +The realm may be the token `dns_locate', in which case the actual +realm will be determined using DNS (independently of the setting +of the `dns_lookup_realm' option). .It Li [realms] .Bl -tag -width "xxx" -offset indent .It Va REALM Li = { @@ -260,12 +268,12 @@ verify the addresses in the tickets used in tgs requests. .\" XXX .It allow-null-ticket-addresses = Va BOOL allow addresses-less tickets. -.\" XXX +.\" XXX .It allow-anonymous = Va BOOL if the kdc is allowed to hand out anonymous tickets. .It encode_as_rep_as_tgs_rep = Va BOOL encode as-rep as tgs-rep tobe compatible with mistakes older DCE secd did. -.\" XXX +.\" XXX .It kdc_warn_pwexpire = Va TIME the time before expiration that the user should be warned that her password is about to expire. @@ -289,7 +297,7 @@ if .Ar etype is omitted it means everything, and if string is omitted is means the default string (for that principal). Additional special values of keyttypes are: .Bl -tag -width "xxx" -offset indent -.It v5 +.It v5 The kerberos 5 salt .Va pw-salt .It v4 diff --git a/crypto/heimdal/lib/krb5/krb5.h b/crypto/heimdal/lib/krb5/krb5.h index cb4a3e5..c50833e 100644 --- a/crypto/heimdal/lib/krb5/krb5.h +++ b/crypto/heimdal/lib/krb5/krb5.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: krb5.h,v 1.197 2001/09/27 01:31:53 assar Exp $ */ +/* $Id: krb5.h,v 1.203 2002/08/22 10:06:20 joda Exp $ */ #ifndef __KRB5_H__ #define __KRB5_H__ @@ -46,6 +46,11 @@ #include <krb5_asn1.h> +/* name confusion with MIT */ +#ifndef KRB5KDC_ERR_KEY_EXP +#define KRB5KDC_ERR_KEY_EXP KRB5KDC_ERR_KEY_EXPIRED +#endif + /* simple constants */ #ifndef TRUE @@ -316,8 +321,8 @@ typedef struct krb5_creds { } krb5_creds; typedef struct krb5_cc_ops { - char *prefix; - char* (*get_name)(krb5_context, krb5_ccache); + const char *prefix; + const char* (*get_name)(krb5_context, krb5_ccache); krb5_error_code (*resolve)(krb5_context, krb5_ccache *, const char *); krb5_error_code (*gen_new)(krb5_context, krb5_ccache *); krb5_error_code (*init)(krb5_context, krb5_ccache, krb5_principal); @@ -411,14 +416,8 @@ typedef Authenticator krb5_donot_replay; #define KRB5_STORAGE_BYTEORDER_LE 0x20 #define KRB5_STORAGE_BYTEORDER_HOST 0x40 -typedef struct krb5_storage { - void *data; - ssize_t (*fetch)(struct krb5_storage*, void*, size_t); - ssize_t (*store)(struct krb5_storage*, const void*, size_t); - off_t (*seek)(struct krb5_storage*, off_t, int); - void (*free)(struct krb5_storage*); - krb5_flags flags; -} krb5_storage; +struct krb5_storage_data; +typedef struct krb5_storage_data krb5_storage; typedef struct krb5_keytab_entry { krb5_principal principal; @@ -438,7 +437,7 @@ struct krb5_keytab_data; typedef struct krb5_keytab_data *krb5_keytab; struct krb5_keytab_data { - char *prefix; + const char *prefix; krb5_error_code (*resolve)(krb5_context, const char*, krb5_keytab); krb5_error_code (*get_name)(krb5_context, krb5_keytab, char*, size_t); krb5_error_code (*close)(krb5_context, krb5_keytab); @@ -539,8 +538,8 @@ typedef EncAPRepPart krb5_ap_rep_enc_part; /* variables */ -extern const char krb5_config_file[]; -extern const char krb5_defkeyname[]; +extern const char *krb5_config_file; +extern const char *krb5_defkeyname; typedef enum { KRB5_PROMPT_TYPE_PASSWORD = 0x1, @@ -550,7 +549,7 @@ typedef enum { } krb5_prompt_type; typedef struct _krb5_prompt { - char *prompt; + const char *prompt; int hidden; krb5_data *reply; krb5_prompt_type type; @@ -664,7 +663,6 @@ typedef struct krb5_krbhst_info { struct credentials; /* this is to keep the compiler happy */ struct getargs; - struct sockaddr; #include <krb5-protos.h> diff --git a/crypto/heimdal/lib/krb5/krb5_425_conv_principal.3 b/crypto/heimdal/lib/krb5/krb5_425_conv_principal.3 index edd2f47..bb7e578 100644 --- a/crypto/heimdal/lib/krb5/krb5_425_conv_principal.3 +++ b/crypto/heimdal/lib/krb5/krb5_425_conv_principal.3 @@ -1,5 +1,5 @@ -.\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_425_conv_principal.3,v 1.5 2001/05/02 08:59:23 assar Exp $ +.\" Copyright (c) 1997-2002 Kungliga Tekniska Högskolan +.\" $Id: krb5_425_conv_principal.3,v 1.8 2002/08/28 15:30:46 joda Exp $ .Dd April 11, 1999 .Dt KRB5_425_CONV_PRINCIPAL 3 .Os HEIMDAL @@ -8,6 +8,8 @@ .Nm krb5_425_conv_principal_ext , .Nm krb5_524_conv_principal .Nd converts to and from version 4 principals +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -26,8 +28,8 @@ realm. In some cases also the first component/name will differ between version 4 and version 5. Furthermore the second component of a host principal will be the fully qualified domain name of the host in question, while the instance of a version 4 principal will only -contain the first component. Because of these problems the conversion -between principals will have to be site customized. +contain the first part (short hostname). Because of these problems +the conversion between principals will have to be site customized. .Pp .Fn krb5_425_conv_principal_ext will try to convert a version 4 principal, given by @@ -42,11 +44,11 @@ is non-NULL, it will be called for each candidate principal. .Fa func should return true if the principal was .Dq good . -To accomplish this, -.Fn krb5_425_conv_principal_ext +To accomplish this, +.Fn krb5_425_conv_principal_ext will look up the name in .Pa krb5.conf . -It first looks in the +It first looks in the .Li v4_name_convert/host subsection, which should contain a list of version 4 names whose instance should be treated as a hostname. This list can be specified @@ -57,7 +59,7 @@ section), or in the section. If the name is found the resulting name of the principal will be the value of this binding. The instance is then first looked up in -.Li v4_instance_convert +.Li v4_instance_convert for the specified realm. If found the resulting value will be used as instance (this can be used for special cases), no further attempts will be made to find a conversion if this fails (with @@ -74,7 +76,7 @@ specific realm. .Pp On the other hand, if the name is not found in a .Li host -section, it is looked up in a +section, it is looked up in a .Li v4_name_convert/plain binding. If found here the name will be converted, but the instance will be untouched. @@ -85,8 +87,10 @@ v4_name_convert = { host = { ftp = ftp hprop = hprop + imap = imap pop = pop rcmd = host + smtp = smtp } } .Ed @@ -97,9 +101,9 @@ config file, so you can override these defaults. .Fn krb5_425_conv_principal will call .Fn krb5_425_conv_principal_ext -with +with .Dv NULL -as +as .Fa func , and the value of .Li v4_instance_resolve @@ -109,24 +113,24 @@ section) as .Fa resolve . .Pp .Fn krb5_524_conv_principal -basically does the opposite of +basically does the opposite of .Fn krb5_425_conv_principal , it just doesn't have to look up any names, but will instead truncate instances found to belong to a host principal. The -.Fa name , -.Fa instance , -and +.Fa name , +.Fa instance , +and .Fa realm should be at least 40 characters long. .Sh EXAMPLES Since this is confusing an example is in place. .Pp -Assume that we have the -.Dq foo.com , -and -.Dq bar.com -domains that have shared a single version 4 realm, FOO.COM. The version 4 -.Pa krb.realms +Assume that we have the +.Dq foo.com , +and +.Dq bar.com +domains that have shared a single version 4 realm, FOO.COM. The version 4 +.Pa krb.realms file looked like: .Bd -literal -offset indent foo.com FOO.COM @@ -165,19 +169,19 @@ ftp.other \(-> ftp/other.foo.com other.a-host \(-> other/a-host .Ed .Pp -The first three are what you expect. If you remove the +The first three are what you expect. If you remove the .Dq v4_domains , the fourth entry will result in an error (since the host .Dq other -can't be found). Even if -.Dq a-host +can't be found). Even if +.Dq a-host is a valid host name, the last entry will not be converted, since the .Dq other name is not known to represent a host-type principal. If you turn off .Dq v4_instance_resolve the second example will result in -.Dq ftp/b-host.foo.com +.Dq ftp/b-host.foo.com (because of the default domain). And all of this is of course only valid if you have working name resolving. .Sh SEE ALSO diff --git a/crypto/heimdal/lib/krb5/krb5_appdefault.3 b/crypto/heimdal/lib/krb5/krb5_appdefault.3 index 4f395cc..750bb75 100644 --- a/crypto/heimdal/lib/krb5/krb5_appdefault.3 +++ b/crypto/heimdal/lib/krb5/krb5_appdefault.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2000 Kungliga Tekniska Högskolan -.\" $Id: krb5_appdefault.3,v 1.5 2001/06/23 22:35:19 assar Exp $ +.\" $Id: krb5_appdefault.3,v 1.7 2002/08/28 15:30:46 joda Exp $ .Dd July 25, 2000 .Dt KRB5_APPDEFAULT 3 .Os HEIMDAL @@ -8,6 +8,8 @@ .Nm krb5_appdefault_string , .Nm krb5_appdefault_time .Nd get application configuration value +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft void @@ -17,14 +19,14 @@ .Ft void .Fn krb5_appdefault_time "krb5_context context" "const char *appname" "krb5_realm realm" "const char *option" "time_t def_val" "time_t *ret_val" .Sh DESCRIPTION -These functions get application application defaults from the +These functions get application application defaults from the .Dv appdefaults section of the -.Xr krb5.conf 5 +.Xr krb5.conf 5 configuration file. These defaults can be specified per application, and/or per realm. .Pp -These values will be looked for in +These values will be looked for in .Xr krb5.conf 5 , in order of descending importance. .Bd -literal -offset indent @@ -46,7 +48,7 @@ in order of descending importance. is the name of the application, and .Fa realm is the realm name. If the realm is omitted it will not be used for -resolving values. +resolving values. .Fa def_val is the value to return if no value is found in .Xr krb5.conf 5 . diff --git a/crypto/heimdal/lib/krb5/krb5_auth_context.3 b/crypto/heimdal/lib/krb5/krb5_auth_context.3 index 92e25b0..afc81e8 100644 --- a/crypto/heimdal/lib/krb5/krb5_auth_context.3 +++ b/crypto/heimdal/lib/krb5/krb5_auth_context.3 @@ -1,6 +1,6 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_auth_context.3,v 1.2 2001/05/02 08:59:23 assar Exp $ -.Dd Jan 21, 2001 +.\" $Id: krb5_auth_context.3,v 1.4 2002/08/28 14:46:20 joda Exp $ +.Dd January 21, 2001 .Dt KRB5_AUTH_CONTEXT 3 .Os HEIMDAL .Sh NAME @@ -35,6 +35,8 @@ .Nm krb5_auth_con_initivector , .Nm krb5_auth_con_setivector .Nd manage authetication on connection level +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -119,9 +121,9 @@ The .Nm krb5_auth_context structure holds all context related to an authenticated connection, in -a similar way to +a similar way to .Nm krb5_context -that holds the context for the thread or process. +that holds the context for the thread or process. .Nm krb5_auth_context is used by various functions that are directly related to authentication between the server/client. Example of data that this @@ -138,18 +140,18 @@ and .Fn krb5_auth_con_setflags . The .Nm auth_context -structure must be freed by +structure must be freed by .Fn krb5_auth_con_free . .Pp .Fn krb5_auth_con_getflags and .Fn krb5_auth_con_setflags -gets and modifies the flags for a +gets and modifies the flags for a .Nm krb5_auth_context structure. Possible flags to set are: .Bl -tag -width Ds .It Dv KRB5_AUTH_CONTEXT_DO_TIME -check timestamp on incoming packets. +check timestamp on incoming packets. .\".It Dv KRB5_AUTH_CONTEXT_RET_TIME .It Dv KRB5_AUTH_CONTEXT_DO_SEQUENCE Generate and check sequence-number on each packet. @@ -186,7 +188,7 @@ fetches the addresses from a file descriptor. .Pp .Fn krb5_auth_con_genaddrs fetches the address information from the given file descriptor -.Fa fd +.Fa fd depending on the bitmap argument .Fa flags . .Pp @@ -219,7 +221,7 @@ and thus no special handling is needed. is not a valid keyblock to .Fn krb5_auth_con_setkey . .Pp -.Fn krb5_auth_con_setuserkey +.Fn krb5_auth_con_setuserkey is only useful when doing user to user authentication. .Fn krb5_auth_con_setkey is equivalent to @@ -230,7 +232,7 @@ is equivalent to .Fn krb5_auth_con_getremotesubkey and .Fn krb5_auth_con_setremotesubkey -gets and sets the keyblock for the local and remote subkey. The keyblock returned by +gets and sets the keyblock for the local and remote subkey. The keyblock returned by .Fn krb5_auth_con_getlocalsubkey and .Fn krb5_auth_con_getremotesubkey @@ -259,7 +261,7 @@ gets and gets the keytype of the keyblock in .Pp .Fn krb5_auth_getauthenticator Retrieves the authenticator that was used during mutual -authentication. The +authentication. The .Dv authenticator returned should be freed by calling .Fn krb5_free_authenticator . @@ -275,7 +277,7 @@ allocates memory for and zeros the initial vector in the keyblock. .Pp .Fn krb5_auth_con_setivector -sets the i_vector portion of +sets the i_vector portion of .Fa auth_context to .Fa ivector . diff --git a/crypto/heimdal/lib/krb5/krb5_build_principal.3 b/crypto/heimdal/lib/krb5/krb5_build_principal.3 index 80ac5e1..6ff2cf3 100644 --- a/crypto/heimdal/lib/krb5/krb5_build_principal.3 +++ b/crypto/heimdal/lib/krb5/krb5_build_principal.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_build_principal.3,v 1.3 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_build_principal.3,v 1.5 2002/08/28 15:30:47 joda Exp $ .Dd August 8, 1997 .Dt KRB5_BUILD_PRINCIPAL 3 .Os HEIMDAL @@ -10,6 +10,8 @@ .Nm krb5_build_principal_va_ext , .Nm krb5_make_principal .Nd principal creation functions +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -25,7 +27,7 @@ .Sh DESCRIPTION These functions create a Kerberos 5 principal from a realm and a list of components. -All of these functions return an allocated principal in the +All of these functions return an allocated principal in the .Fa principal parameter, this should be freed with .Fn krb5_free_principal @@ -36,22 +38,22 @@ The functions take a .Fa realm and the length of the realm. The -.Fn krb5_build_principal +.Fn krb5_build_principal and .Fn krb5_build_principal_va also takes a list of components (zero-terminated strings), terminated with .Dv NULL . The -.Fn krb5_build_principal_ext -and -.Fn krb5_build_principal_va_ext +.Fn krb5_build_principal_ext +and +.Fn krb5_build_principal_va_ext takes a list of length-value pairs, the list is terminated with a zero length. .Pp -The +The .Fn krb5_make_principal -is a wrapper around +is a wrapper around .Fn krb5_build_principal . If the realm is .Dv NULL , diff --git a/crypto/heimdal/lib/krb5/krb5_config.3 b/crypto/heimdal/lib/krb5/krb5_config.3 index f847436..fe5f261 100644 --- a/crypto/heimdal/lib/krb5/krb5_config.3 +++ b/crypto/heimdal/lib/krb5/krb5_config.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2000 Kungliga Tekniska Högskolan -.\" $Id: krb5_config.3,v 1.2 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_config.3,v 1.4 2002/08/28 15:30:48 joda Exp $ .Dd July 25, 2000 .Dt KRB5_CONFIG 3 .Os HEIMDAL @@ -9,6 +9,8 @@ .Nm krb5_config_get_string_default , .Nm krb5_config_get_time_default .Nd get configuration value +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_boolean @@ -20,8 +22,8 @@ .Ft int .Fn krb5_config_get_time_default "krb5_context context" "krb5_config_section *c" "int def_value" "..." .Sh DESCRIPTION -These functions get values from the -.Xr krb5.conf 5 +These functions get values from the +.Xr krb5.conf 5 configuration file, or another configuration database specified by the .Fa c parameter. @@ -39,11 +41,11 @@ option, defaulting to .Pp .Fn krb5_config_get_bool_default will convert the option value to a boolean value, where -.Sq yes , +.Sq yes , .Sq true , and any non-zero number means .Dv TRUE , -and any other value +and any other value .Dv FALSE . .Pp .Fn krb5_config_get_int_default diff --git a/crypto/heimdal/lib/krb5/krb5_context.3 b/crypto/heimdal/lib/krb5/krb5_context.3 index 9b26797..6794f5a 100644 --- a/crypto/heimdal/lib/krb5/krb5_context.3 +++ b/crypto/heimdal/lib/krb5/krb5_context.3 @@ -1,6 +1,6 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_context.3,v 1.2 2001/06/24 00:52:53 assar Exp $ -.Dd Jan 21, 2001 +.\" $Id: krb5_context.3,v 1.3 2002/08/28 15:30:48 joda Exp $ +.Dd January 21, 2001 .Dt KRB5_CONTEXT 3 .Os HEIMDAL .Sh NAME diff --git a/crypto/heimdal/lib/krb5/krb5_create_checksum.3 b/crypto/heimdal/lib/krb5/krb5_create_checksum.3 index 9472ed6..9a8a27b 100644 --- a/crypto/heimdal/lib/krb5/krb5_create_checksum.3 +++ b/crypto/heimdal/lib/krb5/krb5_create_checksum.3 @@ -1,15 +1,17 @@ .\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $Id: krb5_create_checksum.3,v 1.2 2001/01/26 22:43:21 assar Exp $ +.\" $Id: krb5_create_checksum.3,v 1.4 2002/08/28 15:30:49 joda Exp $ .Dd April 7, 1999 .Dt NAME 3 .Os HEIMDAL .Sh NAME -.Nm krb5_checksum_is_collision_proof , -.Nm krb5_checksum_is_keyed , -.Nm krb5_checksumsize , -.Nm krb5_create_checksum , +.Nm krb5_checksum_is_collision_proof , +.Nm krb5_checksum_is_keyed , +.Nm krb5_checksumsize , +.Nm krb5_create_checksum , .Nm krb5_verify_checksum .Nd creates and verifies checksums +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -22,15 +24,15 @@ .Fn krb5_checksum_is_keyed "krb5_context context" "krb5_cksumtype type" .Sh DESCRIPTION These functions are used to create and verify checksums. -.Fn krb5_create_checksum +.Fn krb5_create_checksum creates a checksum of the specified data, and puts it in .Fa result . If .Fa crypto -is +is .Dv NULL , -.Fa usage_or_type -specifies the checksum type to use; it must not be keyed. Otherwise +.Fa usage_or_type +specifies the checksum type to use; it must not be keyed. Otherwise .Fa crypto is an encryption context created by .Fn krb5_crypto_init , @@ -41,7 +43,7 @@ specifies a key-usage. .Fn krb5_verify_checksum verifies the .Fa checksum , -against the provided data. +against the provided data. .Pp .Fn krb5_checksum_is_collision_proof returns true is the specified checksum is collision proof (that it's @@ -52,7 +54,7 @@ collision proof checksums are MD5, and SHA1, while CRC32 is not. .Fn krb5_checksum_is_keyed returns true if the specified checksum type is keyed (that the hash value is a function of both the data, and a separate key). Examples of -keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The +keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The .Dq plain hash functions MD5, and SHA1 are not keyed. .\" .Sh EXAMPLE diff --git a/crypto/heimdal/lib/krb5/krb5_crypto_init.3 b/crypto/heimdal/lib/krb5/krb5_crypto_init.3 index 7d46567..98e8c5c 100644 --- a/crypto/heimdal/lib/krb5/krb5_crypto_init.3 +++ b/crypto/heimdal/lib/krb5/krb5_crypto_init.3 @@ -1,12 +1,14 @@ .\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $Id: krb5_crypto_init.3,v 1.2 2001/01/26 22:43:22 assar Exp $ +.\" $Id: krb5_crypto_init.3,v 1.4 2002/08/28 15:30:50 joda Exp $ .Dd April 7, 1999 .Dt NAME 3 .Os HEIMDAL .Sh NAME -.Nm krb5_crypto_init , +.Nm krb5_crypto_init , .Nm krb5_crypto_destroy .Nd initialize encryption context +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code diff --git a/crypto/heimdal/lib/krb5/krb5_encrypt.3 b/crypto/heimdal/lib/krb5/krb5_encrypt.3 index aa7196a..9b24588 100644 --- a/crypto/heimdal/lib/krb5/krb5_encrypt.3 +++ b/crypto/heimdal/lib/krb5/krb5_encrypt.3 @@ -1,14 +1,16 @@ .\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $Id: krb5_encrypt.3,v 1.3 2001/07/12 08:42:28 assar Exp $ +.\" $Id: krb5_encrypt.3,v 1.5 2002/08/28 15:30:50 joda Exp $ .Dd April 7, 1999 .Dt KRB5_ENCRYPT 3 .Os HEIMDAL .Sh NAME -.Nm krb5_decrypt , -.Nm krb5_decrypt_EncryptedData , -.Nm krb5_encrypt , +.Nm krb5_decrypt , +.Nm krb5_decrypt_EncryptedData , +.Nm krb5_encrypt , .Nm krb5_encrypt_EncryptedData .Nd encrypt and decrypt data +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -23,23 +25,23 @@ These functions are used to encrypt and decrypt data. .Pp .Fn krb5_encrypt -puts the encrypted version of +puts the encrypted version of .Fa data (of size .Fa len ) in .Fa result . -If the encryption type supports using derived keys, +If the encryption type supports using derived keys, .Fa usage should be the appropriate key-usage. .Fn krb5_encrypt_EncryptedData does the same as .Fn krb5_encrypt , but it puts the encrypted data in a -.Fa EncryptedData -structure instead. If -.Fa kvno -is not zero, it will be put in the +.Fa EncryptedData +structure instead. If +.Fa kvno +is not zero, it will be put in the .Fa kvno field in the .Fa EncryptedData . .Pp diff --git a/crypto/heimdal/lib/krb5/krb5_free_addresses.3 b/crypto/heimdal/lib/krb5/krb5_free_addresses.3 index 8148d94..18e1cda 100644 --- a/crypto/heimdal/lib/krb5/krb5_free_addresses.3 +++ b/crypto/heimdal/lib/krb5/krb5_free_addresses.3 @@ -1,20 +1,22 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_free_addresses.3,v 1.1 2001/11/20 20:50:52 assar Exp $ +.\" $Id: krb5_free_addresses.3,v 1.3 2002/08/28 15:30:51 joda Exp $ .Dd November 20, 2001 .Dt KRB5_FREE_ADDRESSES 3 .Os HEIMDAL .Sh NAME .Nm krb5_free_addresses .Nd free list of addresses +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft void .Fn krb5_free_addresses "krb5_context context" "krb5_addresses *addresses" .Sh DESCRIPTION -The +The .Fn krb5_free_addresses will free a list of addresses that has been created with .Fn krb5_get_all_client_addrs -or with some other function. +or with some other function. .Sh SEE ALSO .Xr krb5_get_all_client_addrs 3 diff --git a/crypto/heimdal/lib/krb5/krb5_free_principal.3 b/crypto/heimdal/lib/krb5/krb5_free_principal.3 index 110c802..f9c006c 100644 --- a/crypto/heimdal/lib/krb5/krb5_free_principal.3 +++ b/crypto/heimdal/lib/krb5/krb5_free_principal.3 @@ -1,22 +1,24 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_free_principal.3,v 1.3 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_free_principal.3,v 1.5 2002/08/28 15:30:52 joda Exp $ .Dd August 8, 1997 .Dt KRB5_FREE_PRINCIPAL 3 .Os HEIMDAL .Sh NAME .Nm krb5_free_principal .Nd principal free function +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft void .Fn krb5_free_principal "krb5_context context" "krb5_principal principal" .Sh DESCRIPTION -The +The .Fn krb5_free_principal will free a principal that has been created with .Fn krb5_build_principal , .Fn krb5_parse_name , -or with some other function. +or with some other function. .Sh SEE ALSO .Xr krb5_425_conv_principal 3 , .Xr krb5_build_principal 3 , diff --git a/crypto/heimdal/lib/krb5/krb5_get_all_client_addrs.3 b/crypto/heimdal/lib/krb5/krb5_get_all_client_addrs.3 index eb1ac4b..1821298 100644 --- a/crypto/heimdal/lib/krb5/krb5_get_all_client_addrs.3 +++ b/crypto/heimdal/lib/krb5/krb5_get_all_client_addrs.3 @@ -1,18 +1,20 @@ -.\" $Id: krb5_get_all_client_addrs.3,v 1.2 2001/11/09 09:33:52 joda Exp $ +.\" $Id: krb5_get_all_client_addrs.3,v 1.4 2002/08/28 15:30:52 joda Exp $ .Dd July 1, 2001 .Dt KRB5_GET_ADDRS 3 .Sh NAME .Nm krb5_get_all_client_addrs , .Nm krb5_get_all_server_addrs .Nd return local addresses +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft "krb5_error_code" -.Fn krb5_get_all_client_addrs "krb5_context context" "krb5_addresses *addrs" +.Fn krb5_get_all_client_addrs "krb5_context context" "krb5_addresses *addrs" .Ft "krb5_error_code" -.Fn krb5_get_all_server_addrs "krb5_context context" "krb5_addresses *addrs" +.Fn krb5_get_all_server_addrs "krb5_context context" "krb5_addresses *addrs" .Sh DESCRIPTION -These functions return in +These functions return in .Fa addrs a list of addresses associated with the local host. @@ -24,15 +26,15 @@ to create sockets to listen to. The client version will also scan local interfaces (can be turned off by setting .Li libdefaults/scan_interfaces -to false in -.Pa krb5.conf ) , +to false in +.Pa krb5.conf ) , but will not include loop-back addresses, unless there are no other addresses found. It will remove all addresses included in .Li libdefaults/ignore_addresses but will unconditionally include addresses in .Li libdefaults/extra_addresses . .Pp -The returned addresses should be freed by calling +The returned addresses should be freed by calling .Fn krb5_free_addresses . .\".Sh EXAMPLE .Sh SEE ALSO diff --git a/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 b/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 index f1918a8..fcdc8e1 100644 --- a/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 +++ b/crypto/heimdal/lib/krb5/krb5_get_krbhst.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_get_krbhst.3,v 1.2 2001/11/09 09:34:46 joda Exp $ +.\" $Id: krb5_get_krbhst.3,v 1.4 2002/08/28 15:30:53 joda Exp $ .Dd June 17, 2001 .Dt KRB5_GET_KRBHST 3 .Os HEIMDAL @@ -10,9 +10,10 @@ .Nm krb5_get_krb524hst .Nm krb5_free_krbhst .Nd lookup Kerberos KDC hosts +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> - .Ft krb5_error_code .Fn krb5_get_krbhst "krb5_context context" "const krb5_realm *realm" "char ***hostlist" .Ft krb5_error_code @@ -26,21 +27,21 @@ .Sh DESCRIPTION These functions implement the old API to get a list of Kerberos hosts, and are thus similar to the -.Fn krb5_krbhst_init -functions. However, since these functions returns +.Fn krb5_krbhst_init +functions. However, since these functions returns .Em all hosts in one go, they potentially have to do more lookups than necessary. These functions remain for compatibility reasons. .Pp After a call to one of these functions, -.Fa hostlist +.Fa hostlist is a .Dv NULL terminated list of strings, pointing to the requested Kerberos hosts. These should be freed with -.Fn krb5_free_krbhst +.Fn krb5_free_krbhst when done with. .Sh EXAMPLE -The following code will print the KDCs of the realm +The following code will print the KDCs of the realm .Dq MY.REALM . .Bd -literal -offset indent char **hosts, **p; diff --git a/crypto/heimdal/lib/krb5/krb5_init_context.3 b/crypto/heimdal/lib/krb5/krb5_init_context.3 index 7a7741f..e59b0d0 100644 --- a/crypto/heimdal/lib/krb5/krb5_init_context.3 +++ b/crypto/heimdal/lib/krb5/krb5_init_context.3 @@ -1,12 +1,14 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_init_context.3,v 1.4 2001/07/12 08:42:28 assar Exp $ -.Dd Jan 21, 2001 +.\" $Id: krb5_init_context.3,v 1.5 2002/08/28 15:30:53 joda Exp $ +.Dd January 21, 2001 .Dt KRB5_CONTEXT 3 .Os HEIMDAL .Sh NAME .Nm krb5_init_context , .Nm krb5_free_context .Nd create and delete krb5_context structures +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code diff --git a/crypto/heimdal/lib/krb5/krb5_keytab.3 b/crypto/heimdal/lib/krb5/krb5_keytab.3 index 9aa9fff..9c7eacd 100644 --- a/crypto/heimdal/lib/krb5/krb5_keytab.3 +++ b/crypto/heimdal/lib/krb5/krb5_keytab.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_keytab.3,v 1.3 2001/11/09 09:35:45 joda Exp $ +.\" $Id: krb5_keytab.3,v 1.5 2002/08/28 15:30:54 joda Exp $ .Dd February 5, 2001 .Dt KRB5_KEYTAB 3 .Os HEIMDAL @@ -24,6 +24,8 @@ .Nm krb5_kt_resolve , .Nm krb5_kt_start_seq_get .Nd manage keytab (key storage) files +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Pp @@ -142,7 +144,7 @@ the default keytab is used. The current default type is .Nm file . The default value can be changed in the configuration file .Pa /etc/krb5.conf -by setting the variable +by setting the variable .Li [defaults]default_keytab_name . .Pp The keytab types that are implemented in Heimdal @@ -154,7 +156,7 @@ store the keytab in a file, the type's name is The residual part is a filename. .It Nm keyfile store the keytab in a -.Li AFS +.Li AFS keyfile (usually .Pa /usr/afs/etc/KeyFile ) , the type's name is @@ -182,7 +184,7 @@ key-type, key, key-version number, etc. .Nm krb5_kt_cursor holds the current position that is used when iterating through a keytab entry with -.Fn krb5_kt_start_seq_get , +.Fn krb5_kt_start_seq_get , .Fn krb5_kt_next_entry , and .Fn krb5_kt_end_seq_get . @@ -195,19 +197,19 @@ implementation. .Fn krb5_kt_resolve is the equvalent of an .Xr open 2 -on keytab. Resolve the keytab name in +on keytab. Resolve the keytab name in .Fa name -into a keytab in +into a keytab in .Fa id . Returns 0 or an error. The opposite of -.Fn krb5_kt_resolve -is +.Fn krb5_kt_resolve +is .Fn krb5_kt_close . .Fn krb5_kt_close frees all resources allocated to the keytab. .Pp .Fn krb5_kt_default -sets the argument +sets the argument .Fa id to the default keytab. Returns 0 or an error. @@ -215,27 +217,27 @@ Returns 0 or an error. .Fn krb5_kt_default_name copy the name of the default keytab into .Fa name . -Return 0 or KRB5_CONFIG_NOTENUFSPACE if +Return 0 or KRB5_CONFIG_NOTENUFSPACE if .Fa namesize is too short. .Pp .Fn krb5_kt_add_entry Add a new .Fa entry -to the keytab +to the keytab .Fa id . .Li KRB5_KT_NOWRITE is returned if the keytab is a readonly keytab. .Pp .Fn krb5_kt_compare -compares the passed in +compares the passed in .Fa entry against .Fa principal , .Fa vno , and .Fa enctype . -Any of +Any of .Fa principal , .Fa vno or @@ -244,52 +246,52 @@ might be 0 which acts as a wildcard. Return TRUE if they compare the same, FALSE otherwise. .Pp .Fn krb5_kt_copy_entry_contents -copies the contents of +copies the contents of .Fa in -into +into .Fa out . Returns 0 or an error. .Pp .Fn krb5_kt_get_name -retrieves the name of the keytab +retrieves the name of the keytab .Fa keytab -into +into .Fa name , .Fa namesize . Returns 0 or an error. .Pp .Fn krb5_kt_free_entry -frees the contents of +frees the contents of .Fa entry . .Pp .Fn krb5_kt_start_seq_get sets .Fa cursor -to point at the beginning of +to point at the beginning of .Fa id . Returns 0 or an error. .Pp .Fn krb5_kt_next_entry -gets the next entry from +gets the next entry from .Fa id -pointed to by +pointed to by .Fa cursor and advance the .Fa cursor . Returns 0 or an error. .Pp .Fn krb5_kt_end_seq_get -releases all resources associated with +releases all resources associated with .Fa cursor . .Pp .Fn krb5_kt_get_entry -retrieves the keytab entry for +retrieves the keytab entry for .Fa principal , -.Fa kvno, +.Fa kvno, .Fa enctype -into +into .Fa entry -from the keytab +from the keytab .Fa id . Returns 0 or an error. .Pp @@ -298,16 +300,16 @@ reads the key identified by .Ns ( Fa principal , .Fa vno , .Fa enctype ) -from the keytab in +from the keytab in .Fa keyprocarg -(the default if == NULL) into +(the default if == NULL) into .Fa *key . Returns 0 or an error. .Pp .Fn krb5_kt_remove_entry -removes the entry +removes the entry .Fa entry -from the keytab +from the keytab .Fa id . Returns 0 or an error. .Pp @@ -332,14 +334,14 @@ main (int argc, char **argv) if (krb5_init_context (&context) != 0) errx(1, "krb5_context"); - + ret = krb5_kt_default (context, &keytab); if (ret) krb5_err(context, 1, ret, "krb5_kt_default"); ret = krb5_kt_start_seq_get(context, keytab, &cursor); if (ret) - krb5_err(context, 1, ret, "krb5_kt_start_seq_get"); + krb5_err(context, 1, ret, "krb5_kt_start_seq_get"); while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0){ krb5_unparse_name_short(context, entry.principal, &principal); printf("principal: %s\\n", principal); @@ -348,7 +350,7 @@ main (int argc, char **argv) } ret = krb5_kt_end_seq_get(context, keytab, &cursor); if (ret) - krb5_err(context, 1, ret, "krb5_kt_end_seq_get"); + krb5_err(context, 1, ret, "krb5_kt_end_seq_get"); krb5_free_context(context); return 0; } diff --git a/crypto/heimdal/lib/krb5/krb5_krbhst_init.3 b/crypto/heimdal/lib/krb5/krb5_krbhst_init.3 index 109c64c..6bcf07f 100644 --- a/crypto/heimdal/lib/krb5/krb5_krbhst_init.3 +++ b/crypto/heimdal/lib/krb5/krb5_krbhst_init.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_krbhst_init.3,v 1.3 2001/11/09 09:36:24 joda Exp $ +.\" $Id: krb5_krbhst_init.3,v 1.5 2002/08/28 15:30:54 joda Exp $ .Dd June 17, 2001 .Dt KRB5_KRBHST_INIT 3 .Os HEIMDAL @@ -12,9 +12,10 @@ .Nm krb5_krbhst_format_string , .Nm krb5_krbhst_get_addrinfo .Nd lookup Kerberos KDC hosts +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> - .Ft krb5_error_code .Fn krb5_krbhst_init "krb5_context context" "const char *realm" "unsigned int type" "krb5_krbhst_handle *handle" .Ft krb5_error_code @@ -36,10 +37,10 @@ administrative servers, the password changing servers, or the servers for Kerberos 4 ticket conversion. .Pp First a handle to a particular service is obtained by calling -.Fn krb5_krbhst_init -with the +.Fn krb5_krbhst_init +with the .Fa realm -of interest and the type of service to lookup. The +of interest and the type of service to lookup. The .Fa type can be one of: .Pp @@ -55,7 +56,7 @@ The is returned to the caller, and should be passed to the other functions. .Pp -For each call to +For each call to .Fn krb5_krbhst_next information a new host is returned. The former function returns in .Fa host @@ -73,7 +74,7 @@ typedef struct krb5_krbhst_info { } krb5_krbhst_info; .Ed .Pp -The related function, +The related function, .Fn krb5_krbhst_next_as_string , return the same information as a url-like string. .Pp @@ -82,11 +83,11 @@ When there are no more hosts, these functions return .Pp To re-iterate over all hosts, call .Fn krb5_krbhst_reset -and the next call to +and the next call to .Fn krb5_krbhst_next will return the first host. .Pp -When done with the handle, +When done with the handle, .Fn krb5_krbhst_free should be called. .Pp @@ -101,13 +102,13 @@ that will return a .Va struct addrinfo that can then be used for communicating with the server mentioned. .Sh EXAMPLE -The following code will print the KDCs of the realm +The following code will print the KDCs of the realm .Dq MY.REALM . .Bd -literal -offset indent krb5_krbhst_handle handle; char host[MAXHOSTNAMELEN]; krb5_krbhst_init(context, "MY.REALM", KRB5_KRBHST_KDC, &handle); -while(krb5_krbhst_next_as_string(context, handle, +while(krb5_krbhst_next_as_string(context, handle, host, sizeof(host)) == 0) printf("%s\\n", host); krb5_krbhst_free(context, handle); diff --git a/crypto/heimdal/lib/krb5/krb5_locl.h b/crypto/heimdal/lib/krb5/krb5_locl.h index 2ac70f2..fceeaed 100644 --- a/crypto/heimdal/lib/krb5/krb5_locl.h +++ b/crypto/heimdal/lib/krb5/krb5_locl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: krb5_locl.h,v 1.67 2001/08/22 20:30:30 assar Exp $ */ +/* $Id: krb5_locl.h,v 1.69 2002/08/12 15:09:19 joda Exp $ */ #ifndef __KRB5_LOCL_H__ #define __KRB5_LOCL_H__ @@ -105,6 +105,9 @@ struct sockaddr_dl; #ifdef HAVE_SYS_FILIO_H #include <sys/filio.h> #endif +#ifdef HAVE_SYS_FILE_H +#include <sys/file.h> +#endif #include <roken.h> #include <parse_time.h> #include <base64.h> @@ -135,8 +138,8 @@ struct sockaddr_dl; #define ALLOC_SEQ(X, N) do { (X)->len = (N); ALLOC((X)->val, (N)); } while(0) /* should this be public? */ -#define KEYTAB_DEFAULT "ANY:FILE:/etc/krb5.keytab,krb4:/etc/srvtab" -#define KEYTAB_DEFAULT_MODIFY "FILE:/etc/krb5.keytab" +#define KEYTAB_DEFAULT "ANY:FILE:" SYSCONFDIR "/krb5.keytab,krb4:" SYSCONFDIR "/srvtab" +#define KEYTAB_DEFAULT_MODIFY "FILE:" SYSCONFDIR "/krb5.keytab" #ifndef O_BINARY #define O_BINARY 0 diff --git a/crypto/heimdal/lib/krb5/krb5_openlog.3 b/crypto/heimdal/lib/krb5/krb5_openlog.3 index 5576475..8ed94fc 100644 --- a/crypto/heimdal/lib/krb5/krb5_openlog.3 +++ b/crypto/heimdal/lib/krb5/krb5_openlog.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_openlog.3,v 1.5 2001/01/26 22:43:22 assar Exp $ +.\" $Id: krb5_openlog.3,v 1.7 2002/08/28 15:30:55 joda Exp $ .Dd August 6, 1997 .Dt KRB5_OPENLOG 3 .Os HEIMDAL @@ -12,14 +12,16 @@ .Nm krb5_log , .Nm krb5_vlog , .Nm krb5_log_msg , -.Nm krb5_vlog_msg +.Nm krb5_vlog_msg .Nd Heimdal logging functions +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft "typedef void" -.Fn "\*(lp*krb5_log_log_func_t\*(rp" "const char *time" "const char *message" "void *data" +.Fn "\*(lp*krb5_log_log_func_t\*(rp" "const char *time" "const char *message" "void *data" .Ft "typedef void" -.Fn "\*(lp*krb5_log_close_func_t\*(rp" "void *data" +.Fn "\*(lp*krb5_log_close_func_t\*(rp" "void *data" .Ft krb5_error_code .Fn krb5_addlog_dest "krb5_context context" "krb5_log_facility *facility" "const char *destination" .Ft krb5_error_code @@ -43,7 +45,7 @@ These functions logs messages to one or more destinations. .Pp The .Fn krb5_openlog -function creates a logging +function creates a logging .Fa facility , that is used to log messages. A facility consists of one or more destinations (which can be files or syslog or some other device). The @@ -59,7 +61,7 @@ configuration file. If no entry is found for the entry for .Li default is used, or if that is missing too, -.Li SYSLOG +.Li SYSLOG will be used as destination. .Pp To close a logging facility, use the @@ -72,7 +74,7 @@ To log a message to a facility use one of the functions .Fn krb5_vlog , or .Fn krb5_vlog_msg . -The functions ending in +The functions ending in .Li _msg return in .Fa reply @@ -81,45 +83,45 @@ and should be freed with .Fn free . The .Fa format -is a standard +is a standard .Fn printf style format string (but see the BUGS section). .Pp -If you want better control of where things gets logged, you can instead of using +If you want better control of where things gets logged, you can instead of using .Fn krb5_openlog -call +call .Fn krb5_initlog , which just initializes a facility, but doesn't define any actual logging destinations. You can then add destinations with the .Fn krb5_addlog_dest and -.Fn krb5_addlog_func +.Fn krb5_addlog_func functions. The first of these takes a string specifying a logging destination, and adds this to the facility. If you want to do some non-standard logging you can use the .Fn krb5_addlog_func function, which takes a function to use when logging. -The +The .Fa log function is called for each message with .Fa time being a string specifying the current time, and .Fa message -the message to log. +the message to log. .Fa close -is called when the facility is closed. You can pass application specific data in the -.Fa data +is called when the facility is closed. You can pass application specific data in the +.Fa data parameter. The .Fa min -and +and .Fa max parameter are the same as in a destination (defined below). To specify a max of infinity, pass -1. .Pp .Fn krb5_openlog -calls +calls .Fn krb5_initlog -and then calls +and then calls .Fn krb5_addlog_dest for each destination found. .Ss Destinations @@ -148,9 +150,9 @@ get the name for one of these, you take the name of the macro passed to .Xr syslog 3 , and remove the leading -.Li LOG_ +.Li LOG_ .No ( Li LOG_NOTICE -becomes +becomes .Li NOTICE ) . The default values (as well as the values used for unrecognised values), are @@ -182,8 +184,8 @@ specified value. If no range is specified, all messages gets logged. default = STDERR .Ed .Pp -This will log all messages from the -.Nm kdc +This will log all messages from the +.Nm kdc program with level 0 to .Pa /var/log/kdc.log , other messages will be logged to syslog with priority diff --git a/crypto/heimdal/lib/krb5/krb5_parse_name.3 b/crypto/heimdal/lib/krb5/krb5_parse_name.3 index c4f5acd..1491117 100644 --- a/crypto/heimdal/lib/krb5/krb5_parse_name.3 +++ b/crypto/heimdal/lib/krb5/krb5_parse_name.3 @@ -1,11 +1,13 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_parse_name.3,v 1.3 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_parse_name.3,v 1.5 2002/08/28 15:30:55 joda Exp $ .Dd August 8, 1997 .Dt KRB5_PARSE_NAME 3 .Os HEIMDAL .Sh NAME .Nm krb5_parse_name .Nd string to principal conversion +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -15,12 +17,12 @@ converts a string representation of a princpal name to .Nm krb5_principal . The -.Fa principal +.Fa principal will point to allocated data that should be freed with .Fn krb5_free_principal . .Pp The string should consist of one or more name components separated with slashes -.Pq Dq / , +.Pq Dq / , optionally followed with an .Dq @ and a realm name. A slash or @ may be contained in a name component by diff --git a/crypto/heimdal/lib/krb5/krb5_principal_get_realm.3 b/crypto/heimdal/lib/krb5/krb5_principal_get_realm.3 index 07bffa4..bd02ce6 100644 --- a/crypto/heimdal/lib/krb5/krb5_principal_get_realm.3 +++ b/crypto/heimdal/lib/krb5/krb5_principal_get_realm.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_principal_get_realm.3,v 1.2 2001/11/09 09:36:51 joda Exp $ +.\" $Id: krb5_principal_get_realm.3,v 1.4 2002/08/28 15:30:56 joda Exp $ .Dd June 20, 2001 .Dt KRB5_PRINCIPAL_GET_REALM 3 .Os HEIMDAL @@ -7,6 +7,8 @@ .Nm krb5_principal_get_realm , .Nm krb5_principal_get_comp_string .Nd decompose a principal +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft "const char *" @@ -20,24 +22,24 @@ either the realm or a specific component. The returned string points to data inside the principal, so they are valid only as long as the principal exists. .Pp -The +The .Fa component argument to .Fn krb5_principal_get_comp_string is the component number to return, from zero to the total number of -components minus one. If a the requested component number is out of range, +components minus one. If a the requested component number is out of range, .Dv NULL is returned. .Pp -These functions can be seen as a replacement for the +These functions can be seen as a replacement for the .Fn krb5_princ_realm , .Fn krb5_princ_component and related macros, described as intermal in the MIT API specification. A difference is that these functions return strings, not .Dv krb5_data . -A reason to return -.Dv krb5_data +A reason to return +.Dv krb5_data was that it was believed that principal components could contain binary data, but this belief was unfounded, and it has been decided that principal components are infact UTF8, so it's safe to use zero diff --git a/crypto/heimdal/lib/krb5/krb5_sname_to_principal.3 b/crypto/heimdal/lib/krb5/krb5_sname_to_principal.3 index 1dee7de..f5fff5f 100644 --- a/crypto/heimdal/lib/krb5/krb5_sname_to_principal.3 +++ b/crypto/heimdal/lib/krb5/krb5_sname_to_principal.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_sname_to_principal.3,v 1.3 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_sname_to_principal.3,v 1.5 2002/08/28 15:30:56 joda Exp $ .Dd August 8, 1997 .Dt KRB5_PRINCIPAL 3 .Os HEIMDAL @@ -7,6 +7,8 @@ .Nm krb5_sname_to_principal , .Nm krb5_sock_to_principal .Nd create a service principal +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -14,30 +16,30 @@ .Ft krb5_error_code .Fn krb5_sock_to_principal "krb5_context context" "int socket" "const char *sname" "int32_t type" "krb5_principal *principal" .Sh DESCRIPTION -These functions create a +These functions create a .Dq service principal that can, for instance, be used to lookup a key in a keytab. For both these function the -.Fa sname -parameter will be used for the first component of the created principal. If +.Fa sname +parameter will be used for the first component of the created principal. If .Fa sname is .Dv NULL , .Dq host will be used instead. -.Fn krb5_sname_to_principal -will use the passed +.Fn krb5_sname_to_principal +will use the passed .Fa hostname -for the second component. If type +for the second component. If type .Dv KRB5_NT_SRV_HST this name will be looked up with .Fn gethostbyname . -If +If .Fa hostname is .Dv NULL , the local hostname will be used. .Pp -.Fn krb5_sock_to_principal -will use the +.Fn krb5_sock_to_principal +will use the .Dq sockname of the passed .Fa socket , diff --git a/crypto/heimdal/lib/krb5/krb5_timeofday.3 b/crypto/heimdal/lib/krb5/krb5_timeofday.3 index 7b06175..b0e4b52 100644 --- a/crypto/heimdal/lib/krb5/krb5_timeofday.3 +++ b/crypto/heimdal/lib/krb5/krb5_timeofday.3 @@ -1,16 +1,18 @@ -.\" $Id: krb5_timeofday.3,v 1.1 2001/07/02 22:32:03 joda Exp $ +.\" $Id: krb5_timeofday.3,v 1.3 2002/08/28 15:30:57 joda Exp $ .Dd July 1, 2001 .Dt KRB5_TIMEOFDAY 3 .Sh NAME .Nm krb5_timeofday , .Nm krb5_us_timeofday .Nd whatever these functions do +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft "krb5_error_code" -.Fn krb5_timeofday "krb5_context context" "krb5_timestamp *timeret" +.Fn krb5_timeofday "krb5_context context" "krb5_timestamp *timeret" .Ft "krb5_error_code" -.Fn krb5_us_timeofday "krb5_context context" "int32_t *sec" "int32_t *usec" +.Fn krb5_us_timeofday "krb5_context context" "int32_t *sec" "int32_t *usec" .Sh DESCRIPTION .Fn krb5_timeofday returns the current time, but adjusted with the time difference diff --git a/crypto/heimdal/lib/krb5/krb5_unparse_name.3 b/crypto/heimdal/lib/krb5/krb5_unparse_name.3 index 08409ae..0eee63b 100644 --- a/crypto/heimdal/lib/krb5/krb5_unparse_name.3 +++ b/crypto/heimdal/lib/krb5/krb5_unparse_name.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_unparse_name.3,v 1.3 2001/05/02 08:59:23 assar Exp $ +.\" $Id: krb5_unparse_name.3,v 1.5 2002/08/28 15:30:57 joda Exp $ .Dd August 8, 1997 .Dt KRB5_UNPARSE_NAME 3 .Os HEIMDAL @@ -7,6 +7,8 @@ .Nm krb5_unparse_name .\" .Nm krb5_unparse_name_ext .Nd principal to string conversion +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -18,7 +20,7 @@ This function takes a .Fa principal , and will convert in to a printable representation with the same syntax as decribed in .Xr krb5_parse_name 3 . -.Fa *name +.Fa *name will point to allocated data and should be freed by the caller. .Sh SEE ALSO .Xr krb5_425_conv_principal 3 , diff --git a/crypto/heimdal/lib/krb5/krb5_verify_user.3 b/crypto/heimdal/lib/krb5/krb5_verify_user.3 index 5338550..0e9b108 100644 --- a/crypto/heimdal/lib/krb5/krb5_verify_user.3 +++ b/crypto/heimdal/lib/krb5/krb5_verify_user.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2001 Kungliga Tekniska Högskolan -.\" $Id: krb5_verify_user.3,v 1.2 2001/11/09 09:38:29 joda Exp $ +.\" $Id: krb5_verify_user.3,v 1.5 2002/08/28 15:30:58 joda Exp $ .Dd June 27, 2001 .Dt KRB5_VERIFY_USER 3 .Os HEIMDAL @@ -7,6 +7,8 @@ .Nm krb5_verify_user , .Nm krb5_verify_user_lrealm .Nd Heimdal password verifying functions +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -16,7 +18,7 @@ .Sh DESCRIPTION The .Nm krb5_verify_user -function verifies the password supplied by a user. +function verifies the password supplied by a user. The principal whose password will be verified is specified in .Fa principal . @@ -44,6 +46,10 @@ function does the same, except that it ignores the realm in .Fa principal and tries all the local realms (see .Xr krb5.conf 5 ) . +After a successful return, the principal is set to the authenticated +realm. If the call fails, the principal will not be meaningful, and +should only be freed with +.Xr krb5_free_principal 3 . .Sh EXAMPLE Here is a example program that verifies a password. it uses the .Ql host/`hostname` @@ -74,12 +80,13 @@ main(int argc, char **argv) error = krb5_verify_user(context, princ, NULL, NULL, TRUE, NULL); if (error) krb5_err(context, 1, error, "krb5_verify_user"); - + return 0; } .Ed .Sh SEE ALSO .Xr krb5_err 3 , +.Xr krb5_free_principal 3 , .Xr krb5_init_context 3 , .Xr krb5_kt_default 3 , .Xr krb5.conf 5 diff --git a/crypto/heimdal/lib/krb5/krb5_warn.3 b/crypto/heimdal/lib/krb5/krb5_warn.3 index ae3a330..0a1302a 100644 --- a/crypto/heimdal/lib/krb5/krb5_warn.3 +++ b/crypto/heimdal/lib/krb5/krb5_warn.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1997 Kungliga Tekniska Högskolan -.\" $Id: krb5_warn.3,v 1.3 2001/01/26 22:43:23 assar Exp $ +.\" $Id: krb5_warn.3,v 1.5 2002/08/28 15:30:59 joda Exp $ .Dd August 8, 1997 .Dt KRB5_WARN 3 .Os HEIMDAL @@ -14,6 +14,8 @@ .Nm krb5_verrx , .Nm krb5_set_warn_dest .Nd Heimdal warning and error functions +.Sh LIBRARY +Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .Fd #include <krb5.h> .Ft krb5_error_code @@ -40,7 +42,7 @@ These functions prints a warning message to some destination. is a printf style format specifying the message to print. The forms not ending in an .Dq x prints the error string associated with -.Fa code +.Fa code along with the message. The .Dq err @@ -50,7 +52,7 @@ after printing the message. .Pp The .Fn krb5_set_warn_func -function sets the destination for warning messages to the specified +function sets the destination for warning messages to the specified .Fa facility . Messages logged with the .Dq warn diff --git a/crypto/heimdal/lib/krb5/krbhst-test.c b/crypto/heimdal/lib/krb5/krbhst-test.c index de858ee..bf98104 100644 --- a/crypto/heimdal/lib/krb5/krbhst-test.c +++ b/crypto/heimdal/lib/krb5/krbhst-test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 Kungliga Tekniska Högskolan + * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,30 @@ #include "krb5_locl.h" -RCSID("$Id: krbhst-test.c,v 1.2 2001/06/17 12:22:59 assar Exp $"); +#include <err.h> +#include <getarg.h> + +RCSID("$Id: krbhst-test.c,v 1.3 2002/08/23 03:43:18 assar Exp $"); + +static int version_flag = 0; +static int help_flag = 0; + +static struct getargs args[] = { + {"version", 0, arg_flag, &version_flag, + "print version", NULL }, + {"help", 0, arg_flag, &help_flag, + NULL, NULL } +}; + +static void +usage (int ret) +{ + arg_printusage (args, + sizeof(args)/sizeof(*args), + NULL, + "[realms ...]"); + exit (ret); +} int main(int argc, char **argv) @@ -43,9 +66,26 @@ main(int argc, char **argv) int types[] = {KRB5_KRBHST_KDC, KRB5_KRBHST_ADMIN, KRB5_KRBHST_CHANGEPW, KRB5_KRBHST_KRB524}; const char *type_str[] = {"kdc", "admin", "changepw", "krb524"}; + int optind = 0; + setprogname (argv[0]); + + if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)) + usage(1); + + if (help_flag) + usage (0); + + if(version_flag){ + print_version(NULL); + exit(0); + } + + argc -= optind; + argv += optind; + krb5_init_context (&context); - for(i = 1; i < argc; i++) { + for(i = 0; i < argc; i++) { krb5_krbhst_handle handle; char host[MAXHOSTNAMELEN]; diff --git a/crypto/heimdal/lib/krb5/krbhst.c b/crypto/heimdal/lib/krb5/krbhst.c index e869c62..8ffa6df 100644 --- a/crypto/heimdal/lib/krb5/krbhst.c +++ b/crypto/heimdal/lib/krb5/krbhst.c @@ -34,7 +34,7 @@ #include "krb5_locl.h" #include <resolve.h> -RCSID("$Id: krbhst.c,v 1.40 2001/07/19 16:57:15 assar Exp $"); +RCSID("$Id: krbhst.c,v 1.41 2002/08/16 18:48:19 nectar Exp $"); static int string_to_proto(const char *string) @@ -514,6 +514,8 @@ kpasswd_get_next(krb5_context context, struct krb5_krbhst_data *kd, krb5_krbhst_info **host) { + krb5_error_code ret; + if((kd->flags & KD_CONFIG) == 0) { config_get_hosts(context, kd, "kpasswd_server"); if(get_next(kd, host)) @@ -538,7 +540,10 @@ kpasswd_get_next(krb5_context context, kd->flags = 0; kd->port = kd->def_port; kd->get_next = admin_get_next; - return (*kd->get_next)(context, kd, host); + ret = (*kd->get_next)(context, kd, host); + if (ret == 0) + (*host)->proto = KRB5_KRBHST_UDP; + return ret; } return KRB5_KDC_UNREACH; /* XXX */ diff --git a/crypto/heimdal/lib/krb5/log.c b/crypto/heimdal/lib/krb5/log.c index 64f2b84..ecdb753 100644 --- a/crypto/heimdal/lib/krb5/log.c +++ b/crypto/heimdal/lib/krb5/log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2000, 2002 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: log.c,v 1.27 2002/02/04 10:48:33 joda Exp $"); +RCSID("$Id: log.c,v 1.30 2002/08/20 09:49:09 joda Exp $"); struct facility { int min; @@ -57,7 +57,7 @@ log_realloc(krb5_log_facility *f) } struct s2i { - char *s; + const char *s; int val; }; @@ -157,7 +157,7 @@ krb5_addlog_func(krb5_context context, } -struct syslog_data{ +struct _heimdal_syslog_data{ int priority; }; @@ -167,7 +167,7 @@ log_syslog(const char *time, void *data) { - struct syslog_data *s = data; + struct _heimdal_syslog_data *s = data; syslog(s->priority, "%s", msg); } @@ -183,7 +183,7 @@ open_syslog(krb5_context context, krb5_log_facility *facility, int min, int max, const char *sev, const char *fac) { - struct syslog_data *sd = malloc(sizeof(*sd)); + struct _heimdal_syslog_data *sd = malloc(sizeof(*sd)); int i; if(sd == NULL) { @@ -204,8 +204,8 @@ open_syslog(krb5_context context, } struct file_data{ - char *filename; - char *mode; + const char *filename; + const char *mode; FILE *fd; int keep_open; }; @@ -236,7 +236,7 @@ close_file(void *data) static krb5_error_code open_file(krb5_context context, krb5_log_facility *fac, int min, int max, - char *filename, char *mode, FILE *f, int keep_open) + const char *filename, const char *mode, FILE *f, int keep_open) { struct file_data *fd = malloc(sizeof(*fd)); if(fd == NULL) { @@ -315,15 +315,18 @@ krb5_addlog_dest(krb5_context context, krb5_log_facility *f, const char *orig) ret = open_file(context, f, min, max, fn, "a", file, keep_open); }else if(strncmp(p, "DEVICE=", 6) == 0){ ret = open_file(context, f, min, max, strdup(p + 7), "w", NULL, 0); - }else if(strncmp(p, "SYSLOG", 6) == 0){ - char *severity; - char *facility; - severity = strchr(p, ':'); - if(severity == NULL) - severity = "ERR"; - facility = strchr(severity, ':'); - if(facility == NULL) - facility = "AUTH"; + }else if(strncmp(p, "SYSLOG", 6) == 0 && (p[6] == '\0' || p[6] == ':')){ + char severity[128] = ""; + char facility[128] = ""; + p += 6; + if(*p != '\0') + p++; + if(strsep_copy(&p, ":", severity, sizeof(severity)) != -1) + strsep_copy(&p, ":", facility, sizeof(facility)); + if(*severity == '\0') + strlcpy(severity, "ERR", sizeof(severity)); + if(*facility == '\0') + strlcpy(facility, "AUTH", sizeof(facility)); ret = open_syslog(context, f, min, max, severity, facility); }else{ krb5_set_error_string (context, "unknown log type: %s", p); diff --git a/crypto/heimdal/lib/krb5/mcache.c b/crypto/heimdal/lib/krb5/mcache.c index fb75cce..63b45bb 100644 --- a/crypto/heimdal/lib/krb5/mcache.c +++ b/crypto/heimdal/lib/krb5/mcache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: mcache.c,v 1.14 2001/06/17 23:13:02 assar Exp $"); +RCSID("$Id: mcache.c,v 1.15 2002/04/18 09:40:33 joda Exp $"); typedef struct krb5_mcache { char *name; @@ -54,7 +54,7 @@ static struct krb5_mcache *mcc_head; #define MCC_CURSOR(C) ((struct link*)(C)) -static char* +static const char* mcc_get_name(krb5_context context, krb5_ccache id) { diff --git a/crypto/heimdal/lib/krb5/mk_error.c b/crypto/heimdal/lib/krb5/mk_error.c index 0015f45..249f478 100644 --- a/crypto/heimdal/lib/krb5/mk_error.c +++ b/crypto/heimdal/lib/krb5/mk_error.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: mk_error.c,v 1.16 2001/05/14 06:14:49 assar Exp $"); +RCSID("$Id: mk_error.c,v 1.17 2002/03/27 09:29:43 joda Exp $"); krb5_error_code krb5_mk_error(krb5_context context, @@ -42,8 +42,8 @@ krb5_mk_error(krb5_context context, const krb5_data *e_data, const krb5_principal client, const krb5_principal server, - time_t *ctime, - int *cusec, + time_t *client_time, + int *client_usec, krb5_data *reply) { KRB_ERROR msg; @@ -60,8 +60,8 @@ krb5_mk_error(krb5_context context, msg.msg_type = krb_error; msg.stime = sec; msg.susec = usec; - msg.ctime = ctime; - msg.cusec = cusec; + msg.ctime = client_time; + msg.cusec = client_usec; /* Make sure we only send `protocol' error codes */ if(error_code < KRB5KDC_ERR_NONE || error_code >= KRB5_ERR_RCSID) { if(e_text == NULL) diff --git a/crypto/heimdal/lib/krb5/net_read.c b/crypto/heimdal/lib/krb5/net_read.c index 8cb1dc4..38ff0ea 100644 --- a/crypto/heimdal/lib/krb5/net_read.c +++ b/crypto/heimdal/lib/krb5/net_read.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan + * Copyright (c) 1997, 1998, 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,9 +33,9 @@ #include "krb5_locl.h" -RCSID("$Id: net_read.c,v 1.5 1999/12/02 17:05:11 joda Exp $"); +RCSID("$Id: net_read.c,v 1.6 2002/08/21 09:08:06 joda Exp $"); -ssize_t +krb5_ssize_t krb5_net_read (krb5_context context, void *p_fd, void *buf, diff --git a/crypto/heimdal/lib/krb5/net_write.c b/crypto/heimdal/lib/krb5/net_write.c index 5cc719b..5d87b97 100644 --- a/crypto/heimdal/lib/krb5/net_write.c +++ b/crypto/heimdal/lib/krb5/net_write.c @@ -33,9 +33,9 @@ #include "krb5_locl.h" -RCSID("$Id: net_write.c,v 1.6 1999/12/02 17:05:11 joda Exp $"); +RCSID("$Id: net_write.c,v 1.7 2002/08/21 09:08:07 joda Exp $"); -ssize_t +krb5_ssize_t krb5_net_write (krb5_context context, void *p_fd, const void *buf, diff --git a/crypto/heimdal/lib/krb5/parse-name-test.c b/crypto/heimdal/lib/krb5/parse-name-test.c new file mode 100644 index 0000000..2920272 --- /dev/null +++ b/crypto/heimdal/lib/krb5/parse-name-test.c @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2002 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of KTH nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#include "krb5_locl.h" + +RCSID("$Id: parse-name-test.c,v 1.3 2002/08/30 03:20:11 assar Exp $"); + +enum { MAX_COMPONENTS = 3 }; + +static struct testcase { + const char *input_string; + const char *output_string; + krb5_realm realm; + unsigned ncomponents; + char *comp_val[MAX_COMPONENTS]; + int realmp; +} tests[] = { + {"", "@", "", 1, {""}, FALSE}, + {"a", "a@", "", 1, {"a"}, FALSE}, + {"\\n", "\\n@", "", 1, {"\n"}, FALSE}, + {"\\ ", "\\ @", "", 1, {" "}, FALSE}, + {"\\t", "\\t@", "", 1, {"\t"}, FALSE}, + {"\\b", "\\b@", "", 1, {"\b"}, FALSE}, + {"\\\\", "\\\\@", "", 1, {"\\"}, FALSE}, + {"\\/", "\\/@", "", 1, {"/"}, FALSE}, + {"\\@", "\\@@", "", 1, {"@"}, FALSE}, + {"@", "@", "", 1, {""}, TRUE}, + {"a/b", "a/b@", "", 2, {"a", "b"}, FALSE}, + {"a/", "a/@", "", 2, {"a", ""}, FALSE}, + {"a\\//\\/", "a\\//\\/@", "", 2, {"a/", "/"}, FALSE}, + {"/a", "/a@", "", 2, {"", "a"}, FALSE}, + {"\\@@\\@", "\\@@\\@", "@", 1, {"@"}, TRUE}, + {"a/b/c", "a/b/c@", "", 3, {"a", "b", "c"}, FALSE}, + {NULL, NULL, "", 0, {}, FALSE}}; + +int +main(int argc, char **argv) +{ + struct testcase *t; + krb5_context context; + krb5_error_code ret; + int val = 0; + + ret = krb5_init_context (&context); + if (ret) + errx (1, "krb5_init_context failed: %d", ret); + + /* to enable realm-less principal name above */ + + krb5_set_default_realm(context, ""); + + for (t = tests; t->input_string; ++t) { + krb5_principal princ; + int i, j; + char name_buf[1024]; + char *s; + + ret = krb5_parse_name(context, t->input_string, &princ); + if (ret) + krb5_err (context, 1, ret, "krb5_parse_name %s", + t->input_string); + if (strcmp (t->realm, princ->realm) != 0) { + printf ("wrong realm (\"%s\" should be \"%s\")" + " for \"%s\"\n", + princ->realm, t->realm, + t->input_string); + val = 1; + } + + if (t->ncomponents != princ->name.name_string.len) { + printf ("wrong number of components (%u should be %u)" + " for \"%s\"\n", + princ->name.name_string.len, t->ncomponents, + t->input_string); + val = 1; + } else { + for (i = 0; i < t->ncomponents; ++i) { + if (strcmp(t->comp_val[i], + princ->name.name_string.val[i]) != 0) { + printf ("bad component %d (\"%s\" should be \"%s\")" + " for \"%s\"\n", + i, + princ->name.name_string.val[i], + t->comp_val[i], + t->input_string); + val = 1; + } + } + } + for (j = 0; j < strlen(t->output_string); ++j) { + ret = krb5_unparse_name_fixed(context, princ, + name_buf, j); + if (ret != ERANGE) { + printf ("unparse_name %s with length %d should have failed\n", + t->input_string, j); + val = 1; + break; + } + } + ret = krb5_unparse_name_fixed(context, princ, + name_buf, sizeof(name_buf)); + if (ret) + krb5_err (context, 1, ret, "krb5_unparse_name_fixed"); + + if (strcmp (t->output_string, name_buf) != 0) { + printf ("failed comparing the re-parsed" + " (\"%s\" should be \"%s\")\n", + name_buf, t->output_string); + val = 1; + } + + ret = krb5_unparse_name(context, princ, &s); + if (ret) + krb5_err (context, 1, ret, "krb5_unparse_name"); + + if (strcmp (t->output_string, s) != 0) { + printf ("failed comparing the re-parsed" + " (\"%s\" should be \"%s\"\n", + s, t->output_string); + val = 1; + } + free(s); + + if (!t->realmp) { + for (j = 0; j < strlen(t->input_string); ++j) { + ret = krb5_unparse_name_fixed_short(context, princ, + name_buf, j); + if (ret != ERANGE) { + printf ("unparse_name_short %s with length %d" + " should have failed\n", + t->input_string, j); + val = 1; + break; + } + } + ret = krb5_unparse_name_fixed_short(context, princ, + name_buf, sizeof(name_buf)); + if (ret) + krb5_err (context, 1, ret, "krb5_unparse_name_fixed"); + + if (strcmp (t->input_string, name_buf) != 0) { + printf ("failed comparing the re-parsed" + " (\"%s\" should be \"%s\")\n", + name_buf, t->input_string); + val = 1; + } + + ret = krb5_unparse_name_short(context, princ, &s); + if (ret) + krb5_err (context, 1, ret, "krb5_unparse_name_short"); + + if (strcmp (t->input_string, s) != 0) { + printf ("failed comparing the re-parsed" + " (\"%s\" should be \"%s\"\n", + s, t->input_string); + val = 1; + } + free(s); + } + krb5_free_principal (context, princ); + } + return val; +} diff --git a/crypto/heimdal/lib/krb5/principal.c b/crypto/heimdal/lib/krb5/principal.c index 5d59594..c5289ce 100644 --- a/crypto/heimdal/lib/krb5/principal.c +++ b/crypto/heimdal/lib/krb5/principal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -41,7 +41,7 @@ #include <fnmatch.h> #include "resolve.h" -RCSID("$Id: principal.c,v 1.78 2001/09/20 09:46:20 joda Exp $"); +RCSID("$Id: principal.c,v 1.81 2002/08/26 13:31:40 assar Exp $"); #define princ_num_comp(P) ((P)->name.name_string.len) #define princ_type(P) ((P)->name.name_type) @@ -93,7 +93,7 @@ krb5_parse_name(krb5_context context, general_string realm; int ncomp; - char *p; + const char *p; char *q; char *s; char *start; @@ -104,7 +104,7 @@ krb5_parse_name(krb5_context context, /* count number of component */ ncomp = 1; - for(p = (char*)name; *p; p++){ + for(p = name; *p; p++){ if(*p=='\\'){ if(!p[1]) { krb5_set_error_string (context, @@ -122,7 +122,7 @@ krb5_parse_name(krb5_context context, } n = 0; - start = q = p = s = strdup(name); + p = start = q = s = strdup(name); if (start == NULL) { free (comp); krb5_set_error_string (context, "malloc: out of memory"); @@ -725,45 +725,60 @@ krb5_425_conv_principal_ext(krb5_context context, return HEIM_ERR_V4_PRINC_NO_CONV; } if(resolve){ - const char *inst = NULL; + krb5_boolean passed = FALSE; + char *inst = NULL; #ifdef USE_RESOLVER struct dns_reply *r; - r = dns_lookup(instance, "a"); - if(r && r->head && r->head->type == T_A) - inst = r->head->domain; -#else - struct hostent *hp = roken_gethostbyname(instance); - if(hp) - inst = hp->h_name; -#endif - if(inst) { - char *low_inst = strdup(inst); - if (low_inst == NULL) { -#ifdef USE_RESOLVER + r = dns_lookup(instance, "aaaa"); + if (r && r->head && r->head->type == T_AAAA) { + inst = strdup(r->head->domain); + dns_free_data(r); + passed = TRUE; + } else { + r = dns_lookup(instance, "a"); + if(r && r->head && r->head->type == T_A) { + inst = strdup(r->head->domain); dns_free_data(r); + passed = TRUE; + } + } +#else + struct addrinfo hints, *ai; + int ret; + + memset (&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + ret = getaddrinfo(instance, NULL, &hints, &ai); + if (ret == 0) { + const struct addrinfo *a; + for (a = ai; a != NULL; a = a->ai_next) { + if (a->ai_canonname != NULL) { + inst = strdup (a->ai_canonname); + passed = TRUE; + break; + } + } + freeaddrinfo (ai); + } #endif + if (passed) { + if (inst == NULL) { krb5_set_error_string (context, "malloc: out of memory"); return ENOMEM; } - ret = krb5_make_principal(context, &pr, realm, name, low_inst, + strlwr(inst); + ret = krb5_make_principal(context, &pr, realm, name, inst, NULL); - free (low_inst); + free (inst); if(ret == 0) { if(func == NULL || (*func)(context, pr)){ *princ = pr; -#ifdef USE_RESOLVER - dns_free_data(r); -#endif return 0; } krb5_free_principal(context, pr); } } -#ifdef USE_RESOLVER - if(r) - dns_free_data(r); -#endif } if(func != NULL) { snprintf(host, sizeof(host), "%s.%s", instance, realm); diff --git a/crypto/heimdal/lib/krb5/rd_cred.c b/crypto/heimdal/lib/krb5/rd_cred.c index 746e2d1..401770b 100644 --- a/crypto/heimdal/lib/krb5/rd_cred.c +++ b/crypto/heimdal/lib/krb5/rd_cred.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: rd_cred.c,v 1.15 2001/06/29 14:53:44 assar Exp $"); +RCSID("$Id: rd_cred.c,v 1.17 2002/08/09 17:07:12 joda Exp $"); krb5_error_code krb5_rd_cred(krb5_context context, @@ -136,13 +136,37 @@ krb5_rd_cred(krb5_context context, /* check receiver address */ if (enc_krb_cred_part.r_address - && auth_context->local_address - && !krb5_address_compare (context, - auth_context->local_address, - enc_krb_cred_part.r_address)) { - krb5_clear_error_string (context); - ret = KRB5KRB_AP_ERR_BADADDR; - goto out; + && auth_context->local_address) { + if(auth_context->local_port && + enc_krb_cred_part.r_address->addr_type == KRB5_ADDRESS_ADDRPORT) { + krb5_address *a; + int cmp; + ret = krb5_make_addrport (context, &a, + auth_context->local_address, + auth_context->local_port); + if (ret) + goto out; + + cmp = krb5_address_compare (context, + a, + enc_krb_cred_part.r_address); + krb5_free_address (context, a); + free (a); + + if (cmp == 0) { + krb5_clear_error_string (context); + ret = KRB5KRB_AP_ERR_BADADDR; + goto out; + } + } else { + if(!krb5_address_compare (context, + auth_context->local_address, + enc_krb_cred_part.r_address)) { + krb5_clear_error_string (context); + ret = KRB5KRB_AP_ERR_BADADDR; + goto out; + } + } } /* check timestamp */ diff --git a/crypto/heimdal/lib/krb5/recvauth.c b/crypto/heimdal/lib/krb5/recvauth.c index 806a765..d72b5c6 100644 --- a/crypto/heimdal/lib/krb5/recvauth.c +++ b/crypto/heimdal/lib/krb5/recvauth.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,14 +33,14 @@ #include "krb5_locl.h" -RCSID("$Id: recvauth.c,v 1.15 2001/05/14 06:14:51 assar Exp $"); +RCSID("$Id: recvauth.c,v 1.16 2002/04/18 09:41:33 joda Exp $"); /* * See `sendauth.c' for the format. */ static krb5_boolean -match_exact(void *data, const char *appl_version) +match_exact(const void *data, const char *appl_version) { return strcmp(data, appl_version) == 0; } @@ -49,7 +49,7 @@ krb5_error_code krb5_recvauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointer p_fd, - char *appl_version, + const char *appl_version, krb5_principal server, int32_t flags, krb5_keytab keytab, @@ -65,9 +65,9 @@ krb5_error_code krb5_recvauth_match_version(krb5_context context, krb5_auth_context *auth_context, krb5_pointer p_fd, - krb5_boolean (*match_appl_version)(void *, + krb5_boolean (*match_appl_version)(const void *, const char*), - void *match_data, + const void *match_data, krb5_principal server, int32_t flags, krb5_keytab keytab, diff --git a/crypto/heimdal/lib/krb5/send_to_kdc.c b/crypto/heimdal/lib/krb5/send_to_kdc.c index 37ba96d..94dae30 100644 --- a/crypto/heimdal/lib/krb5/send_to_kdc.c +++ b/crypto/heimdal/lib/krb5/send_to_kdc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: send_to_kdc.c,v 1.47 2001/07/03 19:35:46 assar Exp $"); +RCSID("$Id: send_to_kdc.c,v 1.48 2002/03/27 09:32:50 joda Exp $"); /* * send the data in `req' on the socket `fd' (which is datagram iff udp) @@ -238,7 +238,7 @@ init_port(const char *s, int fallback) static int send_via_proxy (krb5_context context, const krb5_krbhst_info *hi, - const krb5_data *send, + const krb5_data *send_data, krb5_data *receive) { char *proxy2 = strdup(context->http_proxy); @@ -291,7 +291,7 @@ send_via_proxy (krb5_context context, return 1; } ret = send_and_recv_http(s, context->kdc_timeout, - prefix, send, receive); + prefix, send_data, receive); close (s); free(prefix); if(ret == 0 && receive->length != 0) @@ -306,7 +306,7 @@ send_via_proxy (krb5_context context, krb5_error_code krb5_sendto (krb5_context context, - const krb5_data *send, + const krb5_data *send_data, krb5_krbhst_handle handle, krb5_data *receive) { @@ -322,7 +322,7 @@ krb5_sendto (krb5_context context, struct addrinfo *ai, *a; if(hi->proto == KRB5_KRBHST_HTTP && context->http_proxy) { - if (send_via_proxy (context, hi, send, receive)) + if (send_via_proxy (context, hi, send_data, receive)) continue; else goto out; @@ -343,15 +343,15 @@ krb5_sendto (krb5_context context, switch (hi->proto) { case KRB5_KRBHST_HTTP : ret = send_and_recv_http(fd, context->kdc_timeout, - "", send, receive); + "", send_data, receive); break; case KRB5_KRBHST_TCP : ret = send_and_recv_tcp (fd, context->kdc_timeout, - send, receive); + send_data, receive); break; case KRB5_KRBHST_UDP : ret = send_and_recv_udp (fd, context->kdc_timeout, - send, receive); + send_data, receive); break; } close (fd); @@ -369,7 +369,7 @@ out: krb5_error_code krb5_sendto_kdc2(krb5_context context, - const krb5_data *send, + const krb5_data *send_data, const krb5_realm *realm, krb5_data *receive, krb5_boolean master) @@ -387,7 +387,7 @@ krb5_sendto_kdc2(krb5_context context, if (ret) return ret; - ret = krb5_sendto(context, send, handle, receive); + ret = krb5_sendto(context, send_data, handle, receive); krb5_krbhst_free(context, handle); if (ret == KRB5_KDC_UNREACH) krb5_set_error_string(context, @@ -397,9 +397,9 @@ krb5_sendto_kdc2(krb5_context context, krb5_error_code krb5_sendto_kdc(krb5_context context, - const krb5_data *send, + const krb5_data *send_data, const krb5_realm *realm, krb5_data *receive) { - return krb5_sendto_kdc2(context, send, realm, receive, FALSE); + return krb5_sendto_kdc2(context, send_data, realm, receive, FALSE); } diff --git a/crypto/heimdal/lib/krb5/store-int.h b/crypto/heimdal/lib/krb5/store-int.h new file mode 100644 index 0000000..42e695a --- /dev/null +++ b/crypto/heimdal/lib/krb5/store-int.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __store_int_h__ +#define __store_int_h__ + +struct krb5_storage_data { + void *data; + ssize_t (*fetch)(struct krb5_storage_data*, void*, size_t); + ssize_t (*store)(struct krb5_storage_data*, const void*, size_t); + off_t (*seek)(struct krb5_storage_data*, off_t, int); + void (*free)(struct krb5_storage_data*); + krb5_flags flags; + int eof_code; +}; + +#endif /* __store_int_h__ */ diff --git a/crypto/heimdal/lib/krb5/store.c b/crypto/heimdal/lib/krb5/store.c index 4dd96a8..4ea68f9 100644 --- a/crypto/heimdal/lib/krb5/store.c +++ b/crypto/heimdal/lib/krb5/store.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,8 +32,9 @@ */ #include "krb5_locl.h" +#include "store-int.h" -RCSID("$Id: store.c,v 1.35 2001/05/11 13:01:43 joda Exp $"); +RCSID("$Id: store.c,v 1.38 2002/08/21 12:21:57 joda Exp $"); #define BYTEORDER_IS(SP, V) (((SP)->flags & KRB5_STORAGE_BYTEORDER_MASK) == (V)) #define BYTEORDER_IS_LE(SP) BYTEORDER_IS((SP), KRB5_STORAGE_BYTEORDER_LE) @@ -72,8 +73,31 @@ krb5_storage_get_byteorder(krb5_storage *sp, krb5_flags byteorder) return sp->flags & KRB5_STORAGE_BYTEORDER_MASK; } +off_t +krb5_storage_seek(krb5_storage *sp, off_t offset, int whence) +{ + return (*sp->seek)(sp, offset, whence); +} + +krb5_ssize_t +krb5_storage_read(krb5_storage *sp, void *buf, size_t len) +{ + return sp->fetch(sp, buf, len); +} + +krb5_ssize_t +krb5_storage_write(krb5_storage *sp, const void *buf, size_t len) +{ + return sp->store(sp, buf, len); +} + +void +krb5_storage_set_eof_code(krb5_storage *sp, int code) +{ + sp->eof_code = code; +} -ssize_t +krb5_ssize_t _krb5_put_int(void *buffer, unsigned long value, size_t size) { unsigned char *p = buffer; @@ -85,7 +109,7 @@ _krb5_put_int(void *buffer, unsigned long value, size_t size) return size; } -ssize_t +krb5_ssize_t _krb5_get_int(void *buffer, unsigned long *value, size_t size) { unsigned char *p = buffer; @@ -142,7 +166,7 @@ krb5_store_int(krb5_storage *sp, _krb5_put_int(v, value, len); ret = sp->store(sp, v, len); if (ret != len) - return (ret<0)?errno:KRB5_CC_END; + return (ret<0)?errno:sp->eof_code; return 0; } @@ -167,7 +191,7 @@ krb5_ret_int(krb5_storage *sp, unsigned long w; ret = sp->fetch(sp, v, len); if(ret != len) - return (ret<0)?errno:KRB5_CC_END; + return (ret<0)?errno:sp->eof_code; _krb5_get_int(v, &w, len); *value = w; return 0; @@ -223,7 +247,7 @@ krb5_store_int8(krb5_storage *sp, ret = sp->store(sp, &value, sizeof(value)); if (ret != sizeof(value)) - return (ret<0)?errno:KRB5_CC_END; + return (ret<0)?errno:sp->eof_code; return 0; } @@ -235,7 +259,7 @@ krb5_ret_int8(krb5_storage *sp, ret = sp->fetch(sp, value, sizeof(*value)); if (ret != sizeof(*value)) - return (ret<0)?errno:KRB5_CC_END; + return (ret<0)?errno:sp->eof_code; return 0; } @@ -251,7 +275,7 @@ krb5_store_data(krb5_storage *sp, if(ret != data.length){ if(ret < 0) return errno; - return KRB5_CC_END; + return sp->eof_code; } return 0; } @@ -272,7 +296,7 @@ krb5_ret_data(krb5_storage *sp, if (size) { ret = sp->fetch(sp, data->data, size); if(ret != size) - return (ret < 0)? errno : KRB5_CC_END; + return (ret < 0)? errno : sp->eof_code; } return 0; } @@ -315,7 +339,7 @@ krb5_store_stringz(krb5_storage *sp, const char *s) if(ret < 0) return ret; else - return KRB5_CC_END; + return sp->eof_code; } return 0; } @@ -346,7 +370,7 @@ krb5_ret_stringz(krb5_storage *sp, if(ret != 1){ free(s); if(ret == 0) - return KRB5_CC_END; + return sp->eof_code; return ret; } *string = s; @@ -593,37 +617,35 @@ krb5_store_creds(krb5_storage *sp, krb5_creds *creds) int ret; ret = krb5_store_principal(sp, creds->client); - if (ret) + if(ret) return ret; ret = krb5_store_principal(sp, creds->server); - if (ret) + if(ret) return ret; ret = krb5_store_keyblock(sp, creds->session); - if (ret) + if(ret) return ret; ret = krb5_store_times(sp, creds->times); - if (ret) + if(ret) return ret; ret = krb5_store_int8(sp, 0); /* this is probably the enc-tkt-in-skey bit from KDCOptions */ - if (ret) + if(ret) return ret; ret = krb5_store_int32(sp, creds->flags.i); - if (ret) + if(ret) return ret; ret = krb5_store_addrs(sp, creds->addresses); - if (ret) + if(ret) return ret; ret = krb5_store_authdata(sp, creds->authdata); - if (ret) + if(ret) return ret; ret = krb5_store_data(sp, creds->ticket); - if (ret) + if(ret) return ret; ret = krb5_store_data(sp, creds->second_ticket); - if (ret) - return ret; - return 0; + return ret; } krb5_error_code @@ -655,10 +677,10 @@ krb5_ret_creds(krb5_storage *sp, krb5_creds *creds) if(ret) goto cleanup; ret = krb5_ret_data (sp, &creds->second_ticket); cleanup: - if(ret) + if(ret) { #if 0 - krb5_free_creds_contents(context, creds) /* XXX */ + krb5_free_creds_contents(context, creds); /* XXX */ #endif - ; + } return ret; } diff --git a/crypto/heimdal/lib/krb5/store_emem.c b/crypto/heimdal/lib/krb5/store_emem.c index 93a8811..337a81c 100644 --- a/crypto/heimdal/lib/krb5/store_emem.c +++ b/crypto/heimdal/lib/krb5/store_emem.c @@ -32,8 +32,9 @@ */ #include "krb5_locl.h" +#include "store-int.h" -RCSID("$Id: store_emem.c,v 1.11 2002/02/11 13:03:25 joda Exp $"); +RCSID("$Id: store_emem.c,v 1.12 2002/04/18 14:00:34 joda Exp $"); typedef struct emem_storage{ unsigned char *base; @@ -116,6 +117,7 @@ krb5_storage_emem(void) emem_storage *s = malloc(sizeof(*s)); sp->data = s; sp->flags = 0; + sp->eof_code = HEIM_ERR_EOF; s->size = 1024; s->base = malloc(s->size); s->len = 0; diff --git a/crypto/heimdal/lib/krb5/store_fd.c b/crypto/heimdal/lib/krb5/store_fd.c index 91545d5..e31b956 100644 --- a/crypto/heimdal/lib/krb5/store_fd.c +++ b/crypto/heimdal/lib/krb5/store_fd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,8 +32,9 @@ */ #include "krb5_locl.h" +#include "store-int.h" -RCSID("$Id: store_fd.c,v 1.9 2001/06/24 05:39:51 assar Exp $"); +RCSID("$Id: store_fd.c,v 1.10 2002/04/18 14:00:39 joda Exp $"); typedef struct fd_storage{ int fd; @@ -73,6 +74,7 @@ krb5_storage_from_fd(int fd) return NULL; } sp->flags = 0; + sp->eof_code = HEIM_ERR_EOF; FD(sp) = fd; sp->fetch = fd_fetch; sp->store = fd_store; diff --git a/crypto/heimdal/lib/krb5/store_mem.c b/crypto/heimdal/lib/krb5/store_mem.c index e6c277a..b0be2002 100644 --- a/crypto/heimdal/lib/krb5/store_mem.c +++ b/crypto/heimdal/lib/krb5/store_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000, 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,8 +32,9 @@ */ #include "krb5_locl.h" +#include "store-int.h" -RCSID("$Id: store_mem.c,v 1.10 2000/05/19 14:39:02 assar Exp $"); +RCSID("$Id: store_mem.c,v 1.11 2002/04/18 14:00:44 joda Exp $"); typedef struct mem_storage{ unsigned char *base; @@ -100,6 +101,7 @@ krb5_storage_from_mem(void *buf, size_t len) } sp->data = s; sp->flags = 0; + sp->eof_code = HEIM_ERR_EOF; s->base = buf; s->size = len; s->ptr = buf; diff --git a/crypto/heimdal/lib/krb5/test_get_addrs.c b/crypto/heimdal/lib/krb5/test_get_addrs.c index 96a8f89..97e3b2b 100644 --- a/crypto/heimdal/lib/krb5/test_get_addrs.c +++ b/crypto/heimdal/lib/krb5/test_get_addrs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,8 +32,9 @@ #include "krb5_locl.h" #include <err.h> +#include <getarg.h> -RCSID("$Id: test_get_addrs.c,v 1.3 2001/01/25 12:45:15 assar Exp $"); +RCSID("$Id: test_get_addrs.c,v 1.4 2002/08/23 03:42:54 assar Exp $"); /* print all addresses that we find */ @@ -50,12 +51,49 @@ print_addresses (krb5_context context, const krb5_addresses *addrs) } } +static int version_flag = 0; +static int help_flag = 0; + +static struct getargs args[] = { + {"version", 0, arg_flag, &version_flag, + "print version", NULL }, + {"help", 0, arg_flag, &help_flag, + NULL, NULL } +}; + +static void +usage (int ret) +{ + arg_printusage (args, + sizeof(args)/sizeof(*args), + NULL, + ""); + exit (ret); +} + int main(int argc, char **argv) { krb5_context context; krb5_error_code ret; krb5_addresses addrs; + int optind = 0; + + setprogname (argv[0]); + + if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)) + usage(1); + + if (help_flag) + usage (0); + + if(version_flag){ + print_version(NULL); + exit(0); + } + + argc -= optind; + argv += optind; ret = krb5_init_context(&context); if (ret) diff --git a/crypto/heimdal/lib/krb5/verify_init.c b/crypto/heimdal/lib/krb5/verify_init.c index 7e4618e..243ac5f 100644 --- a/crypto/heimdal/lib/krb5/verify_init.c +++ b/crypto/heimdal/lib/krb5/verify_init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: verify_init.c,v 1.14 2001/05/14 06:14:52 assar Exp $"); +RCSID("$Id: verify_init.c,v 1.17 2002/08/20 14:47:59 joda Exp $"); void krb5_verify_init_creds_opt_init(krb5_verify_init_creds_opt *options) @@ -58,7 +58,7 @@ fail_verify_is_ok (krb5_context context, krb5_verify_init_creds_opt *options) { if ((options->flags & KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL - && options->ap_req_nofail == 1) + && options->ap_req_nofail != 0) || krb5_config_get_bool (context, NULL, "libdefaults", @@ -94,7 +94,7 @@ krb5_verify_init_creds(krb5_context context, if (gethostname (local_hostname, sizeof(local_hostname)) < 0) { ret = errno; - krb5_set_error_string (context, "getsockname: %s", + krb5_set_error_string (context, "gethostname: %s", strerror(ret)); return ret; } diff --git a/crypto/heimdal/lib/krb5/verify_krb5_conf.8 b/crypto/heimdal/lib/krb5/verify_krb5_conf.8 index 009ff4e..7d854bf 100644 --- a/crypto/heimdal/lib/krb5/verify_krb5_conf.8 +++ b/crypto/heimdal/lib/krb5/verify_krb5_conf.8 @@ -1,4 +1,4 @@ -.\" $Id: verify_krb5_conf.8,v 1.6 2002/02/15 12:58:19 joda Exp $ +.\" $Id: verify_krb5_conf.8,v 1.7 2002/08/20 17:07:28 joda Exp $ .\" .Dd August 30, 2001 .Dt VERIFY_KRB5_CONF 8 @@ -17,11 +17,11 @@ or the file given on the command line, and parses it, thereby verifying that the syntax is not correctly wrong. .Pp If the file is syntactically correct, -.Nm +.Nm tries to verify that the contents of the file is of relevant nature. .Sh DIAGNOSTICS -Possible output from -.Nm +Possible output from +.Nm include: .Bl -tag -width "<path>" .It "<path>: failed to parse <something> as size/time/number/boolean" @@ -36,7 +36,7 @@ recognised as one. .It <path>: unknown or wrong type Means that <path> is either is a string when it should be a list, vice versa, or just that -.Nm +.Nm is confused. .It <path>: unknown entry Means that <string> is not known by diff --git a/crypto/heimdal/lib/krb5/verify_krb5_conf.c b/crypto/heimdal/lib/krb5/verify_krb5_conf.c index de9e51d..55d8a42 100644 --- a/crypto/heimdal/lib/krb5/verify_krb5_conf.c +++ b/crypto/heimdal/lib/krb5/verify_krb5_conf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -35,14 +35,17 @@ #include <getarg.h> #include <parse_bytes.h> #include <err.h> -RCSID("$Id: verify_krb5_conf.c,v 1.7 2001/09/03 05:42:35 assar Exp $"); +RCSID("$Id: verify_krb5_conf.c,v 1.14 2002/08/28 15:27:19 nectar Exp $"); /* verify krb5.conf */ +static int dumpconfig_flag = 0; static int version_flag = 0; static int help_flag = 0; static struct getargs args[] = { + {"dumpconfig", 0, arg_flag, &dumpconfig_flag, + "show the parsed config files", NULL }, {"version", 0, arg_flag, &version_flag, "print version", NULL }, {"help", 0, arg_flag, &help_flag, @@ -109,6 +112,9 @@ check_boolean(krb5_context context, const char *path, char *data) path, data); return 1; } + if(v != 0 && v != 1) + krb5_warnx(context, "%s: numeric value \"%s\" is treated as \"true\"", + path, data); return 0; } @@ -145,6 +151,135 @@ check_host(krb5_context context, const char *path, char *data) return 0; } +#if 0 +static int +mit_entry(krb5_context context, const char *path, char *data) +{ + krb5_warnx(context, "%s is only used by MIT Kerberos", path); + return 0; +} +#endif + +struct s2i { + char *s; + int val; +}; + +#define L(X) { #X, LOG_ ## X } + +static struct s2i syslogvals[] = { + L(EMERG), + L(ALERT), + L(CRIT), + L(ERR), + L(WARNING), + L(NOTICE), + L(INFO), + L(DEBUG), + + L(AUTH), +#ifdef LOG_AUTHPRIV + L(AUTHPRIV), +#endif +#ifdef LOG_CRON + L(CRON), +#endif + L(DAEMON), +#ifdef LOG_FTP + L(FTP), +#endif + L(KERN), + L(LPR), + L(MAIL), +#ifdef LOG_NEWS + L(NEWS), +#endif + L(SYSLOG), + L(USER), +#ifdef LOG_UUCP + L(UUCP), +#endif + L(LOCAL0), + L(LOCAL1), + L(LOCAL2), + L(LOCAL3), + L(LOCAL4), + L(LOCAL5), + L(LOCAL6), + L(LOCAL7), + { NULL, -1 } +}; + +static int +find_value(const char *s, struct s2i *table) +{ + while(table->s && strcasecmp(table->s, s)) + table++; + return table->val; +} + +static int +check_log(krb5_context context, const char *path, char *data) +{ + /* XXX sync with log.c */ + int min = 0, max = -1, n; + char c; + const char *p = data; + + n = sscanf(p, "%d%c%d/", &min, &c, &max); + if(n == 2){ + if(c == '/') { + if(min < 0){ + max = -min; + min = 0; + }else{ + max = min; + } + } + } + if(n){ + p = strchr(p, '/'); + if(p == NULL) { + krb5_warnx(context, "%s: failed to parse \"%s\"", path, data); + return 1; + } + p++; + } + if(strcmp(p, "STDERR") == 0 || + strcmp(p, "CONSOLE") == 0 || + (strncmp(p, "FILE", 4) == 0 && (p[4] == ':' || p[4] == '=')) || + (strncmp(p, "DEVICE", 6) == 0 && p[6] == '=')) + return 0; + if(strncmp(p, "SYSLOG", 6) == 0){ + int ret = 0; + char severity[128] = ""; + char facility[128] = ""; + p += 6; + if(*p != '\0') + p++; + if(strsep_copy(&p, ":", severity, sizeof(severity)) != -1) + strsep_copy(&p, ":", facility, sizeof(facility)); + if(*severity == '\0') + strlcpy(severity, "ERR", sizeof(severity)); + if(*facility == '\0') + strlcpy(facility, "AUTH", sizeof(facility)); + if(find_value(severity, syslogvals) == NULL) { + krb5_warnx(context, "%s: unknown syslog facility \"%s\"", + path, facility); + ret++; + } + if(find_value(severity, syslogvals) == NULL) { + krb5_warnx(context, "%s: unknown syslog severity \"%s\"", + path, severity); + ret++; + } + return ret; + }else{ + krb5_warnx(context, "%s: unknown log type: \"%s\"", path, data); + return 1; + } +} + typedef int (*check_func_t)(krb5_context, const char*, char*); struct entry { const char *name; @@ -174,6 +309,9 @@ struct entry libdefaults_entries[] = { { "default_keytab_name", krb5_config_string, NULL }, { "default_realm", krb5_config_string, NULL }, { "dns_proxy", krb5_config_string, NULL }, + { "dns_lookup_kdc", krb5_config_string, check_boolean }, + { "dns_lookup_realm", krb5_config_string, check_boolean }, + { "dns_lookup_realm_labels", krb5_config_string, NULL }, { "egd_socket", krb5_config_string, NULL }, { "encrypt", krb5_config_string, check_boolean }, { "extra_addresses", krb5_config_string, NULL }, @@ -184,7 +322,6 @@ struct entry libdefaults_entries[] = { { "ignore_addresses", krb5_config_string, NULL }, { "kdc_timeout", krb5_config_string, check_time }, { "kdc_timesync", krb5_config_string, check_boolean }, - { "krb4_get_tickets", krb5_config_string, check_boolean }, { "log_utc", krb5_config_string, check_boolean }, { "maxretries", krb5_config_string, check_numeric }, { "scan_interfaces", krb5_config_string, check_boolean }, @@ -205,6 +342,7 @@ struct entry appdefaults_entries[] = { { "ticket_lifetime", krb5_config_string, check_time }, { "renew_lifetime", krb5_config_string, check_time }, { "no-addresses", krb5_config_string, check_boolean }, + { "krb4_get_tickets", krb5_config_string, check_boolean }, #if 0 { "anonymous", krb5_config_string, check_boolean }, #endif @@ -226,6 +364,23 @@ struct entry realms_entries[] = { { "v4_instance_convert", krb5_config_list, all_strings }, { "v4_domains", krb5_config_string, NULL }, { "default_domain", krb5_config_string, NULL }, +#if 0 + /* MIT stuff */ + { "admin_keytab", krb5_config_string, mit_entry }, + { "acl_file", krb5_config_string, mit_entry }, + { "dict_file", krb5_config_string, mit_entry }, + { "kadmind_port", krb5_config_string, mit_entry }, + { "kpasswd_port", krb5_config_string, mit_entry }, + { "master_key_name", krb5_config_string, mit_entry }, + { "master_key_type", krb5_config_string, mit_entry }, + { "key_stash_file", krb5_config_string, mit_entry }, + { "max_life", krb5_config_string, mit_entry }, + { "max_renewable_life", krb5_config_string, mit_entry }, + { "default_principal_expiration", krb5_config_string, mit_entry }, + { "default_principal_flags", krb5_config_string, mit_entry }, + { "supported_enctypes", krb5_config_string, mit_entry }, + { "database_name", krb5_config_string, mit_entry }, +#endif { NULL } }; @@ -245,7 +400,7 @@ struct entry kdc_database_entries[] = { struct entry kdc_entries[] = { { "database", krb5_config_list, kdc_database_entries }, { "key-file", krb5_config_string, NULL }, - { "logging", krb5_config_string, NULL }, + { "logging", krb5_config_string, check_log }, { "max-request", krb5_config_string, check_bytes }, { "require-preauth", krb5_config_string, check_boolean }, { "ports", krb5_config_string, NULL }, @@ -269,14 +424,32 @@ struct entry kadmin_entries[] = { { "use_v4_salt", krb5_config_string, NULL }, { NULL } }; +struct entry log_strings[] = { + { "", krb5_config_string, check_log }, + { NULL } +}; + + +#if 0 +struct entry kdcdefaults_entries[] = { + { "kdc_ports, krb5_config_string, mit_entry }, + { "v4_mode, krb5_config_string, mit_entry }, + { NULL } +}; +#endif + struct entry toplevel_sections[] = { { "libdefaults" , krb5_config_list, libdefaults_entries }, { "realms", krb5_config_list, realms_foobar }, { "domain_realm", krb5_config_list, all_strings }, - { "logging", krb5_config_list, all_strings }, + { "logging", krb5_config_list, log_strings }, { "kdc", krb5_config_list, kdc_entries }, { "kadmin", krb5_config_list, kadmin_entries }, { "appdefaults", krb5_config_list, appdefaults_entries }, +#if 0 + /* MIT stuff */ + { "kdcdefaults", krb5_config_list, kdcdefaults_entries }, +#endif { NULL } }; @@ -308,6 +481,8 @@ check_section(krb5_context context, const char *path, krb5_config_section *cf, } if(e->name == NULL) { krb5_warnx(context, "%s: unknown entry", local); + for(e = entries; e->name != NULL; e++) + krb5_warnx(context, " %s", e->name); error |= 1; } free(local); @@ -316,11 +491,33 @@ check_section(krb5_context context, const char *path, krb5_config_section *cf, } +static void +dumpconfig(int level, krb5_config_section *top) +{ + krb5_config_section *x; + for(x = top; x; x = x->next) { + switch(x->type) { + case krb5_config_list: + if(level == 0) { + printf("[%s]\n", x->name); + } else { + printf("%*s%s = {\n", 4 * level, " ", x->name); + } + dumpconfig(level + 1, x->u.list); + if(level > 0) + printf("%*s}\n", 4 * level, " "); + break; + case krb5_config_string: + printf("%*s%s = %s\n", 4 * level, " ", x->name, x->u.string); + break; + } + } +} + int main(int argc, char **argv) { krb5_context context; - const char *config_file = NULL; krb5_error_code ret; krb5_config_section *tmp_cf; int optind = 0; @@ -345,21 +542,19 @@ main(int argc, char **argv) argc -= optind; argv += optind; - if (argc == 0) { - config_file = getenv("KRB5_CONFIG"); - if (config_file == NULL) - config_file = krb5_config_file; - } else if (argc == 1) { - config_file = argv[0]; - } else { - usage (1); - } - - ret = krb5_config_parse_file (context, config_file, &tmp_cf); - if (ret != 0) { - krb5_warn (context, ret, "krb5_config_parse_file"); - return 1; + tmp_cf = NULL; + if(argc == 0) + krb5_get_default_config_files(&argv); + + while(*argv) { + ret = krb5_config_parse_file_multi(context, *argv, &tmp_cf); + if (ret != 0) + krb5_warn (context, ret, "krb5_config_parse_file"); + argv++; } + if(dumpconfig_flag) + dumpconfig(0, tmp_cf); + return check_section(context, "", tmp_cf, toplevel_sections); } diff --git a/crypto/heimdal/lib/krb5/verify_user.c b/crypto/heimdal/lib/krb5/verify_user.c index 25cd77b..1cd571b 100644 --- a/crypto/heimdal/lib/krb5/verify_user.c +++ b/crypto/heimdal/lib/krb5/verify_user.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: verify_user.c,v 1.14 2001/05/14 09:06:53 joda Exp $"); +RCSID("$Id: verify_user.c,v 1.17 2002/08/20 14:48:31 joda Exp $"); static krb5_error_code verify_common (krb5_context context, @@ -146,7 +146,7 @@ verify_user_opt_int(krb5_context context, ret = krb5_get_init_creds_password (context, &cred, principal, - (char*)password, + password, krb5_prompter_posix, NULL, 0, |