Page MenuHomeFreeBSD

openssl: Add <sys/random.h> include for getrandom()
ClosedPublic

Authored by jhb on Jul 17 2024, 1:59 PM.
Tags
None
Referenced Files
F102035851: D45995.diff
Wed, Nov 6, 7:30 PM
Unknown Object (File)
Mon, Oct 21, 7:03 PM
Unknown Object (File)
Tue, Oct 15, 9:50 PM
Unknown Object (File)
Tue, Oct 15, 1:00 AM
Unknown Object (File)
Mon, Oct 14, 7:09 AM
Unknown Object (File)
Sun, Oct 13, 3:13 AM
Unknown Object (File)
Fri, Oct 11, 10:31 PM
Unknown Object (File)
Tue, Oct 8, 9:14 PM
Subscribers

Details

Summary

GCC 14 (but not earlier versions) warns about a missing prototype
for getrandom(). Include <sys/random.h> explicitly to bring in the
prototype rather than depending on a nested include. While here,
stop defining sysctl_random() since it is no longer used.

Fixes: 838b6caababb openssl: use getrandom(2) instead of probing for getentropy(2)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58677
Build 55565: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Jul 17 2024, 1:59 PM
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
31

I'm not sure why this is checking for OPENSSL_SYS_UEFI instead of KERN_ARND. That seems like an upstream bug.

No good explanation here:

https://github.com/openssl/openssl/commit/e2e4b784e65eaafb133a7db3d344446c43112d41

This commit seems a bit odd though and suggests we should instead move this down condition down to follow where FreeBSD goes?

https://github.com/openssl/openssl/commit/1fa90bb3a9089f974e9b07f3e76a964bd2da6976

231

If this is upstreamed as-is then this block can be removed as well.

crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
216

In the change proposed we still use this on FreeBSD versions earlier than 12.x for now: https://github.com/openssl/openssl/pull/24903/files

We should have a follow-up discussion with them about what they want OS support wise, I suspect there's a lot of cruft that can go away from long-since EoL versions.

This revision is now accepted and ready to land.Jul 29 2024, 8:33 PM