Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163509282
D53460.id166078.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D53460.id166078.diff
View Options
diff --git a/share/man/man4/random.4 b/share/man/man4/random.4
--- a/share/man/man4/random.4
+++ b/share/man/man4/random.4
@@ -30,6 +30,7 @@
.Sh SYNOPSIS
.Cd "options RANDOM_LOADABLE"
.Cd "options RANDOM_ENABLE_ETHER"
+.Cd "options RANDOM_ENABLE_TPM"
.Cd "options RANDOM_ENABLE_UMA"
.Sh DESCRIPTION
The
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -309,7 +309,6 @@
device crypto # core crypto support
device aesni # AES-NI OpenCrypto module
device loop # Network loopback
-device rdrand_rng # Intel Bull Mountain RNG
device ether # Ethernet support
device vlan # 802.1Q VLAN support
device tuntap # Packet tunnel.
@@ -323,6 +322,11 @@
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter
+# random(4)
+device rdrand_rng # Intel Bull Mountain RNG
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
+
# USB support
options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface
diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL
--- a/sys/amd64/conf/MINIMAL
+++ b/sys/amd64/conf/MINIMAL
@@ -113,7 +113,6 @@
# Pseudo devices.
device loop # Network loopback
-device rdrand_rng # Intel Bull Mountain RNG
device ether # Ethernet support
# The `bpf' device enables the Berkeley Packet Filter.
@@ -121,6 +120,11 @@
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter
+# random(4)
+device rdrand_rng # Intel Bull Mountain RNG
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
+
# VirtIO support
device virtio # Generic VirtIO bus (required)
device virtio_pci # VirtIO PCI device
diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC
--- a/sys/arm/conf/GENERIC
+++ b/sys/arm/conf/GENERIC
@@ -216,6 +216,10 @@
device neta # Marvell 10/100/1000 Network controller
device smsc # SMSC LAN91C111
+# random(4)
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
+
# Sound support
device sound
diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64
--- a/sys/arm64/conf/std.arm64
+++ b/sys/arm64/conf/std.arm64
@@ -106,3 +106,7 @@
# SMBIOS -- all EFI platforms
device smbios
+
+# random(4)
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2829,6 +2829,8 @@
# environment.
options RANDOM_ENABLE_ETHER # ether_input
+options RANDOM_ENABLE_TPM # implies TPM_HARVEST
+
# Module to enable execution of application via emulators like QEMU
options IMGACT_BINMISC
diff --git a/sys/conf/options b/sys/conf/options
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -960,6 +960,7 @@
# the uma slab allocator.
RANDOM_ENABLE_UMA opt_global.h
RANDOM_ENABLE_ETHER opt_global.h
+RANDOM_ENABLE_TPM opt_global.h
# This options turns TPM into entropy source.
TPM_HARVEST opt_tpm.h
diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c
--- a/sys/dev/tpm/tpm20.c
+++ b/sys/dev/tpm/tpm20.c
@@ -42,7 +42,7 @@
MALLOC_DEFINE(M_TPM20, "tpm_buffer", "buffer for tpm 2.0 driver");
static void tpm20_discard_buffer(void *arg);
-#ifdef TPM_HARVEST
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
static void tpm20_harvest(void *arg, int unused);
#endif
static int tpm20_save_state(device_t dev, bool suspend);
@@ -184,7 +184,7 @@
return (ENOTTY);
}
-#ifdef TPM_HARVEST
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
static const struct random_source random_tpm = {
.rs_ident = "TPM",
.rs_source = RANDOM_PURE_TPM,
@@ -212,7 +212,7 @@
if (result != 0)
tpm20_release(sc);
-#ifdef TPM_HARVEST
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
random_source_register(&random_tpm);
TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0,
tpm20_harvest, sc);
@@ -227,7 +227,7 @@
tpm20_release(struct tpm_sc *sc)
{
-#ifdef TPM_HARVEST
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
if (device_is_attached(sc->dev))
taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task);
random_source_deregister(&random_tpm);
@@ -254,7 +254,7 @@
return (tpm20_save_state(dev, false));
}
-#ifdef TPM_HARVEST
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
/*
* Get TPM_HARVEST_SIZE random bytes and add them
* into system entropy pool.
diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC
--- a/sys/riscv/conf/GENERIC
+++ b/sys/riscv/conf/GENERIC
@@ -204,6 +204,10 @@
device iicbus # Bus support, required for iicoc below.
device iicoc # OpenCores I2C controller support
+# random(4)
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
+
# Include SoC specific configuration
include "std.allwinner"
include "std.cvitek"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 11:06 PM (6 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35455553
Default Alt Text
D53460.id166078.diff (4 KB)
Attached To
Mode
D53460: random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM
Attached
Detach File
Event Timeline
Log In to Comment