aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2005-01-17 12:27:41 +0000
committerLev Walkin <vlm@lionet.info>2005-01-17 12:27:41 +0000
commit1a01e197774639b9898e22ae39faf30f03d83e71 (patch)
tree326fa9f115839afeaed34a8b1fcf6997c8970a72
parent15f54d4b89355b5b4148e9521f5a6bec22878a8f (diff)
choice tagging fix
-rw-r--r--libasn1fix/asn1fix_tags.c2
-rw-r--r--tests/62-any-OK.asn17
-rw-r--r--tests/62-any-OK.asn1.-EF7
3 files changed, 14 insertions, 2 deletions
diff --git a/libasn1fix/asn1fix_tags.c b/libasn1fix/asn1fix_tags.c
index ed08513b..ff662cc3 100644
--- a/libasn1fix/asn1fix_tags.c
+++ b/libasn1fix/asn1fix_tags.c
@@ -44,6 +44,8 @@ asn1f_fetch_tags_impl(arg_t *arg, struct asn1p_type_tag_s **tags, int count, int
if(expr->expr_type == ASN_TYPE_ANY
&& (flags & AFT_IMAGINARY_ANY))
tt.tag_value = -1;
+ else if(expr->expr_type == ASN_CONSTR_CHOICE)
+ return count ? count : -1;
else
return -1;
}
diff --git a/tests/62-any-OK.asn1 b/tests/62-any-OK.asn1
index f3d784ca..0e69e01d 100644
--- a/tests/62-any-OK.asn1
+++ b/tests/62-any-OK.asn1
@@ -14,7 +14,8 @@ BEGIN
T ::= CHOICE {
s1 T1-ext,
s2 T2,
- s3 T3
+ s3 T3,
+ s4 T4
}
T1-ext ::= SEQUENCE {
@@ -37,4 +38,8 @@ BEGIN
m2 [1] BOOLEAN
}
+ T4 ::= [53] CHOICE {
+ m1 [1] IMPLICIT OCTET STRING
+ }
+
END
diff --git a/tests/62-any-OK.asn1.-EF b/tests/62-any-OK.asn1.-EF
index 4c8f5c4b..a7917fc7 100644
--- a/tests/62-any-OK.asn1.-EF
+++ b/tests/62-any-OK.asn1.-EF
@@ -7,7 +7,8 @@ BEGIN
T ::= CHOICE {
s1 T1-ext,
s2 T2,
- s3 T3
+ s3 T3,
+ s4 T4
}
T1-ext ::= SEQUENCE {
@@ -30,4 +31,8 @@ T3 ::= SET {
m2 [1] IMPLICIT BOOLEAN
}
+T4 ::= [53] EXPLICIT CHOICE {
+ m1 [1] IMPLICIT OCTET STRING
+}
+
END