diff options
author | nectar <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
commit | 69a91bec14ec3ad49d1c8a82c40a796755f9e4a3 (patch) | |
tree | 85ecf91fd00875cec4b93111d3a8ed9eec9cddfe /crypto/heimdal/lib/asn1 | |
parent | 8db4cdb3da4228a5d93635e43825e2e8a2f66db7 (diff) | |
download | FreeBSD-src-69a91bec14ec3ad49d1c8a82c40a796755f9e4a3.zip FreeBSD-src-69a91bec14ec3ad49d1c8a82c40a796755f9e4a3.tar.gz |
Import of Heimdal Kerberos from KTH repository circa 2002/02/17.
Diffstat (limited to 'crypto/heimdal/lib/asn1')
22 files changed, 685 insertions, 326 deletions
diff --git a/crypto/heimdal/lib/asn1/Makefile.am b/crypto/heimdal/lib/asn1/Makefile.am index e4f0149..b46c2ce 100644 --- a/crypto/heimdal/lib/asn1/Makefile.am +++ b/crypto/heimdal/lib/asn1/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.63 2001/05/16 23:49:27 assar Exp $ +# $Id: Makefile.am,v 1.67 2001/09/02 16:56:45 joda Exp $ include $(top_srcdir)/Makefile.am.common @@ -7,6 +7,8 @@ YFLAGS = -d lib_LTLIBRARIES = libasn1.la libasn1_la_LDFLAGS = -version-info 5:0:0 +libasn1_la_LIBADD = @LIB_com_err@ + BUILT_SOURCES = \ $(gen_files:.x=.c) \ asn1_err.h \ @@ -98,19 +100,16 @@ asn1_compile_LDADD = \ check_der_LDADD = \ libasn1.la \ - ../com_err/libcom_err.la \ $(LIB_roken) asn1_print_LDADD = $(check_der_LDADD) -TESTS = check-der - 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 +$(asn1_compile_OBJECTS): parse.h parse.c $(gen_files) krb5_asn1.h: asn1_files diff --git a/crypto/heimdal/lib/asn1/Makefile.in b/crypto/heimdal/lib/asn1/Makefile.in index 5717f31..5a6604a 100644 --- a/crypto/heimdal/lib/asn1/Makefile.in +++ b/crypto/heimdal/lib/asn1/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4b from Makefile.am +# Makefile.in generated automatically by automake 1.5 from Makefile.am. -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,16 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ + +# $Id: Makefile.am,v 1.67 2001/09/02 16:56:45 joda Exp $ + + +# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ + + +# $Id: Makefile.am.common,v 1.31 2001/09/01 11:12:18 assar Exp $ + SHELL = @SHELL@ srcdir = @srcdir@ @@ -31,11 +41,9 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = ../.. ACLOCAL = @ACLOCAL@ @@ -47,21 +55,17 @@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : - -@SET_MAKE@ host_alias = @host_alias@ host_triplet = @host@ AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@ -AMDEP = @AMDEP@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ @@ -69,11 +73,11 @@ CANONICAL_HOST = @CANONICAL_HOST@ CATMAN = @CATMAN@ CATMANEXT = @CATMANEXT@ CC = @CC@ +COMPILE_ET = @COMPILE_ET@ CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ DBLIB = @DBLIB@ DEPDIR = @DEPDIR@ +DIR_com_err = @DIR_com_err@ DIR_des = @DIR_des@ DIR_roken = @DIR_roken@ DLLTOOL = @DLLTOOL@ @@ -82,20 +86,27 @@ EXTRA_LIB45 = @EXTRA_LIB45@ GROFF = @GROFF@ INCLUDES_roken = @INCLUDES_roken@ INCLUDE_ = @INCLUDE_@ +INCLUDE_des = @INCLUDE_des@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LEX = @LEX@ LIBOBJS = @LIBOBJS@ 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@ -MAKEINFO = @MAKEINFO@ NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@ NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@ NROFF = @NROFF@ @@ -103,38 +114,32 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ install_sh = @install_sh@ -# $Id: Makefile.am,v 1.63 2001/05/16 23:49:27 assar Exp $ - - -# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ - - -# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $ - - -AUTOMAKE_OPTIONS = foreign no-dependencies +AUTOMAKE_OPTIONS = foreign no-dependencies 1.4b SUFFIXES = .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) -AM_CFLAGS = $(WFLAGS) +AM_CFLAGS = $(WFLAGS) CP = cp -COMPILE_ET = $(top_builddir)/lib/com_err/compile_et - buildinclude = $(top_builddir)/include LIB_XauReadAuth = @LIB_XauReadAuth@ @@ -152,8 +157,8 @@ 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_readline = @LIB_readline@ LIB_res_search = @LIB_res_search@ LIB_setpcred = @LIB_setpcred@ LIB_setsockopt = @LIB_setsockopt@ @@ -175,18 +180,20 @@ INCLUDE_openldap = @INCLUDE_openldap@ LIB_openldap = @LIB_openldap@ INCLUDE_readline = @INCLUDE_readline@ +LIB_readline = @LIB_readline@ LEXLIB = @LEXLIB@ NROFF_MAN = groff -mandoc -Tascii -@KRB4_TRUE@LIB_kafs = @KRB4_TRUE@$(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) +@KRB4_TRUE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) -@KRB5_TRUE@LIB_krb5 = @KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ +@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \ @KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la -@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la -@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la +@KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la + +@DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la CHECK_LOCAL = $(PROGRAMS) @@ -195,6 +202,8 @@ YFLAGS = -d lib_LTLIBRARIES = libasn1.la libasn1_la_LDFLAGS = -version-info 5:0:0 +libasn1_la_LIBADD = @LIB_com_err@ + BUILT_SOURCES = \ $(gen_files:.x=.c) \ asn1_err.h \ @@ -257,7 +266,6 @@ gen_files = \ noinst_PROGRAMS = asn1_compile asn1_print check_PROGRAMS = check-der - TESTS = check-der asn1_compile_SOURCES = \ @@ -291,7 +299,6 @@ asn1_compile_LDADD = \ check_der_LDADD = \ libasn1.la \ - ../com_err/libcom_err.la \ $(LIB_roken) @@ -306,192 +313,174 @@ 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 = ../../include/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + +libasn1_la_DEPENDENCIES = +am_libasn1_la_OBJECTS = der_get.lo der_put.lo der_free.lo der_length.lo \ + der_copy.lo timegm.lo 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 asn1_err.lo +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 = @DEFS@ -I. -I$(srcdir) -I../../include +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ -X_CFLAGS = @X_CFLAGS@ -X_LIBS = @X_LIBS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -libasn1_la_LIBADD = -am_libasn1_la_OBJECTS = der_get.lo der_put.lo der_free.lo der_length.lo \ -der_copy.lo timegm.lo 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 asn1_err.lo -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 ../com_err/libcom_err.la -asn1_print_LDFLAGS = -check_der_SOURCES = check-der.c -check_der_OBJECTS = check-der.$(OBJEXT) -check_der_DEPENDENCIES = libasn1.la ../com_err/libcom_err.la -check_der_LDFLAGS = -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = @CFLAGS@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +depcomp = +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 $@ -DIST_SOURCES = $(libasn1_la_SOURCES) $(asn1_compile_SOURCES) \ -asn1_print.c check-der.c -HEADERS = $(include_HEADERS) - -depcomp = -DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in lex.c parse.c \ -parse.h - - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -GZIP_ENV = --best +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.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 -OBJECTS = $(am_libasn1_la_OBJECTS) $(am_asn1_compile_OBJECTS) asn1_print.$(OBJEXT) check-der.$(OBJEXT) -all: all-redirect +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + .SUFFIXES: .SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common - cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/asn1/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-libLTLIBRARIES: -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - -distclean-libLTLIBRARIES: +mostlyclean-libtool: + -rm -f *.lo -maintainer-clean-libLTLIBRARIES: +clean-libtool: + -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +$(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) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \ + echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -libasn1.la: $(libasn1_la_OBJECTS) $(libasn1_la_DEPENDENCIES) +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) -mostlyclean-checkPROGRAMS: - clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -distclean-checkPROGRAMS: - -maintainer-clean-checkPROGRAMS: - -mostlyclean-noinstPROGRAMS: - clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -maintainer-clean-noinstPROGRAMS: - -asn1_compile$(EXEEXT): $(asn1_compile_OBJECTS) $(asn1_compile_DEPENDENCIES) +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) +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) +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 $< + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + .c.obj: $(COMPILE) -c `cygpath -w $<` + .c.lo: - $(LTCOMPILE) -c -o $@ $< + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< + +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ + .l.c: - $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ + $(LEXCOMPILE) $< && mv $(LEX_OUTPUT_ROOT).c $@ + .y.c: - $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c + $(YACCCOMPILE) $< && mv y.tab.c $@ if test -f y.tab.h; then \ - if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \ - else :; fi -parse.h: parse.c - - + if cmp -s y.tab.h $*.h; then \ + rm -f y.tab.h; \ + else \ + mv y.tab.h $*.h; \ + fi; \ + fi +uninstall-info-am: 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; \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$f; \ + echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ + $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f; \ done uninstall-includeHEADERS: @@ -529,16 +518,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ - && gtags -i $$here - -mostlyclean-tags: - -clean-tags: + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -maintainer-clean-tags: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ @@ -594,11 +578,18 @@ check-TESTS: $(TESTS) test "$$failed" -eq 0; \ fi -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ @@ -608,102 +599,98 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -info-am: -info: info-am -dvi-am: -dvi: dvi-am + $(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 -installcheck-am: -installcheck: installcheck-am -all-recursive-am: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) all-local -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-exec: install-exec-am +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) -install-data-am: install-includeHEADERS install-data-local +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 -install: install-am -uninstall-am: uninstall-libLTLIBRARIES uninstall-includeHEADERS -uninstall: uninstall-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) all-local -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) - +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `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) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: - -rm -f Makefile.in - -test -z "lex.cparse.hparse.c$(BUILT_SOURCES)" || rm -f lex.c parse.h parse.c $(BUILT_SOURCES) -mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ - mostlyclean-libtool mostlyclean-checkPROGRAMS \ - mostlyclean-noinstPROGRAMS mostlyclean-tags \ - mostlyclean-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 -mostlyclean: mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstPROGRAMS mostlyclean-am -clean-am: clean-libLTLIBRARIES clean-compile clean-libtool \ - clean-checkPROGRAMS clean-noinstPROGRAMS clean-tags \ - clean-generic mostlyclean-am +distclean: distclean-am -clean: clean-am +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags -distclean-am: distclean-libLTLIBRARIES distclean-compile \ - distclean-libtool distclean-checkPROGRAMS \ - distclean-noinstPROGRAMS distclean-tags \ - distclean-generic clean-am - -rm -f libtool +dvi: dvi-am -distclean: distclean-am +dvi-am: -maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-checkPROGRAMS \ - maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +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 -.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ -clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ -uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ -distclean-compile clean-compile maintainer-clean-compile \ -mostlyclean-libtool distclean-libtool clean-libtool \ -maintainer-clean-libtool mostlyclean-checkPROGRAMS \ -distclean-checkPROGRAMS clean-checkPROGRAMS \ -maintainer-clean-checkPROGRAMS mostlyclean-noinstPROGRAMS \ -distclean-noinstPROGRAMS clean-noinstPROGRAMS \ -maintainer-clean-noinstPROGRAMS uninstall-includeHEADERS \ -install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags check-TESTS distdir info-am info dvi-am dvi \ -check-local check check-am installcheck-am installcheck \ -all-recursive-am install-exec-am install-exec install-data-local \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-local all-redirect all-am all install-strip installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +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: @@ -834,7 +821,7 @@ check-local:: test "$$failed" -eq 0; \ fi -$(asn1_compile_OBJECTS): parse.h +$(asn1_compile_OBJECTS): parse.h parse.c $(gen_files) krb5_asn1.h: asn1_files @@ -844,7 +831,6 @@ asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.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 index d3a30f2..251d401 100644 --- a/crypto/heimdal/lib/asn1/asn1-common.h +++ b/crypto/heimdal/lib/asn1/asn1-common.h @@ -1,4 +1,4 @@ -/* $Id: asn1-common.h,v 1.1 2000/04/14 15:41:31 joda Exp $ */ +/* $Id: asn1-common.h,v 1.2 2001/09/25 13:39:25 assar Exp $ */ #include <stddef.h> #include <time.h> @@ -13,4 +13,9 @@ typedef struct octet_string { typedef char *general_string; +typedef struct oid { + size_t length; + unsigned *components; +} oid; + #endif diff --git a/crypto/heimdal/lib/asn1/asn1_print.c b/crypto/heimdal/lib/asn1/asn1_print.c index 587d7e0..03e1116 100644 --- a/crypto/heimdal/lib/asn1/asn1_print.c +++ b/crypto/heimdal/lib/asn1/asn1_print.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -37,7 +37,7 @@ #include <getarg.h> #include <err.h> -RCSID("$Id: asn1_print.c,v 1.7 2001/02/20 01:44:52 assar Exp $"); +RCSID("$Id: asn1_print.c,v 1.8 2001/08/21 09:42:51 assar Exp $"); static struct et_list *et_list; @@ -147,7 +147,7 @@ loop (unsigned char *buf, size_t len, int indent) if (ret) errx (1, "der_get_octet_string: %s", com_right (et_list, ret)); - printf ("(length %d), ", length); + printf ("(length %lu), ", (unsigned long)length); uc = (unsigned char *)str.data; for (i = 0; i < 16; ++i) printf ("%02x", uc[i]); @@ -168,7 +168,7 @@ loop (unsigned char *buf, size_t len, int indent) break; } default : - printf ("%d bytes\n", length); + printf ("%lu bytes\n", (unsigned long)length); break; } } diff --git a/crypto/heimdal/lib/asn1/der.h b/crypto/heimdal/lib/asn1/der.h index f031f81..738c8d7 100644 --- a/crypto/heimdal/lib/asn1/der.h +++ b/crypto/heimdal/lib/asn1/der.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: der.h,v 1.20 2001/01/29 08:31:27 assar Exp $ */ +/* $Id: der.h,v 1.22 2001/09/27 16:20:35 assar Exp $ */ #ifndef __DER_H__ #define __DER_H__ @@ -45,11 +45,13 @@ typedef enum {PRIM = 0, CONS = 1} Der_type; /* Universal tags */ enum { - UT_Integer = 2, + UT_Boolean = 1, + UT_Integer = 2, UT_BitString = 3, UT_OctetString = 4, UT_Null = 5, - UT_ObjID = 6, + UT_OID = 6, + UT_Enumerated = 10, UT_Sequence = 16, UT_Set = 17, UT_PrintableString = 19, @@ -75,6 +77,8 @@ 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); @@ -88,8 +92,11 @@ int der_match_tag_and_length (const unsigned char *p, size_t len, 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*); @@ -99,6 +106,8 @@ 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, @@ -108,29 +117,36 @@ 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 index 83c2446..30027e1 100644 --- a/crypto/heimdal/lib/asn1/der_copy.c +++ b/crypto/heimdal/lib/asn1/der_copy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "der_locl.h" -RCSID("$Id: der_copy.c,v 1.8 1999/12/02 17:05:01 joda Exp $"); +RCSID("$Id: der_copy.c,v 1.9 2001/09/25 13:39:25 assar Exp $"); int copy_general_string (const general_string *from, general_string *to) @@ -55,3 +55,14 @@ copy_octet_string (const octet_string *from, octet_string *to) 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 index 7191e4e..fd78b48 100644 --- a/crypto/heimdal/lib/asn1/der_free.c +++ b/crypto/heimdal/lib/asn1/der_free.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "der_locl.h" -RCSID("$Id: der_free.c,v 1.7 1999/12/02 17:05:01 joda Exp $"); +RCSID("$Id: der_free.c,v 1.8 2001/09/25 13:39:26 assar Exp $"); void free_general_string (general_string *str) @@ -46,3 +46,9 @@ 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 index 1a180da..2633204 100644 --- a/crypto/heimdal/lib/asn1/der_get.c +++ b/crypto/heimdal/lib/asn1/der_get.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "der_locl.h" -RCSID("$Id: der_get.c,v 1.28 2000/04/06 17:19:53 assar Exp $"); +RCSID("$Id: der_get.c,v 1.31 2001/09/28 22:53:24 assar Exp $"); #include <version.h> @@ -139,6 +139,42 @@ der_get_octet_string (const unsigned char *p, size_t len, } 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) @@ -252,6 +288,33 @@ decode_unsigned (const unsigned char *p, size_t len, } 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) { @@ -315,6 +378,38 @@ decode_octet_string (const unsigned char *p, size_t len, 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) { diff --git a/crypto/heimdal/lib/asn1/der_length.c b/crypto/heimdal/lib/asn1/der_length.c index d488f8f..359018f 100644 --- a/crypto/heimdal/lib/asn1/der_length.c +++ b/crypto/heimdal/lib/asn1/der_length.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "der_locl.h" -RCSID("$Id: der_length.c,v 1.11 2000/04/06 17:20:26 assar Exp $"); +RCSID("$Id: der_length.c,v 1.12 2001/09/25 13:39:26 assar Exp $"); static size_t len_unsigned (unsigned val) @@ -67,6 +67,25 @@ len_int (int val) 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) { @@ -93,6 +112,14 @@ length_unsigned (const unsigned *data) } 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; @@ -107,6 +134,14 @@ length_octet_string (const octet_string *k) } 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; diff --git a/crypto/heimdal/lib/asn1/der_locl.h b/crypto/heimdal/lib/asn1/der_locl.h index 6eeb42d..36a4281 100644 --- a/crypto/heimdal/lib/asn1/der_locl.h +++ b/crypto/heimdal/lib/asn1/der_locl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: der_locl.h,v 1.3 1999/12/02 17:05:02 joda Exp $ */ +/* $Id: der_locl.h,v 1.4 2001/09/27 16:21:47 assar Exp $ */ #ifndef __DER_LOCL_H__ #define __DER_LOCL_H__ @@ -49,6 +49,8 @@ #include <errno.h> #include <roken.h> -#include <libasn1.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 index 1eda917..1dfafdc 100644 --- a/crypto/heimdal/lib/asn1/der_put.c +++ b/crypto/heimdal/lib/asn1/der_put.c @@ -33,13 +33,14 @@ #include "der_locl.h" -RCSID("$Id: der_put.c,v 1.24 2001/01/29 08:31:27 assar Exp $"); +RCSID("$Id: der_put.c,v 1.27 2001/09/25 23:37:25 assar 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 and return an int - * indicating how many actually got written, or <0 in case of errors. + * 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 @@ -111,14 +112,12 @@ der_put_int (unsigned char *p, size_t len, int val, size_t *size) 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) { - if (len < 1) - return ASN1_OVERFLOW; - else { - *p = val; - *size = 1; - return 0; - } + *p = val; + *size = 1; + return 0; } else { size_t l; int e; @@ -162,6 +161,36 @@ der_put_octet_string (unsigned char *p, size_t len, } 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) { @@ -246,6 +275,31 @@ encode_unsigned (unsigned char *p, size_t len, const unsigned *data, } 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) { @@ -294,6 +348,30 @@ encode_octet_string (unsigned char *p, size_t len, } 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; diff --git a/crypto/heimdal/lib/asn1/gen.c b/crypto/heimdal/lib/asn1/gen.c index 54212d9..6f57ec0 100644 --- a/crypto/heimdal/lib/asn1/gen.c +++ b/crypto/heimdal/lib/asn1/gen.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen.c,v 1.44 2000/06/19 15:17:52 joda Exp $"); +RCSID("$Id: gen.c,v 1.47 2001/09/27 16:21:47 assar Exp $"); FILE *headerfile, *codefile, *logfile; @@ -43,6 +43,27 @@ static const char *orig_filename; static char header[1024]; static char headerbase[1024] = 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) { @@ -90,6 +111,11 @@ init_generate (const char *filename, const char *base) "typedef char *general_string;\n\n" #endif ); + fprintf (headerfile, + "typedef struct oid {\n" + " size_t length;\n" + " unsigned *components;\n" + "} oid;\n\n"); fprintf (headerfile, "#endif\n\n"); logfile = fopen(STEM "_files", "w"); if (logfile == NULL) @@ -140,12 +166,14 @@ define_asn1 (int level, Type *t) space(level); fprintf (headerfile, "OCTET STRING"); break; + case TOID : + space(level); + fprintf(headerfile, "OBJECT IDENTIFIER"); + break; case TBitString: { Member *m; - Type i; int tag = -1; - i.type = TInteger; space(level); fprintf (headerfile, "BIT STRING {\n"); for (m = t->members; m && m->val != tag; m = m->next) { @@ -160,6 +188,24 @@ define_asn1 (int level, Type *t) 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; @@ -251,6 +297,10 @@ define_type (int level, char *name, Type *t, int typedefp) 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; @@ -272,6 +322,23 @@ define_type (int level, char *name, Type *t, int typedefp) 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; @@ -342,6 +409,7 @@ generate_type_header (const Symbol *s) void generate_type (const Symbol *s) { + struct import *i; char *filename; asprintf (&filename, "%s_%s.x", STEM, s->gen_name); @@ -353,16 +421,23 @@ generate_type (const Symbol *s) fprintf (codefile, "/* Generated from %s */\n" "/* Do not edit */\n\n" - "#include \"libasn1.h\"\n\n" -#if 0 "#include <stdio.h>\n" "#include <stdlib.h>\n" "#include <time.h>\n" - "#include <" STEM ".h>\n\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" -#endif - ,orig_filename); + "#include <parse_units.h>\n\n"); generate_type_header (s); generate_type_encode (s); generate_type_decode (s); diff --git a/crypto/heimdal/lib/asn1/gen_copy.c b/crypto/heimdal/lib/asn1/gen_copy.c index 7d414a9..20f0d5b 100644 --- a/crypto/heimdal/lib/asn1/gen_copy.c +++ b/crypto/heimdal/lib/asn1/gen_copy.c @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen_copy.c,v 1.11 2000/04/06 17:22:05 assar Exp $"); +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) @@ -55,11 +55,15 @@ copy_type (const char *from, const char *to, const Type *t) 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; diff --git a/crypto/heimdal/lib/asn1/gen_decode.c b/crypto/heimdal/lib/asn1/gen_decode.c index 9303698..c9c8ca3 100644 --- a/crypto/heimdal/lib/asn1/gen_decode.c +++ b/crypto/heimdal/lib/asn1/gen_decode.c @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen_decode.c,v 1.16 2001/02/10 18:14:38 assar Exp $"); +RCSID("$Id: gen_decode.c,v 1.17 2001/09/25 13:39:26 assar Exp $"); static void decode_primitive (const char *typename, const char *name) @@ -73,9 +73,15 @@ decode_type (const char *name, const Type *t) 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; @@ -297,6 +303,7 @@ generate_type_decode (const Symbol *s) case TInteger: case TUInteger: case TOctetString: + case TOID: case TGeneralizedTime: case TGeneralString: case TBitString: diff --git a/crypto/heimdal/lib/asn1/gen_encode.c b/crypto/heimdal/lib/asn1/gen_encode.c index 367ca37..ba50d5d 100644 --- a/crypto/heimdal/lib/asn1/gen_encode.c +++ b/crypto/heimdal/lib/asn1/gen_encode.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen_encode.c,v 1.11 2000/06/19 15:19:08 joda Exp $"); +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) @@ -76,6 +76,9 @@ encode_type (const char *name, const Type *t) case TOctetString: encode_primitive ("octet_string", name); break; + case TOID : + encode_primitive ("oid", name); + break; case TBitString: { Member *m; int pos; @@ -128,6 +131,10 @@ encode_type (const char *name, const Type *t) rest); break; } + case TEnumerated : { + encode_primitive ("enumerated", name); + break; + } case TSequence: { Member *m; int tag = -1; @@ -234,6 +241,8 @@ generate_type_encode (const Symbol *s) case TGeneralizedTime: case TGeneralString: case TBitString: + case TEnumerated: + case TOID: case TSequence: case TSequenceOf: case TApplication: diff --git a/crypto/heimdal/lib/asn1/gen_free.c b/crypto/heimdal/lib/asn1/gen_free.c index 20ae521..994cbc6 100644 --- a/crypto/heimdal/lib/asn1/gen_free.c +++ b/crypto/heimdal/lib/asn1/gen_free.c @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen_free.c,v 1.8 2000/04/06 17:24:02 assar Exp $"); +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) @@ -53,10 +53,14 @@ free_type (const char *name, const Type *t) 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; } diff --git a/crypto/heimdal/lib/asn1/gen_length.c b/crypto/heimdal/lib/asn1/gen_length.c index ca2af6f..7c379d6 100644 --- a/crypto/heimdal/lib/asn1/gen_length.c +++ b/crypto/heimdal/lib/asn1/gen_length.c @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: gen_length.c,v 1.10 2000/06/21 22:40:53 assar Exp $"); +RCSID("$Id: gen_length.c,v 1.11 2001/09/25 13:39:26 assar Exp $"); static void length_primitive (const char *typename, @@ -69,9 +69,15 @@ length_type (const char *name, const Type *t, const char *variable) 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 diff --git a/crypto/heimdal/lib/asn1/gen_locl.h b/crypto/heimdal/lib/asn1/gen_locl.h index acf6bc1a..212c321 100644 --- a/crypto/heimdal/lib/asn1/gen_locl.h +++ b/crypto/heimdal/lib/asn1/gen_locl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: gen_locl.h,v 1.7 2000/04/09 09:21:56 assar Exp $ */ +/* $Id: gen_locl.h,v 1.9 2001/09/27 16:21:47 assar Exp $ */ #ifndef __GEN_LOCL_H__ #define __GEN_LOCL_H__ @@ -66,6 +66,7 @@ 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; diff --git a/crypto/heimdal/lib/asn1/lex.l b/crypto/heimdal/lib/asn1/lex.l index 21665fb..3abc17e 100644 --- a/crypto/heimdal/lib/asn1/lex.l +++ b/crypto/heimdal/lib/asn1/lex.l @@ -32,7 +32,7 @@ * SUCH DAMAGE. */ -/* $Id: lex.l,v 1.16 2001/04/18 13:08:47 joda Exp $ */ +/* $Id: lex.l,v 1.19 2001/09/25 23:28:03 assar Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -44,6 +44,7 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#undef ECHO #include "symbol.h" #include "parse.h" #include "lex.h" @@ -74,17 +75,27 @@ 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; yylval.constant = strtol(yytext, &e, 0); - if(e == yytext) +-?(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 (yytext); return IDENTIFIER; } + else + return CONSTANT; + } +[A-Za-z][-A-Za-z0-9_]* { + yylval.name = strdup ((const char *)yytext); + return IDENT; + } [ \t] ; \n { ++lineno; } \.\. { return DOTDOT; } diff --git a/crypto/heimdal/lib/asn1/parse.y b/crypto/heimdal/lib/asn1/parse.y index 81b5cb1..fc78086 100644 --- a/crypto/heimdal/lib/asn1/parse.y +++ b/crypto/heimdal/lib/asn1/parse.y @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: parse.y,v 1.17 2001/03/26 04:09:55 assar Exp $ */ +/* $Id: parse.y,v 1.19 2001/09/27 16:21:47 assar Exp $ */ %{ #ifdef HAVE_CONFIG_H @@ -44,7 +44,7 @@ #include "lex.h" #include "gen_locl.h" -RCSID("$Id: parse.y,v 1.17 2001/03/26 04:09:55 assar Exp $"); +RCSID("$Id: parse.y,v 1.19 2001/09/27 16:21:47 assar Exp $"); static Type *new_type (Typetype t); void yyerror (char *); @@ -61,10 +61,12 @@ static void append (Member *l, Member *r); } %token INTEGER SEQUENCE OF OCTET STRING GeneralizedTime GeneralString -%token BIT APPLICATION OPTIONAL EEQUAL TBEGIN END DEFINITIONS EXTERNAL +%token BIT APPLICATION OPTIONAL EEQUAL TBEGIN END DEFINITIONS ENUMERATED +%token EXTERNAL %token DOTDOT %token IMPORTS FROM -%token <name> IDENTIFIER +%token OBJECT IDENTIFIER +%token <name> IDENT %token <constant> CONSTANT %type <constant> constant optional2 @@ -75,7 +77,7 @@ static void append (Member *l, Member *r); %% -envelope : IDENTIFIER DEFINITIONS EEQUAL TBEGIN specification END {} +envelope : IDENT DEFINITIONS EEQUAL TBEGIN specification END {} ; specification : @@ -87,22 +89,23 @@ declaration : imports_decl | constant_decl ; -referencenames : IDENTIFIER ',' referencenames +referencenames : IDENT ',' referencenames { Symbol *s = addsym($1); s->stype = Stype; } - | IDENTIFIER + | IDENT { Symbol *s = addsym($1); s->stype = Stype; } ; -imports_decl : IMPORTS referencenames FROM IDENTIFIER ';' +imports_decl : IMPORTS referencenames FROM IDENT ';' + { add_import($4); } ; -type_decl : IDENTIFIER EEQUAL type +type_decl : IDENT EEQUAL type { Symbol *s = addsym ($1); s->stype = Stype; @@ -111,7 +114,7 @@ type_decl : IDENTIFIER EEQUAL type } ; -constant_decl : IDENTIFIER type EEQUAL constant +constant_decl : IDENT type EEQUAL constant { Symbol *s = addsym ($1); s->stype = SConstant; @@ -134,6 +137,12 @@ type : INTEGER { $$ = new_type(TInteger); } $$ = 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); } @@ -152,7 +161,7 @@ type : INTEGER { $$ = new_type(TInteger); } $$ = new_type(TBitString); $$->members = $4; } - | IDENTIFIER + | IDENT { Symbol *s = addsym($1); $$ = new_type(TType); @@ -174,7 +183,7 @@ memberdecls : { $$ = NULL; } | memberdecls ',' memberdecl { $$ = $1; append($$, $3); } ; -memberdecl : IDENTIFIER '[' constant ']' type optional2 +memberdecl : IDENT '[' constant ']' type optional2 { $$ = malloc(sizeof(*$$)); $$->name = $1; @@ -196,7 +205,7 @@ bitdecls : { $$ = NULL; } | bitdecls ',' bitdecl { $$ = $1; append($$, $3); } ; -bitdecl : IDENTIFIER '(' constant ')' +bitdecl : IDENT '(' constant ')' { $$ = malloc(sizeof(*$$)); $$->name = $1; @@ -210,7 +219,7 @@ bitdecl : IDENTIFIER '(' constant ')' ; constant : CONSTANT { $$ = $1; } - | IDENTIFIER { + | IDENT { Symbol *s = addsym($1); if(s->stype != SConstant) error_message ("%s is not a constant\n", diff --git a/crypto/heimdal/lib/asn1/symbol.c b/crypto/heimdal/lib/asn1/symbol.c index 5e6e741..5f69c10 100644 --- a/crypto/heimdal/lib/asn1/symbol.c +++ b/crypto/heimdal/lib/asn1/symbol.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "gen_locl.h" -RCSID("$Id: symbol.c,v 1.8 1999/12/02 17:05:02 joda Exp $"); +RCSID("$Id: symbol.c,v 1.9 2001/09/25 13:39:27 assar Exp $"); static Hashtab *htab; @@ -55,7 +55,7 @@ hash (void *a) } void -initsym () +initsym (void) { htab = hashtabnew (101, cmp, hash); } diff --git a/crypto/heimdal/lib/asn1/symbol.h b/crypto/heimdal/lib/asn1/symbol.h index bc4707f..1bd9cd8 100644 --- a/crypto/heimdal/lib/asn1/symbol.h +++ b/crypto/heimdal/lib/asn1/symbol.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,14 +31,14 @@ * SUCH DAMAGE. */ -/* $Id: symbol.h,v 1.5 1999/12/02 17:05:02 joda Exp $ */ +/* $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 }; + TUInteger, TEnumerated, TOID }; typedef enum typetype Typetype; |