Re: Skalibs on OpenBSD

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Mon, 13 Feb 2017 22:23:14 +0000

>Don't. This looks like a portability issue. The definition of
>random_init() that makes use of arc4random_addrandom() is
>#ifdef-guarded. It gets picked up if macro SKALIBS_HASARC4RANDOM is
>defined, and whether it is (in <skalibs/sysdeps.h>) or not depends on
>the result of tests perfomed by skalib's 'configure' script.

   This.


>What it actually tests for is the presence of function
>arc4random_uniform(), probably assuming that if it is available, then
>arc4random_addrandom() will be as well, and looking at OpenBSD's man
>pages, it seems version 5.5 and later defeat that assumption.
> If that's really it, you did the right thing by reporting it here, and
>Laurent is going to love this one :D

  That's really it, and indeed you did the right thing, OP - thanks for
the report.
My bad for using an old version of OpenBSD for testing... but I'm
wondering
more and more if OpenBSD if even a target worth porting to, given that
it
shamelessly and purposefully breaks POSIX in several places, and that it
doesn't seem to care (as this report shows) about API stability either.

  I'll fix this one, but given I don't have access to my usual dev
environment, it
will be a few weeks in the making. (It requires adding new sysdeps to
check for
arc4random_addrandom(), and/or the new wonderful OpenBSD API to add
randomness: add_foobar_randomness() with various values of foobar,
knowing
that those functions take an int and not a stream of bytes, because of
course
they don't. And if none of these functions is available, what is one
supposed
to do?)

  I wish I had a quick workaround for the OP but since the API has
changed,
a workaround would take at least a few lines.
The quickest workaround is to comment out the call to
arc4random_addrandom() in skalibs' random_init.c, and pray that the
entropy
pool has already be correctly initialized. (That's effectively what the
OP already
does by commenting calls to random_init().)

  I'm not going to chase after OpenBSD for much longer. One of the next
times
they break something without giving a shit, I'll just drop support and
document
that since this OS isn't even trying to pretend to be nice to
developers, the heavy
lifting should be done by the OS maintainers, and if someone wants an
OpenBSD
port of my software, they should nag OpenBSD people for it.

--
  Laurent, who is loving this one indeed.
Received on Mon Feb 13 2017 - 22:23:14 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC