Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #17981

Closed (moved)
(moved)
Open
Created Jan 03, 2016 by Trac@tracbot

[PATCH] replace getentropy() with arc4random_buf()

This patch will probably raise a few eyebrows.

Mark Kettenis (senior openbsd dev) sent a mail to another developer concerning getentropy():

Noticed the following commit:

CVSROOT: /cvs Module name: ports Changes by: robert@cvs.openbsd.org 2016/01/02 06:57:12

Modified files: mail/zarafa/zarafa: Makefile mail/zarafa/zarafa/patches: patch-common_platform_linux_cpp patch-configure_ac

Log message: use getentropy(2) instead of directly opening /dev/urandom; this unbreaks zarafa-webapp running with chroot'd php

This really looks like a case where you should be calling arc4random_buf(3) instead of getentropy(2). In fact calling getentropy(2) is almost always the wrong approach.

OpenBSD subsequently amended the man page for getentropy() to clarify this:

http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2?query=getentropy&sec=2

getentropy() is not intended for regular code; please use the arc4random(3) family of functions instead.

Attached is a patch that replaces getentropy() with arc4random_buf(). Feedback welcomed.

Trac:
Username: logan

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking