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

View File

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

View File

@@ -62,7 +62,7 @@ seq_type(const char *p)
return 0; return 0;
} }
int dce_fix; int support_ber;
int rfc1510_bitstring; int rfc1510_bitstring;
int one_code_file; int one_code_file;
char *option_file; char *option_file;
@@ -70,7 +70,8 @@ int version_flag;
int help_flag; int help_flag;
struct getargs args[] = { struct getargs args[] = {
{ "encode-rfc1510-bit-string", 0, arg_flag, &rfc1510_bitstring }, { "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 }, { "preserve-binary", 0, arg_strings, &preserve },
{ "sequence", 0, arg_strings, &seq }, { "sequence", 0, arg_strings, &seq },
{ "one-code-file", 0, arg_flag, &one_code_file }, { "one-code-file", 0, arg_flag, &one_code_file },