rename dce-stype to support_ber

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24605 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-02-04 22:08:41 +00:00
parent 8ed1e3e625
commit b29554715f
3 changed files with 12 additions and 11 deletions

View File

@@ -500,9 +500,9 @@ decode_type (const char *name, const Type *t, int optional,
"size_t %s_datalen, %s_oldlen;\n"
"Der_type %s;\n",
tmpstr, tmpstr, typestring);
if(dce_fix)
if(support_ber)
fprintf(codefile,
"int dce_fix;\n");
"int is_indefinite;\n");
fprintf(codefile, "e = der_match_tag_and_length(p, len, %s, &%s, %s, "
"&%s_datalen, &l);\n",
@@ -512,7 +512,7 @@ decode_type (const char *name, const Type *t, int optional,
tmpstr);
/* XXX hardcode for now */
if (dce_fix && t->subtype->type == TOctetString) {
if (support_ber && t->subtype->type == TOctetString) {
ide = typestring;
} else {
fprintf(codefile,
@@ -536,11 +536,11 @@ decode_type (const char *name, const Type *t, int optional,
"p += l; len -= l; ret += l;\n"
"%s_oldlen = len;\n",
tmpstr);
if(dce_fix)
if(support_ber)
fprintf (codefile,
"if((dce_fix = _heim_fix_dce(%s_datalen, &len)) < 0)\n"
"if((is_indefinite = _heim_fix_dce(%s_datalen, &len)) < 0)\n"
"{ e = ASN1_BAD_FORMAT; %s; }\n"
"if (dce_fix) { if (len < 2) { e = ASN1_OVERRUN; %s; } len -= 2; }",
"if (is_indefinite) { if (len < 2) { e = ASN1_OVERRUN; %s; } len -= 2; }",
tmpstr, forwstr, forwstr);
else
fprintf(codefile,
@@ -550,9 +550,9 @@ decode_type (const char *name, const Type *t, int optional,
if (tname == NULL)
errx(1, "malloc");
decode_type (name, t->subtype, 0, forwstr, tname, ide);
if(dce_fix)
if(support_ber)
fprintf(codefile,
"if(dce_fix){\n"
"if(is_indefinite){\n"
"len += 2;\n"
"e = der_match_tag_and_length(p, len, "
"(Der_class)0, &%s, UT_EndOfContent, "

View File

@@ -84,7 +84,7 @@ void close_codefile(void);
extern FILE *headerfile, *codefile, *logfile;
extern int dce_fix;
extern int support_ber;
extern int rfc1510_bitstring;
extern int one_code_file;

View File

@@ -62,7 +62,7 @@ seq_type(const char *p)
return 0;
}
int dce_fix;
int support_ber;
int rfc1510_bitstring;
int one_code_file;
char *option_file;
@@ -70,7 +70,8 @@ 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 },
{ "decode-dce-ber", 0, arg_flag, &support_ber },
{ "support-ber", 0, arg_flag, &support_ber },
{ "preserve-binary", 0, arg_strings, &preserve },
{ "sequence", 0, arg_strings, &seq },
{ "one-code-file", 0, arg_flag, &one_code_file },