Skip to content

Call RtlGenRandom() instead of CryptGetRandom() on Windows #111

Closed
@cpeterso

Description

@cpeterso

On Windows, os.rs can call RtlGenRandom() directly instead of jumping through hoops to obtain an HCRYPTPROV handle from CryptAcquireContextA()/CryptReleaseContext() before calling CryptGenRandom() (which just calls RtlGenRandom() itself).

Chromium, boringssl and ring, and Firefox all call RtlGenRandom() directly (which is actually exported from advapi32.dll as SystemFunction036()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    X-bugType: bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions