<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>
Hal Murray pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a">feca8fab</a></strong>
<div>
<span>by Hal Murray</span>
<i>at 2015-12-18T17:40:13Z</i>
</div>
<pre class='commit-message'>Nuke libisc/random</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
<span class='deleted-file'>
−
libisc/include/isc/random.h
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
<span class='deleted-file'>
−
libisc/random.c
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
libisc/wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a#diff-0'>
<strong>
libisc/include/isc/random.h
</strong>
deleted
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libisc/include/isc/random.h
</span><span style="color: #000000;background-color: #ddffdd">+++ /dev/null
</span><span style="color: #aaaaaa">@@ -1,50 +0,0 @@
</span><span style="color: #000000;background-color: #ffdddd">-/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_ISC_RANDOM_H
-#define GUARD_ISC_RANDOM_H 1
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-/*! \file isc/random.h
- * \brief Implements a random state pool which will let the caller return a
- * series of possibly non-reproducible random values.
- *
- * Note that the
- * strength of these numbers is not all that high, and should not be
- * used in cryptography functions. It is useful for jittering values
- * a bit here and there, such as timeouts, etc.
- */
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_random_seed(uint32_t seed);
-/*%<
- * Set the initial seed of the random state.
- */
-
-void
-isc_random_get(uint32_t *val);
-/*%<
- * Get a random value.
- *
- * Requires:
- * val != NULL.
- */
-
-uint32_t
-isc_random_jitter(uint32_t max, uint32_t jitter);
-/*%<
- * Get a random value between (max - jitter) and (max).
- * This is useful for jittering timer values.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* GUARD_ISC_RANDOM_H */
</span></code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a#diff-1'>
<strong>
libisc/random.c
</strong>
deleted
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libisc/random.c
</span><span style="color: #000000;background-color: #ddffdd">+++ /dev/null
</span><span style="color: #aaaaaa">@@ -1,95 +0,0 @@
</span><span style="color: #000000;background-color: #ffdddd">-/*
- * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2003 Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-/*! \file */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <time.h> /* Required for time(). */
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <isc/once.h>
-#include <isc/random.h>
-#include <isc/util.h>
-
-static isc_once_t once = ISC_ONCE_INIT;
-
-static void
-initialize_rand(void)
-{
-#ifndef HAVE_ARC4RANDOM
- unsigned int pid = getpid();
-
- /*
- * The low bits of pid generally change faster.
- * Xor them with the high bits of time which change slowly.
- */
- pid = ((pid << 16) & 0xffff0000) | ((pid >> 16) & 0xffff);
-
- srand(time(NULL) ^ pid);
-#endif
-}
-
-static void
-initialize(void)
-{
- RUNTIME_CHECK(isc_once_do(&once, initialize_rand) == ISC_R_SUCCESS);
-}
-
-void
-isc_random_seed(uint32_t seed)
-{
- initialize();
-
-#ifndef HAVE_ARC4RANDOM
- srand(seed);
-#else
- arc4random_addrandom((u_char *) &seed, sizeof(uint32_t));
-#endif
-}
-
-void
-isc_random_get(uint32_t *val)
-{
- REQUIRE(val != NULL);
-
- initialize();
-
-#ifndef HAVE_ARC4RANDOM
- /*
- * rand()'s lower bits are not random.
- * rand()'s upper bit is zero.
- */
-#if RAND_MAX >= 0xfffff
- /* We have at least 20 bits. Use lower 16 excluding lower most 4 */
- *val = ((rand() >> 4) & 0xffff) | ((rand() << 12) & 0xffff0000);
-#elif RAND_MAX >= 0x7fff
- /* We have at least 15 bits. Use lower 10/11 excluding lower most 4 */
- *val = ((rand() >> 4) & 0x000007ff) | ((rand() << 7) & 0x003ff800) |
- ((rand() << 18) & 0xffc00000);
-#else
-#error RAND_MAX is too small
-#endif
-#else
- *val = arc4random();
-#endif
-}
-
-uint32_t
-isc_random_jitter(uint32_t max, uint32_t jitter) {
- uint32_t rnd;
-
- REQUIRE(jitter < max || (jitter == 0 && max == 0));
-
- if (jitter == 0)
- return (max);
-
- isc_random_get(&rnd);
- return (max - rnd % jitter);
-}
</span></code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a#diff-2'>
<strong>
libisc/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libisc/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libisc/wscript
</span><span style="color: #aaaaaa">@@ -9,7 +9,6 @@ def build(ctx):
</span> "log.c",
"md5.c",
"netaddr.c",
<span style="color: #000000;background-color: #ffdddd">- "random.c",
</span> "result.c",
"sha1.c",
"unix/errno2result.c",
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/feca8fab203c5a5a291839f07625ae0de885b49a"}}</script>
</p>
</div>
</body>
</html>