Skip to content

crypto/rand: use getentropy(2) on OpenBSD #13785

Closed
@mmcco

Description

@mmcco

It's the progenitor of Linux's getrandom(2), which Go already supports. I have a patch that works on AMD64. I won't submit a pull request until it's tested on i386 and ARM (help welcome!).

This generally just involves mirroring the approach used for getrandom(2). However, we don't need to test for availability, as all supported OpenBSD releases have getentropy(2). The only other caveat is that I had to add syscall.Syscall2() for OpenBSD, as getentropy(2) takes two arguments.

The interface is very simple - here's the man page.

It's a pretty straightforward change. I just wanted to mention it as early as possible, as per the Contribution Guidelines.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions