Closed Bug 303872 Opened 15 years ago Closed 15 years ago

RNG_SystemInfoForRNG() is missing from blapi and loader


(NSS :: Libraries, defect, P2)



(Not tracked)



(Reporter: nelson, Assigned: nelson)


The freebl files that enable us to dynamically load freebl and call the public
freebl functions declared in blapi.h does not expose the freebl function
RNG_SystemInfoForRNG.  Consequently, no version of softoken is able to seed
the PRNG in freebl shared libs.  This was probably my mistake, back in the 
NSS 3.3 timeframe.

To work around this, a copy of sysrand.o was added long ago to libfreebl.a,
along with the dynamic loader.  (libfreebl.a is supposed to contain ONLY the 
loader on platforms that use freebl shared libs.)  That makes softoken link, 
but it also means that there are two copies of the PRNG, and only one copy is 
properly seeded.  (I don't understand why there aren't warnings about 
duplicate symbols when softoken is loaded that way.)

The fix is to put RNG_SystemInfoForRNG into blapi.h, loader.c, loader.h,
and ldvector.c, and remove sysrand from libfreebl.a

I have a large patch for something else that now includes this fix.  I will
try to separate out the part of the patch necessary to fix this problem by
itself on the trunk.
P1 for NSS 3.11
Priority: -- → P1
Target Milestone: --- → 3.11
Version: 3.10 → 3.3
Per our meeting today, lowering to P2.
Priority: P1 → P2
Per our meeting today, this is P1 for 3.11.1 .
Priority: P2 → P1
Target Milestone: 3.11 → 3.11.1
Nelson, you wrote:
> The fix is to put RNG_SystemInfoForRNG into blapi.h,
> loader.c, loader.h, and ldvector.c, and remove sysrand
> from libfreebl.a

I'm happy to report that we took care of this in these
- lib/freebl/blapi.h, rev. 1.23: added RNG_SystemInfoForRNG
- lib/freebl/loader.c, rev. 1.22: added RNG_SystemInfoForRNG
- lib/freebl/loader.h, rev. 1.16: added p_RNG_SystemInfoForRNG
- lib/freebl/ldvector.c, rev. 1.12: added RNG_SystemInfoForRNG
- lib/freebl/, rev. 1.12: removed sysrand.o from

Please verify.

The CVS commit comment is:
date: 2005/09/07 02:47:16;  author:;  state: Exp;  [...]
Bug 303508: Add freebl shared libs that do 64-bit integer math.  Bug 274984: sof
token fails to load freebl in setuid programs.  freebl becomes a shared library
on all platforms.  r=nelson
Modified Files:
        coreconf/ coreconf/
        nss/cmd/shlibsign/Makefile nss/cmd/shlibsign/
        nss/lib/freebl/Makefile nss/lib/freebl/arcfour.c
        nss/lib/freebl/blapi.h nss/lib/freebl/
        nss/lib/freebl/ldvector.c nss/lib/freebl/loader.c
        nss/lib/freebl/loader.h nss/lib/freebl/
Added Files:
Closed: 15 years ago
Priority: P1 → P2
Resolution: --- → FIXED
Target Milestone: 3.11.1 → 3.11
Thanks, Wan-Teh, it sure does look fixed.
You need to log in before you can comment on or make changes to this bug.