mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-18 18:18:00 -05:00
639. [bug] Reading entropy from the keyboard would sometimes fail.
[RT #591] note: the entropy callback conventions should really be documented.
This commit is contained in:
parent
801dceea23
commit
ee303f481d
5 changed files with 14 additions and 8 deletions
3
CHANGES
3
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]
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -74,10 +74,11 @@
|
|||
#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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue