Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
554f5b7a
Commit
554f5b7a
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Fix up comments.
parent
8d821f39
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/liblutil/entropy.c
+7
-5
7 additions, 5 deletions
libraries/liblutil/entropy.c
with
7 additions
and
5 deletions
libraries/liblutil/entropy.c
+
7
−
5
View file @
554f5b7a
...
...
@@ -81,8 +81,9 @@ int lutil_entropy( char *buf, int nbytes )
*/
/*
* the caller may be provide external synchronization OR
* provide entropy (in buf) to ensure quality results.
* the caller may need to provide external synchronization OR
* provide entropy (in buf) to ensure quality results as
* access to this counter may not be atomic.
*/
static
int
counter
=
0
;
int
n
;
...
...
@@ -100,7 +101,8 @@ int lutil_entropy( char *buf, int nbytes )
#else
time_t
time
;
#endif
unsigned
long
junk
;
unsigned
long
junk
;
/* purposely not initialized */
}
rdata
;
/* make sure rdata differs for each process */
...
...
@@ -114,7 +116,7 @@ int lutil_entropy( char *buf, int nbytes )
struct
lutil_MD5Context
ctx
;
char
digest
[
16
];
/*
hopefully has g
oo
d
resolution */
/*
p
oo
r
resolution */
#ifdef HAVE_GETTIMEOFDAY
(
void
)
gettimeofday
(
&
rdata
.
tv
,
NULL
);
#else
...
...
@@ -129,7 +131,7 @@ int lutil_entropy( char *buf, int nbytes )
lutil_MD5Init
(
&
ctx
);
lutil_MD5Update
(
&
ctx
,
(
char
*
)
&
rdata
,
sizeof
(
rdata
)
);
/*
use
caller to provided
information
*/
/*
allow
caller to provided
additional entropy
*/
lutil_MD5Update
(
&
ctx
,
(
char
*
)
&
buf
,
nbytes
);
lutil_MD5Final
(
digest
,
&
ctx
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment