Port NSS GetNoise() function to NSPR

RESOLVED FIXED

Status

defect
P3
normal
RESOLVED FIXED
20 years ago
20 years ago

People

(Reporter: larryh, Assigned: larryh)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Assignee

Description

20 years ago
NSS (crypto) requires truly random noise, not pseudo random number, for use in
seeding cryptographic key generation. NSS has existing function to do this
across multiple platforms; see /m/src/ns/security/lib/util/*rand.c. The
algorithms for some platforms extract randomness from the low-order bits of high
resolution timers. The extant functions in NSS are tightly coupled with other
NSS algorithms.

NSS proposed moving random number seed generation from NSS to NSPR. The reasons
cited for moving it are that NSPR is the place for puting platform specific
stuff and that a source of randomness was discovered to exist on Linux; the
extant Linux implementation provides no random data.

When porting the NSS random seed generation code to NSPR, tight coupling with
NSS will be removed. Specifically, calls to NSS functions will be removed from
the NSPR implementation. The linux implementation will be changed to use
/dev/random for extracting random noise from the underlying platform.
Assignee

Updated

20 years ago
Status: NEW → ASSIGNED
Assignee

Comment 1

20 years ago
See also: BugSplat: 369247.
Assignee

Comment 2

20 years ago
Checked in parts.

cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()" pr/include/nspr.h
Checking in pr/include/nspr.h;
/cvsroot/mozilla/nsprpub/pr/include/nspr.h,v  <--  nspr.h
new revision: 3.8; previous revision: 3.7
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/include/prrng.h
RCS file: /cvsroot/mozilla/nsprpub/pr/include/prrng.h,v
done
Checking in pr/include/prrng.h;
/cvsroot/mozilla/nsprpub/pr/include/prrng.h,v  <--  prrng.h
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/include/md/_macos.h
Checking in pr/include/md/_macos.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_macos.h,v  <--  _macos.h
new revision: 3.14; previous revision: 3.13
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/include/private/primpl.h
Checking in pr/include/private/primpl.h;
/cvsroot/mozilla/nsprpub/pr/include/private/primpl.h,v  <--  primpl.h
new revision: 3.29; previous revision: 3.28
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/Makefile
Checking in pr/src/Makefile;
/cvsroot/mozilla/nsprpub/pr/src/Makefile,v  <--  Makefile
new revision: 3.26; previous revision: 3.25
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/mac/macrng.c
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/mac/macrng.c,v
done
Checking in pr/src/md/mac/macrng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/mac/macrng.c,v  <--  macrng.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/os2/os2rng.c
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/os2/os2rng.c,v
done
Checking in pr/src/md/os2/os2rng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/os2/os2rng.c,v  <--  os2rng.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/unix/Makefile
Checking in pr/src/md/unix/Makefile;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/Makefile,v  <--  Makefile
new revision: 3.26; previous revision: 3.25
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/unix/Makefile.in
Checking in pr/src/md/unix/Makefile.in;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/Makefile.in,v  <--  Makefile.in
new revision: 1.10; previous revision: 1.9
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/unix/objs.mk
Checking in pr/src/md/unix/objs.mk;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/objs.mk,v  <--  objs.mk
new revision: 3.26; previous revision: 3.25
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/unix/os_HPUX.s
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/os_HPUX.s,v
done
Checking in pr/src/md/unix/os_HPUX.s;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/os_HPUX.s,v  <--  os_HPUX.s
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/unix/uxrng.c
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/uxrng.c,v
done
Checking in pr/src/md/unix/uxrng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/uxrng.c,v  <--  uxrng.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/windows/Makefile
Checking in pr/src/md/windows/Makefile;
/cvsroot/mozilla/nsprpub/pr/src/md/windows/Makefile,v  <--  Makefile
new revision: 3.6; previous revision: 3.5
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/md/windows/w32rng.c
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/windows/w32rng.c,v
done
Checking in pr/src/md/windows/w32rng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/windows/w32rng.c,v  <--  w32rng.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/misc/Makefile
Checking in pr/src/misc/Makefile;
/cvsroot/mozilla/nsprpub/pr/src/misc/Makefile,v  <--  Makefile
new revision: 3.8; previous revision: 3.7
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/src/misc/prrng.c
RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prrng.c,v
done
Checking in pr/src/misc/prrng.c;
/cvsroot/mozilla/nsprpub/pr/src/misc/prrng.c,v  <--  prrng.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/tests/Makefile
Checking in pr/tests/Makefile;
/cvsroot/mozilla/nsprpub/pr/tests/Makefile,v  <--  Makefile
new revision: 3.42; previous revision: 3.41
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/tests/randseed.c
RCS file: /cvsroot/mozilla/nsprpub/pr/tests/randseed.c,v
done
Checking in pr/tests/randseed.c;
/cvsroot/mozilla/nsprpub/pr/tests/randseed.c,v  <--  randseed.c
initial revision: 1.1
done
cvs commit -m"BugZilla: 19247. PR_GetRandomNoise()"  pr/tests/runtests.ksh
Checking in pr/tests/runtests.ksh;
/cvsroot/mozilla/nsprpub/pr/tests/runtests.ksh,v  <--  runtests.ksh
new revision: 1.11; previous revision: 1.10
done
Assignee

Comment 3

20 years ago
Add support for FreeBSD.
FreeBSD is like linux, having /dev/random.
The #elif defined(LINUX) will be changed to include FreeBSD.
The update was contributed by Fred Jacobs <lb@enteract.com>,
Computer Science Undergraduate, the University of Illinois at Urbana-Champaign.
Thanks Fred!
Assignee

Comment 4

20 years ago
Commit change supporting FreeBSD.
Checking in uxrng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/uxrng.c,v  <--  uxrng.c
new revision: 1.2; previous revision: 1.1
done
Assignee

Comment 5

20 years ago
Add support for platforms VMS, QNX, NTO.
Thanks to Jerry Kirk, Colin Blake for the contributions.

cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO"
build/autoconf/config.guess
Checking in build/autoconf/config.guess;
/cvsroot/mozilla/nsprpub/build/autoconf/config.guess,v  <--  config.guess
new revision: 1.3; previous revision: 1.2
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO"
build/autoconf/config.sub
Checking in build/autoconf/config.sub;
/cvsroot/mozilla/nsprpub/build/autoconf/config.sub,v  <--  config.sub
new revision: 1.4; previous revision: 1.3
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO" config/NTO.mk
Checking in config/NTO.mk;
/cvsroot/mozilla/nsprpub/config/NTO.mk,v  <--  NTO.mk
new revision: 1.3; previous revision: 1.2
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO" config/arch.mk
Checking in config/arch.mk;
/cvsroot/mozilla/nsprpub/config/arch.mk,v  <--  arch.mk
new revision: 3.13; previous revision: 3.12
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO"
pr/include/md/_nto.h
Checking in pr/include/md/_nto.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_nto.h,v  <--  _nto.h
new revision: 3.3; previous revision: 3.2
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO"
pr/src/md/unix/objs.mk
Checking in pr/src/md/unix/objs.mk;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/objs.mk,v  <--  objs.mk
new revision: 3.28; previous revision: 3.27
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO"
pr/src/md/unix/uxrng.c
Checking in pr/src/md/unix/uxrng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/uxrng.c,v  <--  uxrng.c
new revision: 1.3; previous revision: 1.2
done
cvs commit -m"BugZilla: 19247. Add support for VMS, QNX, NTO" pr/tests/Makefile
Checking in pr/tests/Makefile;
/cvsroot/mozilla/nsprpub/pr/tests/Makefile,v  <--  Makefile
new revision: 3.43; previous revision: 3.42
done
Assignee

Comment 6

20 years ago
update makefiles for Neutrino(NTO) platform.

Checking in Makefile;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/Makefile,v  <--  Makefile
new revision: 3.27; previous revision: 3.26
done
Checking in Makefile.in;
/cvsroot/mozilla/nsprpub/pr/src/md/unix/Makefile.in,v  <--  Makefile.in
new revision: 1.12; previous revision: 1.11
done
Assignee

Comment 7

20 years ago
Fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.