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
Unknown Object (File)
Sun, Feb 16, 3:42 AM
Unknown Object (File)
Wed, Jan 29, 7:28 AM
Unknown Object (File)
Tue, Jan 28, 12:46 AM
Unknown Object (File)
Mon, Jan 27, 5:05 PM
Unknown Object (File)
Mon, Jan 27, 5:02 PM
Unknown Object (File)
Sun, Jan 26, 6:00 PM
Unknown Object (File)
Sat, Jan 25, 6:00 AM
Unknown Object (File)
Sat, Jan 25, 5:39 AM
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