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
62d95d2e
Commit
62d95d2e
authored
Aug 06, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm warnings
parent
645d2de9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
30 additions
and
31 deletions
+30
-31
asn1c/unber.c
asn1c/unber.c
+4
-4
configure.ac
configure.ac
+1
-1
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+4
-0
libasn1fix/asn1fix_cws.c
libasn1fix/asn1fix_cws.c
+1
-2
libasn1fix/asn1fix_misc.c
libasn1fix/asn1fix_misc.c
+2
-3
libasn1parser/asn1p_class.c
libasn1parser/asn1p_class.c
+3
-5
libasn1parser/asn1p_class.h
libasn1parser/asn1p_class.h
+2
-2
libasn1parser/asn1p_constr.c
libasn1parser/asn1p_constr.c
+2
-0
libasn1parser/asn1p_expr.c
libasn1parser/asn1p_expr.c
+2
-3
libasn1parser/asn1p_expr.h
libasn1parser/asn1p_expr.h
+2
-2
libasn1parser/asn1p_ref.c
libasn1parser/asn1p_ref.c
+2
-3
libasn1parser/asn1p_ref.h
libasn1parser/asn1p_ref.h
+2
-2
libasn1print/asn1print.c
libasn1print/asn1print.c
+3
-4
No files found.
asn1c/unber.c
View file @
62d95d2e
...
@@ -52,7 +52,7 @@ static int decode_tlv_from_string(const char *datastring);
...
@@ -52,7 +52,7 @@ static int decode_tlv_from_string(const char *datastring);
static
int
single_type_decoding
=
0
;
/* -1 enables that */
static
int
single_type_decoding
=
0
;
/* -1 enables that */
static
int
minimalistic
=
0
;
/* -m enables that */
static
int
minimalistic
=
0
;
/* -m enables that */
static
int
pretty_printing
=
1
;
/* -p disables that */
static
int
pretty_printing
=
1
;
/* -p disables that */
static
int
skip_bytes
=
0
;
/* -s controls that */
static
long
skip_bytes
=
0
;
/* -s controls that */
static
char
indent_bytes
[
16
]
=
" "
;
/* -i controls that */
static
char
indent_bytes
[
16
]
=
" "
;
/* -i controls that */
int
int
...
@@ -84,7 +84,7 @@ main(int ac, char **av) {
...
@@ -84,7 +84,7 @@ main(int ac, char **av) {
pretty_printing
=
0
;
pretty_printing
=
0
;
break
;
break
;
case
's'
:
case
's'
:
skip_bytes
=
ato
i
(
optarg
);
skip_bytes
=
ato
l
(
optarg
);
if
(
skip_bytes
<
0
)
{
if
(
skip_bytes
<
0
)
{
fprintf
(
stderr
,
"-s %s: positive value expected
\n
"
,
optarg
);
fprintf
(
stderr
,
"-s %s: positive value expected
\n
"
,
optarg
);
exit
(
EX_USAGE
);
exit
(
EX_USAGE
);
...
@@ -196,10 +196,10 @@ process(const char *fname) {
...
@@ -196,10 +196,10 @@ process(const char *fname) {
/*
/*
* Skip the requested amount of bytes.
* Skip the requested amount of bytes.
*/
*/
for
(;
offset
<
skip_bytes
;
offset
++
)
{
for
(;
offset
<
(
size_t
)
skip_bytes
;
offset
++
)
{
if
(
fgetc
(
fp
)
==
-
1
)
{
if
(
fgetc
(
fp
)
==
-
1
)
{
fprintf
(
stderr
,
"%s: input source (%zu bytes) "
fprintf
(
stderr
,
"%s: input source (%zu bytes) "
"has less data than
\"
-s %d
\"
switch "
"has less data than
\"
-s %
l
d
\"
switch "
"wants to skip
\n
"
,
"wants to skip
\n
"
,
fname
,
offset
,
skip_bytes
);
fname
,
offset
,
skip_bytes
);
if
(
fp
!=
stdin
)
fclose
(
fp
);
if
(
fp
!=
stdin
)
fclose
(
fp
);
...
...
configure.ac
View file @
62d95d2e
...
@@ -58,7 +58,7 @@ AX_CHECK_COMPILE_FLAG([-Wno-error=visibility],
...
@@ -58,7 +58,7 @@ AX_CHECK_COMPILE_FLAG([-Wno-error=visibility],
AX_CHECK_COMPILE_FLAG([-Wno-error=parentheses-equality],
AX_CHECK_COMPILE_FLAG([-Wno-error=parentheses-equality],
[CFLAGS="$CFLAGS -Wno-error=parentheses-equality"])
[CFLAGS="$CFLAGS -Wno-error=parentheses-equality"])
AX_CHECK_COMPILE_FLAG([-std=gnu99],
AX_CHECK_COMPILE_FLAG([-std=gnu99],
[CFLAGS="$CFLAGS-std=gnu99"
[CFLAGS="$CFLAGS
-std=gnu99"
TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -std=gnu99"])
TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -std=gnu99"])
AX_CHECK_COMPILE_FLAG([-Wno-error=unused-variable],
AX_CHECK_COMPILE_FLAG([-Wno-error=unused-variable],
[TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -Wno-error=unused-variable"])
[TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -Wno-error=unused-variable"])
...
...
libasn1compiler/asn1c_C.c
View file @
62d95d2e
...
@@ -323,6 +323,10 @@ typedef struct asn1c_ioc_table_s {
...
@@ -323,6 +323,10 @@ typedef struct asn1c_ioc_table_s {
static
asn1c_ioc_table_t
*
static
asn1c_ioc_table_t
*
asn1c_construct_ioc_table_from_objset
(
arg_t
*
arg
,
const
asn1p_ref_t
*
objset_ref
,
asn1p_expr_t
*
objset
)
{
asn1c_construct_ioc_table_from_objset
(
arg_t
*
arg
,
const
asn1p_ref_t
*
objset_ref
,
asn1p_expr_t
*
objset
)
{
(
void
)
arg
;
(
void
)
objset_ref
;
(
void
)
objset
;
asn1c_ioc_table_t
*
itable
=
NULL
;
asn1c_ioc_table_t
*
itable
=
NULL
;
itable
=
calloc
(
1
,
sizeof
(
*
itable
));
itable
=
calloc
(
1
,
sizeof
(
*
itable
));
assert
(
itable
);
assert
(
itable
);
...
...
libasn1fix/asn1fix_cws.c
View file @
62d95d2e
...
@@ -371,7 +371,6 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row,
...
@@ -371,7 +371,6 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row,
struct
asn1p_ioc_cell_s
*
cell
,
const
uint8_t
*
buf
,
struct
asn1p_ioc_cell_s
*
cell
,
const
uint8_t
*
buf
,
const
uint8_t
*
bend
)
{
const
uint8_t
*
bend
)
{
asn1p_expr_t
*
expr
=
(
asn1p_expr_t
*
)
NULL
;
asn1p_expr_t
*
expr
=
(
asn1p_expr_t
*
)
NULL
;
int
idLength
;
char
*
p
;
char
*
p
;
int
new_ref
=
1
;
int
new_ref
=
1
;
asn1p_t
*
asn
;
asn1p_t
*
asn
;
...
@@ -482,7 +481,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row,
...
@@ -482,7 +481,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row,
cell
->
value
=
expr
;
cell
->
value
=
expr
;
cell
->
new_ref
=
new_ref
;
cell
->
new_ref
=
new_ref
;
idLength
=
strlen
(
expr
->
Identifier
);
size_t
idLength
=
strlen
(
expr
->
Identifier
);
if
(
row
->
max_identifier_length
<
idLength
)
if
(
row
->
max_identifier_length
<
idLength
)
row
->
max_identifier_length
=
idLength
;
row
->
max_identifier_length
=
idLength
;
...
...
libasn1fix/asn1fix_misc.c
View file @
62d95d2e
...
@@ -129,12 +129,11 @@ asn1f_printable_value(asn1p_value_t *v) {
...
@@ -129,12 +129,11 @@ asn1f_printable_value(asn1p_value_t *v) {
asn1p_ref_t
*
ref
;
asn1p_ref_t
*
ref
;
size_t
reflen
;
size_t
reflen
;
char
*
ptr
;
char
*
ptr
;
int
i
;
assert
(
v
->
value
.
reference
);
assert
(
v
->
value
.
reference
);
ref
=
v
->
value
.
reference
;
ref
=
v
->
value
.
reference
;
reflen
=
ref
->
comp_count
;
/* Number of dots */
reflen
=
ref
->
comp_count
;
/* Number of dots */
for
(
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
for
(
size_t
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
reflen
+=
strlen
(
ref
->
components
[
i
].
name
);
reflen
+=
strlen
(
ref
->
components
[
i
].
name
);
/*
/*
* Make sure we have a buffer of this size.
* Make sure we have a buffer of this size.
...
@@ -145,7 +144,7 @@ asn1f_printable_value(asn1p_value_t *v) {
...
@@ -145,7 +144,7 @@ asn1f_printable_value(asn1p_value_t *v) {
* Fill-up the buffer.
* Fill-up the buffer.
*/
*/
ptr
=
managedptr
;
ptr
=
managedptr
;
for
(
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
{
char
*
nc
;
char
*
nc
;
if
(
i
)
*
ptr
++
=
'.'
;
if
(
i
)
*
ptr
++
=
'.'
;
for
(
nc
=
ref
->
components
[
i
].
name
;
*
nc
;
nc
++
)
for
(
nc
=
ref
->
components
[
i
].
name
;
*
nc
;
nc
++
)
...
...
libasn1parser/asn1p_class.c
View file @
62d95d2e
...
@@ -29,7 +29,7 @@ asn1p_ioc_row_new(asn1p_expr_t *oclass) {
...
@@ -29,7 +29,7 @@ asn1p_ioc_row_new(asn1p_expr_t *oclass) {
columns
=
0
;
columns
=
0
;
TQ_FOR
(
field
,
&
oclass
->
members
,
next
)
{
TQ_FOR
(
field
,
&
oclass
->
members
,
next
)
{
in
t
fieldIdLen
=
strlen
(
field
->
Identifier
);
size_
t
fieldIdLen
=
strlen
(
field
->
Identifier
);
if
(
fieldIdLen
>
row
->
max_identifier_length
)
if
(
fieldIdLen
>
row
->
max_identifier_length
)
row
->
max_identifier_length
=
fieldIdLen
;
row
->
max_identifier_length
=
fieldIdLen
;
row
->
column
[
columns
].
field
=
field
;
row
->
column
[
columns
].
field
=
field
;
...
@@ -42,10 +42,9 @@ asn1p_ioc_row_new(asn1p_expr_t *oclass) {
...
@@ -42,10 +42,9 @@ asn1p_ioc_row_new(asn1p_expr_t *oclass) {
void
void
asn1p_ioc_row_delete
(
asn1p_ioc_row_t
*
row
)
{
asn1p_ioc_row_delete
(
asn1p_ioc_row_t
*
row
)
{
int
i
;
if
(
row
)
{
if
(
row
)
{
if
(
row
->
column
)
{
if
(
row
->
column
)
{
for
(
i
=
0
;
i
<
row
->
columns
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
row
->
columns
;
i
++
)
{
if
(
!
row
->
column
[
i
].
new_ref
&&
row
->
column
[
i
].
value
)
{
if
(
!
row
->
column
[
i
].
new_ref
&&
row
->
column
[
i
].
value
)
{
/*
/*
* Field 'reference' comes from asn1fix_cws.c :
* Field 'reference' comes from asn1fix_cws.c :
...
@@ -94,8 +93,7 @@ asn1p_ioc_row_match(const asn1p_ioc_row_t *a, const asn1p_ioc_row_t *b) {
...
@@ -94,8 +93,7 @@ asn1p_ioc_row_match(const asn1p_ioc_row_t *a, const asn1p_ioc_row_t *b) {
struct
asn1p_ioc_cell_s
*
struct
asn1p_ioc_cell_s
*
asn1p_ioc_row_cell_fetch
(
asn1p_ioc_row_t
*
row
,
const
char
*
fieldname
)
{
asn1p_ioc_row_cell_fetch
(
asn1p_ioc_row_t
*
row
,
const
char
*
fieldname
)
{
int
i
;
for
(
size_t
i
=
0
;
i
<
row
->
columns
;
i
++
)
{
for
(
i
=
0
;
i
<
row
->
columns
;
i
++
)
{
if
(
strcmp
(
row
->
column
[
i
].
field
->
Identifier
,
fieldname
)
==
0
)
if
(
strcmp
(
row
->
column
[
i
].
field
->
Identifier
,
fieldname
)
==
0
)
return
&
row
->
column
[
i
];
return
&
row
->
column
[
i
];
}
}
...
...
libasn1parser/asn1p_class.h
View file @
62d95d2e
...
@@ -14,8 +14,8 @@ typedef struct asn1p_ioc_row_s {
...
@@ -14,8 +14,8 @@ typedef struct asn1p_ioc_row_s {
struct
asn1p_expr_s
*
value
;
/* may be left uninitialized */
struct
asn1p_expr_s
*
value
;
/* may be left uninitialized */
int
new_ref
;
int
new_ref
;
}
*
column
;
}
*
column
;
in
t
columns
;
size_
t
columns
;
in
t
max_identifier_length
;
size_
t
max_identifier_length
;
}
asn1p_ioc_row_t
;
}
asn1p_ioc_row_t
;
asn1p_ioc_row_t
*
asn1p_ioc_row_new
(
struct
asn1p_expr_s
*
oclass
);
asn1p_ioc_row_t
*
asn1p_ioc_row_new
(
struct
asn1p_expr_s
*
oclass
);
...
...
libasn1parser/asn1p_constr.c
View file @
62d95d2e
...
@@ -24,6 +24,8 @@ asn1p_constraint_set_source(asn1p_constraint_t *ct,
...
@@ -24,6 +24,8 @@ asn1p_constraint_set_source(asn1p_constraint_t *ct,
int
asn1p_constraint_compare
(
const
asn1p_constraint_t
*
a
,
int
asn1p_constraint_compare
(
const
asn1p_constraint_t
*
a
,
const
asn1p_constraint_t
*
b
)
{
const
asn1p_constraint_t
*
b
)
{
(
void
)
a
;
(
void
)
b
;
assert
(
!
"Constraint comparison is not implemented"
);
assert
(
!
"Constraint comparison is not implemented"
);
return
-
1
;
return
-
1
;
}
}
...
...
libasn1parser/asn1p_expr.c
View file @
62d95d2e
...
@@ -346,9 +346,8 @@ asn1p_expr_free(asn1p_expr_t *expr) {
...
@@ -346,9 +346,8 @@ asn1p_expr_free(asn1p_expr_t *expr) {
free
(
expr
->
specializations
.
pspec
);
free
(
expr
->
specializations
.
pspec
);
}
}
if
(
expr
->
object_class_matrix
.
row
)
{
if
(
expr
->
object_class_matrix
.
row
)
{
int
row
;
for
(
size_t
row
=
0
;
row
<
expr
->
object_class_matrix
.
rows
;
row
++
)
{
for
(
row
=
0
;
row
<
expr
->
object_class_matrix
.
rows
;
row
++
)
{
asn1p_ioc_row_delete
(
expr
->
object_class_matrix
.
row
[
row
]);
asn1p_ioc_row_delete
(
expr
->
object_class_matrix
.
row
[
row
]);
}
}
free
(
expr
->
object_class_matrix
.
row
);
free
(
expr
->
object_class_matrix
.
row
);
}
}
...
...
libasn1parser/asn1p_expr.h
View file @
62d95d2e
...
@@ -181,8 +181,8 @@ typedef struct asn1p_expr_s {
...
@@ -181,8 +181,8 @@ typedef struct asn1p_expr_s {
/* Information Object Class matrix, specific for this class */
/* Information Object Class matrix, specific for this class */
struct
asn1p_ioc_matrix_s
{
struct
asn1p_ioc_matrix_s
{
asn1p_ioc_row_t
**
row
;
asn1p_ioc_row_t
**
row
;
in
t
rows
;
size_
t
rows
;
in
t
max_identifier_length
;
size_
t
max_identifier_length
;
}
object_class_matrix
;
}
object_class_matrix
;
/*
/*
...
...
libasn1parser/asn1p_ref.c
View file @
62d95d2e
...
@@ -24,7 +24,7 @@ void
...
@@ -24,7 +24,7 @@ void
asn1p_ref_free
(
asn1p_ref_t
*
ref
)
{
asn1p_ref_free
(
asn1p_ref_t
*
ref
)
{
if
(
ref
)
{
if
(
ref
)
{
if
(
ref
->
components
)
{
if
(
ref
->
components
)
{
in
t
i
=
ref
->
comp_count
;
size_
t
i
=
ref
->
comp_count
;
while
(
i
--
)
{
while
(
i
--
)
{
free
(
ref
->
components
[
i
].
name
);
free
(
ref
->
components
[
i
].
name
);
ref
->
components
[
i
].
name
=
0
;
ref
->
components
[
i
].
name
=
0
;
...
@@ -127,8 +127,7 @@ asn1p_ref_clone(asn1p_ref_t *ref) {
...
@@ -127,8 +127,7 @@ asn1p_ref_clone(asn1p_ref_t *ref) {
newref
=
asn1p_ref_new
(
ref
->
_lineno
,
ref
->
module
);
newref
=
asn1p_ref_new
(
ref
->
_lineno
,
ref
->
module
);
if
(
newref
)
{
if
(
newref
)
{
int
i
;
for
(
size_t
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
{
for
(
i
=
0
;
i
<
ref
->
comp_count
;
i
++
)
{
if
(
asn1p_ref_add_component
(
newref
,
if
(
asn1p_ref_add_component
(
newref
,
ref
->
components
[
i
].
name
,
ref
->
components
[
i
].
name
,
ref
->
components
[
i
].
lex_type
ref
->
components
[
i
].
lex_type
...
...
libasn1parser/asn1p_ref.h
View file @
62d95d2e
...
@@ -34,8 +34,8 @@ typedef struct asn1p_ref_s {
...
@@ -34,8 +34,8 @@ typedef struct asn1p_ref_s {
char
*
name
;
/* An identifier */
char
*
name
;
/* An identifier */
}
*
components
;
}
*
components
;
in
t
comp_count
;
/* Number of the components in the reference name. */
size_
t
comp_count
;
/* Number of the components in the reference name. */
in
t
comp_size
;
/* Number of allocated structures */
size_
t
comp_size
;
/* Number of allocated structures */
struct
asn1p_module_s
*
module
;
/* Defined in module */
struct
asn1p_module_s
*
module
;
/* Defined in module */
int
_lineno
;
/* Number of line in the file */
int
_lineno
;
/* Number of line in the file */
...
...
libasn1print/asn1print.c
View file @
62d95d2e
...
@@ -170,11 +170,10 @@ asn1print_oid(int prior_len, asn1p_oid_t *oid, enum asn1print_flags flags) {
...
@@ -170,11 +170,10 @@ asn1print_oid(int prior_len, asn1p_oid_t *oid, enum asn1print_flags flags) {
static
int
static
int
asn1print_ref
(
asn1p_ref_t
*
ref
,
enum
asn1print_flags
flags
)
{
asn1print_ref
(
asn1p_ref_t
*
ref
,
enum
asn1print_flags
flags
)
{
int
cc
;
(
void
)
flags
;
/* Unused argument */
(
void
)
flags
;
/* Unused argument */
for
(
cc
=
0
;
cc
<
ref
->
comp_count
;
cc
++
)
{
for
(
size_t
cc
=
0
;
cc
<
ref
->
comp_count
;
cc
++
)
{
if
(
cc
)
safe_printf
(
"."
);
if
(
cc
)
safe_printf
(
"."
);
safe_printf
(
"%s"
,
ref
->
components
[
cc
].
name
);
safe_printf
(
"%s"
,
ref
->
components
[
cc
].
name
);
}
}
...
@@ -777,7 +776,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -777,7 +776,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
if
(
flags
&
APF_PRINT_CLASS_MATRIX
if
(
flags
&
APF_PRINT_CLASS_MATRIX
&&
tc
->
expr_type
==
A1TC_CLASSDEF
)
do
{
&&
tc
->
expr_type
==
A1TC_CLASSDEF
)
do
{
int
r
,
col
,
maxidlen
;
size_t
col
,
maxidlen
;
if
(
tc
->
object_class_matrix
.
rows
==
0
)
{
if
(
tc
->
object_class_matrix
.
rows
==
0
)
{
safe_printf
(
"
\n
-- Class matrix is empty"
);
safe_printf
(
"
\n
-- Class matrix is empty"
);
break
;
break
;
...
@@ -786,7 +785,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
...
@@ -786,7 +785,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
tc
->
object_class_matrix
.
rows
,
tc
->
object_class_matrix
.
rows
,
tc
->
object_class_matrix
.
rows
==
1
?
"y"
:
"ies"
);
tc
->
object_class_matrix
.
rows
==
1
?
"y"
:
"ies"
);
maxidlen
=
tc
->
object_class_matrix
.
max_identifier_length
;
maxidlen
=
tc
->
object_class_matrix
.
max_identifier_length
;
for
(
r
=
-
1
;
r
<
tc
->
object_class_matrix
.
rows
;
r
++
)
{
for
(
ssize_t
r
=
-
1
;
r
<
(
ssize_t
)
tc
->
object_class_matrix
.
rows
;
r
++
)
{
struct
asn1p_ioc_row_s
*
row
;
struct
asn1p_ioc_row_s
*
row
;
row
=
tc
->
object_class_matrix
.
row
[
r
<
0
?
0
:
r
];
row
=
tc
->
object_class_matrix
.
row
[
r
<
0
?
0
:
r
];
if
(
r
<
0
)
safe_printf
(
"-- %s"
,
r
>
9
?
" "
:
""
);
if
(
r
<
0
)
safe_printf
(
"-- %s"
,
r
>
9
?
" "
:
""
);
...
...
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