Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
906654e1
Commit
906654e1
authored
Sep 10, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored tagging support
parent
fa30126d
Changes
52
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
1047 additions
and
252 deletions
+1047
-252
ChangeLog
ChangeLog
+4
-1
asn1c/tests/check-43.c
asn1c/tests/check-43.c
+2
-3
asn1c/tests/check-65.c
asn1c/tests/check-65.c
+115
-0
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+37
-62
libasn1fix/asn1fix_internal.h
libasn1fix/asn1fix_internal.h
+1
-1
libasn1fix/asn1fix_tags.c
libasn1fix/asn1fix_tags.c
+33
-5
libasn1fix/asn1fix_tags.h
libasn1fix/asn1fix_tags.h
+0
-1
skeletons/ANY.c
skeletons/ANY.c
+0
-1
skeletons/BIT_STRING.c
skeletons/BIT_STRING.c
+0
-1
skeletons/BMPString.c
skeletons/BMPString.c
+0
-1
skeletons/BOOLEAN.c
skeletons/BOOLEAN.c
+0
-1
skeletons/ENUMERATED.c
skeletons/ENUMERATED.c
+0
-1
skeletons/GeneralString.c
skeletons/GeneralString.c
+0
-1
skeletons/GeneralizedTime.c
skeletons/GeneralizedTime.c
+0
-1
skeletons/GraphicString.c
skeletons/GraphicString.c
+0
-1
skeletons/IA5String.c
skeletons/IA5String.c
+0
-1
skeletons/INTEGER.c
skeletons/INTEGER.c
+0
-1
skeletons/ISO646String.c
skeletons/ISO646String.c
+0
-1
skeletons/NULL.c
skeletons/NULL.c
+0
-1
skeletons/NativeEnumerated.c
skeletons/NativeEnumerated.c
+0
-1
skeletons/NativeInteger.c
skeletons/NativeInteger.c
+0
-1
skeletons/NumericString.c
skeletons/NumericString.c
+0
-1
skeletons/OBJECT_IDENTIFIER.c
skeletons/OBJECT_IDENTIFIER.c
+0
-1
skeletons/OCTET_STRING.c
skeletons/OCTET_STRING.c
+0
-1
skeletons/ObjectDescriptor.c
skeletons/ObjectDescriptor.c
+0
-1
skeletons/PrintableString.c
skeletons/PrintableString.c
+0
-1
skeletons/RELATIVE-OID.c
skeletons/RELATIVE-OID.c
+0
-1
skeletons/T61String.c
skeletons/T61String.c
+0
-1
skeletons/TeletexString.c
skeletons/TeletexString.c
+0
-1
skeletons/UTCTime.c
skeletons/UTCTime.c
+0
-1
skeletons/UTF8String.c
skeletons/UTF8String.c
+0
-1
skeletons/UniversalString.c
skeletons/UniversalString.c
+0
-1
skeletons/VideotexString.c
skeletons/VideotexString.c
+0
-1
skeletons/VisibleString.c
skeletons/VisibleString.c
+0
-1
skeletons/ber_decoder.c
skeletons/ber_decoder.c
+2
-18
skeletons/constr_SEQUENCE.c
skeletons/constr_SEQUENCE.c
+4
-2
skeletons/constr_SET.c
skeletons/constr_SET.c
+0
-1
skeletons/constr_TYPE.h
skeletons/constr_TYPE.h
+0
-1
skeletons/constraints.c
skeletons/constraints.c
+3
-2
skeletons/der_encoder.c
skeletons/der_encoder.c
+5
-5
tests/19-param-OK.asn1.-P
tests/19-param-OK.asn1.-P
+0
-4
tests/31-set-of-OK.asn1.-P
tests/31-set-of-OK.asn1.-P
+0
-6
tests/39-sequence-of-OK.asn1.-P
tests/39-sequence-of-OK.asn1.-P
+0
-3
tests/42-real-life-OK.asn1.-PR
tests/42-real-life-OK.asn1.-PR
+0
-10
tests/43-recursion-OK.asn1.-P
tests/43-recursion-OK.asn1.-P
+0
-5
tests/44-choice-in-sequence-OK.asn1.-P
tests/44-choice-in-sequence-OK.asn1.-P
+0
-4
tests/46-redefine-OK.asn1.-PR
tests/46-redefine-OK.asn1.-PR
+2
-7
tests/47-set-ext-OK.asn1.-P
tests/47-set-ext-OK.asn1.-P
+0
-4
tests/50-constraint-OK.asn1.-P
tests/50-constraint-OK.asn1.-P
+36
-78
tests/60-any-OK.asn1.-P
tests/60-any-OK.asn1.-P
+0
-2
tests/65-multi-tag-OK.asn1
tests/65-multi-tag-OK.asn1
+29
-0
tests/65-multi-tag-OK.asn1.-P
tests/65-multi-tag-OK.asn1.-P
+774
-0
No files found.
ChangeLog
View file @
906654e1
0.9.4: 2004-Sep-
07
0.9.4: 2004-Sep-
10
* More support for recursive type definitions.
* More support for recursive type definitions.
* Explicit support for ANY type decoding.
* Explicit support for ANY type decoding.
* Refactored tags processing code.
* Fixed constraints checking code: non-exploitable buffer overflow.
(Severity: medium, Security impact: low)
0.9.3: 2004-Sep-07
0.9.3: 2004-Sep-07
...
...
asn1c/tests/check-43.c
View file @
906654e1
...
@@ -6,18 +6,17 @@
...
@@ -6,18 +6,17 @@
#include <assert.h>
#include <assert.h>
#include <Test-structure-1.h>
#include <Test-structure-1.h>
#include <
Sets
.h>
#include <
Choice-1
.h>
int
int
main
(
int
ac
,
char
**
av
)
{
main
(
int
ac
,
char
**
av
)
{
Test_structure_1_t
ts1
;
Test_structure_1_t
ts1
;
Sets_t
s1
;
Choice_1_t
c
s1
;
(
void
)
ac
;
/* Unused argument */
(
void
)
ac
;
/* Unused argument */
(
void
)
av
;
/* Unused argument */
(
void
)
av
;
/* Unused argument */
memset
(
&
ts1
,
0
,
sizeof
(
ts1
));
memset
(
&
ts1
,
0
,
sizeof
(
ts1
));
memset
(
&
s1
,
0
,
sizeof
(
s1
));
/*
/*
* No plans to fill it up: just checking whether it compiles or not.
* No plans to fill it up: just checking whether it compiles or not.
...
...
asn1c/tests/check-65.c
0 → 100644
View file @
906654e1
#undef NDEBUG
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <assert.h>
#include <T.h>
#include <T1.h>
uint8_t
buf1
[]
=
{
32
|
((
2
<<
6
)
+
2
),
/* [2], constructed */
8
,
32
|
((
2
<<
6
)
+
3
),
/* [3], constructed */
6
,
32
|
((
2
<<
6
)
+
4
),
/* [4], constructed */
4
,
0
|
((
2
<<
6
)
+
6
),
/* [6], primitive */
2
,
0x91
,
0x92
};
uint8_t
buf2
[]
=
{
32
|
((
2
<<
6
)
+
0
),
/* [0], constructed */
22
,
32
|
((
2
<<
6
)
+
1
),
/* [1], constructed */
6
,
32
|
((
2
<<
6
)
+
4
),
/* [4], constructed */
4
,
0
|
((
2
<<
6
)
+
6
),
/* [6], primitive */
2
,
0x91
,
0x92
,
32
|
((
2
<<
6
)
+
2
),
/* [2], constructed */
6
,
32
|
((
2
<<
6
)
+
4
),
/* [4], constructed */
4
,
0
|
((
2
<<
6
)
+
6
),
/* [6], primitive */
2
,
0x91
,
0x92
,
32
|
((
2
<<
6
)
+
3
),
/* [3], constructed */
4
,
0
|
((
2
<<
6
)
+
6
),
/* [6], primitive */
2
,
0x91
,
0x92
,
};
static
void
check_1
(
int
is_ok
,
uint8_t
*
buf
,
int
size
,
size_t
consumed
)
{
asn1_TYPE_descriptor_t
*
td
=
&
asn1_DEF_T1
;
ber_dec_rval_t
rval
;
T1_t
t
,
*
tp
;
tp
=
memset
(
&
t
,
0
,
sizeof
(
t
));
fprintf
(
stderr
,
"Buf %p
\n
"
,
buf
);
rval
=
ber_decode
(
td
,
(
void
**
)
&
tp
,
buf
,
size
);
fprintf
(
stderr
,
"Returned code %d, consumed %d
\n
"
,
(
int
)
rval
.
code
,
(
int
)
rval
.
consumed
);
if
(
is_ok
)
{
assert
(
rval
.
code
==
RC_OK
);
assert
(
rval
.
consumed
==
consumed
);
}
else
{
if
(
rval
.
code
==
RC_OK
)
{
}
assert
(
rval
.
consumed
<=
consumed
);
}
}
static
void
check_2
(
int
is_ok
,
uint8_t
*
buf
,
int
size
,
size_t
consumed
)
{
asn1_TYPE_descriptor_t
*
td
=
&
asn1_DEF_T
;
ber_dec_rval_t
rval
;
T_t
t
,
*
tp
;
tp
=
memset
(
&
t
,
0
,
sizeof
(
t
));
fprintf
(
stderr
,
"Buf %p
\n
"
,
buf
);
rval
=
ber_decode
(
td
,
(
void
**
)
&
tp
,
buf
,
size
);
fprintf
(
stderr
,
"Returned code %d, consumed %d
\n
"
,
(
int
)
rval
.
code
,
(
int
)
rval
.
consumed
);
if
(
is_ok
)
{
assert
(
rval
.
code
==
RC_OK
);
assert
(
rval
.
consumed
==
consumed
);
}
else
{
if
(
rval
.
code
==
RC_OK
)
{
}
assert
(
rval
.
consumed
<=
consumed
);
}
}
int
main
(
int
ac
,
char
**
av
)
{
(
void
)
ac
;
/* Unused argument */
(
void
)
av
;
/* Unused argument */
check_1
(
1
,
buf1
,
sizeof
(
buf1
),
sizeof
(
buf1
));
check_1
(
0
,
buf1
,
sizeof
(
buf1
)
-
1
,
sizeof
(
buf1
)
-
1
);
check_2
(
1
,
buf2
,
sizeof
(
buf2
),
sizeof
(
buf2
));
check_2
(
0
,
buf2
,
sizeof
(
buf2
)
-
1
,
sizeof
(
buf2
)
-
1
);
return
0
;
}
libasn1compiler/asn1c_C.c
View file @
906654e1
...
@@ -29,7 +29,7 @@ static int check_if_extensible(asn1p_expr_t *expr);
...
@@ -29,7 +29,7 @@ static int check_if_extensible(asn1p_expr_t *expr);
static
int
expr_better_indirect
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
expr_better_indirect
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
expr_elements_count
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
expr_elements_count
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
emit_member_table
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
emit_member_table
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
emit_tags_vector
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
*
tags_impl_skip
,
int
choice_mode
);
static
int
emit_tags_vector
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
);
static
int
emit_tag2member_map
(
arg_t
*
arg
,
tag2el_t
*
tag2el
,
int
tag2el_count
);
static
int
emit_tag2member_map
(
arg_t
*
arg
,
tag2el_t
*
tag2el
,
int
tag2el_count
);
enum
etd_cp
{
enum
etd_cp
{
...
@@ -42,7 +42,7 @@ enum etd_spec {
...
@@ -42,7 +42,7 @@ enum etd_spec {
ETD_NO_SPECIFICS
,
ETD_NO_SPECIFICS
,
ETD_HAS_SPECIFICS
ETD_HAS_SPECIFICS
};
};
static
int
emit_type_DEF
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
tags_count
,
int
tags_impl_skip
,
int
elements_count
,
enum
etd_cp
,
enum
etd_spec
);
static
int
emit_type_DEF
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
tags_count
,
int
elements_count
,
enum
etd_cp
,
enum
etd_spec
);
#define C99_MODE (!(arg->flags & A1C_NO_C99))
#define C99_MODE (!(arg->flags & A1C_NO_C99))
#define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS)
#define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS)
...
@@ -169,7 +169,6 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
...
@@ -169,7 +169,6 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
v
;
asn1p_expr_t
*
v
;
int
elements
;
/* Number of elements */
int
elements
;
/* Number of elements */
int
tags_impl_skip
=
0
;
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
int
ext_start
=
-
1
;
int
ext_start
=
-
1
;
int
ext_stop
=
-
1
;
int
ext_stop
=
-
1
;
...
@@ -215,7 +214,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
...
@@ -215,7 +214,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
/*
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_tags[] vector.
*/
*/
tags_count
=
emit_tags_vector
(
arg
,
expr
,
&
tags_impl_skip
,
0
);
tags_count
=
emit_tags_vector
(
arg
,
expr
);
/*
/*
* Tags to elements map.
* Tags to elements map.
...
@@ -239,7 +238,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
...
@@ -239,7 +238,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
/*
/*
* Emit asn1_DEF_xxx table.
* Emit asn1_DEF_xxx table.
*/
*/
emit_type_DEF
(
arg
,
expr
,
tags_count
,
tags_impl_skip
,
elements
,
emit_type_DEF
(
arg
,
expr
,
tags_count
,
elements
,
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
REDIR
(
OT_TYPE_DECLS
);
REDIR
(
OT_TYPE_DECLS
);
...
@@ -319,7 +318,6 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
...
@@ -319,7 +318,6 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
v
;
asn1p_expr_t
*
v
;
int
elements
;
int
elements
;
int
tags_impl_skip
=
0
;
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
tag2el_t
*
tag2el
=
NULL
;
tag2el_t
*
tag2el
=
NULL
;
int
tag2el_count
=
0
;
int
tag2el_count
=
0
;
...
@@ -363,7 +361,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
...
@@ -363,7 +361,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
/*
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_tags[] vector.
*/
*/
tags_count
=
emit_tags_vector
(
arg
,
expr
,
&
tags_impl_skip
,
0
);
tags_count
=
emit_tags_vector
(
arg
,
expr
);
/*
/*
* Tags to elements map.
* Tags to elements map.
...
@@ -419,7 +417,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
...
@@ -419,7 +417,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
/*
/*
* Emit asn1_DEF_xxx table.
* Emit asn1_DEF_xxx table.
*/
*/
emit_type_DEF
(
arg
,
expr
,
tags_count
,
tags_impl_skip
,
elements
,
emit_type_DEF
(
arg
,
expr
,
tags_count
,
elements
,
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
REDIR
(
OT_TYPE_DECLS
);
REDIR
(
OT_TYPE_DECLS
);
...
@@ -484,7 +482,6 @@ static int
...
@@ -484,7 +482,6 @@ static int
asn1c_lang_C_type_SEx_OF_def
(
arg_t
*
arg
,
int
seq_of
)
{
asn1c_lang_C_type_SEx_OF_def
(
arg_t
*
arg
,
int
seq_of
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
v
;
asn1p_expr_t
*
v
;
int
tags_impl_skip
=
0
;
int
tags_count
;
int
tags_count
;
char
*
p
;
char
*
p
;
...
@@ -516,7 +513,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
...
@@ -516,7 +513,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
/*
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_tags[] vector.
*/
*/
tags_count
=
emit_tags_vector
(
arg
,
expr
,
&
tags_impl_skip
,
0
);
tags_count
=
emit_tags_vector
(
arg
,
expr
);
p
=
MKID
(
expr
->
Identifier
);
p
=
MKID
(
expr
->
Identifier
);
OUT
(
"static asn1_SET_OF_specifics_t asn1_DEF_%s_specs = {
\n
"
,
p
);
OUT
(
"static asn1_SET_OF_specifics_t asn1_DEF_%s_specs = {
\n
"
,
p
);
...
@@ -529,7 +526,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
...
@@ -529,7 +526,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
/*
/*
* Emit asn1_DEF_xxx table.
* Emit asn1_DEF_xxx table.
*/
*/
emit_type_DEF
(
arg
,
expr
,
tags_count
,
tags_impl_skip
,
1
,
emit_type_DEF
(
arg
,
expr
,
tags_count
,
1
,
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
ETD_CP_CONSTRUCTED
,
ETD_HAS_SPECIFICS
);
REDIR
(
OT_TYPE_DECLS
);
REDIR
(
OT_TYPE_DECLS
);
...
@@ -599,7 +596,6 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
...
@@ -599,7 +596,6 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
v
;
asn1p_expr_t
*
v
;
int
elements
;
/* Number of elements */
int
elements
;
/* Number of elements */
int
tags_impl_skip
=
0
;
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
int
comp_mode
=
0
;
/* {root,ext=1,root,root,...} */
tag2el_t
*
tag2el
=
NULL
;
tag2el_t
*
tag2el
=
NULL
;
int
tag2el_count
=
0
;
int
tag2el_count
=
0
;
...
@@ -647,7 +643,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
...
@@ -647,7 +643,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
*/
*/
tags_count
=
0
;
tags_count
=
0
;
}
else
{
}
else
{
tags_count
=
emit_tags_vector
(
arg
,
expr
,
&
tags_impl_skip
,
1
);
tags_count
=
emit_tags_vector
(
arg
,
expr
);
}
}
/*
/*
...
@@ -672,7 +668,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
...
@@ -672,7 +668,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
/*
/*
* Emit asn1_DEF_xxx table.
* Emit asn1_DEF_xxx table.
*/
*/
emit_type_DEF
(
arg
,
expr
,
tags_count
,
tags_impl_skip
,
elements
,
emit_type_DEF
(
arg
,
expr
,
tags_count
,
elements
,
ETD_CP_CONSTRUCTED
/*either?!*/
,
ETD_HAS_SPECIFICS
);
ETD_CP_CONSTRUCTED
/*either?!*/
,
ETD_HAS_SPECIFICS
);
REDIR
(
OT_TYPE_DECLS
);
REDIR
(
OT_TYPE_DECLS
);
...
@@ -727,7 +723,6 @@ asn1c_lang_C_type_REFERENCE(arg_t *arg) {
...
@@ -727,7 +723,6 @@ asn1c_lang_C_type_REFERENCE(arg_t *arg) {
int
int
asn1c_lang_C_type_SIMPLE_TYPE
(
arg_t
*
arg
)
{
asn1c_lang_C_type_SIMPLE_TYPE
(
arg_t
*
arg
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
expr
=
arg
->
expr
;
int
tags_impl_skip
=
0
;
int
tags_count
;
int
tags_count
;
char
*
p
;
char
*
p
;
...
@@ -761,9 +756,9 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
...
@@ -761,9 +756,9 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
/*
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_tags[] vector.
*/
*/
tags_count
=
emit_tags_vector
(
arg
,
expr
,
&
tags_impl_skip
,
0
);
tags_count
=
emit_tags_vector
(
arg
,
expr
);
emit_type_DEF
(
arg
,
expr
,
tags_count
,
tags_impl_skip
,
0
,
emit_type_DEF
(
arg
,
expr
,
tags_count
,
0
,
ETD_CP_UNKNOWN
,
ETD_NO_SPECIFICS
);
ETD_CP_UNKNOWN
,
ETD_NO_SPECIFICS
);
REDIR
(
OT_CODE
);
REDIR
(
OT_CODE
);
...
@@ -814,11 +809,18 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
...
@@ -814,11 +809,18 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT
(
"%s_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
\n
"
,
p
);
OUT
(
"%s_inherit_TYPE_descriptor(asn1_TYPE_descriptor_t *td) {
\n
"
,
p
);
INDENT
(
+
1
);
INDENT
(
+
1
);
{
{
asn1p_expr_t
*
terminal
=
asn1f_find_terminal_type_ex
(
arg
->
asn
,
arg
->
mod
,
expr
);
char
*
type_name
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
char
*
type_name
=
asn1c_type_name
(
arg
,
expr
,
TNF_SAFE
);
OUT
(
"td->ber_decoder = asn1_DEF_%s.ber_decoder;
\n
"
,
type_name
);
OUT
(
"td->ber_decoder = asn1_DEF_%s.ber_decoder;
\n
"
,
type_name
);
OUT
(
"td->der_encoder = asn1_DEF_%s.der_encoder;
\n
"
,
type_name
);
OUT
(
"td->der_encoder = asn1_DEF_%s.der_encoder;
\n
"
,
type_name
);
OUT
(
"td->free_struct = asn1_DEF_%s.free_struct;
\n
"
,
type_name
);
OUT
(
"td->free_struct = asn1_DEF_%s.free_struct;
\n
"
,
type_name
);
OUT
(
"td->print_struct = asn1_DEF_%s.print_struct;
\n
"
,
type_name
);
OUT
(
"td->print_struct = asn1_DEF_%s.print_struct;
\n
"
,
type_name
);
if
(
!
terminal
&&
!
tags_count
)
{
OUT
(
"/* The next two lines are because of -fknown-extern-type */
\n
"
);
OUT
(
"td->tags = asn1_DEF_%s.tags;
\n
"
,
type_name
);
OUT
(
"td->tags_count = asn1_DEF_%s.tags_count;
\n
"
,
type_name
);
OUT
(
"/* End of these lines */
\n
"
);
}
OUT
(
"td->last_tag_form = asn1_DEF_%s.last_tag_form;
\n
"
,
type_name
);
OUT
(
"td->last_tag_form = asn1_DEF_%s.last_tag_form;
\n
"
,
type_name
);
OUT
(
"td->elements = asn1_DEF_%s.elements;
\n
"
,
type_name
);
OUT
(
"td->elements = asn1_DEF_%s.elements;
\n
"
,
type_name
);
OUT
(
"td->elements_count = asn1_DEF_%s.elements_count;
\n
"
,
type_name
);
OUT
(
"td->elements_count = asn1_DEF_%s.elements_count;
\n
"
,
type_name
);
...
@@ -834,8 +836,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
...
@@ -834,8 +836,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
INDENTED
(
INDENTED
(
OUT
(
"
\t
void **structure, void *bufptr, size_t size, int tag_mode) {
\n
"
);
OUT
(
"
\t
void **structure, void *bufptr, size_t size, int tag_mode) {
\n
"
);
OUT
(
"%s_inherit_TYPE_descriptor(td);
\n
"
,
p
);
OUT
(
"%s_inherit_TYPE_descriptor(td);
\n
"
,
p
);
OUT
(
"return td->ber_decoder(td, structure,
\n
"
);
OUT
(
"return td->ber_decoder(td, structure, bufptr, size, tag_mode);
\n
"
);
OUT
(
"
\t
bufptr, size, tag_mode);
\n
"
);
);
);
OUT
(
"}
\n
"
);
OUT
(
"}
\n
"
);
OUT
(
"
\n
"
);
OUT
(
"
\n
"
);
...
@@ -1122,56 +1123,31 @@ emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count) {
...
@@ -1122,56 +1123,31 @@ emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count) {
}
}
static
int
static
int
emit_tags_vector
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
*
tags_impl_skip
,
int
choice_mode
)
{
emit_tags_vector
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
struct
asn1p_type_tag_s
*
tags
=
0
;
int
tags_count
=
0
;
int
tags_count
=
0
;
int
save_target
=
arg
->
target
->
target
;
int
i
;
char
*
p
;
if
(
save_target
!=
OT_IGNORE
)
{
/* Fetch a chain of tags */
int
save_impl_skip
=
*
tags_impl_skip
;
tags_count
=
asn1f_fetch_tags
(
arg
->
asn
,
arg
->
mod
,
expr
,
&
tags
,
0
);
REDIR
(
OT_IGNORE
);
if
(
tags_count
<=
0
)
tags_count
=
emit_tags_vector
(
arg
,
expr
,
tags_impl_skip
,
choice_mode
);
REDIR
(
save_target
);
if
(
tags_count
)
{
*
tags_impl_skip
=
save_impl_skip
;
tags_count
=
0
;
}
else
{
return
0
;
return
0
;
}
}
p
=
MKID
(
expr
->
Identifier
);
OUT
(
"static ber_tlv_tag_t asn1_DEF_%s_tags[] = {
\n
"
,
OUT
(
"static ber_tlv_tag_t asn1_DEF_%s_tags[] = {
\n
"
,
p
);
MKID
(
expr
->
Identifier
)
);
INDENT
(
+
1
);
INDENT
(
+
1
);
if
(
expr
->
tag
.
tag_class
)
{
tags_count
++
;
/* Print the array of collected tags */
_print_tag
(
arg
,
&
expr
->
tag
);
for
(
i
=
0
;
i
<
tags_count
;
i
++
)
{
if
(
expr
->
tag
.
tag_mode
!=
TM_EXPLICIT
)
if
(
i
)
OUT
(
",
\n
"
);
(
*
tags_impl_skip
)
++
;
_print_tag
(
arg
,
&
tags
[
i
]);
}
else
{
if
(
!
choice_mode
)
(
*
tags_impl_skip
)
++
;
}
if
(
!
choice_mode
)
{
if
(
!
expr
->
tag
.
tag_class
||
(
expr
->
meta_type
==
AMT_TYPE
&&
expr
->
tag
.
tag_mode
==
TM_EXPLICIT
))
{
struct
asn1p_type_tag_s
tag
;
if
(
expr
->
tag
.
tag_class
)
OUT
(
",
\n
"
);
tag
.
tag_class
=
TC_UNIVERSAL
;
tag
.
tag_mode
=
TM_IMPLICIT
;
tag
.
tag_value
=
expr_type2uclass_value
[
expr
->
expr_type
];
_print_tag
(
arg
,
&
tag
);
tags_count
++
;
}
}
}
OUT
(
"
\n
"
);
OUT
(
"
\n
"
);
INDENT
(
-
1
);
INDENT
(
-
1
);
OUT
(
"};
\n
"
);
OUT
(
"};
\n
"
);
free
(
tags
);
return
tags_count
;
return
tags_count
;
}
}
...
@@ -1317,7 +1293,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
...
@@ -1317,7 +1293,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
}
static
int
static
int
emit_type_DEF
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
tags_count
,
int
tags_impl_skip
,
int
elements_count
,
enum
etd_cp
cp
,
enum
etd_spec
spec
)
{
emit_type_DEF
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
,
int
tags_count
,
int
elements_count
,
enum
etd_cp
cp
,
enum
etd_spec
spec
)
{
char
*
p
;
char
*
p
;
p
=
MKID
(
expr
->
Identifier
);
p
=
MKID
(
expr
->
Identifier
);
...
@@ -1355,7 +1331,6 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int tags_impl_skip
...
@@ -1355,7 +1331,6 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int tags_impl_skip
OUT
(
"0,
\t
/* No explicit tags (count) */
\n
"
);
OUT
(
"0,
\t
/* No explicit tags (count) */
\n
"
);
}
}
OUT
(
"%d,
\t
/* Tags to skip */
\n
"
,
tags_impl_skip
);
switch
(
cp
)
{
switch
(
cp
)
{
case
ETD_CP_UNKNOWN
:
case
ETD_CP_UNKNOWN
:
OUT
(
"-0,
\t
/* Unknown yet */
\n
"
);
OUT
(
"-0,
\t
/* Unknown yet */
\n
"
);
...
...
libasn1fix/asn1fix_internal.h
View file @
906654e1
...
@@ -89,7 +89,7 @@ typedef struct arg_s {
...
@@ -89,7 +89,7 @@ typedef struct arg_s {
if(code < 0) { \
if(code < 0) { \
if(arg->debug) \
if(arg->debug) \
arg->debug(code, fmt, ##args); \
arg->debug(code, fmt, ##args); \
} else
{
\
} else
if(arg->eh) {
\
arg->eh(code, fmt " in %s", ##args, \
arg->eh(code, fmt " in %s", ##args, \
arg->mod->source_file_name); \
arg->mod->source_file_name); \
} \
} \
...
...
libasn1fix/asn1fix_tags.c
View file @
906654e1
...
@@ -2,14 +2,20 @@
...
@@ -2,14 +2,20 @@
#define ADD_TAG(skip, newtag) do { \
#define ADD_TAG(skip, newtag) do { \
void *__p; \
void *__p; \
if(skip) { skip--; break; } \
if(skip) { \
if(newtag.tag_mode != TM_IMPLICIT) \
skip--; \
break; \
} else { \
if(newtag.tag_mode == TM_IMPLICIT) \
skip++; \
} \
__p = realloc((*tags), \
__p = realloc((*tags), \
sizeof(struct asn1p_type_tag_s) * (count + 1)); \
sizeof(struct asn1p_type_tag_s) * (count + 1)); \
if(!__p) return -1; \
if(!__p) return -1; \
*tags = __p; \
*tags = __p; \
(*tags)[count++] = newtag; \
(*tags)[count++] = newtag; \
if((flags & AFT_FETCH_OUTMOST)) return count; \
if((flags & AFT_FETCH_OUTMOST)) return count; \
if(newtag.tag_mode == TM_IMPLICIT) skip++; \
} while(0)
} while(0)
static
int
static
int
...
@@ -46,11 +52,33 @@ asn1f_fetch_tags_impl(arg_t *arg, struct asn1p_type_tag_s **tags, int count, int
...
@@ -46,11 +52,33 @@ asn1f_fetch_tags_impl(arg_t *arg, struct asn1p_type_tag_s **tags, int count, int
}
}
if
(
expr
->
meta_type
==
AMT_TYPEREF
)
{
if
(
expr
->
meta_type
==
AMT_TYPEREF
)
{
expr
=
asn1f_lookup_symbol
(
arg
,
expr
->
module
,
expr
->
reference
);
asn1p_expr_t
*
nexpr
;
if
(
expr
==
NULL
)
return
-
1
;
nexpr
=
asn1f_lookup_symbol
(
arg
,
expr
->
module
,
expr
->
reference
);
if
(
nexpr
==
NULL
)
{
if
(
errno
!=
EEXIST
)
/* -fknown-extern-type */
return
-
1
;
if
(
!
count
)
return
0
;
/* OK */
if
((
*
tags
)[
count
-
1
].
tag_mode
==
TM_IMPLICIT
)
{
WARNING
(
"Tagging mode for %s "
"is IMPLICIT, assuming %s "
"has exactly one tag"
,
expr
->
Identifier
,
asn1f_printable_reference
(
expr
->
reference
)
);
return
count
;
}
FATAL
(
"Tagging mode %s -> %s "
"dangerously incompatible"
,
expr
->
Identifier
,
asn1f_printable_reference
(
expr
->
reference
)
);
return
-
1
;
}
else
{
arg
->
expr
=
nexpr
;
}
if
(
expr
->
_mark
&
TM_RECURSION
)
if
(
expr
->
_mark
&
TM_RECURSION
)
return
-
1
;
return
-
1
;
arg
->
expr
=
expr
;
expr
->
_mark
|=
TM_RECURSION
;
expr
->
_mark
|=
TM_RECURSION
;
count
=
asn1f_fetch_tags_impl
(
arg
,
tags
,
count
,
skip
,
flags
);
count
=
asn1f_fetch_tags_impl
(
arg
,
tags
,
count
,
skip
,
flags
);
expr
->
_mark
&=
~
TM_RECURSION
;
expr
->
_mark
&=
~
TM_RECURSION
;
...
...
libasn1fix/asn1fix_tags.h
View file @
906654e1
...
@@ -6,7 +6,6 @@ enum asn1f_aft_flags_e {
...
@@ -6,7 +6,6 @@ enum asn1f_aft_flags_e {
AFT_FETCH_OUTMOST
=
0x02
,
/* Fetch only outmost tag */
AFT_FETCH_OUTMOST
=
0x02
,
/* Fetch only outmost tag */
};
};
/*
/*
* Allocate and return an array of tags for the given type.
* Allocate and return an array of tags for the given type.
* Type1 ::= [2] EXPLICIT Type2
* Type1 ::= [2] EXPLICIT Type2
...
...
skeletons/ANY.c
View file @
906654e1
...
@@ -15,7 +15,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ANY = {
...
@@ -15,7 +15,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ANY = {
OCTET_STRING_free
,
OCTET_STRING_free
,
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
0
,
0
,
0
,
0
,
/* No tags may be overridden */
0
,
/* No tags may be overridden */
-
1
,
/* Both ways are fine (primitive and constructed) */
-
1
,
/* Both ways are fine (primitive and constructed) */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
...
...
skeletons/BIT_STRING.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BIT_STRING = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BIT_STRING = {
asn1_DEF_BIT_STRING_tags
,
asn1_DEF_BIT_STRING_tags
,
sizeof
(
asn1_DEF_BIT_STRING_tags
)
sizeof
(
asn1_DEF_BIT_STRING_tags
)
/
sizeof
(
asn1_DEF_BIT_STRING_tags
[
0
]),
/
sizeof
(
asn1_DEF_BIT_STRING_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
(
void
*
)
-
1
/* Special indicator that this is a BIT STRING */
(
void
*
)
-
1
/* Special indicator that this is a BIT STRING */
...
...
skeletons/BMPString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BMPString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BMPString = {
asn1_DEF_BMPString_tags
,
asn1_DEF_BMPString_tags
,
sizeof
(
asn1_DEF_BMPString_tags
)
sizeof
(
asn1_DEF_BMPString_tags
)
/
sizeof
(
asn1_DEF_BMPString_tags
[
0
]),
/
sizeof
(
asn1_DEF_BMPString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/BOOLEAN.c
View file @
906654e1
...
@@ -20,7 +20,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BOOLEAN = {
...
@@ -20,7 +20,6 @@ asn1_TYPE_descriptor_t asn1_DEF_BOOLEAN = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_BOOLEAN_tags
,
asn1_DEF_BOOLEAN_tags
,
sizeof
(
asn1_DEF_BOOLEAN_tags
)
/
sizeof
(
asn1_DEF_BOOLEAN_tags
[
0
]),
sizeof
(
asn1_DEF_BOOLEAN_tags
)
/
sizeof
(
asn1_DEF_BOOLEAN_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/ENUMERATED.c
View file @
906654e1
...
@@ -20,7 +20,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ENUMERATED = {
...
@@ -20,7 +20,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ENUMERATED = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_ENUMERATED_tags
,
asn1_DEF_ENUMERATED_tags
,
sizeof
(
asn1_DEF_ENUMERATED_tags
)
/
sizeof
(
asn1_DEF_ENUMERATED_tags
[
0
]),
sizeof
(
asn1_DEF_ENUMERATED_tags
)
/
sizeof
(
asn1_DEF_ENUMERATED_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Primitive */
0
,
/* Primitive */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/GeneralString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralString = {
asn1_DEF_GeneralString_tags
,
asn1_DEF_GeneralString_tags
,
sizeof
(
asn1_DEF_GeneralString_tags
)
sizeof
(
asn1_DEF_GeneralString_tags
)
/
sizeof
(
asn1_DEF_GeneralString_tags
[
0
]),
/
sizeof
(
asn1_DEF_GeneralString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/GeneralizedTime.c
View file @
906654e1
...
@@ -85,7 +85,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralizedTime = {
...
@@ -85,7 +85,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralizedTime = {
asn1_DEF_GeneralizedTime_tags
,
asn1_DEF_GeneralizedTime_tags
,
sizeof
(
asn1_DEF_GeneralizedTime_tags
)
sizeof
(
asn1_DEF_GeneralizedTime_tags
)
/
sizeof
(
asn1_DEF_GeneralizedTime_tags
[
0
]),
/
sizeof
(
asn1_DEF_GeneralizedTime_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/GraphicString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GraphicString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_GraphicString = {
asn1_DEF_GraphicString_tags
,
asn1_DEF_GraphicString_tags
,
sizeof
(
asn1_DEF_GraphicString_tags
)
sizeof
(
asn1_DEF_GraphicString_tags
)
/
sizeof
(
asn1_DEF_GraphicString_tags
[
0
]),
/
sizeof
(
asn1_DEF_GraphicString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/IA5String.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_IA5String = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_IA5String = {
asn1_DEF_IA5String_tags
,
asn1_DEF_IA5String_tags
,
sizeof
(
asn1_DEF_IA5String_tags
)
sizeof
(
asn1_DEF_IA5String_tags
)
/
sizeof
(
asn1_DEF_IA5String_tags
[
0
]),
/
sizeof
(
asn1_DEF_IA5String_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/INTEGER.c
View file @
906654e1
...
@@ -22,7 +22,6 @@ asn1_TYPE_descriptor_t asn1_DEF_INTEGER = {
...
@@ -22,7 +22,6 @@ asn1_TYPE_descriptor_t asn1_DEF_INTEGER = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_INTEGER_tags
,
asn1_DEF_INTEGER_tags
,
sizeof
(
asn1_DEF_INTEGER_tags
)
/
sizeof
(
asn1_DEF_INTEGER_tags
[
0
]),
sizeof
(
asn1_DEF_INTEGER_tags
)
/
sizeof
(
asn1_DEF_INTEGER_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/ISO646String.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ISO646String = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ISO646String = {
asn1_DEF_ISO646String_tags
,
asn1_DEF_ISO646String_tags
,
sizeof
(
asn1_DEF_ISO646String_tags
)
sizeof
(
asn1_DEF_ISO646String_tags
)
/
sizeof
(
asn1_DEF_ISO646String_tags
[
0
]),
/
sizeof
(
asn1_DEF_ISO646String_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/NULL.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NULL = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NULL = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_NULL_tags
,
asn1_DEF_NULL_tags
,
sizeof
(
asn1_DEF_NULL_tags
)
/
sizeof
(
asn1_DEF_NULL_tags
[
0
]),
sizeof
(
asn1_DEF_NULL_tags
)
/
sizeof
(
asn1_DEF_NULL_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/NativeEnumerated.c
View file @
906654e1
...
@@ -27,7 +27,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeEnumerated = {
...
@@ -27,7 +27,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeEnumerated = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_NativeEnumerated_tags
,
asn1_DEF_NativeEnumerated_tags
,
sizeof
(
asn1_DEF_NativeEnumerated_tags
)
/
sizeof
(
asn1_DEF_NativeEnumerated_tags
[
0
]),
sizeof
(
asn1_DEF_NativeEnumerated_tags
)
/
sizeof
(
asn1_DEF_NativeEnumerated_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/NativeInteger.c
View file @
906654e1
...
@@ -29,7 +29,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeInteger = {
...
@@ -29,7 +29,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeInteger = {
0
,
/* Use generic outmost tag fetcher */
0
,
/* Use generic outmost tag fetcher */
asn1_DEF_NativeInteger_tags
,
asn1_DEF_NativeInteger_tags
,
sizeof
(
asn1_DEF_NativeInteger_tags
)
/
sizeof
(
asn1_DEF_NativeInteger_tags
[
0
]),
sizeof
(
asn1_DEF_NativeInteger_tags
)
/
sizeof
(
asn1_DEF_NativeInteger_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/NumericString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NumericString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_NumericString = {
asn1_DEF_NumericString_tags
,
asn1_DEF_NumericString_tags
,
sizeof
(
asn1_DEF_NumericString_tags
)
sizeof
(
asn1_DEF_NumericString_tags
)
/
sizeof
(
asn1_DEF_NumericString_tags
[
0
]),
/
sizeof
(
asn1_DEF_NumericString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/OBJECT_IDENTIFIER.c
View file @
906654e1
...
@@ -24,7 +24,6 @@ asn1_TYPE_descriptor_t asn1_DEF_OBJECT_IDENTIFIER = {
...
@@ -24,7 +24,6 @@ asn1_TYPE_descriptor_t asn1_DEF_OBJECT_IDENTIFIER = {
asn1_DEF_OBJECT_IDENTIFIER_tags
,
asn1_DEF_OBJECT_IDENTIFIER_tags
,
sizeof
(
asn1_DEF_OBJECT_IDENTIFIER_tags
)
sizeof
(
asn1_DEF_OBJECT_IDENTIFIER_tags
)
/
sizeof
(
asn1_DEF_OBJECT_IDENTIFIER_tags
[
0
]),
/
sizeof
(
asn1_DEF_OBJECT_IDENTIFIER_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/OCTET_STRING.c
View file @
906654e1
...
@@ -23,7 +23,6 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
...
@@ -23,7 +23,6 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
asn1_DEF_OCTET_STRING_tags
,
asn1_DEF_OCTET_STRING_tags
,
sizeof
(
asn1_DEF_OCTET_STRING_tags
)
sizeof
(
asn1_DEF_OCTET_STRING_tags
)
/
sizeof
(
asn1_DEF_OCTET_STRING_tags
[
0
]),
/
sizeof
(
asn1_DEF_OCTET_STRING_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine (primitive and constructed) */
-
1
,
/* Both ways are fine (primitive and constructed) */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/ObjectDescriptor.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor = {
asn1_DEF_ObjectDescriptor_tags
,
asn1_DEF_ObjectDescriptor_tags
,
sizeof
(
asn1_DEF_ObjectDescriptor_tags
)
sizeof
(
asn1_DEF_ObjectDescriptor_tags
)
/
sizeof
(
asn1_DEF_ObjectDescriptor_tags
[
0
]),
/
sizeof
(
asn1_DEF_ObjectDescriptor_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/PrintableString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_PrintableString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_PrintableString = {
asn1_DEF_PrintableString_tags
,
asn1_DEF_PrintableString_tags
,
sizeof
(
asn1_DEF_PrintableString_tags
)
sizeof
(
asn1_DEF_PrintableString_tags
)
/
sizeof
(
asn1_DEF_PrintableString_tags
[
0
]),
/
sizeof
(
asn1_DEF_PrintableString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/RELATIVE-OID.c
View file @
906654e1
...
@@ -24,7 +24,6 @@ asn1_TYPE_descriptor_t asn1_DEF_RELATIVE_OID = {
...
@@ -24,7 +24,6 @@ asn1_TYPE_descriptor_t asn1_DEF_RELATIVE_OID = {
asn1_DEF_RELATIVE_OID_tags
,
asn1_DEF_RELATIVE_OID_tags
,
sizeof
(
asn1_DEF_RELATIVE_OID_tags
)
sizeof
(
asn1_DEF_RELATIVE_OID_tags
)
/
sizeof
(
asn1_DEF_RELATIVE_OID_tags
[
0
]),
/
sizeof
(
asn1_DEF_RELATIVE_OID_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
0
,
/* Always in primitive form */
0
,
/* Always in primitive form */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/T61String.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T61String = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T61String = {
asn1_DEF_T61String_tags
,
asn1_DEF_T61String_tags
,
sizeof
(
asn1_DEF_T61String_tags
)
sizeof
(
asn1_DEF_T61String_tags
)
/
sizeof
(
asn1_DEF_T61String_tags
[
0
]),
/
sizeof
(
asn1_DEF_T61String_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/TeletexString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_TeletexString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_TeletexString = {
asn1_DEF_TeletexString_tags
,
asn1_DEF_TeletexString_tags
,
sizeof
(
asn1_DEF_TeletexString_tags
)
sizeof
(
asn1_DEF_TeletexString_tags
)
/
sizeof
(
asn1_DEF_TeletexString_tags
[
0
]),
/
sizeof
(
asn1_DEF_TeletexString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/UTCTime.c
View file @
906654e1
...
@@ -27,7 +27,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UTCTime = {
...
@@ -27,7 +27,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UTCTime = {
asn1_DEF_UTCTime_tags
,
asn1_DEF_UTCTime_tags
,
sizeof
(
asn1_DEF_UTCTime_tags
)
sizeof
(
asn1_DEF_UTCTime_tags
)
/
sizeof
(
asn1_DEF_UTCTime_tags
[
0
]),
/
sizeof
(
asn1_DEF_UTCTime_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/UTF8String.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UTF8String = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UTF8String = {
asn1_DEF_UTF8String_tags
,
asn1_DEF_UTF8String_tags
,
sizeof
(
asn1_DEF_UTF8String_tags
)
sizeof
(
asn1_DEF_UTF8String_tags
)
/
sizeof
(
asn1_DEF_UTF8String_tags
[
0
]),
/
sizeof
(
asn1_DEF_UTF8String_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/UniversalString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UniversalString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_UniversalString = {
asn1_DEF_UniversalString_tags
,
asn1_DEF_UniversalString_tags
,
sizeof
(
asn1_DEF_UniversalString_tags
)
sizeof
(
asn1_DEF_UniversalString_tags
)
/
sizeof
(
asn1_DEF_UniversalString_tags
[
0
]),
/
sizeof
(
asn1_DEF_UniversalString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/VideotexString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VideotexString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VideotexString = {
asn1_DEF_VideotexString_tags
,
asn1_DEF_VideotexString_tags
,
sizeof
(
asn1_DEF_VideotexString_tags
)
sizeof
(
asn1_DEF_VideotexString_tags
)
/
sizeof
(
asn1_DEF_VideotexString_tags
[
0
]),
/
sizeof
(
asn1_DEF_VideotexString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/VisibleString.c
View file @
906654e1
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VisibleString = {
...
@@ -21,7 +21,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VisibleString = {
asn1_DEF_VisibleString_tags
,
asn1_DEF_VisibleString_tags
,
sizeof
(
asn1_DEF_VisibleString_tags
)
sizeof
(
asn1_DEF_VisibleString_tags
)
/
sizeof
(
asn1_DEF_VisibleString_tags
[
0
]),
/
sizeof
(
asn1_DEF_VisibleString_tags
[
0
]),
1
,
/* Single UNIVERSAL tag may be implicitly overriden */
-
1
,
/* Both ways are fine */
-
1
,
/* Both ways are fine */
0
,
0
,
/* No members */
0
,
0
,
/* No members */
0
/* No specifics */
0
/* No specifics */
...
...
skeletons/ber_decoder.c
View file @
906654e1
...
@@ -53,7 +53,7 @@ ber_check_tags(asn1_TYPE_descriptor_t *td, ber_dec_ctx_t *ctx,
...
@@ -53,7 +53,7 @@ ber_check_tags(asn1_TYPE_descriptor_t *td, ber_dec_ctx_t *ctx,
int
tagno
;
int
tagno
;
/*
/*
* So what does all this
tags_impl_
skip stuff mean?
* So what does all this
implicit
skip stuff mean?
* Imagine two types,
* Imagine two types,
* A ::= [5] IMPLICIT T
* A ::= [5] IMPLICIT T
* B ::= [2] EXPLICIT T
* B ::= [2] EXPLICIT T
...
@@ -74,30 +74,14 @@ ber_check_tags(asn1_TYPE_descriptor_t *td, ber_dec_ctx_t *ctx,
...
@@ -74,30 +74,14 @@ ber_check_tags(asn1_TYPE_descriptor_t *td, ber_dec_ctx_t *ctx,
* it appropriately.
* it appropriately.
*/
*/
/*
* We have a list of tags that must occur in the stream:
* {A,B,C}
* However, it may be indicated that the type is
* implicitly tagged in the caller, so it really boils down to the
* {I,B,C} or even {I,C}
* This is because the implicit tag at above structure may replace
* zero or more (or every) tags which follow it. We don't care
* about the precise number, as it is already computed for us
* by the ASN.1 compiler and placed into td->tags_impl_skip.
* So let's suppose the only tag left after implicit tagging is {I}.
* Yet, the table we have is {A,B,C} and td->tags_impl_skip=3.
* We need to check at least one tag in the loop, so the loop range
* is modified so it will be invoked at least one time.
*/
tagno
=
ctx
->
step
/* Continuing where left previously */
tagno
=
ctx
->
step
/* Continuing where left previously */
+
(
tag_mode
==-
1
?
(
td
->
tags_impl_skip
-
1
)
:
0
)
+
(
tag_mode
==
1
?-
1
:
0
)
+
(
tag_mode
==
1
?-
1
:
0
)
;
;
ASN_DEBUG
(
"ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)"
,
ASN_DEBUG
(
"ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)"
,
td
->
name
,
(
long
)
size
,
tag_mode
,
ctx
->
step
,
tagno
);
td
->
name
,
(
long
)
size
,
tag_mode
,
ctx
->
step
,
tagno
);
//assert(td->tags_count >= 1); ?May not be the case for CHOICE or ANY.
//assert(td->tags_count >= 1); ?May not be the case for CHOICE or ANY.
if
(
tagno
==
td
->
tags_count
)
{
if
(
tag
_mode
==
0
&&
tag
no
==
td
->
tags_count
)
{
/*
/*
* This must be the _untagged_ ANY type,
* This must be the _untagged_ ANY type,
* which outermost tag isn't known in advance.
* which outermost tag isn't known in advance.
...
...
skeletons/constr_SEQUENCE.c
View file @
906654e1
...
@@ -226,8 +226,10 @@ SEQUENCE_decode_ber(asn1_TYPE_descriptor_t *td,
...
@@ -226,8 +226,10 @@ SEQUENCE_decode_ber(asn1_TYPE_descriptor_t *td,
* Fetch the T from TLV.
* Fetch the T from TLV.
*/
*/
tag_len
=
ber_fetch_tag
(
ptr
,
LEFT
,
&
tlv_tag
);
tag_len
=
ber_fetch_tag
(
ptr
,
LEFT
,
&
tlv_tag
);
ASN_DEBUG
(
"In %s SEQUENCE for %d %s next tag length %d"
,
ASN_DEBUG
(
"Current tag in %s SEQUENCE for element %d "
td
->
name
,
edx
,
elements
[
edx
].
name
,
(
int
)
tag_len
);
"(%s) is %s encoded in %d bytes, left %ld"
,
td
->
name
,
edx
,
elements
[
edx
].
name
,
ber_tlv_tag_string
(
tlv_tag
),
(
int
)
tag_len
,
(
long
)
LEFT
);
switch
(
tag_len
)
{
switch
(
tag_len
)
{
case
0
:
if
(
!
SIZE_VIOLATION
)
RETURN
(
RC_WMORE
);
case
0
:
if
(
!
SIZE_VIOLATION
)
RETURN
(
RC_WMORE
);
/* Fall through */
/* Fall through */
...
...
skeletons/constr_SET.c
View file @
906654e1
...
@@ -654,7 +654,6 @@ SET_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
...
@@ -654,7 +654,6 @@ SET_free(asn1_TYPE_descriptor_t *td, void *ptr, int contents_only) {
int
int
SET_constraint
(
asn1_TYPE_descriptor_t
*
td
,
const
void
*
sptr
,
SET_constraint
(
asn1_TYPE_descriptor_t
*
td
,
const
void
*
sptr
,
asn_app_consume_bytes_f
*
app_errlog
,
void
*
app_key
)
{
asn_app_consume_bytes_f
*
app_errlog
,
void
*
app_key
)
{
asn1_SET_specifics_t
*
specs
=
(
asn1_SET_specifics_t
*
)
td
->
specifics
;
int
edx
;
int
edx
;
if
(
!
sptr
)
{
if
(
!
sptr
)
{
...
...
skeletons/constr_TYPE.h
View file @
906654e1
...
@@ -74,7 +74,6 @@ typedef struct asn1_TYPE_descriptor_s {
...
@@ -74,7 +74,6 @@ typedef struct asn1_TYPE_descriptor_s {
*/
*/
ber_tlv_tag_t
*
tags
;
/* At least one tag must be specified */
ber_tlv_tag_t
*
tags
;
/* At least one tag must be specified */
int
tags_count
;
/* Number of tags which are expected */
int
tags_count
;
/* Number of tags which are expected */
int
tags_impl_skip
;
/* Tags to skip in implicit mode */
int
last_tag_form
;
/* Acceptable form of the tag (prim, constr) */
int
last_tag_form
;
/* Acceptable form of the tag (prim, constr) */
/*
/*
...
...
skeletons/constraints.c
View file @
906654e1
...
@@ -112,12 +112,13 @@ _asn_i_log_error(asn_app_consume_bytes_f *cb, void *key, const char *fmt, ...) {
...
@@ -112,12 +112,13 @@ _asn_i_log_error(asn_app_consume_bytes_f *cb, void *key, const char *fmt, ...) {
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
ret
=
vsnprintf
(
buf
,
len
,
fmt
,
ap
);
ret
=
vsnprintf
(
p
,
len
,
fmt
,
ap
);
va_end
(
ap
);
va_end
(
ap
);
if
(
ret
<
0
||
ret
>=
(
ssize_t
)
len
)
{
if
(
ret
<
0
||
ret
>=
(
ssize_t
)
len
)
{
ret
=
sizeof
(
"<broken vsnprintf>"
)
-
1
;
ret
=
sizeof
(
"<broken vsnprintf>"
)
-
1
;
memcpy
(
buf
,
"<broken vsnprintf>"
,
ret
+
1
);
memcpy
(
buf
,
"<broken vsnprintf>"
,
ret
+
1
);
p
=
buf
;
}
}
cb
(
buf
,
ret
,
key
);
cb
(
p
,
ret
,
key
);
}
}
skeletons/der_encoder.c
View file @
906654e1
...
@@ -44,12 +44,12 @@ der_write_tags(asn1_TYPE_descriptor_t *sd,
...
@@ -44,12 +44,12 @@ der_write_tags(asn1_TYPE_descriptor_t *sd,
ssize_t
*
lens
;
ssize_t
*
lens
;
int
i
;
int
i
;
ASN_DEBUG
(
"Writing tags (%s, tm=%d, tc=%d,
iskip=%d,
tag=%s, mtc=%d)"
,
ASN_DEBUG
(
"Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)"
,
sd
->
name
,
tag_mode
,
sd
->
tags_count
,
sd
->
tags_impl_skip
,
sd
->
name
,
tag_mode
,
sd
->
tags_count
,
ber_tlv_tag_string
(
tag
),
ber_tlv_tag_string
(
tag
),
tag_mode
tag_mode
?
(
sd
->
tags_count
+
1
?
(
sd
->
tags_count
+
1
-
((
tag_mode
==-
1
)
?
sd
->
tags_impl_skip
:
0
))
-
((
tag_mode
==
-
1
)
&&
sd
->
tags_count
))
:
sd
->
tags_count
:
sd
->
tags_count
);
);
...
@@ -67,10 +67,10 @@ der_write_tags(asn1_TYPE_descriptor_t *sd,
...
@@ -67,10 +67,10 @@ der_write_tags(asn1_TYPE_descriptor_t *sd,
}
}
tags_count
=
sd
->
tags_count
tags_count
=
sd
->
tags_count
+
1
/* EXPLICIT or IMPLICIT tag is given */
+
1
/* EXPLICIT or IMPLICIT tag is given */
-
((
tag_mode
==-
1
)
?
sd
->
tags_impl_skip
:
0
);
-
((
tag_mode
==
-
1
)
&&
sd
->
tags_count
);
/* Copy tags over */
/* Copy tags over */
tags
[
0
]
=
tag
;
tags
[
0
]
=
tag
;
stag_offset
=
-
1
+
((
tag_mode
==-
1
)
?
sd
->
tags_impl_skip
:
0
);
stag_offset
=
-
1
+
((
tag_mode
==
-
1
)
&&
sd
->
tags_count
);
for
(
i
=
1
;
i
<
tags_count
;
i
++
)
for
(
i
=
1
;
i
<
tags_count
;
i
++
)
tags
[
i
]
=
sd
->
tags
[
i
+
stag_offset
];
tags
[
i
]
=
sd
->
tags
[
i
+
stag_offset
];
}
else
{
}
else
{
...
...
tests/19-param-OK.asn1.-P
View file @
906654e1
...
@@ -117,7 +117,6 @@ asn1_TYPE_descriptor_t asn1_DEF_toBeSigned = {
...
@@ -117,7 +117,6 @@ asn1_TYPE_descriptor_t asn1_DEF_toBeSigned = {
asn1_DEF_toBeSigned_tags,
asn1_DEF_toBeSigned_tags,
sizeof(asn1_DEF_toBeSigned_tags)
sizeof(asn1_DEF_toBeSigned_tags)
/sizeof(asn1_DEF_toBeSigned_tags[0]), /* 1 */
/sizeof(asn1_DEF_toBeSigned_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_toBeSigned,
asn1_MBR_toBeSigned,
3, /* Elements count */
3, /* Elements count */
...
@@ -174,7 +173,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Certificate = {
...
@@ -174,7 +173,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Certificate = {
asn1_DEF_Certificate_tags,
asn1_DEF_Certificate_tags,
sizeof(asn1_DEF_Certificate_tags)
sizeof(asn1_DEF_Certificate_tags)
/sizeof(asn1_DEF_Certificate_tags[0]), /* 1 */
/sizeof(asn1_DEF_Certificate_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Certificate,
asn1_MBR_Certificate,
3, /* Elements count */
3, /* Elements count */
...
@@ -231,7 +229,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Name = {
...
@@ -231,7 +229,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Name = {
asn1_DEF_Name_tags,
asn1_DEF_Name_tags,
sizeof(asn1_DEF_Name_tags)
sizeof(asn1_DEF_Name_tags)
/sizeof(asn1_DEF_Name_tags[0]), /* 1 */
/sizeof(asn1_DEF_Name_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Name,
asn1_MBR_Name,
1, /* Single element */
1, /* Single element */
...
@@ -343,7 +340,6 @@ asn1_TYPE_descriptor_t asn1_DEF_RelativeDistinguishedName = {
...
@@ -343,7 +340,6 @@ asn1_TYPE_descriptor_t asn1_DEF_RelativeDistinguishedName = {
asn1_DEF_RelativeDistinguishedName_tags,
asn1_DEF_RelativeDistinguishedName_tags,
sizeof(asn1_DEF_RelativeDistinguishedName_tags)
sizeof(asn1_DEF_RelativeDistinguishedName_tags)
/sizeof(asn1_DEF_RelativeDistinguishedName_tags[0]), /* 1 */
/sizeof(asn1_DEF_RelativeDistinguishedName_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_RelativeDistinguishedName,
asn1_MBR_RelativeDistinguishedName,
1, /* Single element */
1, /* Single element */
...
...
tests/31-set-of-OK.asn1.-P
View file @
906654e1
...
@@ -48,7 +48,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Forest = {
...
@@ -48,7 +48,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Forest = {
asn1_DEF_Forest_tags,
asn1_DEF_Forest_tags,
sizeof(asn1_DEF_Forest_tags)
sizeof(asn1_DEF_Forest_tags)
/sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
/sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Forest,
asn1_MBR_Forest,
1, /* Single element */
1, /* Single element */
...
@@ -120,7 +119,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Tree = {
...
@@ -120,7 +119,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Tree = {
asn1_DEF_Tree_tags,
asn1_DEF_Tree_tags,
sizeof(asn1_DEF_Tree_tags)
sizeof(asn1_DEF_Tree_tags)
/sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
/sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Tree,
asn1_MBR_Tree,
2, /* Elements count */
2, /* Elements count */
...
@@ -213,7 +211,6 @@ asn1_TYPE_descriptor_t asn1_DEF_trees = {
...
@@ -213,7 +211,6 @@ asn1_TYPE_descriptor_t asn1_DEF_trees = {
asn1_DEF_trees_tags,
asn1_DEF_trees_tags,
sizeof(asn1_DEF_trees_tags)
sizeof(asn1_DEF_trees_tags)
/sizeof(asn1_DEF_trees_tags[0]), /* 1 */
/sizeof(asn1_DEF_trees_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_trees,
asn1_MBR_trees,
1, /* Single element */
1, /* Single element */
...
@@ -255,7 +252,6 @@ asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
...
@@ -255,7 +252,6 @@ asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
asn1_DEF_anything_member_tags,
asn1_DEF_anything_member_tags,
sizeof(asn1_DEF_anything_member_tags)
sizeof(asn1_DEF_anything_member_tags)
/sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
/sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_anything_member,
asn1_MBR_anything_member,
1, /* Elements count */
1, /* Elements count */
...
@@ -290,7 +286,6 @@ asn1_TYPE_descriptor_t asn1_DEF_anything = {
...
@@ -290,7 +286,6 @@ asn1_TYPE_descriptor_t asn1_DEF_anything = {
asn1_DEF_anything_tags,
asn1_DEF_anything_tags,
sizeof(asn1_DEF_anything_tags)
sizeof(asn1_DEF_anything_tags)
/sizeof(asn1_DEF_anything_tags[0]), /* 1 */
/sizeof(asn1_DEF_anything_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_anything,
asn1_MBR_anything,
1, /* Single element */
1, /* Single element */
...
@@ -343,7 +338,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
...
@@ -343,7 +338,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
asn1_DEF_Stuff_tags,
asn1_DEF_Stuff_tags,
sizeof(asn1_DEF_Stuff_tags)
sizeof(asn1_DEF_Stuff_tags)
/sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
/sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Stuff,
asn1_MBR_Stuff,
2, /* Elements count */
2, /* Elements count */
...
...
tests/39-sequence-of-OK.asn1.-P
View file @
906654e1
...
@@ -57,7 +57,6 @@ asn1_TYPE_descriptor_t asn1_DEF_collection = {
...
@@ -57,7 +57,6 @@ asn1_TYPE_descriptor_t asn1_DEF_collection = {
asn1_DEF_collection_tags,
asn1_DEF_collection_tags,
sizeof(asn1_DEF_collection_tags)
sizeof(asn1_DEF_collection_tags)
/sizeof(asn1_DEF_collection_tags[0]), /* 1 */
/sizeof(asn1_DEF_collection_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_collection,
asn1_MBR_collection,
1, /* Single element */
1, /* Single element */
...
@@ -106,7 +105,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
...
@@ -106,7 +105,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
asn1_DEF_T_tags,
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T,
asn1_MBR_T,
2, /* Elements count */
2, /* Elements count */
...
@@ -179,7 +177,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
...
@@ -179,7 +177,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
asn1_DEF_T2_tags,
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T2,
asn1_MBR_T2,
2, /* Elements count */
2, /* Elements count */
...
...
tests/42-real-life-OK.asn1.-PR
View file @
906654e1
...
@@ -93,7 +93,6 @@ asn1_TYPE_descriptor_t asn1_DEF_varsets = {
...
@@ -93,7 +93,6 @@ asn1_TYPE_descriptor_t asn1_DEF_varsets = {
asn1_DEF_varsets_tags,
asn1_DEF_varsets_tags,
sizeof(asn1_DEF_varsets_tags)
sizeof(asn1_DEF_varsets_tags)
/sizeof(asn1_DEF_varsets_tags[0]), /* 1 */
/sizeof(asn1_DEF_varsets_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_varsets,
asn1_MBR_varsets,
1, /* Single element */
1, /* Single element */
...
@@ -142,7 +141,6 @@ asn1_TYPE_descriptor_t asn1_DEF_LogLine = {
...
@@ -142,7 +141,6 @@ asn1_TYPE_descriptor_t asn1_DEF_LogLine = {
asn1_DEF_LogLine_tags,
asn1_DEF_LogLine_tags,
sizeof(asn1_DEF_LogLine_tags)
sizeof(asn1_DEF_LogLine_tags)
/sizeof(asn1_DEF_LogLine_tags[0]), /* 1 */
/sizeof(asn1_DEF_LogLine_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_LogLine,
asn1_MBR_LogLine,
2, /* Elements count */
2, /* Elements count */
...
@@ -235,7 +233,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vparts = {
...
@@ -235,7 +233,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vparts = {
asn1_DEF_vparts_tags,
asn1_DEF_vparts_tags,
sizeof(asn1_DEF_vparts_tags)
sizeof(asn1_DEF_vparts_tags)
/sizeof(asn1_DEF_vparts_tags[0]), /* 1 */
/sizeof(asn1_DEF_vparts_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_vparts,
asn1_MBR_vparts,
1, /* Single element */
1, /* Single element */
...
@@ -284,7 +281,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePartSet = {
...
@@ -284,7 +281,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePartSet = {
asn1_DEF_VariablePartSet_tags,
asn1_DEF_VariablePartSet_tags,
sizeof(asn1_DEF_VariablePartSet_tags)
sizeof(asn1_DEF_VariablePartSet_tags)
/sizeof(asn1_DEF_VariablePartSet_tags[0]), /* 1 */
/sizeof(asn1_DEF_VariablePartSet_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_VariablePartSet,
asn1_MBR_VariablePartSet,
2, /* Elements count */
2, /* Elements count */
...
@@ -405,7 +401,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vset = {
...
@@ -405,7 +401,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vset = {
asn1_DEF_vset_tags,
asn1_DEF_vset_tags,
sizeof(asn1_DEF_vset_tags)
sizeof(asn1_DEF_vset_tags)
/sizeof(asn1_DEF_vset_tags[0]), /* 1 */
/sizeof(asn1_DEF_vset_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_vset,
asn1_MBR_vset,
1, /* Single element */
1, /* Single element */
...
@@ -455,7 +450,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vrange = {
...
@@ -455,7 +450,6 @@ asn1_TYPE_descriptor_t asn1_DEF_vrange = {
asn1_DEF_vrange_tags,
asn1_DEF_vrange_tags,
sizeof(asn1_DEF_vrange_tags)
sizeof(asn1_DEF_vrange_tags)
/sizeof(asn1_DEF_vrange_tags[0]), /* 1 */
/sizeof(asn1_DEF_vrange_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_vrange,
asn1_MBR_vrange,
2, /* Elements count */
2, /* Elements count */
...
@@ -501,7 +495,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePart = {
...
@@ -501,7 +495,6 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePart = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_VariablePart,
asn1_MBR_VariablePart,
2, /* Elements count */
2, /* Elements count */
...
@@ -590,7 +583,6 @@ asn1_TYPE_descriptor_t asn1_DEF_email = {
...
@@ -590,7 +583,6 @@ asn1_TYPE_descriptor_t asn1_DEF_email = {
asn1_DEF_email_tags,
asn1_DEF_email_tags,
sizeof(asn1_DEF_email_tags)
sizeof(asn1_DEF_email_tags)
/sizeof(asn1_DEF_email_tags[0]), /* 1 */
/sizeof(asn1_DEF_email_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_email,
asn1_MBR_email,
1, /* Single element */
1, /* Single element */
...
@@ -640,7 +632,6 @@ asn1_TYPE_descriptor_t asn1_DEF_notify = {
...
@@ -640,7 +632,6 @@ asn1_TYPE_descriptor_t asn1_DEF_notify = {
asn1_DEF_notify_tags,
asn1_DEF_notify_tags,
sizeof(asn1_DEF_notify_tags)
sizeof(asn1_DEF_notify_tags)
/sizeof(asn1_DEF_notify_tags[0]), /* 1 */
/sizeof(asn1_DEF_notify_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_notify,
asn1_MBR_notify,
2, /* Elements count */
2, /* Elements count */
...
@@ -689,7 +680,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ActionItem = {
...
@@ -689,7 +680,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ActionItem = {
asn1_DEF_ActionItem_tags,
asn1_DEF_ActionItem_tags,
sizeof(asn1_DEF_ActionItem_tags)
sizeof(asn1_DEF_ActionItem_tags)
/sizeof(asn1_DEF_ActionItem_tags[0]), /* 1 */
/sizeof(asn1_DEF_ActionItem_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_ActionItem,
asn1_MBR_ActionItem,
2, /* Elements count */
2, /* Elements count */
...
...
tests/43-recursion-OK.asn1.-P
View file @
906654e1
...
@@ -66,7 +66,6 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member1 = {
...
@@ -66,7 +66,6 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member1 = {
asn1_DEF_t_member1_tags,
asn1_DEF_t_member1_tags,
sizeof(asn1_DEF_t_member1_tags)
sizeof(asn1_DEF_t_member1_tags)
/sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
/sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_t_member1,
asn1_MBR_t_member1,
1, /* Single element */
1, /* Single element */
...
@@ -101,7 +100,6 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
...
@@ -101,7 +100,6 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
asn1_DEF_t_member2_tags,
asn1_DEF_t_member2_tags,
sizeof(asn1_DEF_t_member2_tags)
sizeof(asn1_DEF_t_member2_tags)
/sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
/sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_t_member2,
asn1_MBR_t_member2,
1, /* Single element */
1, /* Single element */
...
@@ -166,7 +164,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
...
@@ -166,7 +164,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
asn1_DEF_Test_structure_1_tags,
asn1_DEF_Test_structure_1_tags,
sizeof(asn1_DEF_Test_structure_1_tags)
sizeof(asn1_DEF_Test_structure_1_tags)
/sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
/sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Test_structure_1,
asn1_MBR_Test_structure_1,
4, /* Elements count */
4, /* Elements count */
...
@@ -244,7 +241,6 @@ asn1_TYPE_descriptor_t asn1_DEF_or = {
...
@@ -244,7 +241,6 @@ asn1_TYPE_descriptor_t asn1_DEF_or = {
asn1_DEF_or_tags,
asn1_DEF_or_tags,
sizeof(asn1_DEF_or_tags)
sizeof(asn1_DEF_or_tags)
/sizeof(asn1_DEF_or_tags[0]), /* 1 */
/sizeof(asn1_DEF_or_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_or,
asn1_MBR_or,
1, /* Single element */
1, /* Single element */
...
@@ -306,7 +302,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
...
@@ -306,7 +302,6 @@ asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_Choice_1,
asn1_MBR_Choice_1,
4, /* Elements count */
4, /* Elements count */
...
...
tests/44-choice-in-sequence-OK.asn1.-P
View file @
906654e1
...
@@ -108,7 +108,6 @@ asn1_TYPE_descriptor_t asn1_DEF_e = {
...
@@ -108,7 +108,6 @@ asn1_TYPE_descriptor_t asn1_DEF_e = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_e,
asn1_MBR_e,
2, /* Elements count */
2, /* Elements count */
...
@@ -155,7 +154,6 @@ asn1_TYPE_descriptor_t asn1_DEF_h = {
...
@@ -155,7 +154,6 @@ asn1_TYPE_descriptor_t asn1_DEF_h = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_h,
asn1_MBR_h,
2, /* Elements count */
2, /* Elements count */
...
@@ -219,7 +217,6 @@ asn1_TYPE_descriptor_t asn1_DEF_b = {
...
@@ -219,7 +217,6 @@ asn1_TYPE_descriptor_t asn1_DEF_b = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_b,
asn1_MBR_b,
4, /* Elements count */
4, /* Elements count */
...
@@ -272,7 +269,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
...
@@ -272,7 +269,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
asn1_DEF_T_tags,
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T,
asn1_MBR_T,
2, /* Elements count */
2, /* Elements count */
...
...
tests/46-redefine-OK.asn1.-PR
View file @
906654e1
...
@@ -49,8 +49,7 @@ ber_dec_rval_t
...
@@ -49,8 +49,7 @@ ber_dec_rval_t
PrimitiveType_decode_ber(asn1_TYPE_descriptor_t *td,
PrimitiveType_decode_ber(asn1_TYPE_descriptor_t *td,
void **structure, void *bufptr, size_t size, int tag_mode) {
void **structure, void *bufptr, size_t size, int tag_mode) {
PrimitiveType_inherit_TYPE_descriptor(td);
PrimitiveType_inherit_TYPE_descriptor(td);
return td->ber_decoder(td, structure,
return td->ber_decoder(td, structure, bufptr, size, tag_mode);
bufptr, size, tag_mode);
}
}
der_enc_rval_t
der_enc_rval_t
...
@@ -92,7 +91,6 @@ asn1_TYPE_descriptor_t asn1_DEF_PrimitiveType = {
...
@@ -92,7 +91,6 @@ asn1_TYPE_descriptor_t asn1_DEF_PrimitiveType = {
asn1_DEF_PrimitiveType_tags,
asn1_DEF_PrimitiveType_tags,
sizeof(asn1_DEF_PrimitiveType_tags)
sizeof(asn1_DEF_PrimitiveType_tags)
/sizeof(asn1_DEF_PrimitiveType_tags[0]), /* 1 */
/sizeof(asn1_DEF_PrimitiveType_tags[0]), /* 1 */
1, /* Tags to skip */
-0, /* Unknown yet */
-0, /* Unknown yet */
0, 0, /* No members */
0, 0, /* No members */
0 /* No specifics */
0 /* No specifics */
...
@@ -154,7 +152,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ConstructedType = {
...
@@ -154,7 +152,6 @@ asn1_TYPE_descriptor_t asn1_DEF_ConstructedType = {
asn1_DEF_ConstructedType_tags,
asn1_DEF_ConstructedType_tags,
sizeof(asn1_DEF_ConstructedType_tags)
sizeof(asn1_DEF_ConstructedType_tags)
/sizeof(asn1_DEF_ConstructedType_tags[0]), /* 1 */
/sizeof(asn1_DEF_ConstructedType_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_ConstructedType,
asn1_MBR_ConstructedType,
1, /* Elements count */
1, /* Elements count */
...
@@ -212,8 +209,7 @@ ber_dec_rval_t
...
@@ -212,8 +209,7 @@ ber_dec_rval_t
T_decode_ber(asn1_TYPE_descriptor_t *td,
T_decode_ber(asn1_TYPE_descriptor_t *td,
void **structure, void *bufptr, size_t size, int tag_mode) {
void **structure, void *bufptr, size_t size, int tag_mode) {
T_inherit_TYPE_descriptor(td);
T_inherit_TYPE_descriptor(td);
return td->ber_decoder(td, structure,
return td->ber_decoder(td, structure, bufptr, size, tag_mode);
bufptr, size, tag_mode);
}
}
der_enc_rval_t
der_enc_rval_t
...
@@ -255,7 +251,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
...
@@ -255,7 +251,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
asn1_DEF_T_tags,
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
1, /* Tags to skip */
-0, /* Unknown yet */
-0, /* Unknown yet */
0, 0, /* Defined elsewhere */
0, 0, /* Defined elsewhere */
0 /* No specifics */
0 /* No specifics */
...
...
tests/47-set-ext-OK.asn1.-P
View file @
906654e1
...
@@ -73,7 +73,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
...
@@ -73,7 +73,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
asn1_DEF_T1_tags,
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T1,
asn1_MBR_T1,
1, /* Elements count */
1, /* Elements count */
...
@@ -155,7 +154,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
...
@@ -155,7 +154,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
asn1_DEF_T2_tags,
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T2,
asn1_MBR_T2,
1, /* Elements count */
1, /* Elements count */
...
@@ -227,7 +225,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T3 = {
...
@@ -227,7 +225,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T3 = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T3,
asn1_MBR_T3,
1, /* Elements count */
1, /* Elements count */
...
@@ -299,7 +296,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T4 = {
...
@@ -299,7 +296,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T4 = {
CHOICE_outmost_tag,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T4,
asn1_MBR_T4,
1, /* Elements count */
1, /* Elements count */
...
...
tests/50-constraint-OK.asn1.-P
View file @
906654e1
This diff is collapsed.
Click to expand it.
tests/60-any-OK.asn1.-P
View file @
906654e1
...
@@ -63,7 +63,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
...
@@ -63,7 +63,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
asn1_DEF_T1_tags,
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T1,
asn1_MBR_T1,
2, /* Elements count */
2, /* Elements count */
...
@@ -136,7 +135,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
...
@@ -136,7 +135,6 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
asn1_DEF_T2_tags,
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
1, /* Whether CONSTRUCTED */
asn1_MBR_T2,
asn1_MBR_T2,
2, /* Elements count */
2, /* Elements count */
...
...
tests/65-multi-tag-OK.asn1
0 → 100644
View file @
906654e1
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .65
ModuleTestMultipleTags
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 65 }
DEFINITIONS ::=
BEGIN
T1 ::= [2] EXPLICIT T2
T2 ::= [3] EXPLICIT T3
T3 ::= [4] IMPLICIT T4
T4 ::= [5] EXPLICIT T5
T5 ::= [6] IMPLICIT T6
T6 ::= INTEGER
T ::= [0] IMPLICIT Ts
Ts ::= [123] IMPLICIT SEQUENCE {
m1 [1] IMPLICIT T2, -- [1][4][6]
m2 [2] EXPLICIT T3 OPTIONAL, -- [2][4][6]
m3 [3] IMPLICIT T3 -- [3][6]
}
END
tests/65-multi-tag-OK.asn1.-P
0 → 100644
View file @
906654e1
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment