opnsense-src/stand
Colin Percival c8ebbd28aa loader: Expand EFI entropy if < 2048 bytes
The EFI RNG on some platforms takes a long time if we request 2048
bytes of entropy, so we would like to request less; but our kernel
Fortuna RNG needs to be fed 2048 bytes in order to consider itself
"fully seeded".  If we have between 64 bytes (the size of a single
Fortuna pool and enough to guarantee cryptographic security) and
2048 bytes (what Fortuna wants) then the boot process will hang
waiting for more entropy despite in fact having enough to operate
securely.

Since 64 bytes of entropy is plenty to be cryptographically secure
(an attack of cost ~ 2^128 is infeasible, which implies a mere 16
bytes of entropy), use PBKDF2 (aka pkcs5v2_genkey_raw) to spread
the entropy across 2048 bytes.  This is secure since PBKDF2 has
the property that every subset of output bytes has within O(1) of
the maximum possible amount of entropy.

Reviewed by:	pjd
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46635
2024-09-22 00:35:48 -07:00
..
arm64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
common loader: Add TSLOG to interpreter built-ins 2024-09-22 00:35:47 -07:00
defaults loader: Make EFI entropy size configurable 2024-09-22 00:35:47 -07:00
efi loader: Expand EFI entropy if < 2048 bytes 2024-09-22 00:35:48 -07:00
fdt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ficl stand: Remove dangling mips references 2024-02-28 07:09:41 -07:00
ficl32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fonts Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
forth Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
i386 pxeboot: Enforce a 500k limit here 2024-08-06 17:22:36 -06:00
images Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kboot loader: Bump all versions to 3.0 2024-07-29 16:57:22 -06:00
kshim Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblua Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblua32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libofw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsa loader: Make pkcs5v2 unconditionally available 2024-09-22 00:35:47 -07:00
libsa32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lua loader: Make EFI entropy size configurable 2024-09-22 00:35:47 -07:00
man loader.efi.8: BOOOTX64.EFI: fix typo 2024-09-21 05:25:15 -06:00
powerpc loader: Bump all versions to 3.0 2024-07-29 16:57:22 -06:00
uboot loader: update dependencies for dirdeps build 2024-09-18 11:22:34 -04:00
usb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
userboot loader: Bump all versions to 3.0 2024-07-29 16:57:22 -06:00
defs.mk stand/efi: Add a 32-bit variant of libefi 2024-09-20 08:45:05 -06:00
fdt.mk stand: Rename LIBFDT to LIBSAFDT 2023-11-07 09:57:32 -05:00
ficl.mk Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
loader.mk Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
lua.mk Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile stand/efi: Add a 32-bit variant of libefi 2024-09-20 08:45:05 -06:00
Makefile.amd64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
veriexec.mk libsecureboot do not report expected unverified files 2024-02-12 14:35:01 -08:00