diff options
author | Bjorn Sandell <biorn@cvs.openbsd.org> | 2005-10-16 18:56:36 +0000 |
---|---|---|
committer | Bjorn Sandell <biorn@cvs.openbsd.org> | 2005-10-16 18:56:36 +0000 |
commit | 9b65ff1ed6cf7a1e29a392de0ba9fe5d722eccef (patch) | |
tree | f82203bfbf633ffa333b45fecec06ff9cff005cf /usr.bin/asn1_compile/gen_decode.c | |
parent | 14d3e879f4c504b87ea309e2ae1e198d1572aaa0 (diff) |
sync with heimdal 0.7
Diffstat (limited to 'usr.bin/asn1_compile/gen_decode.c')
-rw-r--r-- | usr.bin/asn1_compile/gen_decode.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/usr.bin/asn1_compile/gen_decode.c b/usr.bin/asn1_compile/gen_decode.c index 27881adc431..6032a974221 100644 --- a/usr.bin/asn1_compile/gen_decode.c +++ b/usr.bin/asn1_compile/gen_decode.c @@ -34,7 +34,7 @@ #include "gen_locl.h" /* -RCSID("$KTH: gen_decode.c,v 1.18 2002/08/09 15:37:34 joda Exp $"); +RCSID("$KTH: gen_decode.c,v 1.21 2005/05/29 14:23:01 lha Exp $"); */ static void @@ -90,7 +90,7 @@ decode_type (const char *name, const Type *t) int pos; fprintf (codefile, - "e = der_match_tag_and_length (p, len, UNIV, PRIM, UT_BitString," + "e = der_match_tag_and_length (p, len, ASN1_C_UNIV, PRIM, UT_BitString," "&reallen, &l);\n" "FORW;\n" "if(len < reallen)\n" @@ -124,7 +124,7 @@ decode_type (const char *name, const Type *t) break; fprintf (codefile, - "e = der_match_tag_and_length (p, len, UNIV, CONS, UT_Sequence," + "e = der_match_tag_and_length (p, len, ASN1_C_UNIV, CONS, UT_Sequence," "&reallen, &l);\n" "FORW;\n" "{\n" @@ -161,7 +161,7 @@ decode_type (const char *name, const Type *t) }else{ fprintf (codefile, "{\n" "size_t newlen, oldlen;\n\n" - "e = der_match_tag (p, len, CONTEXT, CONS, %d, &l);\n", + "e = der_match_tag (p, len, ASN1_C_CONTEXT, CONS, %d, &l);\n", m->val); fprintf (codefile, "if (e)\n"); @@ -221,7 +221,7 @@ decode_type (const char *name, const Type *t) char *n; fprintf (codefile, - "e = der_match_tag_and_length (p, len, UNIV, CONS, UT_Sequence," + "e = der_match_tag_and_length (p, len, ASN1_C_UNIV, CONS, UT_Sequence," "&reallen, &l);\n" "FORW;\n" "if(len < reallen)\n" @@ -255,9 +255,17 @@ decode_type (const char *name, const Type *t) case TGeneralString: decode_primitive ("general_string", name); break; + case TUTF8String: + decode_primitive ("utf8string", name); + break; + case TNull: + fprintf (codefile, + "e = decode_nulltype(p, len, &l);\n" + "FORW;\n"); + break; case TApplication: fprintf (codefile, - "e = der_match_tag_and_length (p, len, APPL, CONS, %d, " + "e = der_match_tag_and_length (p, len, ASN1_C_APPL, CONS, %d, " "&reallen, &l);\n" "FORW;\n" "{\n" @@ -275,6 +283,9 @@ decode_type (const char *name, const Type *t) "}\n"); break; + case TBoolean: + decode_primitive ("boolean", name); + break; default : abort (); } @@ -304,10 +315,14 @@ generate_type_decode (const Symbol *s) switch (s->type->type) { case TInteger: case TUInteger: + case TBoolean: case TOctetString: case TOID: case TGeneralizedTime: case TGeneralString: + case TUTF8String: + case TNull: + case TEnumerated: case TBitString: case TSequence: case TSequenceOf: @@ -357,7 +372,7 @@ generate_seq_type_decode (const Symbol *s) "int dce_fix;\n"); fprintf (codefile, - "e = der_match_tag(p, len, CONTEXT, CONS, tag, &l);\n" + "e = der_match_tag(p, len, ASN1_C_CONTEXT, CONS, tag, &l);\n" "if (e)\n" "return e;\n"); fprintf (codefile, |