Closed
Bug 356595
Opened 18 years ago
Closed 18 years ago
On Windows, RNG_SystemInfoForRNG calls GetCurrentProcess, which returns the constant (HANDLE)-1.
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
3.12
People
(Reporter: wtc, Assigned: wtc)
Details
Attachments
(1 file, 1 obsolete file)
1020 bytes,
patch
|
Details | Diff | Splinter Review |
On Windows, RNG_SystemInfoForRNG calls GetCurrentProcess to
get the current process's handle. But this handle is a
pseudo handle and is a special constant, currently 0xffffffff,
or (HANDLE)-1. There is no time-varying or machine-varying
bit in that value.
Assignee | ||
Comment 1•18 years ago
|
||
It is possible to call DuplicateHandle on the pseudo process handle
to get the real process handle, but I am going to do a quick fix today.
I'm going to replace the GetCurrentProcess call with a GetCurrentThreadId
call.
Attachment #242213 -
Flags: superreview?(neil.williams)
Attachment #242213 -
Flags: review?(glen.beasley)
Updated•18 years ago
|
Attachment #242213 -
Flags: review?(glen.beasley) → review+
Comment 2•18 years ago
|
||
What "fix"?
It never hurts to input constant data into a PRNG.
It doesn't lessen the PRNG's entropy any.
This can't be high priority.
Assignee | ||
Comment 3•18 years ago
|
||
The GetCurrentProcess call is useless and it's easy to
replace it with a GetCurrentThreadId call, which returns
a time-varying (system global) thread id. I can keep the
GetCurrentProcess call with a comment noting that it returns
a constant. If you don't want me to add the GetCurrentThreadId
call on the NSS_3_11_BRANCH, I'll only add it to the NSS trunk.
Updated•18 years ago
|
Attachment #242213 -
Flags: superreview?(neil.williams) → superreview+
Assignee | ||
Comment 4•18 years ago
|
||
I did not remove the GetCurrentProcess call. I just
noted in the comment that it returns a constant pseudo
handle.
I only checked in the patch on the NSS trunk (NSS 3.12).
Checking in win_rand.c;
/cvsroot/mozilla/security/nss/lib/freebl/win_rand.c,v <-- win_rand.c
new revision: 1.12; previous revision: 1.11
done
Attachment #242213 -
Attachment is obsolete: true
Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: 3.11.4 → 3.12
Assignee | ||
Comment 5•18 years ago
|
||
GetCurrentProcess returns 0xffffffff, or (HANDLE) -1.
GetCurrentThread returns 0xfffffffe. Both are pseudo
handles.
You need to log in
before you can comment on or make changes to this bug.
Description
•