From ea193b2f254eeaac98d113fd88a14ff514eb078c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 15 Dec 2008 04:30:22 +0000 Subject: [PATCH] use new der_match_tag_and_length to parse the UT_EndOfContent tag git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24189 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/gen_decode.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/asn1/gen_decode.c b/lib/asn1/gen_decode.c index 62c000748..70ed18db0 100644 --- a/lib/asn1/gen_decode.c +++ b/lib/asn1/gen_decode.c @@ -504,7 +504,7 @@ decode_type (const char *name, const Type *t, int optional, fprintf(codefile, "int dce_fix;\n"); - fprintf(codefile, "e = der_match_tag_and_length2(p, len, %s, &%s, %s, " + fprintf(codefile, "e = der_match_tag_and_length(p, len, %s, &%s, %s, " "&%s_datalen, &l);\n", classname(t->tag.tagclass), typestring, @@ -553,11 +553,17 @@ decode_type (const char *name, const Type *t, int optional, fprintf(codefile, "if(dce_fix){\n" "len += 2;\n" - "e = der_match_tag_and_length (p, len, " - "(Der_class)0,(Der_type)0, UT_EndOfContent, " + "e = der_match_tag_and_length(p, len, " + "(Der_class)0, &%s, UT_EndOfContent, " "&%s_datalen, &l);\n" - "if(e) %s;\np += l; len -= l; ret += l;\n" - "} else \n", tmpstr, forwstr); + "if(e) %s;\n" + "p += l; len -= l; ret += l;\n" + "if (%s != (Der_type)0) { e = ASN1_BAD_ID; %s; }\n" + "} else \n", + typestring, + tmpstr, + forwstr, + typestring, forwstr); fprintf(codefile, "len = %s_oldlen - %s_datalen;\n", tmpstr, tmpstr);