summaryrefslogtreecommitdiff
path: root/crypto/heimdal/lib/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/asn1')
-rw-r--r--crypto/heimdal/lib/asn1/Makefile885
-rw-r--r--crypto/heimdal/lib/asn1/Makefile.am128
-rw-r--r--crypto/heimdal/lib/asn1/Makefile.in880
-rw-r--r--crypto/heimdal/lib/asn1/asn1-common.h21
-rw-r--r--crypto/heimdal/lib/asn1/asn1_err.et20
-rw-r--r--crypto/heimdal/lib/asn1/asn1_print.c255
-rw-r--r--crypto/heimdal/lib/asn1/check-common.c125
-rw-r--r--crypto/heimdal/lib/asn1/check-common.h53
-rw-r--r--crypto/heimdal/lib/asn1/check-der.c197
-rw-r--r--crypto/heimdal/lib/asn1/check-gen.c193
-rw-r--r--crypto/heimdal/lib/asn1/der.h152
-rw-r--r--crypto/heimdal/lib/asn1/der_copy.c67
-rw-r--r--crypto/heimdal/lib/asn1/der_free.c54
-rw-r--r--crypto/heimdal/lib/asn1/der_get.c483
-rw-r--r--crypto/heimdal/lib/asn1/der_length.c154
-rw-r--r--crypto/heimdal/lib/asn1/der_locl.h56
-rw-r--r--crypto/heimdal/lib/asn1/der_put.c421
-rw-r--r--crypto/heimdal/lib/asn1/gen.c460
-rw-r--r--crypto/heimdal/lib/asn1/gen.h38
-rw-r--r--crypto/heimdal/lib/asn1/gen_copy.c151
-rw-r--r--crypto/heimdal/lib/asn1/gen_decode.c394
-rw-r--r--crypto/heimdal/lib/asn1/gen_encode.c265
-rw-r--r--crypto/heimdal/lib/asn1/gen_free.c135
-rw-r--r--crypto/heimdal/lib/asn1/gen_glue.c139
-rw-r--r--crypto/heimdal/lib/asn1/gen_length.c171
-rw-r--r--crypto/heimdal/lib/asn1/gen_locl.h74
-rw-r--r--crypto/heimdal/lib/asn1/hash.c207
-rw-r--r--crypto/heimdal/lib/asn1/hash.h87
-rw-r--r--crypto/heimdal/lib/asn1/k5.asn1451
-rw-r--r--crypto/heimdal/lib/asn1/lex.h41
-rw-r--r--crypto/heimdal/lib/asn1/lex.l122
-rw-r--r--crypto/heimdal/lib/asn1/libasn1.h51
-rw-r--r--crypto/heimdal/lib/asn1/main.c90
-rw-r--r--crypto/heimdal/lib/asn1/parse.y263
-rw-r--r--crypto/heimdal/lib/asn1/pkinit.asn1189
-rw-r--r--crypto/heimdal/lib/asn1/rfc2459.asn121
-rw-r--r--crypto/heimdal/lib/asn1/symbol.c90
-rw-r--r--crypto/heimdal/lib/asn1/symbol.h83
-rw-r--r--crypto/heimdal/lib/asn1/timegm.c71
-rw-r--r--crypto/heimdal/lib/asn1/x509.asn123
40 files changed, 0 insertions, 7760 deletions
diff --git a/crypto/heimdal/lib/asn1/Makefile b/crypto/heimdal/lib/asn1/Makefile
deleted file mode 100644
index 6a57e6b64c346..0000000000000
--- a/crypto/heimdal/lib/asn1/Makefile
+++ /dev/null
@@ -1,885 +0,0 @@
-# Makefile.in generated by automake 1.6.3 from Makefile.am.
-# lib/asn1/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.68 2002/03/10 23:41:33 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)
-
-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
-
-YFLAGS = -d
-
-lib_LTLIBRARIES = libasn1.la
-libasn1_la_LDFLAGS = -version-info 6:0:0
-
-libasn1_la_LIBADD = -lcom_err
-
-BUILT_SOURCES = \
- $(gen_files:.x=.c) \
- asn1_err.h \
- asn1_err.c
-
-
-gen_files = \
- asn1_APOptions.x \
- asn1_AP_REP.x \
- asn1_AP_REQ.x \
- asn1_AS_REP.x \
- asn1_AS_REQ.x \
- asn1_Authenticator.x \
- asn1_AuthorizationData.x \
- asn1_CKSUMTYPE.x \
- asn1_Checksum.x \
- asn1_ENCTYPE.x \
- asn1_ETYPE_INFO.x \
- asn1_ETYPE_INFO_ENTRY.x \
- asn1_EncAPRepPart.x \
- asn1_EncASRepPart.x \
- asn1_EncKDCRepPart.x \
- asn1_EncKrbCredPart.x \
- asn1_EncKrbPrivPart.x \
- asn1_EncTGSRepPart.x \
- asn1_EncTicketPart.x \
- asn1_EncryptedData.x \
- asn1_EncryptionKey.x \
- asn1_HostAddress.x \
- asn1_HostAddresses.x \
- asn1_KDCOptions.x \
- asn1_KDC_REP.x \
- asn1_KDC_REQ.x \
- asn1_KDC_REQ_BODY.x \
- asn1_KRB_CRED.x \
- asn1_KRB_ERROR.x \
- asn1_KRB_PRIV.x \
- asn1_KRB_SAFE.x \
- asn1_KRB_SAFE_BODY.x \
- asn1_KerberosTime.x \
- asn1_KrbCredInfo.x \
- asn1_LastReq.x \
- asn1_LR_TYPE.x \
- asn1_MESSAGE_TYPE.x \
- asn1_METHOD_DATA.x \
- asn1_NAME_TYPE.x \
- asn1_PADATA_TYPE.x \
- asn1_PA_DATA.x \
- asn1_PA_ENC_TS_ENC.x \
- asn1_Principal.x \
- asn1_PrincipalName.x \
- asn1_Realm.x \
- asn1_TGS_REP.x \
- asn1_TGS_REQ.x \
- asn1_Ticket.x \
- asn1_TicketFlags.x \
- asn1_TransitedEncoding.x \
- asn1_UNSIGNED.x
-
-
-noinst_PROGRAMS = asn1_compile asn1_print
-check_PROGRAMS = check-der
-TESTS = check-der
-
-asn1_compile_SOURCES = \
- gen.c \
- gen_copy.c \
- gen_decode.c \
- gen_encode.c \
- gen_free.c \
- gen_glue.c \
- gen_length.c \
- hash.c \
- lex.l \
- main.c \
- parse.y \
- symbol.c
-
-
-libasn1_la_SOURCES = \
- der_get.c \
- der_put.c \
- der_free.c \
- der_length.c \
- der_copy.c \
- timegm.c \
- $(BUILT_SOURCES)
-
-
-asn1_compile_LDADD = \
- $(LIB_roken) $(LEXLIB)
-
-
-check_der_LDADD = \
- libasn1.la \
- $(LIB_roken)
-
-
-asn1_print_LDADD = $(check_der_LDADD)
-
-CLEANFILES = lex.c parse.c parse.h krb5_asn1.h $(BUILT_SOURCES) \
- $(gen_files) asn1_files
-
-
-include_HEADERS = krb5_asn1.h asn1_err.h der.h
-
-EXTRA_DIST = asn1_err.et
-subdir = lib/asn1
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-libasn1_la_DEPENDENCIES =
-am__objects_1 = asn1_APOptions.lo asn1_AP_REP.lo asn1_AP_REQ.lo \
- asn1_AS_REP.lo asn1_AS_REQ.lo asn1_Authenticator.lo \
- asn1_AuthorizationData.lo asn1_CKSUMTYPE.lo asn1_Checksum.lo \
- asn1_ENCTYPE.lo asn1_ETYPE_INFO.lo asn1_ETYPE_INFO_ENTRY.lo \
- asn1_EncAPRepPart.lo asn1_EncASRepPart.lo asn1_EncKDCRepPart.lo \
- asn1_EncKrbCredPart.lo asn1_EncKrbPrivPart.lo \
- asn1_EncTGSRepPart.lo asn1_EncTicketPart.lo \
- asn1_EncryptedData.lo asn1_EncryptionKey.lo asn1_HostAddress.lo \
- asn1_HostAddresses.lo asn1_KDCOptions.lo asn1_KDC_REP.lo \
- asn1_KDC_REQ.lo asn1_KDC_REQ_BODY.lo asn1_KRB_CRED.lo \
- asn1_KRB_ERROR.lo asn1_KRB_PRIV.lo asn1_KRB_SAFE.lo \
- asn1_KRB_SAFE_BODY.lo asn1_KerberosTime.lo asn1_KrbCredInfo.lo \
- asn1_LastReq.lo asn1_LR_TYPE.lo asn1_MESSAGE_TYPE.lo \
- asn1_METHOD_DATA.lo asn1_NAME_TYPE.lo asn1_PADATA_TYPE.lo \
- asn1_PA_DATA.lo asn1_PA_ENC_TS_ENC.lo asn1_Principal.lo \
- asn1_PrincipalName.lo asn1_Realm.lo asn1_TGS_REP.lo \
- asn1_TGS_REQ.lo asn1_Ticket.lo asn1_TicketFlags.lo \
- asn1_TransitedEncoding.lo asn1_UNSIGNED.lo
-am__objects_2 = $(am__objects_1) asn1_err.lo
-am_libasn1_la_OBJECTS = der_get.lo der_put.lo der_free.lo der_length.lo \
- der_copy.lo timegm.lo $(am__objects_2)
-libasn1_la_OBJECTS = $(am_libasn1_la_OBJECTS)
-check_PROGRAMS = check-der$(EXEEXT)
-noinst_PROGRAMS = asn1_compile$(EXEEXT) asn1_print$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-am_asn1_compile_OBJECTS = gen.$(OBJEXT) gen_copy.$(OBJEXT) \
- gen_decode.$(OBJEXT) gen_encode.$(OBJEXT) gen_free.$(OBJEXT) \
- gen_glue.$(OBJEXT) gen_length.$(OBJEXT) hash.$(OBJEXT) \
- lex.$(OBJEXT) main.$(OBJEXT) parse.$(OBJEXT) symbol.$(OBJEXT)
-asn1_compile_OBJECTS = $(am_asn1_compile_OBJECTS)
-asn1_compile_DEPENDENCIES =
-asn1_compile_LDFLAGS =
-asn1_print_SOURCES = asn1_print.c
-asn1_print_OBJECTS = asn1_print.$(OBJEXT)
-asn1_print_DEPENDENCIES = libasn1.la
-asn1_print_LDFLAGS =
-check_der_SOURCES = check-der.c
-check_der_OBJECTS = check-der.$(OBJEXT)
-check_der_DEPENDENCIES = libasn1.la
-check_der_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
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
-DIST_SOURCES = $(libasn1_la_SOURCES) $(asn1_compile_SOURCES) \
- asn1_print.c check-der.c
-HEADERS = $(include_HEADERS)
-
-DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in lex.c parse.c \
- parse.h
-SOURCES = $(libasn1_la_SOURCES) $(asn1_compile_SOURCES) asn1_print.c check-der.c
-
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .l .lo .o .obj .y
-$(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/asn1/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
-libasn1.la: $(libasn1_la_OBJECTS) $(libasn1_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(libasn1_la_LDFLAGS) $(libasn1_la_OBJECTS) $(libasn1_la_LIBADD) $(LIBS)
-
-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
-parse.h: parse.c
- @if test ! -f $@; then \
- rm -f parse.c; \
- $(MAKE) parse.c; \
- else :; fi
-asn1_compile$(EXEEXT): $(asn1_compile_OBJECTS) $(asn1_compile_DEPENDENCIES)
- @rm -f asn1_compile$(EXEEXT)
- $(LINK) $(asn1_compile_LDFLAGS) $(asn1_compile_OBJECTS) $(asn1_compile_LDADD) $(LIBS)
-asn1_print$(EXEEXT): $(asn1_print_OBJECTS) $(asn1_print_DEPENDENCIES)
- @rm -f asn1_print$(EXEEXT)
- $(LINK) $(asn1_print_LDFLAGS) $(asn1_print_OBJECTS) $(asn1_print_LDADD) $(LIBS)
-check-der$(EXEEXT): $(check_der_OBJECTS) $(check_der_DEPENDENCIES)
- @rm -f check-der$(EXEEXT)
- $(LINK) $(check_der_LDFLAGS) $(check_der_OBJECTS) $(check_der_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)/'`$<
-
-.l.c:
- $(LEXCOMPILE) `test -f $< || echo '$(srcdir)/'`$<
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
- rm -f $(LEX_OUTPUT_ROOT).c
-
-.y.c:
- $(YACCCOMPILE) `test -f '$<' || echo '$(srcdir)/'`$<
- sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@
- rm -f y.tab.c
- if test -f y.tab.h; then \
- to=`echo "$*_H" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
- sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >$*.ht; \
- rm -f y.tab.h; \
- if cmp -s $*.ht $*.h; then \
- rm -f $*.ht ;\
- else \
- mv $*.ht $*.h; \
- fi; \
- fi
- if test -f y.output; then \
- mv y.output $*.output; \
- fi
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-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) $(HEADERS) all-local
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(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."
- -test -z "lex.cparse.hparse.c$(BUILT_SOURCES)" || rm -f lex.c parse.h parse.c $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: 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-exec-am: install-libLTLIBRARIES
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-
-install-info: install-info-am
-
-install-man:
-
-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-includeHEADERS uninstall-info-am \
- uninstall-libLTLIBRARIES
-
-.PHONY: GTAGS all all-am all-local check check-TESTS check-am \
- check-local clean 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-data install-data-am install-data-local \
- install-exec install-exec-am install-includeHEADERS \
- install-info install-info-am install-libLTLIBRARIES install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- tags uninstall uninstall-am uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLTLIBRARIES
-
-
-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) $<
-
-$(asn1_compile_OBJECTS): parse.h parse.c
-
-$(gen_files) krb5_asn1.h: asn1_files
-
-asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1
- ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 krb5_asn1
-
-$(libasn1_la_OBJECTS): krb5_asn1.h asn1_err.h
-
-$(asn1_print_OBJECTS): krb5_asn1.h
-# 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/asn1/Makefile.am b/crypto/heimdal/lib/asn1/Makefile.am
deleted file mode 100644
index 36cd9f015d55f..0000000000000
--- a/crypto/heimdal/lib/asn1/Makefile.am
+++ /dev/null
@@ -1,128 +0,0 @@
-# $Id: Makefile.am,v 1.69.2.1 2003/05/12 15:20:44 joda Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-YFLAGS = -d
-
-lib_LTLIBRARIES = libasn1.la
-libasn1_la_LDFLAGS = -version-info 6:1:0
-
-libasn1_la_LIBADD = @LIB_com_err@
-
-BUILT_SOURCES = \
- $(gen_files:.x=.c) \
- asn1_err.h \
- asn1_err.c
-
-gen_files = \
- asn1_APOptions.x \
- asn1_AP_REP.x \
- asn1_AP_REQ.x \
- asn1_AS_REP.x \
- asn1_AS_REQ.x \
- asn1_Authenticator.x \
- asn1_AuthorizationData.x \
- asn1_CKSUMTYPE.x \
- asn1_Checksum.x \
- asn1_ENCTYPE.x \
- asn1_ETYPE_INFO.x \
- asn1_ETYPE_INFO_ENTRY.x \
- asn1_EncAPRepPart.x \
- asn1_EncASRepPart.x \
- asn1_EncKDCRepPart.x \
- asn1_EncKrbCredPart.x \
- asn1_EncKrbPrivPart.x \
- asn1_EncTGSRepPart.x \
- asn1_EncTicketPart.x \
- asn1_EncryptedData.x \
- asn1_EncryptionKey.x \
- asn1_HostAddress.x \
- asn1_HostAddresses.x \
- asn1_KDCOptions.x \
- asn1_KDC_REP.x \
- asn1_KDC_REQ.x \
- asn1_KDC_REQ_BODY.x \
- asn1_KRB_CRED.x \
- asn1_KRB_ERROR.x \
- asn1_KRB_PRIV.x \
- asn1_KRB_SAFE.x \
- asn1_KRB_SAFE_BODY.x \
- asn1_KerberosTime.x \
- asn1_KrbCredInfo.x \
- asn1_LastReq.x \
- asn1_LR_TYPE.x \
- asn1_MESSAGE_TYPE.x \
- asn1_METHOD_DATA.x \
- asn1_NAME_TYPE.x \
- asn1_PADATA_TYPE.x \
- asn1_PA_DATA.x \
- asn1_PA_ENC_TS_ENC.x \
- asn1_Principal.x \
- asn1_PrincipalName.x \
- asn1_Realm.x \
- asn1_TGS_REP.x \
- asn1_TGS_REQ.x \
- asn1_Ticket.x \
- asn1_TicketFlags.x \
- asn1_TransitedEncoding.x \
- asn1_UNSIGNED.x
-
-
-noinst_PROGRAMS = asn1_compile asn1_print
-check_PROGRAMS = check-der check-gen
-TESTS = check-der check-gen
-
-check_der_SOURCES = check-der.c check-common.c
-check_gen_SOURCES = check-gen.c check-common.c
-
-
-asn1_compile_SOURCES = \
- gen.c \
- gen_copy.c \
- gen_decode.c \
- gen_encode.c \
- gen_free.c \
- gen_glue.c \
- gen_length.c \
- hash.c \
- lex.l \
- main.c \
- parse.y \
- symbol.c
-
-libasn1_la_SOURCES = \
- der_get.c \
- der_put.c \
- der_free.c \
- der_length.c \
- der_copy.c \
- timegm.c \
- $(BUILT_SOURCES)
-
-asn1_compile_LDADD = \
- $(LIB_roken) $(LEXLIB)
-
-check_der_LDADD = \
- libasn1.la \
- $(LIB_roken)
-
-check_gen_LDADD = $(check_der_LDADD)
-asn1_print_LDADD = $(check_der_LDADD)
-
-CLEANFILES = lex.c parse.c parse.h krb5_asn1.h $(BUILT_SOURCES) \
- $(gen_files) asn1_files
-
-include_HEADERS = krb5_asn1.h asn1_err.h der.h
-
-$(asn1_compile_OBJECTS): parse.h parse.c
-
-$(gen_files) krb5_asn1.h: asn1_files
-
-asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1
- ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 krb5_asn1
-
-$(libasn1_la_OBJECTS): krb5_asn1.h asn1_err.h
-
-$(asn1_print_OBJECTS): krb5_asn1.h
-
-EXTRA_DIST = asn1_err.et
diff --git a/crypto/heimdal/lib/asn1/Makefile.in b/crypto/heimdal/lib/asn1/Makefile.in
deleted file mode 100644
index e97ee0415b722..0000000000000
--- a/crypto/heimdal/lib/asn1/Makefile.in
+++ /dev/null
@@ -1,880 +0,0 @@
-# Makefile.in generated by automake 1.6.1 from Makefile.am.
-# @configure_input@
-
-# 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.
-
-@SET_MAKE@
-
-# $Id: Makefile.am,v 1.69.2.1 2003/05/12 15:20:44 joda Exp $
-
-# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $
-
-# $Id: Makefile.am.common,v 1.37.2.1 2003/05/08 17:08:09 joda Exp $
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-
-ACLOCAL = @ACLOCAL@
-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_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = @program_transform_name@
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-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@
-AWK = @AWK@
-CANONICAL_HOST = @CANONICAL_HOST@
-CATMAN = @CATMAN@
-CATMANEXT = @CATMANEXT@
-CC = @CC@
-COMPILE_ET = @COMPILE_ET@
-CPP = @CPP@
-DBLIB = @DBLIB@
-DEPDIR = @DEPDIR@
-DIR_com_err = @DIR_com_err@
-DIR_des = @DIR_des@
-DIR_roken = @DIR_roken@
-DLLTOOL = @DLLTOOL@
-ECHO = @ECHO@
-EXTRA_LIB45 = @EXTRA_LIB45@
-GROFF = @GROFF@
-INCLUDES_roken = @INCLUDES_roken@
-INCLUDE_ = @INCLUDE_@
-INCLUDE_des = @INCLUDE_des@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LEX = @LEX@
-
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBTOOL = @LIBTOOL@
-LIB_ = @LIB_@
-LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@
-LIB_NDBM = @LIB_NDBM@
-LIB_com_err = @LIB_com_err@
-LIB_com_err_a = @LIB_com_err_a@
-LIB_com_err_so = @LIB_com_err_so@
-LIB_des = @LIB_des@
-LIB_des_a = @LIB_des_a@
-LIB_des_appl = @LIB_des_appl@
-LIB_des_so = @LIB_des_so@
-LIB_kdb = @LIB_kdb@
-LIB_otp = @LIB_otp@
-LIB_roken = @LIB_roken@
-LIB_security = @LIB_security@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@
-NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@
-NROFF = @NROFF@
-OBJDUMP = @OBJDUMP@
-PACKAGE = @PACKAGE@
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VOID_RETSIGTYPE = @VOID_RETSIGTYPE@
-WFLAGS = @WFLAGS@
-WFLAGS_NOIMPLICITINT = @WFLAGS_NOIMPLICITINT@
-WFLAGS_NOUNUSED = @WFLAGS_NOUNUSED@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-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_ldflags = @dpagaix_ldflags@
-install_sh = @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)
-
-@do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME
-
-AM_CFLAGS = $(WFLAGS)
-
-CP = cp
-
-buildinclude = $(top_builddir)/include
-
-LIB_XauReadAuth = @LIB_XauReadAuth@
-LIB_crypt = @LIB_crypt@
-LIB_dbm_firstkey = @LIB_dbm_firstkey@
-LIB_dbopen = @LIB_dbopen@
-LIB_dlopen = @LIB_dlopen@
-LIB_dn_expand = @LIB_dn_expand@
-LIB_el_init = @LIB_el_init@
-LIB_getattr = @LIB_getattr@
-LIB_gethostbyname = @LIB_gethostbyname@
-LIB_getpwent_r = @LIB_getpwent_r@
-LIB_getpwnam_r = @LIB_getpwnam_r@
-LIB_getsockopt = @LIB_getsockopt@
-LIB_logout = @LIB_logout@
-LIB_logwtmp = @LIB_logwtmp@
-LIB_odm_initialize = @LIB_odm_initialize@
-LIB_openpty = @LIB_openpty@
-LIB_pidfile = @LIB_pidfile@
-LIB_res_search = @LIB_res_search@
-LIB_setpcred = @LIB_setpcred@
-LIB_setsockopt = @LIB_setsockopt@
-LIB_socket = @LIB_socket@
-LIB_syslog = @LIB_syslog@
-LIB_tgetent = @LIB_tgetent@
-
-HESIODLIB = @HESIODLIB@
-HESIODINCLUDE = @HESIODINCLUDE@
-INCLUDE_hesiod = @INCLUDE_hesiod@
-LIB_hesiod = @LIB_hesiod@
-
-INCLUDE_krb4 = @INCLUDE_krb4@
-LIB_krb4 = @LIB_krb4@
-
-INCLUDE_openldap = @INCLUDE_openldap@
-LIB_openldap = @LIB_openldap@
-
-INCLUDE_readline = @INCLUDE_readline@
-LIB_readline = @LIB_readline@
-
-NROFF_MAN = groff -mandoc -Tascii
-
-LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
-
-@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
-
-@KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
-
-@DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
-
-YFLAGS = -d
-
-lib_LTLIBRARIES = libasn1.la
-libasn1_la_LDFLAGS = -version-info 6:1:0
-
-libasn1_la_LIBADD = @LIB_com_err@
-
-BUILT_SOURCES = \
- $(gen_files:.x=.c) \
- asn1_err.h \
- asn1_err.c
-
-
-gen_files = \
- asn1_APOptions.x \
- asn1_AP_REP.x \
- asn1_AP_REQ.x \
- asn1_AS_REP.x \
- asn1_AS_REQ.x \
- asn1_Authenticator.x \
- asn1_AuthorizationData.x \
- asn1_CKSUMTYPE.x \
- asn1_Checksum.x \
- asn1_ENCTYPE.x \
- asn1_ETYPE_INFO.x \
- asn1_ETYPE_INFO_ENTRY.x \
- asn1_EncAPRepPart.x \
- asn1_EncASRepPart.x \
- asn1_EncKDCRepPart.x \
- asn1_EncKrbCredPart.x \
- asn1_EncKrbPrivPart.x \
- asn1_EncTGSRepPart.x \
- asn1_EncTicketPart.x \
- asn1_EncryptedData.x \
- asn1_EncryptionKey.x \
- asn1_HostAddress.x \
- asn1_HostAddresses.x \
- asn1_KDCOptions.x \
- asn1_KDC_REP.x \
- asn1_KDC_REQ.x \
- asn1_KDC_REQ_BODY.x \
- asn1_KRB_CRED.x \
- asn1_KRB_ERROR.x \
- asn1_KRB_PRIV.x \
- asn1_KRB_SAFE.x \
- asn1_KRB_SAFE_BODY.x \
- asn1_KerberosTime.x \
- asn1_KrbCredInfo.x \
- asn1_LastReq.x \
- asn1_LR_TYPE.x \
- asn1_MESSAGE_TYPE.x \
- asn1_METHOD_DATA.x \
- asn1_NAME_TYPE.x \
- asn1_PADATA_TYPE.x \
- asn1_PA_DATA.x \
- asn1_PA_ENC_TS_ENC.x \
- asn1_Principal.x \
- asn1_PrincipalName.x \
- asn1_Realm.x \
- asn1_TGS_REP.x \
- asn1_TGS_REQ.x \
- asn1_Ticket.x \
- asn1_TicketFlags.x \
- asn1_TransitedEncoding.x \
- asn1_UNSIGNED.x
-
-
-noinst_PROGRAMS = asn1_compile asn1_print
-check_PROGRAMS = check-der check-gen
-TESTS = check-der check-gen
-
-check_der_SOURCES = check-der.c check-common.c
-check_gen_SOURCES = check-gen.c check-common.c
-
-asn1_compile_SOURCES = \
- gen.c \
- gen_copy.c \
- gen_decode.c \
- gen_encode.c \
- gen_free.c \
- gen_glue.c \
- gen_length.c \
- hash.c \
- lex.l \
- main.c \
- parse.y \
- symbol.c
-
-
-libasn1_la_SOURCES = \
- der_get.c \
- der_put.c \
- der_free.c \
- der_length.c \
- der_copy.c \
- timegm.c \
- $(BUILT_SOURCES)
-
-
-asn1_compile_LDADD = \
- $(LIB_roken) $(LEXLIB)
-
-
-check_der_LDADD = \
- libasn1.la \
- $(LIB_roken)
-
-
-check_gen_LDADD = $(check_der_LDADD)
-asn1_print_LDADD = $(check_der_LDADD)
-
-CLEANFILES = lex.c parse.c parse.h krb5_asn1.h $(BUILT_SOURCES) \
- $(gen_files) asn1_files
-
-
-include_HEADERS = krb5_asn1.h asn1_err.h der.h
-
-EXTRA_DIST = asn1_err.et
-subdir = lib/asn1
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-libasn1_la_DEPENDENCIES =
-am__objects_6 = asn1_APOptions.lo asn1_AP_REP.lo asn1_AP_REQ.lo \
- asn1_AS_REP.lo asn1_AS_REQ.lo asn1_Authenticator.lo \
- asn1_AuthorizationData.lo asn1_CKSUMTYPE.lo asn1_Checksum.lo \
- asn1_ENCTYPE.lo asn1_ETYPE_INFO.lo asn1_ETYPE_INFO_ENTRY.lo \
- asn1_EncAPRepPart.lo asn1_EncASRepPart.lo asn1_EncKDCRepPart.lo \
- asn1_EncKrbCredPart.lo asn1_EncKrbPrivPart.lo \
- asn1_EncTGSRepPart.lo asn1_EncTicketPart.lo \
- asn1_EncryptedData.lo asn1_EncryptionKey.lo asn1_HostAddress.lo \
- asn1_HostAddresses.lo asn1_KDCOptions.lo asn1_KDC_REP.lo \
- asn1_KDC_REQ.lo asn1_KDC_REQ_BODY.lo asn1_KRB_CRED.lo \
- asn1_KRB_ERROR.lo asn1_KRB_PRIV.lo asn1_KRB_SAFE.lo \
- asn1_KRB_SAFE_BODY.lo asn1_KerberosTime.lo asn1_KrbCredInfo.lo \
- asn1_LastReq.lo asn1_LR_TYPE.lo asn1_MESSAGE_TYPE.lo \
- asn1_METHOD_DATA.lo asn1_NAME_TYPE.lo asn1_PADATA_TYPE.lo \
- asn1_PA_DATA.lo asn1_PA_ENC_TS_ENC.lo asn1_Principal.lo \
- asn1_PrincipalName.lo asn1_Realm.lo asn1_TGS_REP.lo \
- asn1_TGS_REQ.lo asn1_Ticket.lo asn1_TicketFlags.lo \
- asn1_TransitedEncoding.lo asn1_UNSIGNED.lo
-am__objects_5 = $(am__objects_6) asn1_err.lo
-am_libasn1_la_OBJECTS = der_get.lo der_put.lo der_free.lo der_length.lo \
- der_copy.lo timegm.lo $(am__objects_5)
-libasn1_la_OBJECTS = $(am_libasn1_la_OBJECTS)
-check_PROGRAMS = check-der$(EXEEXT) check-gen$(EXEEXT)
-noinst_PROGRAMS = asn1_compile$(EXEEXT) asn1_print$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-am_asn1_compile_OBJECTS = gen.$(OBJEXT) gen_copy.$(OBJEXT) \
- gen_decode.$(OBJEXT) gen_encode.$(OBJEXT) gen_free.$(OBJEXT) \
- gen_glue.$(OBJEXT) gen_length.$(OBJEXT) hash.$(OBJEXT) \
- lex.$(OBJEXT) main.$(OBJEXT) parse.$(OBJEXT) symbol.$(OBJEXT)
-asn1_compile_OBJECTS = $(am_asn1_compile_OBJECTS)
-asn1_compile_DEPENDENCIES =
-asn1_compile_LDFLAGS =
-asn1_print_SOURCES = asn1_print.c
-asn1_print_OBJECTS = asn1_print.$(OBJEXT)
-asn1_print_DEPENDENCIES = libasn1.la
-asn1_print_LDFLAGS =
-am_check_der_OBJECTS = check-der.$(OBJEXT) check-common.$(OBJEXT)
-check_der_OBJECTS = $(am_check_der_OBJECTS)
-check_der_DEPENDENCIES = libasn1.la
-check_der_LDFLAGS =
-am_check_gen_OBJECTS = check-gen.$(OBJEXT) check-common.$(OBJEXT)
-check_gen_OBJECTS = $(am_check_gen_OBJECTS)
-check_gen_DEPENDENCIES = libasn1.la
-check_gen_LDFLAGS =
-
-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) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CFLAGS = @CFLAGS@
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
-DIST_SOURCES = $(libasn1_la_SOURCES) $(asn1_compile_SOURCES) \
- asn1_print.c $(check_der_SOURCES) $(check_gen_SOURCES)
-HEADERS = $(include_HEADERS)
-
-DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in lex.c parse.c \
- parse.h
-SOURCES = $(libasn1_la_SOURCES) $(asn1_compile_SOURCES) asn1_print.c $(check_der_SOURCES) $(check_gen_SOURCES)
-
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .l .lo .o .obj .y
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ 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/asn1/Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(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)
-libasn1.la: $(libasn1_la_OBJECTS) $(libasn1_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(libasn1_la_LDFLAGS) $(libasn1_la_OBJECTS) $(libasn1_la_LIBADD) $(LIBS)
-
-clean-checkPROGRAMS:
- -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-parse.h: parse.c
-asn1_compile$(EXEEXT): $(asn1_compile_OBJECTS) $(asn1_compile_DEPENDENCIES)
- @rm -f asn1_compile$(EXEEXT)
- $(LINK) $(asn1_compile_LDFLAGS) $(asn1_compile_OBJECTS) $(asn1_compile_LDADD) $(LIBS)
-asn1_print$(EXEEXT): $(asn1_print_OBJECTS) $(asn1_print_DEPENDENCIES)
- @rm -f asn1_print$(EXEEXT)
- $(LINK) $(asn1_print_LDFLAGS) $(asn1_print_OBJECTS) $(asn1_print_LDADD) $(LIBS)
-check-der$(EXEEXT): $(check_der_OBJECTS) $(check_der_DEPENDENCIES)
- @rm -f check-der$(EXEEXT)
- $(LINK) $(check_der_LDFLAGS) $(check_der_OBJECTS) $(check_der_LDADD) $(LIBS)
-check-gen$(EXEEXT): $(check_gen_OBJECTS) $(check_gen_DEPENDENCIES)
- @rm -f check-gen$(EXEEXT)
- $(LINK) $(check_gen_LDFLAGS) $(check_gen_OBJECTS) $(check_gen_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)/'`$<
-
-.l.c:
- $(LEXCOMPILE) `test -f $< || echo '$(srcdir)/'`$<
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
- rm -f $(LEX_OUTPUT_ROOT).c
-
-.y.c:
- $(YACCCOMPILE) `test -f '$<' || echo '$(srcdir)/'`$<
- sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@
- rm -f y.tab.c
- if test -f y.tab.h; then \
- to=`echo "$*_H" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
- sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >$*.ht; \
- rm -f y.tab.h; \
- if cmp -s $*.ht $*.h; then \
- rm -f $*.ht ;\
- else \
- mv $*.ht $*.h; \
- fi; \
- fi
- if test -f y.output; then \
- mv y.output $*.output; \
- fi
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-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)
- @for file in $(DISTFILES); 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) $(HEADERS) all-local
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(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) stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "parse.h$(BUILT_SOURCES)" || rm -f parse.h $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: 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-includeHEADERS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
-install-exec-am: install-libLTLIBRARIES
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-
-install-info: install-info-am
-
-install-man:
-
-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-includeHEADERS uninstall-info-am \
- uninstall-libLTLIBRARIES
-
-.PHONY: GTAGS all all-am all-local check check-TESTS check-am \
- check-local clean 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-data install-data-am install-exec \
- install-exec-am install-includeHEADERS install-info \
- install-info-am install-libLTLIBRARIES install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- tags uninstall uninstall-am uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLTLIBRARIES
-
-
-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-hook: install-cat-mans
-
-.et.h:
- $(COMPILE_ET) $<
-.et.c:
- $(COMPILE_ET) $<
-
-$(asn1_compile_OBJECTS): parse.h parse.c
-
-$(gen_files) krb5_asn1.h: asn1_files
-
-asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1
- ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 krb5_asn1
-
-$(libasn1_la_OBJECTS): krb5_asn1.h asn1_err.h
-
-$(asn1_print_OBJECTS): krb5_asn1.h
-# 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/asn1/asn1-common.h b/crypto/heimdal/lib/asn1/asn1-common.h
deleted file mode 100644
index 251d401d5608e..0000000000000
--- a/crypto/heimdal/lib/asn1/asn1-common.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $Id: asn1-common.h,v 1.2 2001/09/25 13:39:25 assar Exp $ */
-
-#include <stddef.h>
-#include <time.h>
-
-#ifndef __asn1_common_definitions__
-#define __asn1_common_definitions__
-
-typedef struct octet_string {
- size_t length;
- void *data;
-} octet_string;
-
-typedef char *general_string;
-
-typedef struct oid {
- size_t length;
- unsigned *components;
-} oid;
-
-#endif
diff --git a/crypto/heimdal/lib/asn1/asn1_err.et b/crypto/heimdal/lib/asn1/asn1_err.et
deleted file mode 100644
index 8f1f272cccbda..0000000000000
--- a/crypto/heimdal/lib/asn1/asn1_err.et
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Error messages for the asn.1 library
-#
-# This might look like a com_err file, but is not
-#
-id "$Id: asn1_err.et,v 1.5 1998/02/16 16:17:17 joda Exp $"
-
-error_table asn1
-prefix ASN1
-error_code BAD_TIMEFORMAT, "ASN.1 failed call to system time library"
-error_code MISSING_FIELD, "ASN.1 structure is missing a required field"
-error_code MISPLACED_FIELD, "ASN.1 unexpected field number"
-error_code TYPE_MISMATCH, "ASN.1 type numbers are inconsistent"
-error_code OVERFLOW, "ASN.1 value too large"
-error_code OVERRUN, "ASN.1 encoding ended unexpectedly"
-error_code BAD_ID, "ASN.1 identifier doesn't match expected value"
-error_code BAD_LENGTH, "ASN.1 length doesn't match expected value"
-error_code BAD_FORMAT, "ASN.1 badly-formatted encoding"
-error_code PARSE_ERROR, "ASN.1 parse error"
-end
diff --git a/crypto/heimdal/lib/asn1/asn1_print.c b/crypto/heimdal/lib/asn1/asn1_print.c
deleted file mode 100644
index d3199e8edd81a..0000000000000
--- a/crypto/heimdal/lib/asn1/asn1_print.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 1997 - 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.
- */
-
-#include "der_locl.h"
-#include <com_err.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <getarg.h>
-#include <err.h>
-
-RCSID("$Id: asn1_print.c,v 1.11 2002/08/29 20:45:35 assar Exp $");
-
-const char *class_names[] = {
- "UNIV", /* 0 */
- "APPL", /* 1 */
- "CONTEXT", /* 2 */
- "PRIVATE" /* 3 */
-};
-
-const char *type_names[] = {
- "PRIM", /* 0 */
- "CONS" /* 1 */
-};
-
-const char *tag_names[] = {
- NULL, /* 0 */
- NULL, /* 1 */
- "Integer", /* 2 */
- "BitString", /* 3 */
- "OctetString", /* 4 */
- "Null", /* 5 */
- "ObjectID", /* 6 */
- NULL, /* 7 */
- NULL, /* 8 */
- NULL, /* 9 */
- NULL, /* 10 */
- NULL, /* 11 */
- NULL, /* 12 */
- NULL, /* 13 */
- NULL, /* 14 */
- NULL, /* 15 */
- "Sequence", /* 16 */
- "Set", /* 17 */
- NULL, /* 18 */
- "PrintableString", /* 19 */
- NULL, /* 20 */
- NULL, /* 21 */
- "IA5String", /* 22 */
- "UTCTime", /* 23 */
- "GeneralizedTime", /* 24 */
- NULL, /* 25 */
- "VisibleString", /* 26 */
- "GeneralString" /* 27 */
-};
-
-static int
-loop (unsigned char *buf, size_t len, int indent)
-{
- while (len > 0) {
- int ret;
- Der_class class;
- Der_type type;
- int tag;
- size_t sz;
- size_t length;
- int i;
-
- ret = der_get_tag (buf, len, &class, &type, &tag, &sz);
- if (ret)
- errx (1, "der_get_tag: %s", error_message (ret));
- if (sz > len)
- errx (1, "unreasonable length (%u) > %u",
- (unsigned)sz, (unsigned)len);
- buf += sz;
- len -= sz;
- for (i = 0; i < indent; ++i)
- printf (" ");
- printf ("%s %s ", class_names[class], type_names[type]);
- if (tag_names[tag])
- printf ("%s = ", tag_names[tag]);
- else
- printf ("tag %d = ", tag);
- ret = der_get_length (buf, len, &length, &sz);
- if (ret)
- errx (1, "der_get_tag: %s", error_message (ret));
- buf += sz;
- len -= sz;
-
- if (class == CONTEXT) {
- printf ("[%d]\n", tag);
- loop (buf, length, indent);
- } else if (class == UNIV) {
- switch (tag) {
- case UT_Sequence :
- printf ("{\n");
- loop (buf, length, indent + 2);
- for (i = 0; i < indent; ++i)
- printf (" ");
- printf ("}\n");
- break;
- case UT_Integer : {
- int val;
-
- ret = der_get_int (buf, length, &val, NULL);
- if (ret)
- errx (1, "der_get_int: %s", error_message (ret));
- printf ("integer %d\n", val);
- break;
- }
- case UT_OctetString : {
- octet_string str;
- int i;
- unsigned char *uc;
-
- ret = der_get_octet_string (buf, length, &str, NULL);
- if (ret)
- errx (1, "der_get_octet_string: %s", error_message (ret));
- printf ("(length %lu), ", (unsigned long)length);
- uc = (unsigned char *)str.data;
- for (i = 0; i < 16; ++i)
- printf ("%02x", uc[i]);
- printf ("\n");
- free (str.data);
- break;
- }
- case UT_GeneralizedTime :
- case UT_GeneralString : {
- general_string str;
-
- ret = der_get_general_string (buf, length, &str, NULL);
- if (ret)
- errx (1, "der_get_general_string: %s",
- error_message (ret));
- printf ("\"%s\"\n", str);
- free (str);
- break;
- }
- case UT_OID: {
- oid o;
- int i;
-
- ret = der_get_oid(buf, length, &o, NULL);
- if (ret)
- errx (1, "der_get_oid: %s", error_message (ret));
-
- for (i = 0; i < o.length ; i++)
- printf("%d%s", o.components[i],
- i < o.length - 1 ? "." : "");
- printf("\n");
- free_oid(&o);
- break;
- }
- default :
- printf ("%lu bytes\n", (unsigned long)length);
- break;
- }
- }
- buf += length;
- len -= length;
- }
- return 0;
-}
-
-static int
-doit (const char *filename)
-{
- int fd = open (filename, O_RDONLY);
- struct stat sb;
- unsigned char *buf;
- size_t len;
- int ret;
-
- if(fd < 0)
- err (1, "opening %s for read", filename);
- if (fstat (fd, &sb) < 0)
- err (1, "stat %s", filename);
- len = sb.st_size;
- buf = malloc (len);
- if (buf == NULL)
- err (1, "malloc %u", (unsigned)len);
- if (read (fd, buf, len) != len)
- errx (1, "read failed");
- close (fd);
- ret = loop (buf, len, 0);
- free (buf);
- return ret;
-}
-
-
-static int version_flag;
-static int help_flag;
-struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-int num_args = sizeof(args) / sizeof(args[0]);
-
-static void
-usage(int code)
-{
- arg_printusage(args, num_args, NULL, "dump-file");
- exit(code);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
- setprogname (argv[0]);
- initialize_asn1_error_table ();
- if(getarg(args, num_args, argc, argv, &optind))
- usage(1);
- if(help_flag)
- usage(0);
- if(version_flag) {
- print_version(NULL);
- exit(0);
- }
- argv += optind;
- argc -= optind;
- if (argc != 1)
- usage (1);
- return doit (argv[0]);
-}
diff --git a/crypto/heimdal/lib/asn1/check-common.c b/crypto/heimdal/lib/asn1/check-common.c
deleted file mode 100644
index 20a41ad859a54..0000000000000
--- a/crypto/heimdal/lib/asn1/check-common.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <err.h>
-#include <roken.h>
-
-#include "check-common.h"
-
-RCSID("$Id: check-common.c,v 1.1 2003/01/23 10:21:36 lha Exp $");
-
-static void
-print_bytes (unsigned const char *buf, size_t len)
-{
- int i;
-
- for (i = 0; i < len; ++i)
- printf ("%02x ", buf[i]);
-}
-
-int
-generic_test (const struct test_case *tests,
- unsigned ntests,
- size_t data_size,
- int (*encode)(unsigned char *, size_t, void *, size_t *),
- int (*length)(void *),
- int (*decode)(unsigned char *, size_t, void *, size_t *),
- int (*cmp)(void *a, void *b))
-{
- unsigned char buf[4711];
- int i;
- int failures = 0;
- void *val = malloc (data_size);
-
- if (data_size != 0 && val == NULL)
- err (1, "malloc");
-
- for (i = 0; i < ntests; ++i) {
- int ret;
- size_t sz, consumed_sz, length_sz;
- unsigned char *beg;
-
- ret = (*encode) (buf + sizeof(buf) - 1, sizeof(buf),
- tests[i].val, &sz);
- beg = buf + sizeof(buf) - sz;
- if (ret != 0) {
- printf ("encoding of %s failed\n", tests[i].name);
- ++failures;
- }
- if (sz != tests[i].byte_len) {
- printf ("encoding of %s has wrong len (%lu != %lu)\n",
- tests[i].name,
- (unsigned long)sz, (unsigned long)tests[i].byte_len);
- ++failures;
- }
-
- length_sz = (*length) (tests[i].val);
- if (sz != length_sz) {
- printf ("length for %s is bad (%lu != %lu)\n",
- tests[i].name, (unsigned long)length_sz, (unsigned long)sz);
- ++failures;
- }
-
- if (memcmp (beg, tests[i].bytes, tests[i].byte_len) != 0) {
- printf ("encoding of %s has bad bytes:\n"
- "correct: ", tests[i].name);
- print_bytes (tests[i].bytes, tests[i].byte_len);
- printf ("\nactual: ");
- print_bytes (beg, sz);
- printf ("\n");
- ++failures;
- }
- ret = (*decode) (beg, sz, val, &consumed_sz);
- if (ret != 0) {
- printf ("decoding of %s failed\n", tests[i].name);
- ++failures;
- }
- if (sz != consumed_sz) {
- printf ("different length decoding %s (%ld != %ld)\n",
- tests[i].name,
- (unsigned long)sz, (unsigned long)consumed_sz);
- ++failures;
- }
- if ((*cmp)(val, tests[i].val) != 0) {
- printf ("%s: comparison failed\n", tests[i].name);
- ++failures;
- }
- }
- free (val);
- return failures;
-}
diff --git a/crypto/heimdal/lib/asn1/check-common.h b/crypto/heimdal/lib/asn1/check-common.h
deleted file mode 100644
index 52d59cb4f7a80..0000000000000
--- a/crypto/heimdal/lib/asn1/check-common.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 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.
- */
-
-struct test_case {
- void *val;
- int byte_len;
- const unsigned char *bytes;
- char *name;
-};
-
-typedef int (*generic_encode)(unsigned char *, size_t, void *, size_t *);
-typedef int (*generic_length)(void *);
-typedef int (*generic_decode)(unsigned char *, size_t, void *, size_t *);
-
-int
-generic_test (const struct test_case *tests,
- unsigned ntests,
- size_t data_size,
- int (*encode)(unsigned char *, size_t, void *, size_t *),
- int (*length)(void *),
- int (*decode)(unsigned char *, size_t, void *, size_t *),
- int (*cmp)(void *a, void *b));
-
diff --git a/crypto/heimdal/lib/asn1/check-der.c b/crypto/heimdal/lib/asn1/check-der.c
deleted file mode 100644
index 7cb057749e49f..0000000000000
--- a/crypto/heimdal/lib/asn1/check-der.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <err.h>
-#include <roken.h>
-
-#include <asn1-common.h>
-#include <asn1_err.h>
-#include <der.h>
-
-#include "check-common.h"
-
-RCSID("$Id: check-der.c,v 1.9 2003/01/23 10:19:49 lha Exp $");
-
-static int
-cmp_integer (void *a, void *b)
-{
- int *ia = (int *)a;
- int *ib = (int *)b;
-
- return *ib - *ia;
-}
-
-static int
-test_integer (void)
-{
- struct test_case tests[] = {
- {NULL, 3, "\x02\x01\x00"},
- {NULL, 3, "\x02\x01\x7f"},
- {NULL, 4, "\x02\x02\x00\x80"},
- {NULL, 4, "\x02\x02\x01\x00"},
- {NULL, 3, "\x02\x01\x80"},
- {NULL, 4, "\x02\x02\xff\x7f"},
- {NULL, 3, "\x02\x01\xff"},
- {NULL, 4, "\x02\x02\xff\x01"},
- {NULL, 4, "\x02\x02\x00\xff"},
- {NULL, 6, "\x02\x04\x80\x00\x00\x00"},
- {NULL, 6, "\x02\x04\x7f\xff\xff\xff"}
- };
-
- int values[] = {0, 127, 128, 256, -128, -129, -1, -255, 255,
- 0x80000000, 0x7fffffff};
- int i;
- int ntests = sizeof(tests) / sizeof(*tests);
-
- for (i = 0; i < ntests; ++i) {
- tests[i].val = &values[i];
- asprintf (&tests[i].name, "integer %d", values[i]);
- }
-
- return generic_test (tests, ntests, sizeof(int),
- (generic_encode)encode_integer,
- (generic_length) length_integer,
- (generic_decode)decode_integer,
- cmp_integer);
-}
-
-static int
-cmp_octet_string (void *a, void *b)
-{
- octet_string *oa = (octet_string *)a;
- octet_string *ob = (octet_string *)b;
-
- if (oa->length != ob->length)
- return ob->length - oa->length;
-
- return (memcmp (oa->data, ob->data, oa->length));
-}
-
-static int
-test_octet_string (void)
-{
- octet_string s1 = {8, "\x01\x23\x45\x67\x89\xab\xcd\xef"};
-
- struct test_case tests[] = {
- {NULL, 10, "\x04\x08\x01\x23\x45\x67\x89\xab\xcd\xef"}
- };
- int ntests = sizeof(tests) / sizeof(*tests);
-
- tests[0].val = &s1;
- asprintf (&tests[0].name, "a octet string");
-
- return generic_test (tests, ntests, sizeof(octet_string),
- (generic_encode)encode_octet_string,
- (generic_length)length_octet_string,
- (generic_decode)decode_octet_string,
- cmp_octet_string);
-}
-
-static int
-cmp_general_string (void *a, void *b)
-{
- unsigned char **sa = (unsigned char **)a;
- unsigned char **sb = (unsigned char **)b;
-
- return strcmp (*sa, *sb);
-}
-
-static int
-test_general_string (void)
-{
- unsigned char *s1 = "Test User 1";
-
- struct test_case tests[] = {
- {NULL, 13, "\x1b\x0b\x54\x65\x73\x74\x20\x55\x73\x65\x72\x20\x31"}
- };
- int ntests = sizeof(tests) / sizeof(*tests);
-
- tests[0].val = &s1;
- asprintf (&tests[0].name, "the string \"%s\"", s1);
-
- return generic_test (tests, ntests, sizeof(unsigned char *),
- (generic_encode)encode_general_string,
- (generic_length)length_general_string,
- (generic_decode)decode_general_string,
- cmp_general_string);
-}
-
-static int
-cmp_generalized_time (void *a, void *b)
-{
- time_t *ta = (time_t *)a;
- time_t *tb = (time_t *)b;
-
- return *tb - *ta;
-}
-
-static int
-test_generalized_time (void)
-{
- struct test_case tests[] = {
- {NULL, 17, "\x18\x0f""19700101000000Z"},
- {NULL, 17, "\x18\x0f""19851106210627Z"}
- };
- time_t values[] = {0, 500159187};
- int i;
- int ntests = sizeof(tests) / sizeof(*tests);
-
- for (i = 0; i < ntests; ++i) {
- tests[i].val = &values[i];
- asprintf (&tests[i].name, "time %d", (int)values[i]);
- }
-
- return generic_test (tests, ntests, sizeof(time_t),
- (generic_encode)encode_generalized_time,
- (generic_length)length_generalized_time,
- (generic_decode)decode_generalized_time,
- cmp_generalized_time);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
-
- ret += test_integer ();
- ret += test_octet_string ();
- ret += test_general_string ();
- ret += test_generalized_time ();
-
- return ret;
-}
diff --git a/crypto/heimdal/lib/asn1/check-gen.c b/crypto/heimdal/lib/asn1/check-gen.c
deleted file mode 100644
index 0b0bec939b4d9..0000000000000
--- a/crypto/heimdal/lib/asn1/check-gen.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <err.h>
-#include <roken.h>
-
-#include <asn1-common.h>
-#include <asn1_err.h>
-#include <der.h>
-#include <krb5_asn1.h>
-
-#include "check-common.h"
-
-RCSID("$Id: check-gen.c,v 1.2.2.1 2003/05/06 16:49:57 joda Exp $");
-
-static char *lha_princ[] = { "lha" };
-static char *lharoot_princ[] = { "lha", "root" };
-static char *datan_princ[] = { "host", "nutcracker.e.kth.se" };
-
-
-#define COMPARE_STRING(ac,bc,e) \
- do { if (strcmp((ac)->e, (bc)->e) != 0) return 1; } while(0)
-#define COMPARE_INTEGER(ac,bc,e) \
- do { if ((ac)->e != (bc)->e) return 1; } while(0)
-#define COMPARE_MEM(ac,bc,e,len) \
- do { if (memcmp((ac)->e, (bc)->e,len) != 0) return 1; } while(0)
-
-static int
-cmp_principal (void *a, void *b)
-{
- Principal *pa = a;
- Principal *pb = b;
- int i;
-
- COMPARE_STRING(pa,pb,realm);
- COMPARE_INTEGER(pa,pb,name.name_type);
- COMPARE_INTEGER(pa,pb,name.name_string.len);
-
- for (i = 0; i < pa->name.name_string.len; i++)
- COMPARE_STRING(pa,pb,name.name_string.val[i]);
-
- return 0;
-}
-
-static int
-test_principal (void)
-{
-
- struct test_case tests[] = {
- { NULL, 29,
- (unsigned char*)"\x30\x1b\xa0\x10\x30\x0e\xa0\x03\x02\x01\x01\xa1\x07\x30\x05\x1b"
- "\x03\x6c\x68\x61\xa1\x07\x1b\x05\x53\x55\x2e\x53\x45"
- },
- { NULL, 35,
- (unsigned char*)"\x30\x21\xa0\x16\x30\x14\xa0\x03\x02\x01\x01\xa1\x0d\x30\x0b\x1b"
- "\x03\x6c\x68\x61\x1b\x04\x72\x6f\x6f\x74\xa1\x07\x1b\x05\x53\x55"
- "\x2e\x53\x45"
- },
- { NULL, 54,
- (unsigned char*)"\x30\x34\xa0\x26\x30\x24\xa0\x03\x02\x01\x03\xa1\x1d\x30\x1b\x1b"
- "\x04\x68\x6f\x73\x74\x1b\x13\x6e\x75\x74\x63\x72\x61\x63\x6b\x65"
- "\x72\x2e\x65\x2e\x6b\x74\x68\x2e\x73\x65\xa1\x0a\x1b\x08\x45\x2e"
- "\x4b\x54\x48\x2e\x53\x45"
- }
- };
-
-
- Principal values[] = {
- { { KRB5_NT_PRINCIPAL, { 1, lha_princ } }, "SU.SE" },
- { { KRB5_NT_PRINCIPAL, { 2, lharoot_princ } }, "SU.SE" },
- { { KRB5_NT_SRV_HST, { 2, datan_princ } }, "E.KTH.SE" }
- };
- int i;
- int ntests = sizeof(tests) / sizeof(*tests);
-
- for (i = 0; i < ntests; ++i) {
- tests[i].val = &values[i];
- asprintf (&tests[i].name, "Principal %d", i);
- }
-
- return generic_test (tests, ntests, sizeof(Principal),
- (generic_encode)encode_Principal,
- (generic_length)length_Principal,
- (generic_decode)decode_Principal,
- cmp_principal);
-}
-
-static int
-cmp_authenticator (void *a, void *b)
-{
- Authenticator *aa = a;
- Authenticator *ab = b;
- int i;
-
- COMPARE_INTEGER(aa,ab,authenticator_vno);
- COMPARE_STRING(aa,ab,crealm);
-
- COMPARE_INTEGER(aa,ab,cname.name_type);
- COMPARE_INTEGER(aa,ab,cname.name_string.len);
-
- for (i = 0; i < aa->cname.name_string.len; i++)
- COMPARE_STRING(aa,ab,cname.name_string.val[i]);
-
- return 0;
-}
-
-static int
-test_authenticator (void)
-{
- struct test_case tests[] = {
- { NULL, 63,
- (unsigned char*)"\x62\x3d\x30\x3b\xa0\x03\x02\x01\x05\xa1\x0a\x1b\x08"
- "\x45\x2e\x4b\x54\x48\x2e\x53\x45\xa2\x10\x30\x0e\xa0"
- "\x03\x02\x01\x01\xa1\x07\x30\x05\x1b\x03\x6c\x68\x61"
- "\xa4\x03\x02\x01\x0a\xa5\x11\x18\x0f\x31\x39\x37\x30"
- "\x30\x31\x30\x31\x30\x30\x30\x31\x33\x39\x5a"
- },
- { NULL, 67,
- (unsigned char*)"\x62\x41\x30\x3f\xa0\x03\x02\x01\x05\xa1\x07\x1b\x05"
- "\x53\x55\x2e\x53\x45\xa2\x16\x30\x14\xa0\x03\x02\x01"
- "\x01\xa1\x0d\x30\x0b\x1b\x03\x6c\x68\x61\x1b\x04\x72"
- "\x6f\x6f\x74\xa4\x04\x02\x02\x01\x24\xa5\x11\x18\x0f"
- "\x31\x39\x37\x30\x30\x31\x30\x31\x30\x30\x31\x36\x33"
- "\x39\x5a"
- }
- };
-
- Authenticator values[] = {
- { 5, "E.KTH.SE", { KRB5_NT_PRINCIPAL, { 1, lha_princ } },
- NULL, 10, 99, NULL, NULL, NULL },
- { 5, "SU.SE", { KRB5_NT_PRINCIPAL, { 2, lharoot_princ } },
- NULL, 292, 999, NULL, NULL, NULL }
- };
- int i;
- int ntests = sizeof(tests) / sizeof(*tests);
-
- for (i = 0; i < ntests; ++i) {
- tests[i].val = &values[i];
- asprintf (&tests[i].name, "Authenticator %d", i);
- }
-
- return generic_test (tests, ntests, sizeof(Authenticator),
- (generic_encode)encode_Authenticator,
- (generic_length)length_Authenticator,
- (generic_decode)decode_Authenticator,
- cmp_authenticator);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
-
- ret += test_principal ();
- ret += test_authenticator();
-
- return ret;
-}
diff --git a/crypto/heimdal/lib/asn1/der.h b/crypto/heimdal/lib/asn1/der.h
deleted file mode 100644
index 738c8d7e7a4da..0000000000000
--- a/crypto/heimdal/lib/asn1/der.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: der.h,v 1.22 2001/09/27 16:20:35 assar Exp $ */
-
-#ifndef __DER_H__
-#define __DER_H__
-
-#include <time.h>
-
-typedef enum {UNIV = 0, APPL = 1, CONTEXT = 2 , PRIVATE = 3} Der_class;
-
-typedef enum {PRIM = 0, CONS = 1} Der_type;
-
-/* Universal tags */
-
-enum {
- UT_Boolean = 1,
- UT_Integer = 2,
- UT_BitString = 3,
- UT_OctetString = 4,
- UT_Null = 5,
- UT_OID = 6,
- UT_Enumerated = 10,
- UT_Sequence = 16,
- UT_Set = 17,
- UT_PrintableString = 19,
- UT_IA5String = 22,
- UT_UTCTime = 23,
- UT_GeneralizedTime = 24,
- UT_VisibleString = 26,
- UT_GeneralString = 27
-};
-
-#define ASN1_INDEFINITE 0xdce0deed
-
-#ifndef HAVE_TIMEGM
-time_t timegm (struct tm *);
-#endif
-
-int time2generalizedtime (time_t t, octet_string *s);
-
-int der_get_int (const unsigned char *p, size_t len, int *ret, size_t *size);
-int der_get_length (const unsigned char *p, size_t len,
- size_t *val, size_t *size);
-int der_get_general_string (const unsigned char *p, size_t len,
- general_string *str, size_t *size);
-int der_get_octet_string (const unsigned char *p, size_t len,
- octet_string *data, size_t *size);
-int der_get_oid (const unsigned char *p, size_t len,
- oid *data, size_t *size);
-int der_get_tag (const unsigned char *p, size_t len,
- Der_class *class, Der_type *type,
- int *tag, size_t *size);
-
-int der_match_tag (const unsigned char *p, size_t len,
- Der_class class, Der_type type,
- int tag, size_t *size);
-int der_match_tag_and_length (const unsigned char *p, size_t len,
- Der_class class, Der_type type, int tag,
- size_t *length_ret, size_t *size);
-
-int decode_integer (const unsigned char*, size_t, int*, size_t*);
-int decode_unsigned (const unsigned char*, size_t, unsigned*, size_t*);
-int decode_enumerated (const unsigned char*, size_t, unsigned*, size_t*);
-int decode_general_string (const unsigned char*, size_t,
- general_string*, size_t*);
-int decode_oid (const unsigned char *p, size_t len,
- oid *k, size_t *size);
-int decode_octet_string (const unsigned char*, size_t, octet_string*, size_t*);
-int decode_generalized_time (const unsigned char*, size_t, time_t*, size_t*);
-
-int der_put_int (unsigned char *p, size_t len, int val, size_t*);
-int der_put_length (unsigned char *p, size_t len, size_t val, size_t*);
-int der_put_general_string (unsigned char *p, size_t len,
- const general_string *str, size_t*);
-int der_put_octet_string (unsigned char *p, size_t len,
- const octet_string *data, size_t*);
-int der_put_oid (unsigned char *p, size_t len,
- const oid *data, size_t *size);
-int der_put_tag (unsigned char *p, size_t len, Der_class class, Der_type type,
- int tag, size_t*);
-int der_put_length_and_tag (unsigned char*, size_t, size_t,
- Der_class, Der_type, int, size_t*);
-
-int encode_integer (unsigned char *p, size_t len,
- const int *data, size_t*);
-int encode_unsigned (unsigned char *p, size_t len,
- const unsigned *data, size_t*);
-int encode_enumerated (unsigned char *p, size_t len,
- const unsigned *data, size_t*);
-int encode_general_string (unsigned char *p, size_t len,
- const general_string *data, size_t*);
-int encode_octet_string (unsigned char *p, size_t len,
- const octet_string *k, size_t*);
-int encode_oid (unsigned char *p, size_t len,
- const oid *k, size_t*);
-int encode_generalized_time (unsigned char *p, size_t len,
- const time_t *t, size_t*);
-
-void free_integer (int *num);
-void free_general_string (general_string *str);
-void free_octet_string (octet_string *k);
-void free_oid (oid *k);
-void free_generalized_time (time_t *t);
-
-size_t length_len (size_t len);
-size_t length_integer (const int *data);
-size_t length_unsigned (const unsigned *data);
-size_t length_enumerated (const unsigned *data);
-size_t length_general_string (const general_string *data);
-size_t length_octet_string (const octet_string *k);
-size_t length_oid (const oid *k);
-size_t length_generalized_time (const time_t *t);
-
-int copy_general_string (const general_string *from, general_string *to);
-int copy_octet_string (const octet_string *from, octet_string *to);
-int copy_oid (const oid *from, oid *to);
-
-int fix_dce(size_t reallen, size_t *len);
-
-#endif /* __DER_H__ */
diff --git a/crypto/heimdal/lib/asn1/der_copy.c b/crypto/heimdal/lib/asn1/der_copy.c
deleted file mode 100644
index eefc914170347..0000000000000
--- a/crypto/heimdal/lib/asn1/der_copy.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: der_copy.c,v 1.10 2003/04/17 07:13:08 lha Exp $");
-
-int
-copy_general_string (const general_string *from, general_string *to)
-{
- *to = strdup(*from);
- if(*to == NULL)
- return ENOMEM;
- return 0;
-}
-
-int
-copy_octet_string (const octet_string *from, octet_string *to)
-{
- to->length = from->length;
- to->data = malloc(to->length);
- if(to->length != 0 && to->data == NULL)
- return ENOMEM;
- memcpy(to->data, from->data, to->length);
- return 0;
-}
-
-int
-copy_oid (const oid *from, oid *to)
-{
- to->length = from->length;
- to->components = malloc(to->length * sizeof(*to->components));
- if (to->length != 0 && to->components == NULL)
- return ENOMEM;
- memcpy(to->components, from->components, to->length);
- return 0;
-}
diff --git a/crypto/heimdal/lib/asn1/der_free.c b/crypto/heimdal/lib/asn1/der_free.c
deleted file mode 100644
index fd78b4810d1d9..0000000000000
--- a/crypto/heimdal/lib/asn1/der_free.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: der_free.c,v 1.8 2001/09/25 13:39:26 assar Exp $");
-
-void
-free_general_string (general_string *str)
-{
- free(*str);
-}
-
-void
-free_octet_string (octet_string *k)
-{
- free(k->data);
-}
-
-void
-free_oid (oid *k)
-{
- free(k->components);
-}
diff --git a/crypto/heimdal/lib/asn1/der_get.c b/crypto/heimdal/lib/asn1/der_get.c
deleted file mode 100644
index 429fd66ed4e54..0000000000000
--- a/crypto/heimdal/lib/asn1/der_get.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * Copyright (c) 1997 - 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: der_get.c,v 1.33 2002/09/03 16:21:49 nectar Exp $");
-
-#include <version.h>
-
-/*
- * All decoding functions take a pointer `p' to first position in
- * which to read, from the left, `len' which means the maximum number
- * of characters we are able to read, `ret' were the value will be
- * returned and `size' where the number of used bytes is stored.
- * Either 0 or an error code is returned.
- */
-
-static int
-der_get_unsigned (const unsigned char *p, size_t len,
- unsigned *ret, size_t *size)
-{
- unsigned val = 0;
- size_t oldlen = len;
-
- while (len--)
- val = val * 256 + *p++;
- *ret = val;
- if(size) *size = oldlen;
- return 0;
-}
-
-int
-der_get_int (const unsigned char *p, size_t len,
- int *ret, size_t *size)
-{
- int val = 0;
- size_t oldlen = len;
-
- if (len > 0) {
- val = (signed char)*p++;
- while (--len)
- val = val * 256 + *p++;
- }
- *ret = val;
- if(size) *size = oldlen;
- return 0;
-}
-
-int
-der_get_length (const unsigned char *p, size_t len,
- size_t *val, size_t *size)
-{
- size_t v;
-
- if (len <= 0)
- return ASN1_OVERRUN;
- --len;
- v = *p++;
- if (v < 128) {
- *val = v;
- if(size) *size = 1;
- } else {
- int e;
- size_t l;
- unsigned tmp;
-
- if(v == 0x80){
- *val = ASN1_INDEFINITE;
- if(size) *size = 1;
- return 0;
- }
- v &= 0x7F;
- if (len < v)
- return ASN1_OVERRUN;
- e = der_get_unsigned (p, v, &tmp, &l);
- if(e) return e;
- *val = tmp;
- if(size) *size = l + 1;
- }
- return 0;
-}
-
-int
-der_get_general_string (const unsigned char *p, size_t len,
- general_string *str, size_t *size)
-{
- char *s;
-
- s = malloc (len + 1);
- if (s == NULL)
- return ENOMEM;
- memcpy (s, p, len);
- s[len] = '\0';
- *str = s;
- if(size) *size = len;
- return 0;
-}
-
-int
-der_get_octet_string (const unsigned char *p, size_t len,
- octet_string *data, size_t *size)
-{
- data->length = len;
- data->data = malloc(len);
- if (data->data == NULL && data->length != 0)
- return ENOMEM;
- memcpy (data->data, p, len);
- if(size) *size = len;
- return 0;
-}
-
-int
-der_get_oid (const unsigned char *p, size_t len,
- oid *data, size_t *size)
-{
- int n;
- size_t oldlen = len;
-
- if (len < 1)
- return ASN1_OVERRUN;
-
- data->components = malloc(len * sizeof(*data->components));
- if (data->components == NULL && len != 0)
- return ENOMEM;
- data->components[0] = (*p) / 40;
- data->components[1] = (*p) % 40;
- --len;
- ++p;
- for (n = 2; len > 0; ++n) {
- unsigned u = 0;
-
- do {
- --len;
- u = u * 128 + (*p++ % 128);
- } while (len > 0 && p[-1] & 0x80);
- data->components[n] = u;
- }
- if (p[-1] & 0x80) {
- free_oid (data);
- return ASN1_OVERRUN;
- }
- data->length = n;
- if (size)
- *size = oldlen;
- return 0;
-}
-
-int
-der_get_tag (const unsigned char *p, size_t len,
- Der_class *class, Der_type *type,
- int *tag, size_t *size)
-{
- if (len < 1)
- return ASN1_OVERRUN;
- *class = (Der_class)(((*p) >> 6) & 0x03);
- *type = (Der_type)(((*p) >> 5) & 0x01);
- *tag = (*p) & 0x1F;
- if(size) *size = 1;
- return 0;
-}
-
-int
-der_match_tag (const unsigned char *p, size_t len,
- Der_class class, Der_type type,
- int tag, size_t *size)
-{
- size_t l;
- Der_class thisclass;
- Der_type thistype;
- int thistag;
- int e;
-
- e = der_get_tag (p, len, &thisclass, &thistype, &thistag, &l);
- if (e) return e;
- if (class != thisclass || type != thistype)
- return ASN1_BAD_ID;
- if(tag > thistag)
- return ASN1_MISPLACED_FIELD;
- if(tag < thistag)
- return ASN1_MISSING_FIELD;
- if(size) *size = l;
- return 0;
-}
-
-int
-der_match_tag_and_length (const unsigned char *p, size_t len,
- Der_class class, Der_type type, int tag,
- size_t *length_ret, size_t *size)
-{
- size_t l, ret = 0;
- int e;
-
- e = der_match_tag (p, len, class, type, tag, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- e = der_get_length (p, len, length_ret, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_integer (const unsigned char *p, size_t len,
- int *num, size_t *size)
-{
- size_t ret = 0;
- size_t l, reallen;
- int e;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_Integer, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- e = der_get_length (p, len, &reallen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (reallen > len)
- return ASN1_OVERRUN;
- e = der_get_int (p, reallen, num, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_unsigned (const unsigned char *p, size_t len,
- unsigned *num, size_t *size)
-{
- size_t ret = 0;
- size_t l, reallen;
- int e;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_Integer, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- e = der_get_length (p, len, &reallen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (reallen > len)
- return ASN1_OVERRUN;
- e = der_get_unsigned (p, reallen, num, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_enumerated (const unsigned char *p, size_t len,
- unsigned *num, size_t *size)
-{
- size_t ret = 0;
- size_t l, reallen;
- int e;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_Enumerated, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- e = der_get_length (p, len, &reallen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- e = der_get_int (p, reallen, num, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_general_string (const unsigned char *p, size_t len,
- general_string *str, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
- size_t slen;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_GeneralString, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
-
- e = der_get_length (p, len, &slen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (len < slen)
- return ASN1_OVERRUN;
-
- e = der_get_general_string (p, slen, str, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_octet_string (const unsigned char *p, size_t len,
- octet_string *k, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
- size_t slen;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_OctetString, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
-
- e = der_get_length (p, len, &slen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (len < slen)
- return ASN1_OVERRUN;
-
- e = der_get_octet_string (p, slen, k, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-int
-decode_oid (const unsigned char *p, size_t len,
- oid *k, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
- size_t slen;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_OID, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
-
- e = der_get_length (p, len, &slen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (len < slen)
- return ASN1_OVERRUN;
-
- e = der_get_oid (p, slen, k, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if(size) *size = ret;
- return 0;
-}
-
-static void
-generalizedtime2time (const char *s, time_t *t)
-{
- struct tm tm;
-
- memset(&tm, 0, sizeof(tm));
- sscanf (s, "%04d%02d%02d%02d%02d%02dZ",
- &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour,
- &tm.tm_min, &tm.tm_sec);
- tm.tm_year -= 1900;
- tm.tm_mon -= 1;
- *t = timegm (&tm);
-}
-
-int
-decode_generalized_time (const unsigned char *p, size_t len,
- time_t *t, size_t *size)
-{
- octet_string k;
- char *times;
- size_t ret = 0;
- size_t l;
- int e;
- size_t slen;
-
- e = der_match_tag (p, len, UNIV, PRIM, UT_GeneralizedTime, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
-
- e = der_get_length (p, len, &slen, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- if (len < slen)
- return ASN1_OVERRUN;
- e = der_get_octet_string (p, slen, &k, &l);
- if (e) return e;
- p += l;
- len -= l;
- ret += l;
- times = realloc(k.data, k.length + 1);
- if (times == NULL){
- free(k.data);
- return ENOMEM;
- }
- times[k.length] = 0;
- generalizedtime2time (times, t);
- free (times);
- if(size) *size = ret;
- return 0;
-}
-
-
-int
-fix_dce(size_t reallen, size_t *len)
-{
- if(reallen == ASN1_INDEFINITE)
- return 1;
- if(*len < reallen)
- return -1;
- *len = reallen;
- return 0;
-}
diff --git a/crypto/heimdal/lib/asn1/der_length.c b/crypto/heimdal/lib/asn1/der_length.c
deleted file mode 100644
index 359018f97d890..0000000000000
--- a/crypto/heimdal/lib/asn1/der_length.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: der_length.c,v 1.12 2001/09/25 13:39:26 assar Exp $");
-
-static size_t
-len_unsigned (unsigned val)
-{
- size_t ret = 0;
-
- do {
- ++ret;
- val /= 256;
- } while (val);
- return ret;
-}
-
-static size_t
-len_int (int val)
-{
- size_t ret = 0;
-
- if (val == 0)
- return 1;
- while (val > 255 || val < -255) {
- ++ret;
- val /= 256;
- }
- if (val != 0) {
- ++ret;
- if ((signed char)val != val)
- ++ret;
- val /= 256;
- }
- return ret;
-}
-
-static size_t
-len_oid (const oid *oid)
-{
- size_t ret = 1;
- int n;
-
- for (n = 2; n < oid->length; ++n) {
- unsigned u = oid->components[n];
-
- ++ret;
- u /= 128;
- while (u > 0) {
- ++ret;
- u /= 128;
- }
- }
- return ret;
-}
-
-size_t
-length_len (size_t len)
-{
- if (len < 128)
- return 1;
- else
- return len_unsigned (len) + 1;
-}
-
-size_t
-length_integer (const int *data)
-{
- size_t len = len_int (*data);
-
- return 1 + length_len(len) + len;
-}
-
-size_t
-length_unsigned (const unsigned *data)
-{
- size_t len = len_unsigned (*data);
-
- return 1 + length_len(len) + len;
-}
-
-size_t
-length_enumerated (const unsigned *data)
-{
- size_t len = len_int (*data);
-
- return 1 + length_len(len) + len;
-}
-
-size_t
-length_general_string (const general_string *data)
-{
- char *str = *data;
- size_t len = strlen(str);
- return 1 + length_len(len) + len;
-}
-
-size_t
-length_octet_string (const octet_string *k)
-{
- return 1 + length_len(k->length) + k->length;
-}
-
-size_t
-length_oid (const oid *k)
-{
- size_t len = len_oid (k);
-
- return 1 + length_len(len) + len;
-}
-
-size_t
-length_generalized_time (const time_t *t)
-{
- octet_string k;
- size_t ret;
-
- time2generalizedtime (*t, &k);
- ret = 1 + length_len(k.length) + k.length;
- free (k.data);
- return ret;
-}
diff --git a/crypto/heimdal/lib/asn1/der_locl.h b/crypto/heimdal/lib/asn1/der_locl.h
deleted file mode 100644
index 36a4281363b0e..0000000000000
--- a/crypto/heimdal/lib/asn1/der_locl.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: der_locl.h,v 1.4 2001/09/27 16:21:47 assar Exp $ */
-
-#ifndef __DER_LOCL_H__
-#define __DER_LOCL_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <ctype.h>
-#include <time.h>
-#include <errno.h>
-#include <roken.h>
-
-#include <asn1-common.h>
-#include <asn1_err.h>
-#include <der.h>
-
-#endif /* __DER_LOCL_H__ */
diff --git a/crypto/heimdal/lib/asn1/der_put.c b/crypto/heimdal/lib/asn1/der_put.c
deleted file mode 100644
index 41733c57b3f86..0000000000000
--- a/crypto/heimdal/lib/asn1/der_put.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: der_put.c,v 1.28 2003/04/17 07:12:24 lha Exp $");
-
-/*
- * All encoding functions take a pointer `p' to first position in
- * which to write, from the right, `len' which means the maximum
- * number of characters we are able to write. The function returns
- * the number of characters written in `size' (if non-NULL).
- * The return value is 0 or an error.
- */
-
-static int
-der_put_unsigned (unsigned char *p, size_t len, unsigned val, size_t *size)
-{
- unsigned char *base = p;
-
- if (val) {
- while (len > 0 && val) {
- *p-- = val % 256;
- val /= 256;
- --len;
- }
- if (val != 0)
- return ASN1_OVERFLOW;
- else {
- *size = base - p;
- return 0;
- }
- } else if (len < 1)
- return ASN1_OVERFLOW;
- else {
- *p = 0;
- *size = 1;
- return 0;
- }
-}
-
-int
-der_put_int (unsigned char *p, size_t len, int val, size_t *size)
-{
- unsigned char *base = p;
-
- if(val >= 0) {
- do {
- if(len < 1)
- return ASN1_OVERFLOW;
- *p-- = val % 256;
- len--;
- val /= 256;
- } while(val);
- if(p[1] >= 128) {
- if(len < 1)
- return ASN1_OVERFLOW;
- *p-- = 0;
- len--;
- }
- } else {
- val = ~val;
- do {
- if(len < 1)
- return ASN1_OVERFLOW;
- *p-- = ~(val % 256);
- len--;
- val /= 256;
- } while(val);
- if(p[1] < 128) {
- if(len < 1)
- return ASN1_OVERFLOW;
- *p-- = 0xff;
- len--;
- }
- }
- *size = base - p;
- return 0;
-}
-
-
-int
-der_put_length (unsigned char *p, size_t len, size_t val, size_t *size)
-{
- if (len < 1)
- return ASN1_OVERFLOW;
- if (val < 128) {
- *p = val;
- *size = 1;
- return 0;
- } else {
- size_t l;
- int e;
-
- e = der_put_unsigned (p, len - 1, val, &l);
- if (e)
- return e;
- p -= l;
- *p = 0x80 | l;
- *size = l + 1;
- return 0;
- }
-}
-
-int
-der_put_general_string (unsigned char *p, size_t len,
- const general_string *str, size_t *size)
-{
- size_t slen = strlen(*str);
-
- if (len < slen)
- return ASN1_OVERFLOW;
- p -= slen;
- len -= slen;
- memcpy (p+1, *str, slen);
- *size = slen;
- return 0;
-}
-
-int
-der_put_octet_string (unsigned char *p, size_t len,
- const octet_string *data, size_t *size)
-{
- if (len < data->length)
- return ASN1_OVERFLOW;
- p -= data->length;
- len -= data->length;
- memcpy (p+1, data->data, data->length);
- *size = data->length;
- return 0;
-}
-
-int
-der_put_oid (unsigned char *p, size_t len,
- const oid *data, size_t *size)
-{
- unsigned char *base = p;
- int n;
-
- for (n = data->length - 1; n >= 2; --n) {
- unsigned u = data->components[n];
-
- if (len < 1)
- return ASN1_OVERFLOW;
- *p-- = u % 128;
- u /= 128;
- --len;
- while (u > 0) {
- if (len < 1)
- return ASN1_OVERFLOW;
- *p-- = 128 + u % 128;
- u /= 128;
- --len;
- }
- }
- if (len < 1)
- return ASN1_OVERFLOW;
- *p-- = 40 * data->components[0] + data->components[1];
- *size = base - p;
- return 0;
-}
-
-int
-der_put_tag (unsigned char *p, size_t len, Der_class class, Der_type type,
- int tag, size_t *size)
-{
- if (len < 1)
- return ASN1_OVERFLOW;
- *p = (class << 6) | (type << 5) | tag; /* XXX */
- *size = 1;
- return 0;
-}
-
-int
-der_put_length_and_tag (unsigned char *p, size_t len, size_t len_val,
- Der_class class, Der_type type, int tag, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_length (p, len, len_val, &l);
- if(e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_tag (p, len, class, type, tag, &l);
- if(e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_integer (unsigned char *p, size_t len, const int *data, size_t *size)
-{
- int num = *data;
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_int (p, len, num, &l);
- if(e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_Integer, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_unsigned (unsigned char *p, size_t len, const unsigned *data,
- size_t *size)
-{
- unsigned num = *data;
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_unsigned (p, len, num, &l);
- if(e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_Integer, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_enumerated (unsigned char *p, size_t len, const unsigned *data,
- size_t *size)
-{
- unsigned num = *data;
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_int (p, len, num, &l);
- if(e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_Enumerated, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_general_string (unsigned char *p, size_t len,
- const general_string *data, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_general_string (p, len, data, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_GeneralString, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_octet_string (unsigned char *p, size_t len,
- const octet_string *k, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_octet_string (p, len, k, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_OctetString, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-encode_oid(unsigned char *p, size_t len,
- const oid *k, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- int e;
-
- e = der_put_oid (p, len, k, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, l, UNIV, PRIM, UT_OID, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
-
-int
-time2generalizedtime (time_t t, octet_string *s)
-{
- struct tm *tm;
- size_t len;
-
- len = 15;
-
- s->data = malloc(len + 1);
- if (s->data == NULL)
- return ENOMEM;
- s->length = len;
- tm = gmtime (&t);
- snprintf (s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ",
- tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec);
- return 0;
-}
-
-int
-encode_generalized_time (unsigned char *p, size_t len,
- const time_t *t, size_t *size)
-{
- size_t ret = 0;
- size_t l;
- octet_string k;
- int e;
-
- e = time2generalizedtime (*t, &k);
- if (e)
- return e;
- e = der_put_octet_string (p, len, &k, &l);
- free (k.data);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- e = der_put_length_and_tag (p, len, k.length, UNIV, PRIM,
- UT_GeneralizedTime, &l);
- if (e)
- return e;
- p -= l;
- len -= l;
- ret += l;
- *size = ret;
- return 0;
-}
diff --git a/crypto/heimdal/lib/asn1/gen.c b/crypto/heimdal/lib/asn1/gen.c
deleted file mode 100644
index 8580360c60583..0000000000000
--- a/crypto/heimdal/lib/asn1/gen.c
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (c) 1997 - 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen.c,v 1.50 2003/04/17 07:09:18 lha Exp $");
-
-FILE *headerfile, *codefile, *logfile;
-
-#define STEM "asn1"
-
-static const char *orig_filename;
-static char *header;
-static char *headerbase = STEM;
-
-/*
- * list of all IMPORTs
- */
-
-struct import {
- const char *module;
- struct import *next;
-};
-
-static struct import *imports = NULL;
-
-void
-add_import (const char *module)
-{
- struct import *tmp = emalloc (sizeof(*tmp));
-
- tmp->module = module;
- tmp->next = imports;
- imports = tmp;
-}
-
-const char *
-filename (void)
-{
- return orig_filename;
-}
-
-void
-init_generate (const char *filename, const char *base)
-{
- orig_filename = filename;
- if(base)
- asprintf(&headerbase, "%s", base);
- asprintf(&header, "%s.h", headerbase);
- headerfile = fopen (header, "w");
- if (headerfile == NULL)
- err (1, "open %s", header);
- fprintf (headerfile,
- "/* Generated from %s */\n"
- "/* Do not edit */\n\n",
- filename);
- fprintf (headerfile,
- "#ifndef __%s_h__\n"
- "#define __%s_h__\n\n", headerbase, headerbase);
- fprintf (headerfile,
- "#include <stddef.h>\n"
- "#include <time.h>\n\n");
-#ifndef HAVE_TIMEGM
- fprintf (headerfile, "time_t timegm (struct tm*);\n\n");
-#endif
- fprintf (headerfile,
- "#ifndef __asn1_common_definitions__\n"
- "#define __asn1_common_definitions__\n\n");
- fprintf (headerfile,
- "typedef struct octet_string {\n"
- " size_t length;\n"
- " void *data;\n"
- "} octet_string;\n\n");
- fprintf (headerfile,
- "typedef char *general_string;\n\n"
- );
- fprintf (headerfile,
- "typedef struct oid {\n"
- " size_t length;\n"
- " unsigned *components;\n"
- "} oid;\n\n");
- fputs("#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \\\n"
- " do { \\\n"
- " (BL) = length_##T((S)); \\\n"
- " (B) = malloc((BL)); \\\n"
- " if((B) == NULL) { \\\n"
- " (R) = ENOMEM; \\\n"
- " } else { \\\n"
- " (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \\\n"
- " (S), (L)); \\\n"
- " if((R) != 0) { \\\n"
- " free((B)); \\\n"
- " (B) = NULL; \\\n"
- " } \\\n"
- " } \\\n"
- " } while (0)\n\n",
- headerfile);
- fprintf (headerfile, "#endif\n\n");
- logfile = fopen(STEM "_files", "w");
- if (logfile == NULL)
- err (1, "open " STEM "_files");
-}
-
-void
-close_generate (void)
-{
- fprintf (headerfile, "#endif /* __%s_h__ */\n", headerbase);
-
- fclose (headerfile);
- fprintf (logfile, "\n");
- fclose (logfile);
-}
-
-void
-generate_constant (const Symbol *s)
-{
- fprintf (headerfile, "enum { %s = %d };\n\n",
- s->gen_name, s->constant);
-}
-
-static void
-space(int level)
-{
- while(level-- > 0)
- fprintf(headerfile, " ");
-}
-
-static void
-define_asn1 (int level, Type *t)
-{
- switch (t->type) {
- case TType:
- space(level);
- fprintf (headerfile, "%s", t->symbol->name);
- break;
- case TInteger:
- space(level);
- fprintf (headerfile, "INTEGER");
- break;
- case TUInteger:
- space(level);
- fprintf (headerfile, "UNSIGNED INTEGER");
- break;
- case TOctetString:
- space(level);
- fprintf (headerfile, "OCTET STRING");
- break;
- case TOID :
- space(level);
- fprintf(headerfile, "OBJECT IDENTIFIER");
- break;
- case TBitString: {
- Member *m;
- int tag = -1;
-
- space(level);
- fprintf (headerfile, "BIT STRING {\n");
- for (m = t->members; m && m->val != tag; m = m->next) {
- if (tag == -1)
- tag = m->val;
- space(level + 1);
- fprintf (headerfile, "%s(%d)%s\n", m->name, m->val,
- m->next->val == tag?"":",");
-
- }
- space(level);
- fprintf (headerfile, "}");
- break;
- }
- case TEnumerated : {
- Member *m;
- int tag = -1;
-
- space(level);
- fprintf (headerfile, "ENUMERATED {\n");
- for (m = t->members; m && m->val != tag; m = m->next) {
- if (tag == -1)
- tag = m->val;
- space(level + 1);
- fprintf (headerfile, "%s(%d)%s\n", m->name, m->val,
- m->next->val == tag?"":",");
-
- }
- space(level);
- fprintf (headerfile, "}");
- break;
- }
- case TSequence: {
- Member *m;
- int tag;
- int max_width = 0;
-
- space(level);
- fprintf (headerfile, "SEQUENCE {\n");
- for (m = t->members, tag = -1; m && m->val != tag; m = m->next) {
- if (tag == -1)
- tag = m->val;
- if(strlen(m->name) + (m->val > 9) > max_width)
- max_width = strlen(m->name) + (m->val > 9);
- }
- max_width += 3 + 2;
- if(max_width < 16) max_width = 16;
- for (m = t->members, tag = -1 ; m && m->val != tag; m = m->next) {
- int width;
- if (tag == -1)
- tag = m->val;
- space(level + 1);
- fprintf(headerfile, "%s[%d]", m->name, m->val);
- width = max_width - strlen(m->name) - 3 - (m->val > 9) - 2;
- fprintf(headerfile, "%*s", width, "");
- define_asn1(level + 1, m->type);
- if(m->optional)
- fprintf(headerfile, " OPTIONAL");
- if(m->next->val != tag)
- fprintf (headerfile, ",");
- fprintf (headerfile, "\n");
- }
- space(level);
- fprintf (headerfile, "}");
- break;
- }
- case TSequenceOf: {
- space(level);
- fprintf (headerfile, "SEQUENCE OF ");
- define_asn1 (0, t->subtype);
- break;
- }
- case TGeneralizedTime:
- space(level);
- fprintf (headerfile, "GeneralizedTime");
- break;
- case TGeneralString:
- space(level);
- fprintf (headerfile, "GeneralString");
- break;
- case TApplication:
- fprintf (headerfile, "[APPLICATION %d] ", t->application);
- define_asn1 (level, t->subtype);
- break;
- default:
- abort ();
- }
-}
-
-static void
-define_type (int level, char *name, Type *t, int typedefp)
-{
- switch (t->type) {
- case TType:
- space(level);
- fprintf (headerfile, "%s %s;\n", t->symbol->gen_name, name);
- break;
- case TInteger:
- space(level);
- if(t->members == NULL) {
- fprintf (headerfile, "int %s;\n", name);
- } else {
- Member *m;
- int tag = -1;
- fprintf (headerfile, "enum %s {\n", typedefp ? name : "");
- for (m = t->members; m && m->val != tag; m = m->next) {
- if(tag == -1)
- tag = m->val;
- space (level + 1);
- fprintf(headerfile, "%s = %d%s\n", m->gen_name, m->val,
- m->next->val == tag ? "" : ",");
- }
- fprintf (headerfile, "} %s;\n", name);
- }
- break;
- case TUInteger:
- space(level);
- fprintf (headerfile, "unsigned int %s;\n", name);
- break;
- case TOctetString:
- space(level);
- fprintf (headerfile, "octet_string %s;\n", name);
- break;
- case TOID :
- space(level);
- fprintf (headerfile, "oid %s;\n", name);
- break;
- case TBitString: {
- Member *m;
- Type i;
- int tag = -1;
-
- i.type = TUInteger;
- space(level);
- fprintf (headerfile, "struct %s {\n", typedefp ? name : "");
- for (m = t->members; m && m->val != tag; m = m->next) {
- char *n;
-
- asprintf (&n, "%s:1", m->gen_name);
- define_type (level + 1, n, &i, FALSE);
- free (n);
- if (tag == -1)
- tag = m->val;
- }
- space(level);
- fprintf (headerfile, "} %s;\n\n", name);
- break;
- }
- case TEnumerated: {
- Member *m;
- int tag = -1;
-
- space(level);
- fprintf (headerfile, "enum %s {\n", typedefp ? name : "");
- for (m = t->members; m && m->val != tag; m = m->next) {
- if (tag == -1)
- tag = m->val;
- space(level + 1);
- fprintf (headerfile, "%s = %d%s\n", m->gen_name, m->val,
- m->next->val == tag ? "" : ",");
- }
- space(level);
- fprintf (headerfile, "} %s;\n\n", name);
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- space(level);
- fprintf (headerfile, "struct %s {\n", typedefp ? name : "");
- for (m = t->members; m && m->val != tag; m = m->next) {
- if (m->optional) {
- char *n;
-
- asprintf (&n, "*%s", m->gen_name);
- define_type (level + 1, n, m->type, FALSE);
- free (n);
- } else
- define_type (level + 1, m->gen_name, m->type, FALSE);
- if (tag == -1)
- tag = m->val;
- }
- space(level);
- fprintf (headerfile, "} %s;\n", name);
- break;
- }
- case TSequenceOf: {
- Type i;
-
- i.type = TUInteger;
- i.application = 0;
-
- space(level);
- fprintf (headerfile, "struct %s {\n", typedefp ? name : "");
- define_type (level + 1, "len", &i, FALSE);
- define_type (level + 1, "*val", t->subtype, FALSE);
- space(level);
- fprintf (headerfile, "} %s;\n", name);
- break;
- }
- case TGeneralizedTime:
- space(level);
- fprintf (headerfile, "time_t %s;\n", name);
- break;
- case TGeneralString:
- space(level);
- fprintf (headerfile, "general_string %s;\n", name);
- break;
- case TApplication:
- define_type (level, name, t->subtype, FALSE);
- break;
- default:
- abort ();
- }
-}
-
-static void
-generate_type_header (const Symbol *s)
-{
- fprintf (headerfile, "/*\n");
- fprintf (headerfile, "%s ::= ", s->name);
- define_asn1 (0, s->type);
- fprintf (headerfile, "\n*/\n\n");
-
- fprintf (headerfile, "typedef ");
- define_type (0, s->gen_name, s->type, TRUE);
-
- fprintf (headerfile, "\n");
-}
-
-
-void
-generate_type (const Symbol *s)
-{
- struct import *i;
- char *filename;
-
- asprintf (&filename, "%s_%s.x", STEM, s->gen_name);
- codefile = fopen (filename, "w");
- if (codefile == NULL)
- err (1, "fopen %s", filename);
- fprintf(logfile, "%s ", filename);
- free(filename);
- fprintf (codefile,
- "/* Generated from %s */\n"
- "/* Do not edit */\n\n"
- "#include <stdio.h>\n"
- "#include <stdlib.h>\n"
- "#include <time.h>\n"
- "#include <string.h>\n"
- "#include <errno.h>\n",
- orig_filename);
-
- for (i = imports; i != NULL; i = i->next)
- fprintf (codefile,
- "#include <%s_asn1.h>\n",
- i->module);
- fprintf (codefile,
- "#include <%s.h>\n",
- headerbase);
- fprintf (codefile,
- "#include <asn1_err.h>\n"
- "#include <der.h>\n"
- "#include <parse_units.h>\n\n");
- generate_type_header (s);
- generate_type_encode (s);
- generate_type_decode (s);
- generate_type_free (s);
- generate_type_length (s);
- generate_type_copy (s);
- generate_glue (s);
- fprintf(headerfile, "\n\n");
- fclose(codefile);
-}
diff --git a/crypto/heimdal/lib/asn1/gen.h b/crypto/heimdal/lib/asn1/gen.h
deleted file mode 100644
index 369b6e392acdc..0000000000000
--- a/crypto/heimdal/lib/asn1/gen.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 1997 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.
- */
-
-/* $Id: gen.h,v 1.4 1999/12/02 17:05:02 joda Exp $ */
-
-#include <stdio.h>
-#include "symbol.h"
-
diff --git a/crypto/heimdal/lib/asn1/gen_copy.c b/crypto/heimdal/lib/asn1/gen_copy.c
deleted file mode 100644
index 20f0d5b569e71..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_copy.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 1997 - 2000 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_copy.c,v 1.12 2001/09/25 13:39:26 assar Exp $");
-
-static void
-copy_primitive (const char *typename, const char *from, const char *to)
-{
- fprintf (codefile, "if(copy_%s(%s, %s)) return ENOMEM;\n",
- typename, from, to);
-}
-
-static void
-copy_type (const char *from, const char *to, const Type *t)
-{
- switch (t->type) {
- case TType:
-#if 0
- copy_type (from, to, t->symbol->type);
-#endif
- fprintf (codefile, "if(copy_%s(%s, %s)) return ENOMEM;\n",
- t->symbol->gen_name, from, to);
- break;
- case TInteger:
- case TUInteger:
- case TEnumerated :
- fprintf(codefile, "*(%s) = *(%s);\n", to, from);
- break;
- case TOctetString:
- copy_primitive ("octet_string", from, to);
- break;
- case TOID:
- copy_primitive ("oid", from, to);
- break;
- case TBitString: {
- fprintf(codefile, "*(%s) = *(%s);\n", to, from);
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- for (m = t->members; m && tag != m->val; m = m->next) {
- char *f;
- char *t;
-
- asprintf (&f, "%s(%s)->%s",
- m->optional ? "" : "&", from, m->gen_name);
- asprintf (&t, "%s(%s)->%s",
- m->optional ? "" : "&", to, m->gen_name);
- if(m->optional){
- fprintf(codefile, "if(%s) {\n", f);
- fprintf(codefile, "%s = malloc(sizeof(*%s));\n", t, t);
- fprintf(codefile, "if(%s == NULL) return ENOMEM;\n", t);
- }
- copy_type (f, t, m->type);
- if(m->optional){
- fprintf(codefile, "}else\n");
- fprintf(codefile, "%s = NULL;\n", t);
- }
- if (tag == -1)
- tag = m->val;
- free (f);
- free (t);
- }
- break;
- }
- case TSequenceOf: {
- char *f;
- char *T;
-
- fprintf (codefile, "if(((%s)->val = "
- "malloc((%s)->len * sizeof(*(%s)->val))) == NULL && (%s)->len != 0)\n",
- to, from, to, from);
- fprintf (codefile, "return ENOMEM;\n");
- fprintf(codefile,
- "for((%s)->len = 0; (%s)->len < (%s)->len; (%s)->len++){\n",
- to, to, from, to);
- asprintf(&f, "&(%s)->val[(%s)->len]", from, to);
- asprintf(&T, "&(%s)->val[(%s)->len]", to, to);
- copy_type(f, T, t->subtype);
- fprintf(codefile, "}\n");
- free(f);
- free(T);
- break;
- }
- case TGeneralizedTime:
- fprintf(codefile, "*(%s) = *(%s);\n", to, from);
- break;
- case TGeneralString:
- copy_primitive ("general_string", from, to);
- break;
- case TApplication:
- copy_type (from, to, t->subtype);
- break;
- default :
- abort ();
- }
-}
-
-void
-generate_type_copy (const Symbol *s)
-{
- fprintf (headerfile,
- "int copy_%s (const %s *, %s *);\n",
- s->gen_name, s->gen_name, s->gen_name);
-
- fprintf (codefile, "int\n"
- "copy_%s(const %s *from, %s *to)\n"
- "{\n",
- s->gen_name, s->gen_name, s->gen_name);
-
- copy_type ("from", "to", s->type);
- fprintf (codefile, "return 0;\n}\n\n");
-}
-
diff --git a/crypto/heimdal/lib/asn1/gen_decode.c b/crypto/heimdal/lib/asn1/gen_decode.c
deleted file mode 100644
index 7237e4e421ade..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_decode.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_decode.c,v 1.18 2002/08/09 15:37:34 joda Exp $");
-
-static void
-decode_primitive (const char *typename, const char *name)
-{
- fprintf (codefile,
- "e = decode_%s(p, len, %s, &l);\n"
- "FORW;\n",
- typename,
- name);
-}
-
-static void
-decode_type (const char *name, const Type *t)
-{
- switch (t->type) {
- case TType:
-#if 0
- decode_type (name, t->symbol->type);
-#endif
- fprintf (codefile,
- "e = decode_%s(p, len, %s, &l);\n"
- "FORW;\n",
- t->symbol->gen_name, name);
- break;
- case TInteger:
- if(t->members == NULL)
- decode_primitive ("integer", name);
- else {
- char *s;
- asprintf(&s, "(int*)%s", name);
- if(s == NULL)
- errx (1, "out of memory");
- decode_primitive ("integer", s);
- free(s);
- }
- break;
- case TUInteger:
- decode_primitive ("unsigned", name);
- break;
- case TEnumerated:
- decode_primitive ("enumerated", name);
- break;
- case TOctetString:
- decode_primitive ("octet_string", name);
- break;
- case TOID :
- decode_primitive ("oid", name);
- break;
- case TBitString: {
- Member *m;
- int tag = -1;
- int pos;
-
- fprintf (codefile,
- "e = der_match_tag_and_length (p, len, UNIV, PRIM, UT_BitString,"
- "&reallen, &l);\n"
- "FORW;\n"
- "if(len < reallen)\n"
- "return ASN1_OVERRUN;\n"
- "p++;\n"
- "len--;\n"
- "reallen--;\n"
- "ret++;\n");
- pos = 0;
- for (m = t->members; m && tag != m->val; m = m->next) {
- while (m->val / 8 > pos / 8) {
- fprintf (codefile,
- "p++; len--; reallen--; ret++;\n");
- pos += 8;
- }
- fprintf (codefile,
- "%s->%s = (*p >> %d) & 1;\n",
- name, m->gen_name, 7 - m->val % 8);
- if (tag == -1)
- tag = m->val;
- }
- fprintf (codefile,
- "p += reallen; len -= reallen; ret += reallen;\n");
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- fprintf (codefile,
- "e = der_match_tag_and_length (p, len, UNIV, CONS, UT_Sequence,"
- "&reallen, &l);\n"
- "FORW;\n"
- "{\n"
- "int dce_fix;\n"
- "if((dce_fix = fix_dce(reallen, &len)) < 0)\n"
- "return ASN1_BAD_FORMAT;\n");
-
- for (m = t->members; m && tag != m->val; m = m->next) {
- char *s;
-
- asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name);
- if (0 && m->type->type == TType){
- if(m->optional)
- fprintf (codefile,
- "%s = malloc(sizeof(*%s));\n"
- "if(%s == NULL) return ENOMEM;\n", s, s, s);
- fprintf (codefile,
- "e = decode_seq_%s(p, len, %d, %d, %s, &l);\n",
- m->type->symbol->gen_name,
- m->val,
- m->optional,
- s);
- if(m->optional)
- fprintf (codefile,
- "if (e == ASN1_MISSING_FIELD) {\n"
- "free(%s);\n"
- "%s = NULL;\n"
- "e = l = 0;\n"
- "}\n",
- s, s);
-
- fprintf (codefile, "FORW;\n");
-
- }else{
- fprintf (codefile, "{\n"
- "size_t newlen, oldlen;\n\n"
- "e = der_match_tag (p, len, CONTEXT, CONS, %d, &l);\n",
- m->val);
- fprintf (codefile,
- "if (e)\n");
- if(m->optional)
- /* XXX should look at e */
- fprintf (codefile,
- "%s = NULL;\n", s);
- else
- fprintf (codefile,
- "return e;\n");
- fprintf (codefile,
- "else {\n");
- fprintf (codefile,
- "p += l;\n"
- "len -= l;\n"
- "ret += l;\n"
- "e = der_get_length (p, len, &newlen, &l);\n"
- "FORW;\n"
- "{\n"
-
- "int dce_fix;\n"
- "oldlen = len;\n"
- "if((dce_fix = fix_dce(newlen, &len)) < 0)"
- "return ASN1_BAD_FORMAT;\n");
- if (m->optional)
- fprintf (codefile,
- "%s = malloc(sizeof(*%s));\n"
- "if(%s == NULL) return ENOMEM;\n", s, s, s);
- decode_type (s, m->type);
- fprintf (codefile,
- "if(dce_fix){\n"
- "e = der_match_tag_and_length (p, len, "
- "(Der_class)0, (Der_type)0, 0, &reallen, &l);\n"
- "FORW;\n"
- "}else \n"
- "len = oldlen - newlen;\n"
- "}\n"
- "}\n");
- fprintf (codefile,
- "}\n");
- }
- if (tag == -1)
- tag = m->val;
- free (s);
- }
- fprintf(codefile,
- "if(dce_fix){\n"
- "e = der_match_tag_and_length (p, len, "
- "(Der_class)0, (Der_type)0, 0, &reallen, &l);\n"
- "FORW;\n"
- "}\n"
- "}\n");
-
- break;
- }
- case TSequenceOf: {
- char *n;
-
- fprintf (codefile,
- "e = der_match_tag_and_length (p, len, UNIV, CONS, UT_Sequence,"
- "&reallen, &l);\n"
- "FORW;\n"
- "if(len < reallen)\n"
- "return ASN1_OVERRUN;\n"
- "len = reallen;\n");
-
- fprintf (codefile,
- "{\n"
- "size_t origlen = len;\n"
- "int oldret = ret;\n"
- "ret = 0;\n"
- "(%s)->len = 0;\n"
- "(%s)->val = NULL;\n"
- "while(ret < origlen) {\n"
- "(%s)->len++;\n"
- "(%s)->val = realloc((%s)->val, sizeof(*((%s)->val)) * (%s)->len);\n",
- name, name, name, name, name, name, name);
- asprintf (&n, "&(%s)->val[(%s)->len-1]", name, name);
- decode_type (n, t->subtype);
- fprintf (codefile,
- "len = origlen - ret;\n"
- "}\n"
- "ret += oldret;\n"
- "}\n");
- free (n);
- break;
- }
- case TGeneralizedTime:
- decode_primitive ("generalized_time", name);
- break;
- case TGeneralString:
- decode_primitive ("general_string", name);
- break;
- case TApplication:
- fprintf (codefile,
- "e = der_match_tag_and_length (p, len, APPL, CONS, %d, "
- "&reallen, &l);\n"
- "FORW;\n"
- "{\n"
- "int dce_fix;\n"
- "if((dce_fix = fix_dce(reallen, &len)) < 0)\n"
- "return ASN1_BAD_FORMAT;\n",
- t->application);
- decode_type (name, t->subtype);
- fprintf(codefile,
- "if(dce_fix){\n"
- "e = der_match_tag_and_length (p, len, "
- "(Der_class)0, (Der_type)0, 0, &reallen, &l);\n"
- "FORW;\n"
- "}\n"
- "}\n");
-
- break;
- default :
- abort ();
- }
-}
-
-void
-generate_type_decode (const Symbol *s)
-{
- fprintf (headerfile,
- "int "
- "decode_%s(const unsigned char *, size_t, %s *, size_t *);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile, "#define FORW "
- "if(e) goto fail; "
- "p += l; "
- "len -= l; "
- "ret += l\n\n");
-
-
- fprintf (codefile, "int\n"
- "decode_%s(const unsigned char *p,"
- " size_t len, %s *data, size_t *size)\n"
- "{\n",
- s->gen_name, s->gen_name);
-
- switch (s->type->type) {
- case TInteger:
- case TUInteger:
- case TOctetString:
- case TOID:
- case TGeneralizedTime:
- case TGeneralString:
- case TBitString:
- case TSequence:
- case TSequenceOf:
- case TApplication:
- case TType:
- fprintf (codefile,
- "size_t ret = 0, reallen;\n"
- "size_t l;\n"
- "int e;\n\n");
- fprintf (codefile, "memset(data, 0, sizeof(*data));\n");
- fprintf (codefile, "reallen = 0;\n"); /* hack to avoid `unused variable' */
-
- decode_type ("data", s->type);
- fprintf (codefile,
- "if(size) *size = ret;\n"
- "return 0;\n");
- fprintf (codefile,
- "fail:\n"
- "free_%s(data);\n"
- "return e;\n",
- s->gen_name);
- break;
- default:
- abort ();
- }
- fprintf (codefile, "}\n\n");
-}
-
-void
-generate_seq_type_decode (const Symbol *s)
-{
- fprintf (headerfile,
- "int decode_seq_%s(const unsigned char *, size_t, int, int, "
- "%s *, size_t *);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile, "int\n"
- "decode_seq_%s(const unsigned char *p, size_t len, int tag, "
- "int optional, %s *data, size_t *size)\n"
- "{\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile,
- "size_t newlen, oldlen;\n"
- "size_t l, ret = 0;\n"
- "int e;\n"
- "int dce_fix;\n");
-
- fprintf (codefile,
- "e = der_match_tag(p, len, CONTEXT, CONS, tag, &l);\n"
- "if (e)\n"
- "return e;\n");
- fprintf (codefile,
- "p += l;\n"
- "len -= l;\n"
- "ret += l;\n"
- "e = der_get_length(p, len, &newlen, &l);\n"
- "if (e)\n"
- "return e;\n"
- "p += l;\n"
- "len -= l;\n"
- "ret += l;\n"
- "oldlen = len;\n"
- "if ((dce_fix = fix_dce(newlen, &len)) < 0)\n"
- "return ASN1_BAD_FORMAT;\n"
- "e = decode_%s(p, len, data, &l);\n"
- "if (e)\n"
- "return e;\n"
- "p += l;\n"
- "len -= l;\n"
- "ret += l;\n"
- "if (dce_fix) {\n"
- "size_t reallen;\n\n"
- "e = der_match_tag_and_length(p, len, "
- "(Der_class)0, (Der_type)0, 0, &reallen, &l);\n"
- "if (e)\n"
- "return e;\n"
- "ret += l;\n"
- "}\n",
- s->gen_name);
- fprintf (codefile,
- "if(size) *size = ret;\n"
- "return 0;\n");
-
- fprintf (codefile, "}\n\n");
-}
diff --git a/crypto/heimdal/lib/asn1/gen_encode.c b/crypto/heimdal/lib/asn1/gen_encode.c
deleted file mode 100644
index ba50d5da4c0a5..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_encode.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_encode.c,v 1.12 2001/09/25 13:39:26 assar Exp $");
-
-static void
-encode_primitive (const char *typename, const char *name)
-{
- fprintf (codefile,
- "e = encode_%s(p, len, %s, &l);\n"
- "BACK;\n",
- typename,
- name);
-}
-
-static void
-encode_type (const char *name, const Type *t)
-{
- switch (t->type) {
- case TType:
-#if 0
- encode_type (name, t->symbol->type);
-#endif
- fprintf (codefile,
- "e = encode_%s(p, len, %s, &l);\n"
- "BACK;\n",
- t->symbol->gen_name, name);
- break;
- case TInteger:
- if(t->members == NULL)
- encode_primitive ("integer", name);
- else {
- char *s;
- asprintf(&s, "(const int*)%s", name);
- if(s == NULL)
- errx(1, "out of memory");
- encode_primitive ("integer", s);
- free(s);
- }
- break;
- case TUInteger:
- encode_primitive ("unsigned", name);
- break;
- case TOctetString:
- encode_primitive ("octet_string", name);
- break;
- case TOID :
- encode_primitive ("oid", name);
- break;
- case TBitString: {
- Member *m;
- int pos;
- int rest;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- fprintf (codefile, "{\n"
- "unsigned char c = 0;\n");
- pos = t->members->prev->val;
- /* fix for buggy MIT (and OSF?) code */
- if (pos > 31)
- abort ();
- /*
- * It seems that if we do not always set pos to 31 here, the MIT
- * code will do the wrong thing.
- *
- * I hate ASN.1 (and DER), but I hate it even more when everybody
- * has to screw it up differently.
- */
- pos = 31;
- rest = 7 - (pos % 8);
-
- for (m = t->members->prev; m && tag != m->val; m = m->prev) {
- while (m->val / 8 < pos / 8) {
- fprintf (codefile,
- "*p-- = c; len--; ret++;\n"
- "c = 0;\n");
- pos -= 8;
- }
- fprintf (codefile,
- "if(%s->%s) c |= 1<<%d;\n", name, m->gen_name,
- 7 - m->val % 8);
-
- if (tag == -1)
- tag = m->val;
- }
-
- fprintf (codefile,
- "*p-- = c;\n"
- "*p-- = %d;\n"
- "len -= 2;\n"
- "ret += 2;\n"
- "}\n\n"
- "e = der_put_length_and_tag (p, len, ret, UNIV, PRIM,"
- "UT_BitString, &l);\n"
- "BACK;\n",
- rest);
- break;
- }
- case TEnumerated : {
- encode_primitive ("enumerated", name);
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- for (m = t->members->prev; m && tag != m->val; m = m->prev) {
- char *s;
-
- asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name);
- if (m->optional)
- fprintf (codefile,
- "if(%s)\n",
- s);
-#if 1
- fprintf (codefile, "{\n"
- "int oldret = ret;\n"
- "ret = 0;\n");
-#endif
- encode_type (s, m->type);
- fprintf (codefile,
- "e = der_put_length_and_tag (p, len, ret, CONTEXT, CONS, "
- "%d, &l);\n"
- "BACK;\n",
- m->val);
-#if 1
- fprintf (codefile,
- "ret += oldret;\n"
- "}\n");
-#endif
- if (tag == -1)
- tag = m->val;
- free (s);
- }
- fprintf (codefile,
- "e = der_put_length_and_tag (p, len, ret, UNIV, CONS, UT_Sequence, &l);\n"
- "BACK;\n");
- break;
- }
- case TSequenceOf: {
- char *n;
-
- fprintf (codefile,
- "for(i = (%s)->len - 1; i >= 0; --i) {\n"
-#if 1
- "int oldret = ret;\n"
- "ret = 0;\n",
-#else
- ,
-#endif
- name);
- asprintf (&n, "&(%s)->val[i]", name);
- encode_type (n, t->subtype);
- fprintf (codefile,
-#if 1
- "ret += oldret;\n"
-#endif
- "}\n"
- "e = der_put_length_and_tag (p, len, ret, UNIV, CONS, UT_Sequence, &l);\n"
- "BACK;\n");
- free (n);
- break;
- }
- case TGeneralizedTime:
- encode_primitive ("generalized_time", name);
- break;
- case TGeneralString:
- encode_primitive ("general_string", name);
- break;
- case TApplication:
- encode_type (name, t->subtype);
- fprintf (codefile,
- "e = der_put_length_and_tag (p, len, ret, APPL, CONS, %d, &l);\n"
- "BACK;\n",
- t->application);
- break;
- default:
- abort ();
- }
-}
-
-void
-generate_type_encode (const Symbol *s)
-{
- fprintf (headerfile,
- "int "
- "encode_%s(unsigned char *, size_t, const %s *, size_t *);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile, "#define BACK if (e) return e; p -= l; len -= l; ret += l\n\n");
-
-
- fprintf (codefile, "int\n"
- "encode_%s(unsigned char *p, size_t len,"
- " const %s *data, size_t *size)\n"
- "{\n",
- s->gen_name, s->gen_name);
-
- switch (s->type->type) {
- case TInteger:
- case TUInteger:
- case TOctetString:
- case TGeneralizedTime:
- case TGeneralString:
- case TBitString:
- case TEnumerated:
- case TOID:
- case TSequence:
- case TSequenceOf:
- case TApplication:
- case TType:
- fprintf (codefile,
- "size_t ret = 0;\n"
- "size_t l;\n"
- "int i, e;\n\n");
- fprintf(codefile, "i = 0;\n"); /* hack to avoid `unused variable' */
-
- encode_type("data", s->type);
-
- fprintf (codefile, "*size = ret;\n"
- "return 0;\n");
- break;
- default:
- abort ();
- }
- fprintf (codefile, "}\n\n");
-}
diff --git a/crypto/heimdal/lib/asn1/gen_free.c b/crypto/heimdal/lib/asn1/gen_free.c
deleted file mode 100644
index 994cbc637e41a..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_free.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1997 - 2000 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_free.c,v 1.9 2001/09/25 13:39:26 assar Exp $");
-
-static void
-free_primitive (const char *typename, const char *name)
-{
- fprintf (codefile, "free_%s(%s);\n", typename, name);
-}
-
-static void
-free_type (const char *name, const Type *t)
-{
- switch (t->type) {
- case TType:
-#if 0
- free_type (name, t->symbol->type);
-#endif
- fprintf (codefile, "free_%s(%s);\n", t->symbol->gen_name, name);
- break;
- case TInteger:
- case TUInteger:
- case TEnumerated :
- break;
- case TOctetString:
- free_primitive ("octet_string", name);
- break;
- case TOID :
- free_primitive ("oid", name);
- break;
- case TBitString: {
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- for (m = t->members; m && tag != m->val; m = m->next) {
- char *s;
-
- asprintf (&s, "%s(%s)->%s",
- m->optional ? "" : "&", name, m->gen_name);
- if(m->optional)
- fprintf(codefile, "if(%s) {\n", s);
- free_type (s, m->type);
- if(m->optional)
- fprintf(codefile,
- "free(%s);\n"
- "}\n",s);
- if (tag == -1)
- tag = m->val;
- free (s);
- }
- break;
- }
- case TSequenceOf: {
- char *n;
-
- fprintf (codefile, "while((%s)->len){\n", name);
- asprintf (&n, "&(%s)->val[(%s)->len-1]", name, name);
- free_type(n, t->subtype);
- fprintf(codefile,
- "(%s)->len--;\n"
- "}\n",
- name);
- fprintf(codefile,
- "free((%s)->val);\n", name);
- free(n);
- break;
- }
- case TGeneralizedTime:
- break;
- case TGeneralString:
- free_primitive ("general_string", name);
- break;
- case TApplication:
- free_type (name, t->subtype);
- break;
- default :
- abort ();
- }
-}
-
-void
-generate_type_free (const Symbol *s)
-{
- fprintf (headerfile,
- "void free_%s (%s *);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile, "void\n"
- "free_%s(%s *data)\n"
- "{\n",
- s->gen_name, s->gen_name);
-
- free_type ("data", s->type);
- fprintf (codefile, "}\n\n");
-}
-
diff --git a/crypto/heimdal/lib/asn1/gen_glue.c b/crypto/heimdal/lib/asn1/gen_glue.c
deleted file mode 100644
index 2f6280ad6c28d..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_glue.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_glue.c,v 1.7 1999/12/02 17:05:02 joda Exp $");
-
-static void
-generate_2int (const Symbol *s)
-{
- Type *t = s->type;
- Member *m;
- int tag = -1;
-
- fprintf (headerfile,
- "unsigned %s2int(%s);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile,
- "unsigned %s2int(%s f)\n"
- "{\n"
- "unsigned r = 0;\n",
- s->gen_name, s->gen_name);
-
- for (m = t->members; m && m->val != tag; m = m->next) {
- fprintf (codefile, "if(f.%s) r |= (1U << %d);\n",
- m->gen_name, m->val);
-
- if (tag == -1)
- tag = m->val;
- }
- fprintf (codefile, "return r;\n"
- "}\n\n");
-}
-
-static void
-generate_int2 (const Symbol *s)
-{
- Type *t = s->type;
- Member *m;
- int tag = -1;
-
- fprintf (headerfile,
- "%s int2%s(unsigned);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile,
- "%s int2%s(unsigned n)\n"
- "{\n"
- "\t%s flags;\n\n",
- s->gen_name, s->gen_name, s->gen_name);
-
- for (m = t->members; m && m->val != tag; m = m->next) {
- fprintf (codefile, "\tflags.%s = (n >> %d) & 1;\n",
- m->gen_name, m->val);
-
- if (tag == -1)
- tag = m->val;
- }
- fprintf (codefile, "\treturn flags;\n"
- "}\n\n");
-}
-
-/*
- * This depends on the bit string being declared in increasing order
- */
-
-static void
-generate_units (const Symbol *s)
-{
- Type *t = s->type;
- Member *m;
- int tag = -1;
-
- fprintf (headerfile,
- "extern struct units %s_units[];",
- s->gen_name);
-
- fprintf (codefile,
- "struct units %s_units[] = {\n",
- s->gen_name);
-
- if(t->members)
- for (m = t->members->prev; m && m->val != tag; m = m->prev) {
- fprintf (codefile,
- "\t{\"%s\",\t1U << %d},\n", m->gen_name, m->val);
-
- if (tag == -1)
- tag = m->val;
- }
-
- fprintf (codefile,
- "\t{NULL,\t0}\n"
- "};\n\n");
-}
-
-void
-generate_glue (const Symbol *s)
-{
- switch(s->type->type) {
- case TBitString :
- generate_2int (s);
- generate_int2 (s);
- generate_units (s);
- break;
- default :
- break;
- }
-}
diff --git a/crypto/heimdal/lib/asn1/gen_length.c b/crypto/heimdal/lib/asn1/gen_length.c
deleted file mode 100644
index 7c379d6acb94c..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_length.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1997 - 2000 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: gen_length.c,v 1.11 2001/09/25 13:39:26 assar Exp $");
-
-static void
-length_primitive (const char *typename,
- const char *name,
- const char *variable)
-{
- fprintf (codefile, "%s += length_%s(%s);\n", variable, typename, name);
-}
-
-static void
-length_type (const char *name, const Type *t, const char *variable)
-{
- switch (t->type) {
- case TType:
-#if 0
- length_type (name, t->symbol->type);
-#endif
- fprintf (codefile, "%s += length_%s(%s);\n",
- variable, t->symbol->gen_name, name);
- break;
- case TInteger:
- if(t->members == NULL)
- length_primitive ("integer", name, variable);
- else {
- char *s;
- asprintf(&s, "(const int*)%s", name);
- if(s == NULL)
- errx (1, "out of memory");
- length_primitive ("integer", s, variable);
- free(s);
- }
- break;
- case TUInteger:
- length_primitive ("unsigned", name, variable);
- break;
- case TEnumerated :
- length_primitive ("enumerated", name, variable);
- break;
- case TOctetString:
- length_primitive ("octet_string", name, variable);
- break;
- case TOID :
- length_primitive ("oid", name, variable);
- break;
- case TBitString: {
- /*
- * XXX - Hope this is correct
- * look at TBitString case in `encode_type'
- */
- fprintf (codefile, "%s += 7;\n", variable);
- break;
- }
- case TSequence: {
- Member *m;
- int tag = -1;
-
- if (t->members == NULL)
- break;
-
- for (m = t->members; m && tag != m->val; m = m->next) {
- char *s;
-
- asprintf (&s, "%s(%s)->%s",
- m->optional ? "" : "&", name, m->gen_name);
- if (m->optional)
- fprintf (codefile, "if(%s)", s);
- fprintf (codefile, "{\n"
- "int oldret = %s;\n"
- "%s = 0;\n", variable, variable);
- length_type (s, m->type, "ret");
- fprintf (codefile, "%s += 1 + length_len(%s) + oldret;\n",
- variable, variable);
- fprintf (codefile, "}\n");
- if (tag == -1)
- tag = m->val;
- free (s);
- }
- fprintf (codefile,
- "%s += 1 + length_len(%s);\n", variable, variable);
- break;
- }
- case TSequenceOf: {
- char *n;
-
- fprintf (codefile,
- "{\n"
- "int oldret = %s;\n"
- "int i;\n"
- "%s = 0;\n",
- variable, variable);
-
- fprintf (codefile, "for(i = (%s)->len - 1; i >= 0; --i){\n", name);
- asprintf (&n, "&(%s)->val[i]", name);
- length_type(n, t->subtype, variable);
- fprintf (codefile, "}\n");
-
- fprintf (codefile,
- "%s += 1 + length_len(%s) + oldret;\n"
- "}\n", variable, variable);
- free(n);
- break;
- }
- case TGeneralizedTime:
- length_primitive ("generalized_time", name, variable);
- break;
- case TGeneralString:
- length_primitive ("general_string", name, variable);
- break;
- case TApplication:
- length_type (name, t->subtype, variable);
- fprintf (codefile, "ret += 1 + length_len (ret);\n");
- break;
- default :
- abort ();
- }
-}
-
-void
-generate_type_length (const Symbol *s)
-{
- fprintf (headerfile,
- "size_t length_%s(const %s *);\n",
- s->gen_name, s->gen_name);
-
- fprintf (codefile,
- "size_t\n"
- "length_%s(const %s *data)\n"
- "{\n"
- "size_t ret = 0;\n",
- s->gen_name, s->gen_name);
-
- length_type ("data", s->type, "ret");
- fprintf (codefile, "return ret;\n}\n\n");
-}
-
diff --git a/crypto/heimdal/lib/asn1/gen_locl.h b/crypto/heimdal/lib/asn1/gen_locl.h
deleted file mode 100644
index 212c3217c1bab..0000000000000
--- a/crypto/heimdal/lib/asn1/gen_locl.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: gen_locl.h,v 1.9 2001/09/27 16:21:47 assar Exp $ */
-
-#ifndef __GEN_LOCL_H__
-#define __GEN_LOCL_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <ctype.h>
-#include <time.h>
-#include <errno.h>
-#include <err.h>
-#include <roken.h>
-#include "hash.h"
-#include "symbol.h"
-
-void generate_type (const Symbol *);
-void generate_constant (const Symbol *);
-void generate_type_encode (const Symbol *s);
-void generate_type_decode (const Symbol *s);
-void generate_seq_type_decode (const Symbol *s);
-void generate_type_free (const Symbol *s);
-void generate_type_length (const Symbol *s);
-void generate_type_copy (const Symbol *s);
-void generate_type_maybe (const Symbol *s);
-void generate_glue (const Symbol *s);
-
-void init_generate (const char *filename, const char *basename);
-const char *filename (void);
-void close_generate(void);
-void add_import(const char *module);
-int yyparse(void);
-
-extern FILE *headerfile, *codefile, *logfile;
-
-#endif /* __GEN_LOCL_H__ */
diff --git a/crypto/heimdal/lib/asn1/hash.c b/crypto/heimdal/lib/asn1/hash.c
deleted file mode 100644
index a8d3eb39f972e..0000000000000
--- a/crypto/heimdal/lib/asn1/hash.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1997 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.
- */
-
-/*
- * Hash table functions
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: hash.c,v 1.8 1999/12/02 17:05:02 joda Exp $");
-
-static Hashentry *_search(Hashtab * htab, /* The hash table */
- void *ptr); /* And key */
-
-Hashtab *
-hashtabnew(int sz,
- int (*cmp) (void *, void *),
- unsigned (*hash) (void *))
-{
- Hashtab *htab;
- int i;
-
- assert(sz > 0);
-
- htab = (Hashtab *) malloc(sizeof(Hashtab) + (sz - 1) * sizeof(Hashentry *));
- for (i = 0; i < sz; ++i)
- htab->tab[i] = NULL;
-
- if (htab == NULL) {
- return NULL;
- } else {
- htab->cmp = cmp;
- htab->hash = hash;
- htab->sz = sz;
- return htab;
- }
-}
-
-/* Intern search function */
-
-static Hashentry *
-_search(Hashtab * htab, void *ptr)
-{
- Hashentry *hptr;
-
- assert(htab && ptr);
-
- for (hptr = htab->tab[(*htab->hash) (ptr) % htab->sz];
- hptr;
- hptr = hptr->next)
- if ((*htab->cmp) (ptr, hptr->ptr) == 0)
- break;
- return hptr;
-}
-
-/* Search for element in hash table */
-
-void *
-hashtabsearch(Hashtab * htab, void *ptr)
-{
- Hashentry *tmp;
-
- tmp = _search(htab, ptr);
- return tmp ? tmp->ptr : tmp;
-}
-
-/* add element to hash table */
-/* if already there, set new value */
-/* !NULL if succesful */
-
-void *
-hashtabadd(Hashtab * htab, void *ptr)
-{
- Hashentry *h = _search(htab, ptr);
- Hashentry **tabptr;
-
- assert(htab && ptr);
-
- if (h)
- free((void *) h->ptr);
- else {
- h = (Hashentry *) malloc(sizeof(Hashentry));
- if (h == NULL) {
- return NULL;
- }
- tabptr = &htab->tab[(*htab->hash) (ptr) % htab->sz];
- h->next = *tabptr;
- *tabptr = h;
- h->prev = tabptr;
- if (h->next)
- h->next->prev = &h->next;
- }
- h->ptr = ptr;
- return h;
-}
-
-/* delete element with key key. Iff freep, free Hashentry->ptr */
-
-int
-_hashtabdel(Hashtab * htab, void *ptr, int freep)
-{
- Hashentry *h;
-
- assert(htab && ptr);
-
- h = _search(htab, ptr);
- if (h) {
- if (freep)
- free(h->ptr);
- if ((*(h->prev) = h->next))
- h->next->prev = h->prev;
- free(h);
- return 0;
- } else
- return -1;
-}
-
-/* Do something for each element */
-
-void
-hashtabforeach(Hashtab * htab, int (*func) (void *ptr, void *arg),
- void *arg)
-{
- Hashentry **h, *g;
-
- assert(htab);
-
- for (h = htab->tab; h < &htab->tab[htab->sz]; ++h)
- for (g = *h; g; g = g->next)
- if ((*func) (g->ptr, arg))
- return;
-}
-
-/* standard hash-functions for strings */
-
-unsigned
-hashadd(const char *s)
-{ /* Standard hash function */
- unsigned i;
-
- assert(s);
-
- for (i = 0; *s; ++s)
- i += *s;
- return i;
-}
-
-unsigned
-hashcaseadd(const char *s)
-{ /* Standard hash function */
- unsigned i;
-
- assert(s);
-
- for (i = 0; *s; ++s)
- i += toupper(*s);
- return i;
-}
-
-#define TWELVE (sizeof(unsigned))
-#define SEVENTYFIVE (6*sizeof(unsigned))
-#define HIGH_BITS (~((unsigned)(~0) >> TWELVE))
-
-unsigned
-hashjpw(const char *ss)
-{ /* another hash function */
- unsigned h = 0;
- unsigned g;
- const unsigned char *s = (const unsigned char *)ss;
-
- for (; *s; ++s) {
- h = (h << TWELVE) + *s;
- if ((g = h & HIGH_BITS))
- h = (h ^ (g >> SEVENTYFIVE)) & ~HIGH_BITS;
- }
- return h;
-}
diff --git a/crypto/heimdal/lib/asn1/hash.h b/crypto/heimdal/lib/asn1/hash.h
deleted file mode 100644
index b54e10234a74d..0000000000000
--- a/crypto/heimdal/lib/asn1/hash.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1997 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.
- */
-
-/*
- * hash.h. Header file for hash table functions
- */
-
-/* $Id: hash.h,v 1.3 1999/12/02 17:05:02 joda Exp $ */
-
-struct hashentry { /* Entry in bucket */
- struct hashentry **prev;
- struct hashentry *next;
- void *ptr;
-};
-
-typedef struct hashentry Hashentry;
-
-struct hashtab { /* Hash table */
- int (*cmp)(void *, void *); /* Compare function */
- unsigned (*hash)(void *); /* hash function */
- int sz; /* Size */
- Hashentry *tab[1]; /* The table */
-};
-
-typedef struct hashtab Hashtab;
-
-/* prototypes */
-
-Hashtab *hashtabnew(int sz,
- int (*cmp)(void *, void *),
- unsigned (*hash)(void *)); /* Make new hash table */
-
-void *hashtabsearch(Hashtab *htab, /* The hash table */
- void *ptr); /* The key */
-
-
-void *hashtabadd(Hashtab *htab, /* The hash table */
- void *ptr); /* The element */
-
-int _hashtabdel(Hashtab *htab, /* The table */
- void *ptr, /* Key */
- int freep); /* Free data part? */
-
-void hashtabforeach(Hashtab *htab,
- int (*func)(void *ptr, void *arg),
- void *arg);
-
-unsigned hashadd(const char *s); /* Standard hash function */
-unsigned hashcaseadd(const char *s); /* Standard hash function */
-unsigned hashjpw(const char *s); /* another hash function */
-
-/* macros */
-
- /* Don't free space */
-#define hashtabdel(htab,key) _hashtabdel(htab,key,FALSE)
-
-#define hashtabfree(htab,key) _hashtabdel(htab,key,TRUE) /* Do! */
diff --git a/crypto/heimdal/lib/asn1/k5.asn1 b/crypto/heimdal/lib/asn1/k5.asn1
deleted file mode 100644
index 37c60a8dcb662..0000000000000
--- a/crypto/heimdal/lib/asn1/k5.asn1
+++ /dev/null
@@ -1,451 +0,0 @@
--- $Id: k5.asn1,v 1.28 2003/01/15 03:13:47 lha Exp $
-
-KERBEROS5 DEFINITIONS ::=
-BEGIN
-
-NAME-TYPE ::= INTEGER {
- KRB5_NT_UNKNOWN(0), -- Name type not known
- KRB5_NT_PRINCIPAL(1), -- Just the name of the principal as in
- KRB5_NT_SRV_INST(2), -- Service and other unique instance (krbtgt)
- KRB5_NT_SRV_HST(3), -- Service with host name as instance
- KRB5_NT_SRV_XHST(4), -- Service with host as remaining components
- KRB5_NT_UID(5), -- Unique ID
- KRB5_NT_X500_PRINCIPAL(6) -- PKINIT
-}
-
--- message types
-
-MESSAGE-TYPE ::= INTEGER {
- krb-as-req(10), -- Request for initial authentication
- krb-as-rep(11), -- Response to KRB_AS_REQ request
- krb-tgs-req(12), -- Request for authentication based on TGT
- krb-tgs-rep(13), -- Response to KRB_TGS_REQ request
- krb-ap-req(14), -- application request to server
- krb-ap-rep(15), -- Response to KRB_AP_REQ_MUTUAL
- krb-safe(20), -- Safe (checksummed) application message
- krb-priv(21), -- Private (encrypted) application message
- krb-cred(22), -- Private (encrypted) message to forward credentials
- krb-error(30) -- Error response
-}
-
-
--- pa-data types
-
-PADATA-TYPE ::= INTEGER {
- KRB5-PADATA-NONE(0),
- KRB5-PADATA-TGS-REQ(1),
- KRB5-PADATA-AP-REQ(1),
- KRB5-PADATA-ENC-TIMESTAMP(2),
- KRB5-PADATA-PW-SALT(3),
- KRB5-PADATA-ENC-UNIX-TIME(5),
- KRB5-PADATA-SANDIA-SECUREID(6),
- KRB5-PADATA-SESAME(7),
- KRB5-PADATA-OSF-DCE(8),
- KRB5-PADATA-CYBERSAFE-SECUREID(9),
- KRB5-PADATA-AFS3-SALT(10),
- KRB5-PADATA-ETYPE-INFO(11),
- KRB5-PADATA-SAM-CHALLENGE(12), -- (sam/otp)
- KRB5-PADATA-SAM-RESPONSE(13), -- (sam/otp)
- KRB5-PADATA-PK-AS-REQ(14), -- (PKINIT)
- KRB5-PADATA-PK-AS-REP(15), -- (PKINIT)
- KRB5-PADATA-PK-AS-SIGN(16), -- (PKINIT)
- KRB5-PADATA-PK-KEY-REQ(17), -- (PKINIT)
- KRB5-PADATA-PK-KEY-REP(18), -- (PKINIT)
- KRB5-PADATA-USE-SPECIFIED-KVNO(20),
- KRB5-PADATA-SAM-REDIRECT(21), -- (sam/otp)
- KRB5-PADATA-GET-FROM-TYPED-DATA(22),
- KRB5-PADATA-SAM-ETYPE-INFO(23)
-}
-
--- checksumtypes
-
-CKSUMTYPE ::= INTEGER {
- CKSUMTYPE_NONE(0),
- CKSUMTYPE_CRC32(1),
- CKSUMTYPE_RSA_MD4(2),
- CKSUMTYPE_RSA_MD4_DES(3),
- CKSUMTYPE_DES_MAC(4),
- CKSUMTYPE_DES_MAC_K(5),
- CKSUMTYPE_RSA_MD4_DES_K(6),
- CKSUMTYPE_RSA_MD5(7),
- CKSUMTYPE_RSA_MD5_DES(8),
- CKSUMTYPE_RSA_MD5_DES3(9),
- CKSUMTYPE_HMAC_SHA1_96_AES_128(10),
- CKSUMTYPE_HMAC_SHA1_96_AES_256(11),
- CKSUMTYPE_HMAC_SHA1_DES3(12),
- CKSUMTYPE_SHA1(1000), -- correct value? 10 (9 also)
- CKSUMTYPE_GSSAPI(0x8003),
- CKSUMTYPE_HMAC_MD5(-138), -- unofficial microsoft number
- CKSUMTYPE_HMAC_MD5_ENC(-1138) -- even more unofficial
-}
-
---enctypes
-ENCTYPE ::= INTEGER {
- ETYPE_NULL(0),
- ETYPE_DES_CBC_CRC(1),
- ETYPE_DES_CBC_MD4(2),
- ETYPE_DES_CBC_MD5(3),
- ETYPE_DES3_CBC_MD5(5),
- ETYPE_OLD_DES3_CBC_SHA1(7),
- ETYPE_SIGN_DSA_GENERATE(8),
- ETYPE_ENCRYPT_RSA_PRIV(9),
- ETYPE_ENCRYPT_RSA_PUB(10),
- ETYPE_DES3_CBC_SHA1(16), -- with key derivation
- ETYPE_AES128_CTS_HMAC_SHA1_96(17),
- ETYPE_AES256_CTS_HMAC_SHA1_96(18),
- ETYPE_ARCFOUR_HMAC_MD5(23),
- ETYPE_ARCFOUR_HMAC_MD5_56(24),
- ETYPE_ENCTYPE_PK_CROSS(48),
--- these are for Heimdal internal use
- ETYPE_DES_CBC_NONE(-0x1000),
- ETYPE_DES3_CBC_NONE(-0x1001),
- ETYPE_DES_CFB64_NONE(-0x1002),
- ETYPE_DES_PCBC_NONE(-0x1003)
-}
-
--- this is sugar to make something ASN1 does not have: unsigned
-
-UNSIGNED ::= INTEGER (0..4294967295)
-
-Realm ::= GeneralString
-PrincipalName ::= SEQUENCE {
- name-type[0] NAME-TYPE,
- name-string[1] SEQUENCE OF GeneralString
-}
-
--- this is not part of RFC1510
-Principal ::= SEQUENCE {
- name[0] PrincipalName,
- realm[1] Realm
-}
-
-HostAddress ::= SEQUENCE {
- addr-type[0] INTEGER,
- address[1] OCTET STRING
-}
-
--- This is from RFC1510.
---
--- HostAddresses ::= SEQUENCE OF SEQUENCE {
--- addr-type[0] INTEGER,
--- address[1] OCTET STRING
--- }
-
--- This seems much better.
-HostAddresses ::= SEQUENCE OF HostAddress
-
-
-KerberosTime ::= GeneralizedTime -- Specifying UTC time zone (Z)
-
-AuthorizationData ::= SEQUENCE OF SEQUENCE {
- ad-type[0] INTEGER,
- ad-data[1] OCTET STRING
-}
-
-APOptions ::= BIT STRING {
- reserved(0),
- use-session-key(1),
- mutual-required(2)
-}
-
-TicketFlags ::= BIT STRING {
- reserved(0),
- forwardable(1),
- forwarded(2),
- proxiable(3),
- proxy(4),
- may-postdate(5),
- postdated(6),
- invalid(7),
- renewable(8),
- initial(9),
- pre-authent(10),
- hw-authent(11),
- transited-policy-checked(12),
- ok-as-delegate(13),
- anonymous(14)
-}
-
-KDCOptions ::= BIT STRING {
- reserved(0),
- forwardable(1),
- forwarded(2),
- proxiable(3),
- proxy(4),
- allow-postdate(5),
- postdated(6),
- unused7(7),
- renewable(8),
- unused9(9),
- unused10(10),
- unused11(11),
- request-anonymous(14),
- canonicalize(15),
- disable-transited-check(26),
- renewable-ok(27),
- enc-tkt-in-skey(28),
- renew(30),
- validate(31)
-}
-
-LR-TYPE ::= INTEGER {
- LR_NONE(0), -- no information
- LR_INITIAL_TGT(1), -- last initial TGT request
- LR_INITIAL(2), -- last initial request
- LR_ISSUE_USE_TGT(3), -- time of newest TGT used
- LR_RENEWAL(4), -- time of last renewal
- LR_REQUEST(5), -- time of last request (of any type)
- LR_PW_EXPTIME(6), -- expiration time of password
- LR_ACCT_EXPTIME(7) -- expiration time of account
-}
-
-LastReq ::= SEQUENCE OF SEQUENCE {
- lr-type[0] LR-TYPE,
- lr-value[1] KerberosTime
-}
-
-
-EncryptedData ::= SEQUENCE {
- etype[0] ENCTYPE, -- EncryptionType
- kvno[1] INTEGER OPTIONAL,
- cipher[2] OCTET STRING -- ciphertext
-}
-
-EncryptionKey ::= SEQUENCE {
- keytype[0] INTEGER,
- keyvalue[1] OCTET STRING
-}
-
--- encoded Transited field
-TransitedEncoding ::= SEQUENCE {
- tr-type[0] INTEGER, -- must be registered
- contents[1] OCTET STRING
-}
-
-Ticket ::= [APPLICATION 1] SEQUENCE {
- tkt-vno[0] INTEGER,
- realm[1] Realm,
- sname[2] PrincipalName,
- enc-part[3] EncryptedData
-}
--- Encrypted part of ticket
-EncTicketPart ::= [APPLICATION 3] SEQUENCE {
- flags[0] TicketFlags,
- key[1] EncryptionKey,
- crealm[2] Realm,
- cname[3] PrincipalName,
- transited[4] TransitedEncoding,
- authtime[5] KerberosTime,
- starttime[6] KerberosTime OPTIONAL,
- endtime[7] KerberosTime,
- renew-till[8] KerberosTime OPTIONAL,
- caddr[9] HostAddresses OPTIONAL,
- authorization-data[10] AuthorizationData OPTIONAL
-}
-
-Checksum ::= SEQUENCE {
- cksumtype[0] CKSUMTYPE,
- checksum[1] OCTET STRING
-}
-
-Authenticator ::= [APPLICATION 2] SEQUENCE {
- authenticator-vno[0] INTEGER,
- crealm[1] Realm,
- cname[2] PrincipalName,
- cksum[3] Checksum OPTIONAL,
- cusec[4] INTEGER,
- ctime[5] KerberosTime,
- subkey[6] EncryptionKey OPTIONAL,
- seq-number[7] UNSIGNED OPTIONAL,
- authorization-data[8] AuthorizationData OPTIONAL
- }
-
-PA-DATA ::= SEQUENCE {
- -- might be encoded AP-REQ
- padata-type[1] PADATA-TYPE,
- padata-value[2] OCTET STRING
-}
-
-ETYPE-INFO-ENTRY ::= SEQUENCE {
- etype[0] ENCTYPE,
- salt[1] OCTET STRING OPTIONAL,
- salttype[2] INTEGER OPTIONAL
-}
-
-ETYPE-INFO ::= SEQUENCE OF ETYPE-INFO-ENTRY
-
-METHOD-DATA ::= SEQUENCE OF PA-DATA
-
-KDC-REQ-BODY ::= SEQUENCE {
- kdc-options[0] KDCOptions,
- cname[1] PrincipalName OPTIONAL, -- Used only in AS-REQ
- realm[2] Realm, -- Server's realm
- -- Also client's in AS-REQ
- sname[3] PrincipalName OPTIONAL,
- from[4] KerberosTime OPTIONAL,
- till[5] KerberosTime OPTIONAL,
- rtime[6] KerberosTime OPTIONAL,
- nonce[7] INTEGER,
- etype[8] SEQUENCE OF ENCTYPE, -- EncryptionType,
- -- in preference order
- addresses[9] HostAddresses OPTIONAL,
- enc-authorization-data[10] EncryptedData OPTIONAL,
- -- Encrypted AuthorizationData encoding
- additional-tickets[11] SEQUENCE OF Ticket OPTIONAL
-}
-
-KDC-REQ ::= SEQUENCE {
- pvno[1] INTEGER,
- msg-type[2] MESSAGE-TYPE,
- padata[3] METHOD-DATA OPTIONAL,
- req-body[4] KDC-REQ-BODY
-}
-
-AS-REQ ::= [APPLICATION 10] KDC-REQ
-TGS-REQ ::= [APPLICATION 12] KDC-REQ
-
--- padata-type ::= PA-ENC-TIMESTAMP
--- padata-value ::= EncryptedData - PA-ENC-TS-ENC
-
-PA-ENC-TS-ENC ::= SEQUENCE {
- patimestamp[0] KerberosTime, -- client's time
- pausec[1] INTEGER OPTIONAL
-}
-
-KDC-REP ::= SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- padata[2] METHOD-DATA OPTIONAL,
- crealm[3] Realm,
- cname[4] PrincipalName,
- ticket[5] Ticket,
- enc-part[6] EncryptedData
-}
-
-AS-REP ::= [APPLICATION 11] KDC-REP
-TGS-REP ::= [APPLICATION 13] KDC-REP
-
-EncKDCRepPart ::= SEQUENCE {
- key[0] EncryptionKey,
- last-req[1] LastReq,
- nonce[2] INTEGER,
- key-expiration[3] KerberosTime OPTIONAL,
- flags[4] TicketFlags,
- authtime[5] KerberosTime,
- starttime[6] KerberosTime OPTIONAL,
- endtime[7] KerberosTime,
- renew-till[8] KerberosTime OPTIONAL,
- srealm[9] Realm,
- sname[10] PrincipalName,
- caddr[11] HostAddresses OPTIONAL
-}
-
-EncASRepPart ::= [APPLICATION 25] EncKDCRepPart
-EncTGSRepPart ::= [APPLICATION 26] EncKDCRepPart
-
-AP-REQ ::= [APPLICATION 14] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- ap-options[2] APOptions,
- ticket[3] Ticket,
- authenticator[4] EncryptedData
-}
-
-AP-REP ::= [APPLICATION 15] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- enc-part[2] EncryptedData
-}
-
-EncAPRepPart ::= [APPLICATION 27] SEQUENCE {
- ctime[0] KerberosTime,
- cusec[1] INTEGER,
- subkey[2] EncryptionKey OPTIONAL,
- seq-number[3] UNSIGNED OPTIONAL
-}
-
-KRB-SAFE-BODY ::= SEQUENCE {
- user-data[0] OCTET STRING,
- timestamp[1] KerberosTime OPTIONAL,
- usec[2] INTEGER OPTIONAL,
- seq-number[3] UNSIGNED OPTIONAL,
- s-address[4] HostAddress OPTIONAL,
- r-address[5] HostAddress OPTIONAL
-}
-
-KRB-SAFE ::= [APPLICATION 20] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- safe-body[2] KRB-SAFE-BODY,
- cksum[3] Checksum
-}
-
-KRB-PRIV ::= [APPLICATION 21] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- enc-part[3] EncryptedData
-}
-EncKrbPrivPart ::= [APPLICATION 28] SEQUENCE {
- user-data[0] OCTET STRING,
- timestamp[1] KerberosTime OPTIONAL,
- usec[2] INTEGER OPTIONAL,
- seq-number[3] UNSIGNED OPTIONAL,
- s-address[4] HostAddress OPTIONAL, -- sender's addr
- r-address[5] HostAddress OPTIONAL -- recip's addr
-}
-
-KRB-CRED ::= [APPLICATION 22] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE, -- KRB_CRED
- tickets[2] SEQUENCE OF Ticket,
- enc-part[3] EncryptedData
-}
-
-KrbCredInfo ::= SEQUENCE {
- key[0] EncryptionKey,
- prealm[1] Realm OPTIONAL,
- pname[2] PrincipalName OPTIONAL,
- flags[3] TicketFlags OPTIONAL,
- authtime[4] KerberosTime OPTIONAL,
- starttime[5] KerberosTime OPTIONAL,
- endtime[6] KerberosTime OPTIONAL,
- renew-till[7] KerberosTime OPTIONAL,
- srealm[8] Realm OPTIONAL,
- sname[9] PrincipalName OPTIONAL,
- caddr[10] HostAddresses OPTIONAL
-}
-
-EncKrbCredPart ::= [APPLICATION 29] SEQUENCE {
- ticket-info[0] SEQUENCE OF KrbCredInfo,
- nonce[1] INTEGER OPTIONAL,
- timestamp[2] KerberosTime OPTIONAL,
- usec[3] INTEGER OPTIONAL,
- s-address[4] HostAddress OPTIONAL,
- r-address[5] HostAddress OPTIONAL
-}
-
-KRB-ERROR ::= [APPLICATION 30] SEQUENCE {
- pvno[0] INTEGER,
- msg-type[1] MESSAGE-TYPE,
- ctime[2] KerberosTime OPTIONAL,
- cusec[3] INTEGER OPTIONAL,
- stime[4] KerberosTime,
- susec[5] INTEGER,
- error-code[6] INTEGER,
- crealm[7] Realm OPTIONAL,
- cname[8] PrincipalName OPTIONAL,
- realm[9] Realm, -- Correct realm
- sname[10] PrincipalName, -- Correct name
- e-text[11] GeneralString OPTIONAL,
- e-data[12] OCTET STRING OPTIONAL
-}
-
-pvno INTEGER ::= 5 -- current Kerberos protocol version number
-
--- transited encodings
-
-DOMAIN-X500-COMPRESS INTEGER ::= 1
-
-END
-
--- etags -r '/\([A-Za-z][-A-Za-z0-9]*\).*::=/\1/' k5.asn1
diff --git a/crypto/heimdal/lib/asn1/lex.h b/crypto/heimdal/lib/asn1/lex.h
deleted file mode 100644
index 9f5cadf92b840..0000000000000
--- a/crypto/heimdal/lib/asn1/lex.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 1997 - 2000 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.
- */
-
-/* $Id: lex.h,v 1.5 2000/07/01 20:21:34 assar Exp $ */
-
-#include <roken.h>
-
-void error_message (const char *, ...)
-__attribute__ ((format (printf, 1, 2)));
-
-int yylex(void);
diff --git a/crypto/heimdal/lib/asn1/lex.l b/crypto/heimdal/lib/asn1/lex.l
deleted file mode 100644
index 3abc17ee67f62..0000000000000
--- a/crypto/heimdal/lib/asn1/lex.l
+++ /dev/null
@@ -1,122 +0,0 @@
-%{
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: lex.l,v 1.19 2001/09/25 23:28:03 assar Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#undef ECHO
-#include "symbol.h"
-#include "parse.h"
-#include "lex.h"
-#include "gen_locl.h"
-
-static unsigned lineno = 1;
-
-#define YY_NO_UNPUT
-
-#undef ECHO
-
-%}
-
-
-%%
-INTEGER { return INTEGER; }
-IMPORTS { return IMPORTS; }
-FROM { return FROM; }
-SEQUENCE { return SEQUENCE; }
-OF { return OF; }
-OCTET { return OCTET; }
-STRING { return STRING; }
-GeneralizedTime { return GeneralizedTime; }
-GeneralString { return GeneralString; }
-BIT { return BIT; }
-APPLICATION { return APPLICATION; }
-OPTIONAL { return OPTIONAL; }
-BEGIN { return TBEGIN; }
-END { return END; }
-DEFINITIONS { return DEFINITIONS; }
-ENUMERATED { return ENUMERATED; }
-EXTERNAL { return EXTERNAL; }
-OBJECT { return OBJECT; }
-IDENTIFIER { return IDENTIFIER; }
-[,;{}()|] { return *yytext; }
-"[" { return *yytext; }
-"]" { return *yytext; }
-::= { return EEQUAL; }
---[^\n]*\n { ++lineno; }
--?(0x)?[0-9]+ { char *e, *y = yytext;
- yylval.constant = strtol((const char *)yytext,
- &e, 0);
- if(e == y)
- error_message("malformed constant (%s)", yytext);
- else
- return CONSTANT;
- }
-[A-Za-z][-A-Za-z0-9_]* {
- yylval.name = strdup ((const char *)yytext);
- return IDENT;
- }
-[ \t] ;
-\n { ++lineno; }
-\.\. { return DOTDOT; }
-. { error_message("Ignoring char(%c)\n", *yytext); }
-%%
-
-#ifndef yywrap /* XXX */
-int
-yywrap ()
-{
- return 1;
-}
-#endif
-
-void
-error_message (const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- fprintf (stderr, "%s:%d: ", filename(), lineno);
- vfprintf (stderr, format, args);
- va_end (args);
-}
diff --git a/crypto/heimdal/lib/asn1/libasn1.h b/crypto/heimdal/lib/asn1/libasn1.h
deleted file mode 100644
index 8a4994a20c769..0000000000000
--- a/crypto/heimdal/lib/asn1/libasn1.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: libasn1.h,v 1.9 2001/04/18 13:10:24 joda Exp $ */
-
-#ifndef __LIBASN1_H__
-#define __LIBASN1_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "krb5_asn1.h"
-#include "der.h"
-#include "asn1_err.h"
-#include <parse_units.h>
-
-#endif /* __LIBASN1_H__ */
diff --git a/crypto/heimdal/lib/asn1/main.c b/crypto/heimdal/lib/asn1/main.c
deleted file mode 100644
index 8b1b4093cb148..0000000000000
--- a/crypto/heimdal/lib/asn1/main.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999 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.
- */
-
-#include "gen_locl.h"
-#include <getarg.h>
-
-RCSID("$Id: main.c,v 1.11 2001/02/20 01:44:52 assar Exp $");
-
-extern FILE *yyin;
-
-int version_flag;
-int help_flag;
-struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-int num_args = sizeof(args) / sizeof(args[0]);
-
-static void
-usage(int code)
-{
- arg_printusage(args, num_args, NULL, "[asn1-file [name]]");
- exit(code);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret;
- char *file;
- char *name = NULL;
- int optind = 0;
-
- setprogname(argv[0]);
- if(getarg(args, num_args, argc, argv, &optind))
- usage(1);
- if(help_flag)
- usage(0);
- if(version_flag) {
- print_version(NULL);
- exit(0);
- }
- if (argc == optind) {
- file = "stdin";
- name = "stdin";
- yyin = stdin;
- } else {
- file = argv[optind];
- yyin = fopen (file, "r");
- if (yyin == NULL)
- err (1, "open %s", file);
- name = argv[optind + 1];
- }
-
- init_generate (file, name);
- initsym ();
- ret = yyparse ();
- close_generate ();
- return ret;
-}
diff --git a/crypto/heimdal/lib/asn1/parse.y b/crypto/heimdal/lib/asn1/parse.y
deleted file mode 100644
index fc780860364bf..0000000000000
--- a/crypto/heimdal/lib/asn1/parse.y
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: parse.y,v 1.19 2001/09/27 16:21:47 assar Exp $ */
-
-%{
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "symbol.h"
-#include "lex.h"
-#include "gen_locl.h"
-
-RCSID("$Id: parse.y,v 1.19 2001/09/27 16:21:47 assar Exp $");
-
-static Type *new_type (Typetype t);
-void yyerror (char *);
-
-static void append (Member *l, Member *r);
-
-%}
-
-%union {
- int constant;
- char *name;
- Type *type;
- Member *member;
-}
-
-%token INTEGER SEQUENCE OF OCTET STRING GeneralizedTime GeneralString
-%token BIT APPLICATION OPTIONAL EEQUAL TBEGIN END DEFINITIONS ENUMERATED
-%token EXTERNAL
-%token DOTDOT
-%token IMPORTS FROM
-%token OBJECT IDENTIFIER
-%token <name> IDENT
-%token <constant> CONSTANT
-
-%type <constant> constant optional2
-%type <type> type
-%type <member> memberdecls memberdecl bitdecls bitdecl
-
-%start envelope
-
-%%
-
-envelope : IDENT DEFINITIONS EEQUAL TBEGIN specification END {}
- ;
-
-specification :
- | specification declaration
- ;
-
-declaration : imports_decl
- | type_decl
- | constant_decl
- ;
-
-referencenames : IDENT ',' referencenames
- {
- Symbol *s = addsym($1);
- s->stype = Stype;
- }
- | IDENT
- {
- Symbol *s = addsym($1);
- s->stype = Stype;
- }
- ;
-
-imports_decl : IMPORTS referencenames FROM IDENT ';'
- { add_import($4); }
- ;
-
-type_decl : IDENT EEQUAL type
- {
- Symbol *s = addsym ($1);
- s->stype = Stype;
- s->type = $3;
- generate_type (s);
- }
- ;
-
-constant_decl : IDENT type EEQUAL constant
- {
- Symbol *s = addsym ($1);
- s->stype = SConstant;
- s->constant = $4;
- generate_constant (s);
- }
- ;
-
-type : INTEGER { $$ = new_type(TInteger); }
- | INTEGER '(' constant DOTDOT constant ')' {
- if($3 != 0)
- error_message("Only 0 supported as low range");
- if($5 != INT_MIN && $5 != UINT_MAX && $5 != INT_MAX)
- error_message("Only %u supported as high range",
- UINT_MAX);
- $$ = new_type(TUInteger);
- }
- | INTEGER '{' bitdecls '}'
- {
- $$ = new_type(TInteger);
- $$->members = $3;
- }
- | OBJECT IDENTIFIER { $$ = new_type(TOID); }
- | ENUMERATED '{' bitdecls '}'
- {
- $$ = new_type(TEnumerated);
- $$->members = $3;
- }
- | OCTET STRING { $$ = new_type(TOctetString); }
- | GeneralString { $$ = new_type(TGeneralString); }
- | GeneralizedTime { $$ = new_type(TGeneralizedTime); }
- | SEQUENCE OF type
- {
- $$ = new_type(TSequenceOf);
- $$->subtype = $3;
- }
- | SEQUENCE '{' memberdecls '}'
- {
- $$ = new_type(TSequence);
- $$->members = $3;
- }
- | BIT STRING '{' bitdecls '}'
- {
- $$ = new_type(TBitString);
- $$->members = $4;
- }
- | IDENT
- {
- Symbol *s = addsym($1);
- $$ = new_type(TType);
- if(s->stype != Stype)
- error_message ("%s is not a type\n", $1);
- else
- $$->symbol = s;
- }
- | '[' APPLICATION constant ']' type
- {
- $$ = new_type(TApplication);
- $$->subtype = $5;
- $$->application = $3;
- }
- ;
-
-memberdecls : { $$ = NULL; }
- | memberdecl { $$ = $1; }
- | memberdecls ',' memberdecl { $$ = $1; append($$, $3); }
- ;
-
-memberdecl : IDENT '[' constant ']' type optional2
- {
- $$ = malloc(sizeof(*$$));
- $$->name = $1;
- $$->gen_name = strdup($1);
- output_name ($$->gen_name);
- $$->val = $3;
- $$->optional = $6;
- $$->type = $5;
- $$->next = $$->prev = $$;
- }
- ;
-
-optional2 : { $$ = 0; }
- | OPTIONAL { $$ = 1; }
- ;
-
-bitdecls : { $$ = NULL; }
- | bitdecl { $$ = $1; }
- | bitdecls ',' bitdecl { $$ = $1; append($$, $3); }
- ;
-
-bitdecl : IDENT '(' constant ')'
- {
- $$ = malloc(sizeof(*$$));
- $$->name = $1;
- $$->gen_name = strdup($1);
- output_name ($$->gen_name);
- $$->val = $3;
- $$->optional = 0;
- $$->type = NULL;
- $$->prev = $$->next = $$;
- }
- ;
-
-constant : CONSTANT { $$ = $1; }
- | IDENT {
- Symbol *s = addsym($1);
- if(s->stype != SConstant)
- error_message ("%s is not a constant\n",
- s->name);
- else
- $$ = s->constant;
- }
- ;
-%%
-
-void
-yyerror (char *s)
-{
- error_message ("%s\n", s);
-}
-
-static Type *
-new_type (Typetype tt)
-{
- Type *t = malloc(sizeof(*t));
- if (t == NULL) {
- error_message ("out of memory in malloc(%lu)",
- (unsigned long)sizeof(*t));
- exit (1);
- }
- t->type = tt;
- t->application = 0;
- t->members = NULL;
- t->subtype = NULL;
- t->symbol = NULL;
- return t;
-}
-
-static void
-append (Member *l, Member *r)
-{
- l->prev->next = r;
- r->prev = l->prev;
- l->prev = r;
- r->next = l;
-}
diff --git a/crypto/heimdal/lib/asn1/pkinit.asn1 b/crypto/heimdal/lib/asn1/pkinit.asn1
deleted file mode 100644
index 92c5de75daac6..0000000000000
--- a/crypto/heimdal/lib/asn1/pkinit.asn1
+++ /dev/null
@@ -1,189 +0,0 @@
-PKINIT DEFINITIONS ::= BEGIN
-
-IMPORTS EncryptionKey, PrincipalName, Realm, KerberosTime, TypedData
- FROM krb5;
-IMPORTS SignedData, EnvelopedData FROM CMS;
-IMPORTS CertificateSerialNumber, AttributeTypeAndValue, Name FROM X509;
-
-
--- 3.1
-
-CertPrincipalName ::= SEQUENCE {
- name-type[0] INTEGER,
- name-string[1] SEQUENCE OF UTF8String
-}
-
-
--- 3.2.2
-
-
-TrustedCertifiers ::= SEQUENCE OF PrincipalName
- -- X.500 name encoded as a principal name
- -- see Section 3.1
-CertificateIndex ::= INTEGER
- -- 0 = 1st certificate,
- -- (in order of encoding)
- -- 1 = 2nd certificate, etc
-
-PA-PK-AS-REP ::= CHOICE {
- -- PA TYPE 15
- dhSignedData[0] SignedData,
- -- Defined in CMS and used only with
- -- Diffie-Hellman key exchange (if the
- -- client public value was present in the
- -- request).
- -- This choice MUST be supported
- -- by compliant implementations.
- encKeyPack[1] EnvelopedData
- -- Defined in CMS
- -- The temporary key is encrypted
- -- using the client public key
- -- key
- -- SignedReplyKeyPack, encrypted
- -- with the temporary key, is also
- -- included.
-}
-
-
-
-KdcDHKeyInfo ::= SEQUENCE {
- -- used only when utilizing Diffie-Hellman
- nonce[0] INTEGER,
- -- binds responce to the request
- subjectPublicKey[2] BIT STRING
- -- Equals public exponent (g^a mod p)
- -- INTEGER encoded as payload of
- -- BIT STRING
-}
-
-ReplyKeyPack ::= SEQUENCE {
- -- not used for Diffie-Hellman
- replyKey[0] EncryptionKey,
- -- used to encrypt main reply
- -- ENCTYPE is at least as strong as
- -- ENCTYPE of session key
- nonce[1] INTEGER
- -- binds response to the request
- -- must be same as the nonce
- -- passed in the PKAuthenticator
-}
-
--- subjectAltName EXTENSION ::= {
--- SYNTAX GeneralNames
--- IDENTIFIED BY id-ce-subjectAltName
--- }
-
-OtherName ::= SEQUENCE {
- type-id OBJECT IDENTIFIER,
- value[0] OCTET STRING
--- value[0] EXPLICIT ANY DEFINED BY type-id
-}
-
-GeneralName ::= CHOICE {
- otherName [0] OtherName,
- ...
-}
-
-GeneralNames ::= SEQUENCE -- SIZE(1..MAX)
- OF GeneralName
-
-KerberosName ::= SEQUENCE {
- realm[0] Realm,
- -- as defined in RFC 1510
- principalName[1] CertPrincipalName
- -- defined above
-}
-
-
--- krb5 OBJECT IDENTIFIER ::= {
--- iso (1) org (3) dod (6) internet (1) security (5) kerberosv5 (2)
--- }
-
--- krb5PrincipalName OBJECT IDENTIFIER ::= { krb5 2 }
-
--- 3.2.1
-
-
-IssuerAndSerialNumber ::= SEQUENCE {
- issuer Name,
- serialNumber CertificateSerialNumber
-}
-
-TrustedCas ::= CHOICE {
- principalName[0] KerberosName,
- -- as defined below
- caName[1] Name,
- -- fully qualified X.500 name
- -- as defined by X.509
- issuerAndSerial[2] IssuerAndSerialNumber
- -- Since a CA may have a number of
- -- certificates, only one of which
- -- a client trusts
-}
-
-PA-PK-AS-REQ ::= SEQUENCE {
- -- PA TYPE 14
- signedAuthPack[0] SignedData,
- -- defined in CMS [11]
- -- AuthPack (below) defines the data
- -- that is signed
- trustedCertifiers[1] SEQUENCE OF TrustedCas OPTIONAL,
- -- CAs that the client trusts
- kdcCert[2] IssuerAndSerialNumber OPTIONAL,
- -- as defined in CMS [11]
- -- specifies a particular KDC
- -- certificate if the client
- -- already has it;
- encryptionCert[3] IssuerAndSerialNumber OPTIONAL
- -- For example, this may be the
- -- client's Diffie-Hellman
- -- certificate, or it may be the
- -- client's RSA encryption
- -- certificate.
-}
-
-PKAuthenticator ::= SEQUENCE {
- kdcName[0] PrincipalName,
- kdcRealm[1] Realm,
- cusec[2] INTEGER,
- -- for replay prevention as in RFC1510
- ctime[3] KerberosTime,
- -- for replay prevention as in RFC1510
- nonce[4] INTEGER
-}
-
--- This is the real definition of AlgorithmIdentifier
--- AlgorithmIdentifier ::= SEQUENCE {
--- algorithm ALGORITHM.&id,
--- parameters ALGORITHM.&Type
--- } -- as specified by the X.509 recommendation[10]
-
--- But we'll use this one instead:
-
-AlgorithmIdentifier ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters CHOICE {
- a INTEGER
- }
-}
-
-
-
-SubjectPublicKeyInfo ::= SEQUENCE {
- algorithm AlgorithmIdentifier,
- -- dhKeyAgreement
- subjectPublicKey BIT STRING
- -- for DH, equals
- -- public exponent (INTEGER encoded
- -- as payload of BIT STRING)
-} -- as specified by the X.509 recommendation[10]
-
-AuthPack ::= SEQUENCE {
- pkAuthenticator[0] PKAuthenticator,
- clientPublicValue[1] SubjectPublicKeyInfo OPTIONAL
- -- if client is using Diffie-Hellman
- -- (ephemeral-ephemeral only)
-}
-
-
-END
diff --git a/crypto/heimdal/lib/asn1/rfc2459.asn1 b/crypto/heimdal/lib/asn1/rfc2459.asn1
deleted file mode 100644
index c9adec6093c60..0000000000000
--- a/crypto/heimdal/lib/asn1/rfc2459.asn1
+++ /dev/null
@@ -1,21 +0,0 @@
-RFC2459 DEFINITIONS ::= BEGIN
-
-AttributeType ::= OBJECT-IDENTIFIER
-
-AttributeValue ::= OCTET STRING --ANY DEFINED BY AttributeType
-
-AttributeTypeAndValue ::= SEQUENCE {
- type AttributeType,
- value AttributeValue
-}
-
-RelativeDistinguishedName ::= --SET
-SEQUENCE OF AttributeTypeAndValue
-
-RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
-
-Name ::= CHOICE { -- RFC2459
- x RDNSequence
-}
-
-END \ No newline at end of file
diff --git a/crypto/heimdal/lib/asn1/symbol.c b/crypto/heimdal/lib/asn1/symbol.c
deleted file mode 100644
index 5f69c1092543c..0000000000000
--- a/crypto/heimdal/lib/asn1/symbol.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-#include "gen_locl.h"
-
-RCSID("$Id: symbol.c,v 1.9 2001/09/25 13:39:27 assar Exp $");
-
-static Hashtab *htab;
-
-static int
-cmp (void *a, void *b)
-{
- Symbol *s1 = (Symbol *)a;
- Symbol *s2 = (Symbol *)b;
-
- return strcmp (s1->name, s2->name);
-}
-
-static unsigned
-hash (void *a)
-{
- Symbol *s = (Symbol *)a;
-
- return hashjpw (s->name);
-}
-
-void
-initsym (void)
-{
- htab = hashtabnew (101, cmp, hash);
-}
-
-
-void
-output_name (char *s)
-{
- char *p;
-
- for (p = s; *p; ++p)
- if (*p == '-')
- *p = '_';
-}
-
-Symbol*
-addsym (char *name)
-{
- Symbol key, *s;
-
- key.name = name;
- s = (Symbol *)hashtabsearch (htab, (void *)&key);
- if (s == NULL) {
- s = (Symbol *)malloc (sizeof (*s));
- s->name = name;
- s->gen_name = strdup(name);
- output_name (s->gen_name);
- s->stype = SUndefined;
- hashtabadd (htab, s);
- }
- return s;
-}
diff --git a/crypto/heimdal/lib/asn1/symbol.h b/crypto/heimdal/lib/asn1/symbol.h
deleted file mode 100644
index 1bd9cd8ade715..0000000000000
--- a/crypto/heimdal/lib/asn1/symbol.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 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.
- */
-
-/* $Id: symbol.h,v 1.6 2001/09/25 13:39:27 assar Exp $ */
-
-#ifndef _SYMBOL_H
-#define _SYMBOL_H
-
-enum typetype { TInteger, TOctetString, TBitString, TSequence, TSequenceOf,
- TGeneralizedTime, TGeneralString, TApplication, TType,
- TUInteger, TEnumerated, TOID };
-
-typedef enum typetype Typetype;
-
-struct type;
-
-struct member {
- char *name;
- char *gen_name;
- int val;
- int optional;
- struct type *type;
- struct member *next, *prev;
-};
-
-typedef struct member Member;
-
-struct symbol;
-
-struct type {
- Typetype type;
- int application;
- Member *members;
- struct type *subtype;
- struct symbol *symbol;
-};
-
-typedef struct type Type;
-
-struct symbol {
- char *name;
- char *gen_name;
- enum { SUndefined, SConstant, Stype } stype;
- int constant;
- Type *type;
-};
-
-typedef struct symbol Symbol;
-
-void initsym (void);
-Symbol *addsym (char *);
-void output_name (char *);
-#endif
diff --git a/crypto/heimdal/lib/asn1/timegm.c b/crypto/heimdal/lib/asn1/timegm.c
deleted file mode 100644
index bdc997fa44601..0000000000000
--- a/crypto/heimdal/lib/asn1/timegm.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1997 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.
- */
-
-#include "der_locl.h"
-
-RCSID("$Id: timegm.c,v 1.7 1999/12/02 17:05:02 joda Exp $");
-
-#ifndef HAVE_TIMEGM
-
-static int
-is_leap(unsigned y)
-{
- y += 1900;
- return (y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0);
-}
-
-time_t
-timegm (struct tm *tm)
-{
- static const unsigned ndays[2][12] ={
- {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
- {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
- time_t res = 0;
- unsigned i;
-
- for (i = 70; i < tm->tm_year; ++i)
- res += is_leap(i) ? 366 : 365;
-
- for (i = 0; i < tm->tm_mon; ++i)
- res += ndays[is_leap(tm->tm_year)][i];
- res += tm->tm_mday - 1;
- res *= 24;
- res += tm->tm_hour;
- res *= 60;
- res += tm->tm_min;
- res *= 60;
- res += tm->tm_sec;
- return res;
-}
-
-#endif /* HAVE_TIMEGM */
diff --git a/crypto/heimdal/lib/asn1/x509.asn1 b/crypto/heimdal/lib/asn1/x509.asn1
deleted file mode 100644
index 4a15844c85639..0000000000000
--- a/crypto/heimdal/lib/asn1/x509.asn1
+++ /dev/null
@@ -1,23 +0,0 @@
-X509 DEFINITIONS ::= BEGIN
-
-CertificateSerialNumber ::= INTEGER -- X.509 '97
-
-AttributeType ::= OBJECT-IDENTIFIER
-
-AttributeValue ::= OCTET STRING --ANY DEFINED BY AttributeType
-
-AttributeTypeAndValue ::= SEQUENCE {
- type AttributeType,
- value AttributeValue
-}
-
-RelativeDistinguishedName ::= --SET
-SEQUENCE OF AttributeTypeAndValue
-
-RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
-
-Name ::= CHOICE { -- RFC2459
- x RDNSequence
-}
-
-END \ No newline at end of file