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
208d9edd
Unverified
Commit
208d9edd
authored
Aug 30, 2023
by
Mouse
Committed by
GitHub
Aug 30, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from kentkost/junktest-windows-fix
parents
b93d80fd
30d7a84e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
.gitignore
.gitignore
+1
-0
skeletons/asn_random_fill.c
skeletons/asn_random_fill.c
+10
-5
skeletons/converter-example.c
skeletons/converter-example.c
+5
-0
No files found.
.gitignore
View file @
208d9edd
...
...
@@ -8,6 +8,7 @@
*.trs
*.core
.tmp.*
*.exe
# Generated by `autoreconf`
config/
...
...
skeletons/asn_random_fill.c
View file @
208d9edd
...
...
@@ -42,17 +42,22 @@ asn_random_between(intmax_t lb, intmax_t rb) {
uintmax_t
range
=
asn__intmax_range
(
lb
,
rb
);
uintmax_t
value
=
0
;
uintmax_t
got_entropy
=
0
;
(
void
)
intmax_max
;
assert
(
RAND_MAX
>
0xffffff
);
/* Seen 7ffffffd! */
int
max
=
0xffffff
;
#ifdef __WIN32__
max
=
RAND_MAX
-
1
;
#endif
assert
(
RAND_MAX
>
max
);
/* Seen 7ffffffd! */
assert
(
range
<
intmax_max
);
for
(;
got_entropy
<
range
;)
{
got_entropy
=
(
got_entropy
<<
24
)
|
0xffffff
;
got_entropy
=
(
got_entropy
<<
24
)
|
max
;
#ifdef HAVE_RANDOM
value
=
(
value
<<
24
)
|
(
random
()
%
0xffffff
);
value
=
(
value
<<
24
)
|
(
random
()
%
max
);
#else
value
=
(
value
<<
24
)
|
(
rand
()
%
0xffffff
);
value
=
(
value
<<
24
)
|
(
rand
()
%
max
);
#endif
}
...
...
skeletons/converter-example.c
View file @
208d9edd
...
...
@@ -70,6 +70,11 @@ static void junk_bytes_with_probability(uint8_t *, size_t, double prob);
#define RANDOPT "R:"
static
ssize_t
random_max_size
=
0
;
/* Size of the random data */
#if defined(__WIN32__) && defined(JUNKTEST)
#define random rand
#define srandom srand
#endif
#if !defined(__FreeBSD__) && !(defined(__APPLE__) && defined(__MACH__))
static
void
srandomdev
(
void
)
{
...
...
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