implement TeletexString

This commit is contained in:
Love Hornquist Astrand
2009-09-30 00:48:18 -07:00
parent 0b144cdf8d
commit 4d06f484ec
9 changed files with 37 additions and 1 deletions

View File

@@ -220,7 +220,6 @@ gen_files_rfc2459 = \
asn1_SubjectPublicKeyInfo.x \ asn1_SubjectPublicKeyInfo.x \
asn1_TBSCRLCertList.x \ asn1_TBSCRLCertList.x \
asn1_TBSCertificate.x \ asn1_TBSCertificate.x \
asn1_TeletexStringx.x \
asn1_Time.x \ asn1_Time.x \
asn1_UniqueIdentifier.x \ asn1_UniqueIdentifier.x \
asn1_ValidationParms.x \ asn1_ValidationParms.x \

View File

@@ -687,6 +687,11 @@ RestrictedCharactedStringType: kw_GeneralString
$$ = new_tag(ASN1_C_UNIV, UT_GeneralString, $$ = new_tag(ASN1_C_UNIV, UT_GeneralString,
TE_EXPLICIT, new_type(TGeneralString)); TE_EXPLICIT, new_type(TGeneralString));
} }
| kw_TeletexString
{
$$ = new_tag(ASN1_C_UNIV, UT_TeletexString,
TE_EXPLICIT, new_type(TTeletexString));
}
| kw_UTF8String | kw_UTF8String
{ {
$$ = new_tag(ASN1_C_UNIV, UT_UTF8String, $$ = new_tag(ASN1_C_UNIV, UT_UTF8String,

View File

@@ -494,6 +494,9 @@ define_asn1 (int level, Type *t)
case TGeneralString: case TGeneralString:
fprintf (headerfile, "GeneralString"); fprintf (headerfile, "GeneralString");
break; break;
case TTeletexString:
fprintf (headerfile, "TeletexString");
break;
case TTag: { case TTag: {
const char *classnames[] = { "UNIVERSAL ", "APPLICATION ", const char *classnames[] = { "UNIVERSAL ", "APPLICATION ",
"" /* CONTEXT */, "PRIVATE " }; "" /* CONTEXT */, "PRIVATE " };
@@ -685,6 +688,10 @@ define_type (int level, const char *name, Type *t, int typedefp, int preservep)
space(level); space(level);
fprintf (headerfile, "heim_general_string %s;\n", name); fprintf (headerfile, "heim_general_string %s;\n", name);
break; break;
case TTeletexString:
space(level);
fprintf (headerfile, "heim_general_string %s;\n", name);
break;
case TTag: case TTag:
define_type (level, name, t->subtype, typedefp, preservep); define_type (level, name, t->subtype, typedefp, preservep);
break; break;

View File

@@ -184,6 +184,9 @@ copy_type (const char *from, const char *to, const Type *t, int preserve)
case TGeneralString: case TGeneralString:
copy_primitive ("general_string", from, to); copy_primitive ("general_string", from, to);
break; break;
case TTeletexString:
copy_primitive ("general_string", from, to);
break;
case TUTCTime: case TUTCTime:
fprintf(codefile, "*(%s) = *(%s);\n", to, from); fprintf(codefile, "*(%s) = *(%s);\n", to, from);
break; break;

View File

@@ -67,6 +67,7 @@ is_primitive_type(int type)
case TEnumerated: case TEnumerated:
case TGeneralizedTime: case TGeneralizedTime:
case TGeneralString: case TGeneralString:
case TTeletexString:
case TOID: case TOID:
case TUTCTime: case TUTCTime:
case TUTF8String: case TUTF8String:
@@ -109,6 +110,11 @@ find_tag (const Type *t,
*ty = PRIM; *ty = PRIM;
*tag = UT_GeneralString; *tag = UT_GeneralString;
break; break;
case TTeletexString:
*cl = ASN1_C_UNIV;
*ty = PRIM;
*tag = UT_TeletexString;
break;
case TGeneralizedTime: case TGeneralizedTime:
*cl = ASN1_C_UNIV; *cl = ASN1_C_UNIV;
*ty = PRIM; *ty = PRIM;
@@ -489,6 +495,9 @@ decode_type (const char *name, const Type *t, int optional,
case TGeneralString: case TGeneralString:
decode_primitive ("general_string", name, forwstr); decode_primitive ("general_string", name, forwstr);
break; break;
case TTeletexString:
decode_primitive ("general_string", name, forwstr);
break;
case TTag:{ case TTag:{
char *tname, *typestring; char *tname, *typestring;
char *ide = NULL; char *ide = NULL;
@@ -703,6 +712,7 @@ generate_type_decode (const Symbol *s)
case TOID: case TOID:
case TGeneralizedTime: case TGeneralizedTime:
case TGeneralString: case TGeneralString:
case TTeletexString:
case TUTF8String: case TUTF8String:
case TPrintableString: case TPrintableString:
case TIA5String: case TIA5String:

View File

@@ -383,6 +383,10 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
encode_primitive ("general_string", name); encode_primitive ("general_string", name);
constructed = 0; constructed = 0;
break; break;
case TTeletexString:
encode_primitive ("general_string", name);
constructed = 0;
break;
case TTag: { case TTag: {
char *tname; char *tname;
int c; int c;
@@ -521,6 +525,7 @@ generate_type_encode (const Symbol *s)
case TOctetString: case TOctetString:
case TGeneralizedTime: case TGeneralizedTime:
case TGeneralString: case TGeneralString:
case TTeletexString:
case TUTCTime: case TUTCTime:
case TUTF8String: case TUTF8String:
case TPrintableString: case TPrintableString:

View File

@@ -145,6 +145,9 @@ free_type (const char *name, const Type *t, int preserve)
case TGeneralString: case TGeneralString:
free_primitive ("general_string", name); free_primitive ("general_string", name);
break; break;
case TTeletexString:
free_primitive ("general_string", name);
break;
case TUTF8String: case TUTF8String:
free_primitive ("utf8string", name); free_primitive ("utf8string", name);
break; break;

View File

@@ -219,6 +219,9 @@ length_type (const char *name, const Type *t,
case TGeneralString: case TGeneralString:
length_primitive ("general_string", name, variable); length_primitive ("general_string", name, variable);
break; break;
case TTeletexString:
length_primitive ("general_string", name, variable);
break;
case TUTCTime: case TUTCTime:
length_primitive ("utctime", name, variable); length_primitive ("utctime", name, variable);
break; break;

View File

@@ -44,6 +44,7 @@ enum typetype {
TChoice, TChoice,
TEnumerated, TEnumerated,
TGeneralString, TGeneralString,
TTeletexString,
TGeneralizedTime, TGeneralizedTime,
TIA5String, TIA5String,
TInteger, TInteger,