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
71160968
Commit
71160968
authored
Jun 02, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler support for tagged parametrized members.
parent
f3b29b1f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
22 deletions
+61
-22
ChangeLog
ChangeLog
+2
-1
libasn1fix/asn1fix_constr.c
libasn1fix/asn1fix_constr.c
+7
-0
libasn1fix/asn1fix_param.c
libasn1fix/asn1fix_param.c
+10
-0
libasn1parser/asn1p_expr.c
libasn1parser/asn1p_expr.c
+38
-0
libasn1parser/asn1p_expr.h
libasn1parser/asn1p_expr.h
+3
-0
libasn1print/asn1print.c
libasn1print/asn1print.c
+1
-21
No files found.
ChangeLog
View file @
71160968
0.9.15: 2005-
May-17
0.9.15: 2005-
June-01
* Compiler now checks 64-bit overflows in constraints range handling
* Compiler now checks 64-bit overflows in constraints range handling
code. No effect on the code produced by the compiler.
code. No effect on the code produced by the compiler.
* Compiler support for tagged parametrized members.
* Empty tags to element map avoided.
* Empty tags to element map avoided.
0.9.14: 2005-Apr-29
0.9.14: 2005-Apr-29
...
...
libasn1fix/asn1fix_constr.c
View file @
71160968
...
@@ -419,6 +419,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
...
@@ -419,6 +419,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
||
ta
.
tag_value
==
-
1
/* Spread IMAGINARY ANY tag... */
||
ta
.
tag_value
==
-
1
/* Spread IMAGINARY ANY tag... */
||
tb
.
tag_value
==
-
1
/* ...it is an evil virus, fear it! */
||
tb
.
tag_value
==
-
1
/* ...it is an evil virus, fear it! */
)
{
)
{
char
tagbuf
[
2
][
TAG2STRING_BUFFER_SIZE
];
char
*
p
=
(
a
->
expr_type
==
A1TC_EXTENSIBLE
)
char
*
p
=
(
a
->
expr_type
==
A1TC_EXTENSIBLE
)
?
"potentially "
:
""
;
?
"potentially "
:
""
;
FATAL
(
"Processing %s at line %d: component
\"
%s
\"
at line %d %shas the same tag "
FATAL
(
"Processing %s at line %d: component
\"
%s
\"
at line %d %shas the same tag "
...
@@ -431,6 +432,12 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
...
@@ -431,6 +432,12 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
b
->
Identifier
,
b
->
Identifier
,
b
->
_lineno
b
->
_lineno
);
);
DEBUG
(
"Tags: %s %s vs. %s %s"
,
asn1p_tag2string
(
&
ta
,
tagbuf
[
0
]),
a
->
Identifier
,
asn1p_tag2string
(
&
tb
,
tagbuf
[
1
]),
b
->
Identifier
);
if
((
arg
->
mod
->
module_flags
&
MSF_EXTENSIBILITY_IMPLIED
)
if
((
arg
->
mod
->
module_flags
&
MSF_EXTENSIBILITY_IMPLIED
)
&&
(
a
->
expr_type
==
A1TC_EXTENSIBLE
)
&&
(
a
->
expr_type
==
A1TC_EXTENSIBLE
)
&&
(
b
->
expr_type
==
A1TC_EXTENSIBLE
))
{
&&
(
b
->
expr_type
==
A1TC_EXTENSIBLE
))
{
...
...
libasn1fix/asn1fix_param.c
View file @
71160968
...
@@ -60,12 +60,22 @@ asn1f_fix_parametrized_assignment(arg_t *arg) {
...
@@ -60,12 +60,22 @@ asn1f_fix_parametrized_assignment(arg_t *arg) {
#define SUBSTITUTE(to, from) do { \
#define SUBSTITUTE(to, from) do { \
asn1p_expr_t tmp, *__v; \
asn1p_expr_t tmp, *__v; \
if((to)->tag.tag_class \
&& (from)->tag.tag_class) { \
FATAL("Layered tagging " \
"in parametrization " \
"is not yet supported, " \
"contact asn1c author for"); \
return -1; \
} \
tmp = *(to); \
tmp = *(to); \
*(to) = *(from); \
*(to) = *(from); \
TQ_MOVE(&(to)->members, &(from)->members); \
TQ_MOVE(&(to)->members, &(from)->members); \
*(from) = tmp; \
*(from) = tmp; \
(to)->next = tmp.next; \
(to)->next = tmp.next; \
(to)->parent_expr = tmp.parent_expr; \
(to)->parent_expr = tmp.parent_expr; \
if(tmp.tag.tag_class) \
(to)->tag = tmp.tag; \
memset(&((from)->next), 0, \
memset(&((from)->next), 0, \
sizeof((from)->next)); \
sizeof((from)->next)); \
memset(&((from)->members), 0, \
memset(&((from)->members), 0, \
...
...
libasn1parser/asn1p_expr.c
View file @
71160968
...
@@ -142,3 +142,41 @@ asn1p_expr_free(asn1p_expr_t *expr) {
...
@@ -142,3 +142,41 @@ asn1p_expr_free(asn1p_expr_t *expr) {
}
}
}
}
char
*
asn1p_tag2string
(
struct
asn1p_type_tag_s
*
tag
,
char
*
buf
)
{
static
buf_stat
[
TAG2STRING_BUFFER_SIZE
];
char
*
start
;
char
*
end
;
if
(
!
buf
)
buf
=
buf_stat
;
start
=
buf
;
end
=
buf
+
TAG2STRING_BUFFER_SIZE
;
if
(
tag
->
tag_class
==
TC_NOCLASS
)
{
*
buf
=
0
;
return
buf
;
}
strcpy
(
buf
,
"["
);
switch
(
tag
->
tag_class
)
{
case
TC_NOCLASS
:
assert
(
tag
->
tag_class
!=
TC_NOCLASS
);
break
;
case
TC_UNIVERSAL
:
strcat
(
buf
,
"UNIVERSAL "
);
break
;
case
TC_PRIVATE
:
strcat
(
buf
,
"PRIVATE "
);
break
;
case
TC_APPLICATION
:
strcat
(
buf
,
"APPLICATION "
);
break
;
case
TC_CONTEXT_SPECIFIC
:
break
;
}
buf
+=
snprintf
(
buf
+
strlen
(
buf
),
end
-
buf
,
"%"
PRIdASN
"]"
,
tag
->
tag_value
);
assert
((
buf
-
end
)
>
sizeof
(
" IMPLICIT "
));
switch
(
tag
->
tag_mode
)
{
case
TM_DEFAULT
:
break
;
case
TM_IMPLICIT
:
strcat
(
buf
,
" IMPLICIT"
);
break
;
case
TM_EXPLICIT
:
strcat
(
buf
,
" EXPLICIT"
);
break
;
}
return
start
;
}
libasn1parser/asn1p_expr.h
View file @
71160968
...
@@ -242,4 +242,7 @@ asn1p_expr_t *asn1p_expr_clone(asn1p_expr_t *, int skip_extensions);
...
@@ -242,4 +242,7 @@ asn1p_expr_t *asn1p_expr_clone(asn1p_expr_t *, int skip_extensions);
void
asn1p_expr_add
(
asn1p_expr_t
*
to
,
asn1p_expr_t
*
what
);
void
asn1p_expr_add
(
asn1p_expr_t
*
to
,
asn1p_expr_t
*
what
);
void
asn1p_expr_free
(
asn1p_expr_t
*
expr
);
void
asn1p_expr_free
(
asn1p_expr_t
*
expr
);
#define TAG2STRING_BUFFER_SIZE 64
/* buf should be at least this big */
char
*
asn1p_tag2string
(
struct
asn1p_type_tag_s
*
tag
,
char
*
opt_buf
);
#endif
/* ASN1_PARSER_EXPR_H */
#endif
/* ASN1_PARSER_EXPR_H */
libasn1print/asn1print.c
View file @
71160968
...
@@ -168,27 +168,7 @@ asn1print_tag(asn1p_expr_t *tc, enum asn1print_flags flags) {
...
@@ -168,27 +168,7 @@ asn1print_tag(asn1p_expr_t *tc, enum asn1print_flags flags) {
(
void
)
flags
;
/* Unused argument */
(
void
)
flags
;
/* Unused argument */
if
(
tag
->
tag_class
==
TC_NOCLASS
)
printf
(
"%s"
,
asn1p_tag2string
(
tag
,
0
));
return
0
;
printf
(
"["
);
switch
(
tag
->
tag_class
)
{
case
TC_NOCLASS
:
assert
(
tag
->
tag_class
!=
TC_NOCLASS
);
break
;
case
TC_UNIVERSAL
:
printf
(
"UNIVERSAL "
);
break
;
case
TC_PRIVATE
:
printf
(
"PRIVATE "
);
break
;
case
TC_APPLICATION
:
printf
(
"APPLICATION "
);
break
;
case
TC_CONTEXT_SPECIFIC
:
break
;
}
printf
(
"%"
PRIdASN
"]"
,
tag
->
tag_value
);
switch
(
tag
->
tag_mode
)
{
case
TM_DEFAULT
:
break
;
case
TM_IMPLICIT
:
printf
(
" IMPLICIT"
);
break
;
case
TM_EXPLICIT
:
printf
(
" EXPLICIT"
);
break
;
}
return
0
;
return
0
;
}
}
...
...
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