From 954c01728e0c7485b72c9a5d5737e5f6bd0cf0b9 Mon Sep 17 00:00:00 2001 From: Heimdal Import User Date: Mon, 11 Jul 2005 01:16:55 +0000 Subject: r8302: import mini HEIMDAL into the tree (This used to be commit 118be28a7aef233799956615a99d1a2a74dac175) --- source4/heimdal/lib/asn1/main.c | 90 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 source4/heimdal/lib/asn1/main.c (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c new file mode 100644 index 0000000000..afa164ea81 --- /dev/null +++ b/source4/heimdal/lib/asn1/main.c @@ -0,0 +1,90 @@ +/* + * 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 + +RCSID("$Id: main.c,v 1.13 2005/06/16 20:05:31 lha 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; + const char *file; + const char *name = NULL; + int optidx = 0; + + setprogname(argv[0]); + if(getarg(args, num_args, argc, argv, &optidx)) + usage(1); + if(help_flag) + usage(0); + if(version_flag) { + print_version(NULL); + exit(0); + } + if (argc == optidx) { + file = "stdin"; + name = "stdin"; + yyin = stdin; + } else { + file = argv[optidx]; + yyin = fopen (file, "r"); + if (yyin == NULL) + err (1, "open %s", file); + name = argv[optidx + 1]; + } + + init_generate (file, name); + initsym (); + ret = yyparse (); + close_generate (); + return ret; +} -- cgit From c0e8144c5d1e402b36ebe04b843eba62e7ab9958 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 9 Aug 2005 03:04:47 +0000 Subject: r9221: Try to merge Heimdal across from lorikeet-heimdal to samba4. This is my first attempt at this, so there may be a few rough edges. Andrew Bartlett (This used to be commit 9a1d2f2fec67930975da856a2d365345cec46216) --- source4/heimdal/lib/asn1/main.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c index afa164ea81..088e8ebfa2 100644 --- a/source4/heimdal/lib/asn1/main.c +++ b/source4/heimdal/lib/asn1/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2005 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,14 +33,32 @@ #include "gen_locl.h" #include +#include "lex.h" -RCSID("$Id: main.c,v 1.13 2005/06/16 20:05:31 lha Exp $"); +RCSID("$Id: main.c,v 1.14 2005/07/12 06:27:34 lha Exp $"); extern FILE *yyin; +static getarg_strings preserve; + +int +preserve_type(const char *p) +{ + int i; + for (i = 0; i < preserve.num_strings; i++) + if (strcmp(preserve.strings[i], p) == 0) + return 1; + return 0; +} + +int dce_fix; +int rfc1510_bitstring; int version_flag; int help_flag; struct getargs args[] = { + { "encode-rfc1510-bit-string", 0, arg_flag, &rfc1510_bitstring }, + { "decode-dce-ber", 0, arg_flag, &dce_fix }, + { "preserve-binary", 0, arg_strings, &preserve }, { "version", 0, arg_flag, &version_flag }, { "help", 0, arg_flag, &help_flag } }; @@ -53,12 +71,14 @@ usage(int code) exit(code); } +int error_flag; + int main(int argc, char **argv) { int ret; - const char *file; - const char *name = NULL; + char *file; + char *name = NULL; int optidx = 0; setprogname(argv[0]); @@ -79,12 +99,21 @@ main(int argc, char **argv) yyin = fopen (file, "r"); if (yyin == NULL) err (1, "open %s", file); - name = argv[optidx + 1]; + if (argc == optidx + 1) { + char *p; + name = estrdup(file); + p = strrchr(name, '.'); + if (p) + *p = '\0'; + } else + name = argv[optidx + 1]; } init_generate (file, name); initsym (); ret = yyparse (); + if(ret != 0 || error_flag != 0) + exit(1); close_generate (); - return ret; + return 0; } -- cgit From 08730652fbf1c9f6d53378b1b094a2c5ddf2cf62 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 27 Aug 2005 11:49:06 +0000 Subject: r9680: Update Heimdal to current lorikeet-heimdal (which was itself updated to Heimdal CVS as of 2005-08-27). Andrew Bartlett (This used to be commit 913924a4997f5e14c503f87510cbd8e4bfd965a9) --- source4/heimdal/lib/asn1/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c index 088e8ebfa2..eec775f3ba 100644 --- a/source4/heimdal/lib/asn1/main.c +++ b/source4/heimdal/lib/asn1/main.c @@ -35,7 +35,7 @@ #include #include "lex.h" -RCSID("$Id: main.c,v 1.14 2005/07/12 06:27:34 lha Exp $"); +RCSID("$Id: main.c,v 1.15 2005/08/23 10:50:12 lha Exp $"); extern FILE *yyin; @@ -77,8 +77,8 @@ int main(int argc, char **argv) { int ret; - char *file; - char *name = NULL; + const char *file; + const char *name = NULL; int optidx = 0; setprogname(argv[0]); -- cgit From 3c1e780ec7e16dc6667402bbc65708bf9a5c062f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Nov 2006 06:59:56 +0000 Subject: r19604: This is a massive commit, and I appologise in advance for it's size. This merges Samba4 with lorikeet-heimdal, which itself has been tracking Heimdal CVS for the past couple of weeks. This is such a big change because Heimdal reorganised it's internal structures, with the mechglue merge, and because many of our 'wishes' have been granted: we now have DCE_STYLE GSSAPI, send_to_kdc hooks and many other features merged into the mainline code. We have adapted to upstream's choice of API in these cases. In gensec_gssapi and gensec_krb5, we either expect a valid PAC, or NO PAC. This matches windows behavour. We also have an option to require the PAC to be present (which allows us to automate the testing of this code). This also includes a restructure of how the kerberos dependencies are handled, due to the fallout of the merge. Andrew Bartlett (This used to be commit 4826f1735197c2a471d771495e6d4c1051b4c471) --- source4/heimdal/lib/asn1/main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c index eec775f3ba..bba79b1e4e 100644 --- a/source4/heimdal/lib/asn1/main.c +++ b/source4/heimdal/lib/asn1/main.c @@ -35,11 +35,12 @@ #include #include "lex.h" -RCSID("$Id: main.c,v 1.15 2005/08/23 10:50:12 lha Exp $"); +RCSID("$Id: main.c,v 1.16 2006/09/05 12:27:29 lha Exp $"); extern FILE *yyin; static getarg_strings preserve; +static getarg_strings seq; int preserve_type(const char *p) @@ -51,6 +52,16 @@ preserve_type(const char *p) return 0; } +int +seq_type(const char *p) +{ + int i; + for (i = 0; i < seq.num_strings; i++) + if (strcmp(seq.strings[i], p) == 0) + return 1; + return 0; +} + int dce_fix; int rfc1510_bitstring; int version_flag; @@ -59,6 +70,7 @@ struct getargs args[] = { { "encode-rfc1510-bit-string", 0, arg_flag, &rfc1510_bitstring }, { "decode-dce-ber", 0, arg_flag, &dce_fix }, { "preserve-binary", 0, arg_strings, &preserve }, + { "sequence", 0, arg_strings, &seq }, { "version", 0, arg_flag, &version_flag }, { "help", 0, arg_flag, &help_flag } }; -- cgit From 91adebe749beb0dc23cacaea316cb2b724776aad Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 13 Jun 2007 05:44:24 +0000 Subject: r23456: Update Samba4 to current lorikeet-heimdal. Andrew Bartlett (This used to be commit ae0f81ab235c72cceb120bcdeb051a483cf3cc4f) --- source4/heimdal/lib/asn1/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c index bba79b1e4e..3b4a8122ca 100644 --- a/source4/heimdal/lib/asn1/main.c +++ b/source4/heimdal/lib/asn1/main.c @@ -35,7 +35,7 @@ #include #include "lex.h" -RCSID("$Id: main.c,v 1.16 2006/09/05 12:27:29 lha Exp $"); +RCSID("$Id: main.c 20858 2007-06-03 18:56:41Z lha $"); extern FILE *yyin; @@ -127,5 +127,7 @@ main(int argc, char **argv) if(ret != 0 || error_flag != 0) exit(1); close_generate (); + if (argc != optidx) + fclose(yyin); return 0; } -- cgit From 243321b4bbe273cf3a9105ca132caa2b53e2f263 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2008 19:35:52 +0200 Subject: heimdal: import heimdal's trunk svn rev 23697 + lorikeet-heimdal patches This is based on f56a3b1846c7d462542f2e9527f4d0ed8a34748d in my heimdal-wip repo. metze (This used to be commit 467a1f2163a63cdf1a4c83a69473db50e8794f53) --- source4/heimdal/lib/asn1/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/heimdal/lib/asn1/main.c') diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c index 3b4a8122ca..3e15b39e6a 100644 --- a/source4/heimdal/lib/asn1/main.c +++ b/source4/heimdal/lib/asn1/main.c @@ -35,7 +35,7 @@ #include #include "lex.h" -RCSID("$Id: main.c 20858 2007-06-03 18:56:41Z lha $"); +RCSID("$Id$"); extern FILE *yyin; -- cgit