Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD. #66092

Merged
merged 2 commits into from
Nov 6, 2019

Commits on Nov 4, 2019

  1. Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.

    This system call is present on all supported NetBSD versions and
    provides an endless stream of non-blocking random data from the
    kernel's ChaCha20-based CSPRNG. It doesn't require a file descriptor
    to be opened.
    
    The system call is documented here (under kern.arandom):
    https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-7.0
    
    And defined here:
    https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#273
    
    The semantics are the same as FreeBSD so reading 256 bytes per call
    is fine.
    
    Similar change for getrandom crate: rust-random/getrandom#115
    alarixnia committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    23d2211 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4f92ea View commit details
    Browse the repository at this point in the history