]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
639. [bug] Reading entropy from the keyboard would sometimes fail.
authorBrian Wellington <source@isc.org>
Wed, 27 Dec 2000 00:11:26 +0000 (00:11 +0000)
committerBrian Wellington <source@isc.org>
Wed, 27 Dec 2000 00:11:26 +0000 (00:11 +0000)
                        [RT #591]

note: the entropy callback conventions should really be documented.

CHANGES
bin/dnssec/dnssectool.c
lib/isc/include/isc/result.h
lib/isc/result.c
lib/isc/unix/entropy.c

diff --git a/CHANGES b/CHANGES
index b730e0110cc92186ecef71245f212489c9a82396..aed9c0f0958cba93a16b875e134af60bd524f948 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 
+ 639.  [bug]           Reading entropy from the keyboard would sometimes fail.
+                       [RT #591]
+
  638.  [port]          lib/isc/random.c needed to explicitly include
                        time.h explicitly to get a prototype for time() when
                        pthreads was not being used. [RT #592]
index 1f4e92d367a06ae60d8d8200bfb35e94a6dff9a8..1f5d4e52ab093aff3084175ebf48769667c25854 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssectool.c,v 1.25 2000/12/11 19:15:51 bwelling Exp $ */
+/* $Id: dnssectool.c,v 1.26 2000/12/27 00:11:23 bwelling Exp $ */
 
 #include <config.h>
 
@@ -235,7 +235,7 @@ kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
        unsigned char c;
 
        if (!blocking)
-               return (ISC_R_NOENTROPY);
+               return (ISC_R_NOTBLOCKING);
 
        result = isc_keyboard_getchar(kbd, &c);
        if (result != ISC_R_SUCCESS)
index fa979d8ccf3267de20d263bff01b177311f30d2d..3f2f7c7c12f5b2d6e43d9dd21cfbf7930d4c902c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: result.h,v 1.52 2000/11/18 02:56:47 gson Exp $ */
+/* $Id: result.h,v 1.53 2000/12/27 00:11:25 bwelling Exp $ */
 
 #ifndef ISC_RESULT_H
 #define ISC_RESULT_H 1
 #define ISC_R_FAMILYNOSUPPORT          48      /* AF not supported */
 #define ISC_R_BADHEX                   49      /* bad hex encoding */
 #define ISC_R_TOOMANYOPENFILES         50      /* too many open files */
+#define ISC_R_NOTBLOCKING              51      /* not blocking */
 /*
  * Not a result code: the number of results.
  */
-#define ISC_R_NRESULTS                         51
+#define ISC_R_NRESULTS                         52
 
 ISC_LANG_BEGINDECLS
 
index ce27208eacb4548c49f15b16122113fc645ae627..c0d116f4cdd06a76d67e7a9433b783e6d2eb7bd3 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: result.c,v 1.51 2000/12/06 00:30:07 tale Exp $ */
+/* $Id: result.c,v 1.52 2000/12/27 00:11:24 bwelling Exp $ */
 
 #include <config.h>
 
@@ -88,7 +88,8 @@ static const char *text[ISC_R_NRESULTS] = {
        "address family mismatch",              /* 47 */
        "address family not supported",         /* 48 */
        "bad hex encoding",                     /* 49 */
-       "too many open files"                   /* 50 */
+       "too many open files",                  /* 50 */
+       "not blocking"                          /* 51 */
 };
 
 #define ISC_RESULT_RESULTSET                   2
index 61db8dce07d1e496d0984eae127dc62012570ca5..1cefc858d175a5a7ef551da153d91e7fe6b69d8c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: entropy.c,v 1.53 2000/12/14 22:40:17 gson Exp $ */
+/* $Id: entropy.c,v 1.54 2000/12/27 00:11:26 bwelling Exp $ */
 
 #include <config.h>
 
@@ -442,7 +442,8 @@ get_from_callback(isc_entropysource_t *source, unsigned int desired,
                        added += got;
                        desired -= ISC_MIN(got, desired);
                        result = ISC_R_SUCCESS;
-               } else if (result != ISC_R_SUCCESS)
+               } else if (result != ISC_R_SUCCESS &&
+                          result != ISC_R_NOTBLOCKING)
                        source->bad = ISC_TRUE;
 
        }