From 7ef83a454f6b1e6d7b7f4f85d5968346e93cbc4c Mon Sep 17 00:00:00 2001 From: Lev Walkin <vlm@lionet.info> Date: Tue, 29 Mar 2005 19:04:24 +0000 Subject: [PATCH] deeper validation --- libasn1compiler/asn1c_C.c | 2 +- libasn1compiler/asn1c_constraint.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c index 7d66b1b1..a2a09f27 100644 --- a/libasn1compiler/asn1c_C.c +++ b/libasn1compiler/asn1c_C.c @@ -1067,7 +1067,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) { OUT("td->elements_count = asn_DEF_%s.elements_count;\n", type_name); if(etd_spec != ETD_NO_SPECIFICS) { INDENT(-1); - OUT(" /* "); + OUT(" /* "); } OUT("td->specifics = asn_DEF_%s.specifics;", type_name); if(etd_spec == ETD_NO_SPECIFICS) { diff --git a/libasn1compiler/asn1c_constraint.c b/libasn1compiler/asn1c_constraint.c index 0729d08e..78097838 100644 --- a/libasn1compiler/asn1c_constraint.c +++ b/libasn1compiler/asn1c_constraint.c @@ -170,8 +170,17 @@ asn1c_emit_constraint_checking_code(arg_t *arg) { INDENT(-1); OUT(") {\n"); INDENT(+1); - OUT("/* Constraint check succeeded */\n"); - OUT("return 0;\n"); + switch(etype) { + case ASN_CONSTR_SEQUENCE_OF: + OUT("/* SEQUENCE validation code is the same as SET */\n"); + case ASN_CONSTR_SET_OF: + OUT("/* Perform validation of the inner elements */\n"); + OUT("return SET_OF_constraint(td, list, app_errlog, app_key);\n"); + break; + default: + OUT("/* Constraint check succeeded */\n"); + OUT("return 0;\n"); + } INDENT(-1); OUT("} else {\n"); INDENT(+1); -- GitLab