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
6bc5696f
Commit
6bc5696f
authored
Oct 20, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix consrtaint propagation for random_fill
parent
d14802fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
skeletons/BIT_STRING.c
skeletons/BIT_STRING.c
+2
-1
skeletons/BOOLEAN.c
skeletons/BOOLEAN.c
+2
-1
skeletons/OCTET_STRING.c
skeletons/OCTET_STRING.c
+6
-6
tests/tests-randomized/bundles/16-SEQUENCE-bundle.txt
tests/tests-randomized/bundles/16-SEQUENCE-bundle.txt
+6
-0
No files found.
skeletons/BIT_STRING.c
View file @
6bc5696f
...
@@ -571,7 +571,8 @@ BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
...
@@ -571,7 +571,8 @@ BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
/* Figure out how far we should go */
/* Figure out how far we should go */
rnd_bits
=
lengths
[
asn_random_between
(
rnd_bits
=
lengths
[
asn_random_between
(
0
,
sizeof
(
lengths
)
/
sizeof
(
lengths
[
0
])
-
1
)];
0
,
sizeof
(
lengths
)
/
sizeof
(
lengths
[
0
])
-
1
)];
if
(
!
constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
!
constraints
||
!
constraints
->
per_constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
constraints
->
per_constraints
)
{
if
(
constraints
->
per_constraints
)
{
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
size
;
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
size
;
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
...
...
skeletons/BOOLEAN.c
View file @
6bc5696f
...
@@ -406,7 +406,8 @@ BOOLEAN_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
...
@@ -406,7 +406,8 @@ BOOLEAN_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
}
}
}
}
if
(
!
constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
!
constraints
||
!
constraints
->
per_constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
constraints
->
per_constraints
)
{
if
(
constraints
->
per_constraints
)
{
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
value
;
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
value
;
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
...
...
skeletons/OCTET_STRING.c
View file @
6bc5696f
...
@@ -1886,10 +1886,10 @@ OCTET_STRING_random_length_constrained(
...
@@ -1886,10 +1886,10 @@ OCTET_STRING_random_length_constrained(
rnd_len
=
lengths
[
asn_random_between
(
rnd_len
=
lengths
[
asn_random_between
(
0
,
sizeof
(
lengths
)
/
sizeof
(
lengths
[
0
])
-
1
)];
0
,
sizeof
(
lengths
)
/
sizeof
(
lengths
[
0
])
-
1
)];
if
(
!
constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
!
constraints
||
!
constraints
->
per_constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
constraints
->
per_constraints
)
{
if
(
constraints
->
per_constraints
)
{
const
asn_per_constraint_t
*
pc
=
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
size
;
&
td
->
encoding_constraints
.
per_constraints
->
size
;
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
long
suggested_upper_bound
=
pc
->
upper_bound
<
(
ssize_t
)
max_length
long
suggested_upper_bound
=
pc
->
upper_bound
<
(
ssize_t
)
max_length
?
pc
->
upper_bound
?
pc
->
upper_bound
...
@@ -1977,10 +1977,10 @@ OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
...
@@ -1977,10 +1977,10 @@ OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
break
;
break
;
}
}
if
(
!
constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
!
constraints
||
!
constraints
->
per_constraints
)
constraints
=
&
td
->
encoding_constraints
;
if
(
constraints
->
per_constraints
)
{
if
(
constraints
->
per_constraints
)
{
const
asn_per_constraint_t
*
pc
=
const
asn_per_constraint_t
*
pc
=
&
constraints
->
per_constraints
->
value
;
&
td
->
encoding_constraints
.
per_constraints
->
value
;
if
(
pc
->
flags
&
APC_SEMI_CONSTRAINED
)
{
if
(
pc
->
flags
&
APC_SEMI_CONSTRAINED
)
{
clb
=
pc
->
lower_bound
;
clb
=
pc
->
lower_bound
;
}
else
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
}
else
if
(
pc
->
flags
&
APC_CONSTRAINED
)
{
...
...
tests/tests-randomized/bundles/16-SEQUENCE-bundle.txt
View file @
6bc5696f
...
@@ -7,6 +7,12 @@ SEQUENCE { ..., null NULL OPTIONAL }
...
@@ -7,6 +7,12 @@ SEQUENCE { ..., null NULL OPTIONAL }
SEQUENCE { ..., null BOOLEAN }
SEQUENCE { ..., null BOOLEAN }
SEQUENCE { ..., null BOOLEAN DEFAULT FALSE }
SEQUENCE { ..., null BOOLEAN DEFAULT FALSE }
SEQUENCE { ..., null BOOLEAN DEFAULT TRUE }
SEQUENCE { ..., null BOOLEAN DEFAULT TRUE }
SEQUENCE { str IA5String }
SEQUENCE { str IA5String OPTIONAL }
SEQUENCE { str IA5String (SIZE(0)) }
SEQUENCE { str IA5String (SIZE(0)) OPTIONAL }
SEQUENCE { str IA5String (SIZE(1)) }
SEQUENCE { str IA5String (SIZE(1)) OPTIONAL }
SEQUENCE { null NULL }
SEQUENCE { null NULL }
SEQUENCE { null NULL, ... }
SEQUENCE { null NULL, ... }
...
...
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