diff options
author | Lev Walkin <vlm@lionet.info> | 2006-08-28 02:24:24 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2006-08-28 02:24:24 +0000 |
commit | a0c9290c01e98d4fce4c5ebbe9728f2d37199f3c (patch) | |
tree | 8d9f7941de4b114519e9a407a6f6ef794b02a40f /libasn1fix | |
parent | ef4a32bd3fac06caa052ab113694736a40027b3d (diff) |
identifier name clash
Diffstat (limited to 'libasn1fix')
-rw-r--r-- | libasn1fix/asn1fix_bitstring.c | 17 | ||||
-rw-r--r-- | libasn1fix/asn1fix_enum.c | 3 | ||||
-rw-r--r-- | libasn1fix/asn1fix_integer.c | 15 | ||||
-rw-r--r-- | libasn1fix/asn1fix_misc.c | 3 |
4 files changed, 21 insertions, 17 deletions
diff --git a/libasn1fix/asn1fix_bitstring.c b/libasn1fix/asn1fix_bitstring.c index f8adc753..e2f2434a 100644 --- a/libasn1fix/asn1fix_bitstring.c +++ b/libasn1fix/asn1fix_bitstring.c @@ -36,17 +36,28 @@ static int asn1f_fix_bit_string_type(arg_t *arg) { asn1p_expr_t *expr = arg->expr; asn1p_expr_t *v; + int r_value = 0; + int ret; TQ_FOR(v, &(expr->members), next) { + /* Check identifier uniqueness as per 21.4 */ + ret = asn1f_check_unique_expr_child(arg, v, 0); + RET2RVAL(ret, r_value); + + if(v->expr_type == A1TC_EXTENSIBLE) { + FATAL("Extension marker (...) is not allowed " + "as a BIT STRING NamedBit at line %d ", + v->_lineno); + return -1; + } if(v->expr_type != A1TC_UNIVERVAL) { FATAL("BIT STRING value at line %d " - "is not an identifier", - v->_lineno); + "is not an identifier", v->_lineno); return -1; } } - return 0; + return r_value; } static int diff --git a/libasn1fix/asn1fix_enum.c b/libasn1fix/asn1fix_enum.c index ce2fc2fc..cf03914f 100644 --- a/libasn1fix/asn1fix_enum.c +++ b/libasn1fix/asn1fix_enum.c @@ -34,8 +34,7 @@ asn1f_fix_enum(arg_t *arg) { */ if(ev->expr_type == A1TC_EXTENSIBLE) { if(ext_marker) { - arg->eh(1, - "Enumeration %s at line %d: " + FATAL("Enumeration %s at line %d: " "Second extension marker is not allowed", expr->Identifier, ev->_lineno); diff --git a/libasn1fix/asn1fix_integer.c b/libasn1fix/asn1fix_integer.c index 8a144911..0302acd2 100644 --- a/libasn1fix/asn1fix_integer.c +++ b/libasn1fix/asn1fix_integer.c @@ -38,20 +38,17 @@ asn1f_fix_integer(arg_t *arg) { * Found "...", check correctness. */ if(iv->expr_type == A1TC_EXTENSIBLE) { - arg->eh(1, - "INTEGER %s at line %d: " + FATAL("INTEGER %s at line %d: " "Extension marker is not allowed", expr->Identifier, - iv->_lineno - ); + iv->_lineno); rvalue = -1; continue; } if(iv->Identifier == NULL || iv->expr_type != A1TC_UNIVERVAL) { - arg->eh(1, - "INTEGER %s at line %d: " + FATAL("INTEGER %s at line %d: " "Unsupported enumeration element %s", expr->Identifier, iv->_lineno, @@ -62,8 +59,7 @@ asn1f_fix_integer(arg_t *arg) { } if(iv->value == NULL) { - arg->eh(1, - "INTEGER %s at line %d: " + FATAL("INTEGER %s at line %d: " "Value for the identifier %s " "must be set explicitly", expr->Identifier, @@ -84,8 +80,7 @@ asn1f_fix_integer(arg_t *arg) { } if(iv->value->type != ATV_INTEGER) { - arg->eh(1, - "INTEGER %s at line %d: " + FATAL("INTEGER %s at line %d: " "Value for the identifier %s " "is not compatible with INTEGER type", expr->Identifier, diff --git a/libasn1fix/asn1fix_misc.c b/libasn1fix/asn1fix_misc.c index 72317aa2..9e8cc07f 100644 --- a/libasn1fix/asn1fix_misc.c +++ b/libasn1fix/asn1fix_misc.c @@ -294,8 +294,7 @@ asn1f_check_unique_expr_child(arg_t *arg, asn1p_expr_t *child, msg = opt_compare ?"Expressions clash" :"Identifiers name clash"; - arg->eh(1, - "%s: " + FATAL("%s: " "\"%s\" at line %d has similar %s with " "\"%s\" at line %d", msg, |