Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 889116 - remove fallback on unix when urandom is not available; d…
…rop os2 support; r=mt,rrelyea

--HG--
extra : amend_source : fadd59392a21dfde1fc07708f8482d4c156d0b36
  • Loading branch information
franziskuskiefer committed Nov 11, 2016
1 parent 29082bf commit 3b5b0d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 465 deletions.
334 changes: 0 additions & 334 deletions lib/freebl/os2_rand.c

This file was deleted.

33 changes: 0 additions & 33 deletions lib/freebl/sysrand.c
Expand Up @@ -8,42 +8,9 @@

#include "seccomon.h"

#ifndef XP_WIN
static size_t rng_systemFromNoise(unsigned char *dest, size_t maxLen);
#endif

#if defined(XP_UNIX) || defined(XP_BEOS)
#include "unix_rand.c"
#endif
#ifdef XP_WIN
#include "win_rand.c"
#endif
#ifdef XP_OS2
#include "os2_rand.c"
#endif

#ifndef XP_WIN
/*
* Normal RNG_SystemRNG() isn't available, use the system noise to collect
* the required amount of entropy.
*/
static size_t
rng_systemFromNoise(unsigned char *dest, size_t maxLen)
{
size_t retBytes = maxLen;

while (maxLen) {
size_t nbytes = RNG_GetNoise(dest, maxLen);

PORT_Assert(nbytes != 0);

dest += nbytes;
maxLen -= nbytes;

/* some hw op to try to introduce more entropy into the next
* RNG_GetNoise call */
rng_systemJitter();
}
return retBytes;
}
#endif

0 comments on commit 3b5b0d3

Please sign in to comment.