Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: nss/lib/freebl/sysrand.c

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « nss/lib/freebl/shvfy.c ('k') | nss/lib/freebl/tlsprfalg.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifdef FREEBL_NO_DEPEND
6 #include "stubs.h"
7 #endif
8
9 #include "seccomon.h"
10
11 #ifndef XP_WIN
12 static size_t rng_systemFromNoise(unsigned char *dest, size_t maxLen);
13 #endif
14
15 #if defined(XP_UNIX) || defined(XP_BEOS)
16 #include "unix_rand.c"
17 #endif
18 #ifdef XP_WIN
19 #include "win_rand.c"
20 #endif
21 #ifdef XP_OS2
22 #include "os2_rand.c"
23 #endif
24
25 #ifndef XP_WIN
26 /*
27 * Normal RNG_SystemRNG() isn't available, use the system noise to collect
28 * the required amount of entropy.
29 */
30 static size_t
31 rng_systemFromNoise(unsigned char *dest, size_t maxLen)
32 {
33 size_t retBytes = maxLen;
34
35 while (maxLen) {
36 size_t nbytes = RNG_GetNoise(dest, maxLen);
37
38 PORT_Assert(nbytes != 0);
39
40 dest += nbytes;
41 maxLen -= nbytes;
42
43 /* some hw op to try to introduce more entropy into the next
44 * RNG_GetNoise call */
45 rng_systemJitter();
46 }
47 return retBytes;
48 }
49 #endif
OLDNEW
« no previous file with comments | « nss/lib/freebl/shvfy.c ('k') | nss/lib/freebl/tlsprfalg.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698