diff options
author | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | 0c8fa354358381b3f1b92598e7f1b46f8cf744cc (patch) | |
tree | ed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/lib/asn1 | |
parent | 06c859ecf534f468a52f24a3eb14409d73a4907c (diff) | |
download | FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.zip FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.tar.gz |
import of heimdal 0.3f
Diffstat (limited to 'crypto/heimdal/lib/asn1')
-rw-r--r-- | crypto/heimdal/lib/asn1/Makefile.am | 50 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/Makefile.in | 112 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/asn1_print.c | 4 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/gen_decode.c | 14 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/k5.asn1 | 44 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/lex.l | 9 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/libasn1.h | 7 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/main.c | 4 | ||||
-rw-r--r-- | crypto/heimdal/lib/asn1/parse.y | 9 |
9 files changed, 167 insertions, 86 deletions
diff --git a/crypto/heimdal/lib/asn1/Makefile.am b/crypto/heimdal/lib/asn1/Makefile.am index 8f89441..e4f0149 100644 --- a/crypto/heimdal/lib/asn1/Makefile.am +++ b/crypto/heimdal/lib/asn1/Makefile.am @@ -1,11 +1,11 @@ -# $Id: Makefile.am,v 1.59 2001/01/30 01:46:53 assar Exp $ +# $Id: Makefile.am,v 1.63 2001/05/16 23:49:27 assar Exp $ include $(top_srcdir)/Makefile.am.common YFLAGS = -d lib_LTLIBRARIES = libasn1.la -libasn1_la_LDFLAGS = -version-info 4:0:2 +libasn1_la_LDFLAGS = -version-info 5:0:0 BUILT_SOURCES = \ $(gen_files:.x=.c) \ @@ -22,6 +22,7 @@ gen_files = \ asn1_AuthorizationData.x \ asn1_CKSUMTYPE.x \ asn1_Checksum.x \ + asn1_ENCTYPE.x \ asn1_ETYPE_INFO.x \ asn1_ETYPE_INFO_ENTRY.x \ asn1_EncAPRepPart.x \ @@ -47,6 +48,7 @@ gen_files = \ 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 \ @@ -68,17 +70,27 @@ noinst_PROGRAMS = asn1_compile asn1_print check_PROGRAMS = check-der TESTS = check-der -asn1_compile_SOURCES = parse.y lex.l main.c hash.c symbol.c gen.c \ - gen_encode.c gen_decode.c gen_free.c gen_length.c gen_copy.c \ - gen_glue.c - -libasn1_la_SOURCES = \ - der_get.c \ - der_put.c \ - der_free.c \ - der_length.c \ - der_copy.c \ - timegm.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 = \ @@ -93,20 +105,20 @@ asn1_print_LDADD = $(check_der_LDADD) TESTS = check-der -CLEANFILES = lex.c parse.c parse.h asn1.h $(BUILT_SOURCES) \ +CLEANFILES = lex.c parse.c parse.h krb5_asn1.h $(BUILT_SOURCES) \ $(gen_files) asn1_files -include_HEADERS = asn1.h asn1_err.h der.h +include_HEADERS = krb5_asn1.h asn1_err.h der.h $(asn1_compile_OBJECTS): parse.h -$(gen_files) asn1.h: asn1_files +$(gen_files) krb5_asn1.h: asn1_files asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 - ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 + ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 krb5_asn1 -$(libasn1_la_OBJECTS): asn1.h asn1_err.h +$(libasn1_la_OBJECTS): krb5_asn1.h asn1_err.h -$(asn1_print_OBJECTS): asn1.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 index 7652c10..5717f31 100644 --- a/crypto/heimdal/lib/asn1/Makefile.in +++ b/crypto/heimdal/lib/asn1/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4b from Makefile.am -# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# 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. @@ -113,13 +114,13 @@ dpagaix_CFLAGS = @dpagaix_CFLAGS@ dpagaix_LDADD = @dpagaix_LDADD@ install_sh = @install_sh@ -# $Id: Makefile.am,v 1.59 2001/01/30 01:46:53 assar Exp $ +# $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.23 2000/12/05 09:11:09 joda Exp $ +# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $ AUTOMAKE_OPTIONS = foreign no-dependencies @@ -185,12 +186,14 @@ NROFF_MAN = groff -mandoc -Tascii @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 + CHECK_LOCAL = $(PROGRAMS) YFLAGS = -d lib_LTLIBRARIES = libasn1.la -libasn1_la_LDFLAGS = -version-info 4:0:2 +libasn1_la_LDFLAGS = -version-info 5:0:0 BUILT_SOURCES = \ $(gen_files:.x=.c) \ @@ -208,6 +211,7 @@ gen_files = \ asn1_AuthorizationData.x \ asn1_CKSUMTYPE.x \ asn1_Checksum.x \ + asn1_ENCTYPE.x \ asn1_ETYPE_INFO.x \ asn1_ETYPE_INFO_ENTRY.x \ asn1_EncAPRepPart.x \ @@ -233,6 +237,7 @@ gen_files = \ 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 \ @@ -255,18 +260,28 @@ check_PROGRAMS = check-der TESTS = check-der -asn1_compile_SOURCES = parse.y lex.l main.c hash.c symbol.c gen.c \ - gen_encode.c gen_decode.c gen_free.c gen_length.c gen_copy.c \ - gen_glue.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 \ + der_get.c \ + der_put.c \ + der_free.c \ + der_length.c \ + der_copy.c \ + timegm.c \ $(BUILT_SOURCES) @@ -282,11 +297,11 @@ check_der_LDADD = \ asn1_print_LDADD = $(check_der_LDADD) -CLEANFILES = lex.c parse.c parse.h asn1.h $(BUILT_SOURCES) \ +CLEANFILES = lex.c parse.c parse.h krb5_asn1.h $(BUILT_SOURCES) \ $(gen_files) asn1_files -include_HEADERS = asn1.h asn1_err.h der.h +include_HEADERS = krb5_asn1.h asn1_err.h der.h EXTRA_DIST = asn1_err.et subdir = lib/asn1 @@ -308,28 +323,29 @@ 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_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_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 +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 = parse.$(OBJEXT) lex.$(OBJEXT) main.$(OBJEXT) \ -hash.$(OBJEXT) symbol.$(OBJEXT) gen.$(OBJEXT) gen_encode.$(OBJEXT) \ -gen_decode.$(OBJEXT) gen_free.$(OBJEXT) gen_length.$(OBJEXT) \ -gen_copy.$(OBJEXT) gen_glue.$(OBJEXT) +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 = @@ -364,7 +380,7 @@ OBJECTS = $(am_libasn1_la_OBJECTS) $(am_asn1_compile_OBJECTS) asn1_print.$(OBJEX all: all-redirect .SUFFIXES: -.SUFFIXES: .1 .3 .5 .8 .c .cat1 .cat3 .cat5 .cat8 .et .h .l .lo .o .obj .x .y +.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 @@ -510,6 +526,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $$here + mostlyclean-tags: clean-tags: @@ -598,6 +619,9 @@ check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am +all-recursive-am: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + install-exec-am: install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook @@ -674,12 +698,12 @@ 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 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 +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 install-suid-programs: @@ -812,14 +836,14 @@ check-local:: $(asn1_compile_OBJECTS): parse.h -$(gen_files) asn1.h: asn1_files +$(gen_files) krb5_asn1.h: asn1_files asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 - ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 + ./asn1_compile$(EXEEXT) $(srcdir)/k5.asn1 krb5_asn1 -$(libasn1_la_OBJECTS): asn1.h asn1_err.h +$(libasn1_la_OBJECTS): krb5_asn1.h asn1_err.h -$(asn1_print_OBJECTS): asn1.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. diff --git a/crypto/heimdal/lib/asn1/asn1_print.c b/crypto/heimdal/lib/asn1/asn1_print.c index e66ac22..587d7e0 100644 --- a/crypto/heimdal/lib/asn1/asn1_print.c +++ b/crypto/heimdal/lib/asn1/asn1_print.c @@ -37,7 +37,7 @@ #include <getarg.h> #include <err.h> -RCSID("$Id: asn1_print.c,v 1.6 2000/12/29 03:34:16 assar Exp $"); +RCSID("$Id: asn1_print.c,v 1.7 2001/02/20 01:44:52 assar Exp $"); static struct et_list *et_list; @@ -224,7 +224,7 @@ main(int argc, char **argv) { int optind = 0; - set_progname (argv[0]); + setprogname (argv[0]); initialize_asn1_error_table_r (&et_list); if(getarg(args, num_args, argc, argv, &optind)) usage(1); diff --git a/crypto/heimdal/lib/asn1/gen_decode.c b/crypto/heimdal/lib/asn1/gen_decode.c index bed19a9..9303698 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.15 2001/01/29 08:36:45 assar Exp $"); +RCSID("$Id: gen_decode.c,v 1.16 2001/02/10 18:14:38 assar Exp $"); static void decode_primitive (const char *typename, const char *name) @@ -281,7 +281,7 @@ generate_type_decode (const Symbol *s) s->gen_name, s->gen_name); fprintf (codefile, "#define FORW " - "if(e) return e; " + "if(e) goto fail; " "p += l; " "len -= l; " "ret += l\n\n"); @@ -308,13 +308,19 @@ generate_type_decode (const Symbol *s) "size_t ret = 0, reallen;\n" "size_t l;\n" "int i, e;\n\n"); - fprintf(codefile, "i = 0;\n"); /* hack to avoid `unused variable' */ - fprintf(codefile, "reallen = 0;\n"); /* hack to avoid `unused variable' */ + fprintf (codefile, "memset(data, 0, sizeof(*data));\n"); + fprintf (codefile, "i = 0;\n"); /* hack to avoid `unused variable' */ + 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 (); diff --git a/crypto/heimdal/lib/asn1/k5.asn1 b/crypto/heimdal/lib/asn1/k5.asn1 index c5382f3..1fa8b7b 100644 --- a/crypto/heimdal/lib/asn1/k5.asn1 +++ b/crypto/heimdal/lib/asn1/k5.asn1 @@ -1,4 +1,4 @@ --- $Id: k5.asn1,v 1.23 2000/12/11 06:30:35 assar Exp $ +-- $Id: k5.asn1,v 1.25 2001/05/14 06:12:13 assar Exp $ KERBEROS5 DEFINITIONS ::= BEGIN @@ -77,6 +77,29 @@ CKSUMTYPE ::= INTEGER { 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_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), + ETYPE_DES3_CBC_NONE_IVEC(-0x1004) +} + -- this is sugar to make something ASN1 does not have: unsigned UNSIGNED ::= INTEGER (0..4294967295) @@ -162,14 +185,25 @@ KDCOptions ::= BIT STRING { 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] INTEGER, + lr-type[0] LR-TYPE, lr-value[1] KerberosTime } + EncryptedData ::= SEQUENCE { - etype[0] INTEGER, -- EncryptionType + etype[0] ENCTYPE, -- EncryptionType kvno[1] INTEGER OPTIONAL, cipher[2] OCTET STRING -- ciphertext } @@ -230,7 +264,7 @@ PA-DATA ::= SEQUENCE { } ETYPE-INFO-ENTRY ::= SEQUENCE { - etype[0] INTEGER, + etype[0] ENCTYPE, salt[1] OCTET STRING OPTIONAL, salttype[2] INTEGER OPTIONAL } @@ -249,7 +283,7 @@ KDC-REQ-BODY ::= SEQUENCE { till[5] KerberosTime OPTIONAL, rtime[6] KerberosTime OPTIONAL, nonce[7] INTEGER, - etype[8] SEQUENCE OF INTEGER, -- EncryptionType, + etype[8] SEQUENCE OF ENCTYPE, -- EncryptionType, -- in preference order addresses[9] HostAddresses OPTIONAL, enc-authorization-data[10] EncryptedData OPTIONAL, diff --git a/crypto/heimdal/lib/asn1/lex.l b/crypto/heimdal/lib/asn1/lex.l index ffb6fd5..21665fb 100644 --- a/crypto/heimdal/lib/asn1/lex.l +++ b/crypto/heimdal/lib/asn1/lex.l @@ -1,6 +1,6 @@ %{ /* - * 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. * @@ -32,7 +32,7 @@ * SUCH DAMAGE. */ -/* $Id: lex.l,v 1.15 2000/07/02 04:08:02 assar Exp $ */ +/* $Id: lex.l,v 1.16 2001/04/18 13:08:47 joda Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -80,7 +80,10 @@ EXTERNAL { return EXTERNAL; } "]" { return *yytext; } ::= { return EEQUAL; } --[^\n]*\n { ++lineno; } --?[0-9]+ { yylval.constant = atoi(yytext); return CONSTANT; } +-?(0x)?[0-9]+ { char *e; yylval.constant = strtol(yytext, &e, 0); + if(e == yytext) + error_message("malformed constant (%s)", yytext); + else return CONSTANT; } [A-Za-z][-A-Za-z0-9_]* { yylval.name = strdup (yytext); return IDENTIFIER; } [ \t] ; \n { ++lineno; } diff --git a/crypto/heimdal/lib/asn1/libasn1.h b/crypto/heimdal/lib/asn1/libasn1.h index 90eda60..8a4994a 100644 --- a/crypto/heimdal/lib/asn1/libasn1.h +++ b/crypto/heimdal/lib/asn1/libasn1.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: libasn1.h,v 1.7 1999/12/02 17:05:02 joda Exp $ */ +/* $Id: libasn1.h,v 1.9 2001/04/18 13:10:24 joda Exp $ */ #ifndef __LIBASN1_H__ #define __LIBASN1_H__ @@ -41,8 +41,9 @@ #endif #include <stdlib.h> +#include <string.h> #include <errno.h> -#include "asn1.h" +#include "krb5_asn1.h" #include "der.h" #include "asn1_err.h" #include <parse_units.h> diff --git a/crypto/heimdal/lib/asn1/main.c b/crypto/heimdal/lib/asn1/main.c index 538af5a..8b1b409 100644 --- a/crypto/heimdal/lib/asn1/main.c +++ b/crypto/heimdal/lib/asn1/main.c @@ -34,7 +34,7 @@ #include "gen_locl.h" #include <getarg.h> -RCSID("$Id: main.c,v 1.10 1999/12/02 17:05:02 joda Exp $"); +RCSID("$Id: main.c,v 1.11 2001/02/20 01:44:52 assar Exp $"); extern FILE *yyin; @@ -61,7 +61,7 @@ main(int argc, char **argv) char *name = NULL; int optind = 0; - set_progname(argv[0]); + setprogname(argv[0]); if(getarg(args, num_args, argc, argv, &optind)) usage(1); if(help_flag) diff --git a/crypto/heimdal/lib/asn1/parse.y b/crypto/heimdal/lib/asn1/parse.y index 4b8e590..81b5cb1 100644 --- a/crypto/heimdal/lib/asn1/parse.y +++ b/crypto/heimdal/lib/asn1/parse.y @@ -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: parse.y,v 1.16 2000/07/08 11:35:47 assar Exp $ */ +/* $Id: parse.y,v 1.17 2001/03/26 04:09:55 assar Exp $ */ %{ #ifdef HAVE_CONFIG_H @@ -44,7 +44,7 @@ #include "lex.h" #include "gen_locl.h" -RCSID("$Id: parse.y,v 1.16 2000/07/08 11:35:47 assar Exp $"); +RCSID("$Id: parse.y,v 1.17 2001/03/26 04:09:55 assar Exp $"); static Type *new_type (Typetype t); void yyerror (char *); @@ -232,7 +232,8 @@ new_type (Typetype tt) { Type *t = malloc(sizeof(*t)); if (t == NULL) { - error_message ("out of memory in malloc(%u)", sizeof(*t)); + error_message ("out of memory in malloc(%lu)", + (unsigned long)sizeof(*t)); exit (1); } t->type = tt; |