diff options
author | Petr Štetiar <ynezz@true.cz> | 2019-05-20 14:02:20 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-06-11 08:06:28 +0200 |
commit | 714bd89fceee494282984d0ed76e4a3acde419e0 (patch) | |
tree | 77db2fe4ccdd5c9b7324bbb5c60e8fe945e444d5 /package | |
parent | c53f62b1113459ade21f9540a41db66570097a7f (diff) | |
download | upstream-714bd89fceee494282984d0ed76e4a3acde419e0.tar.gz upstream-714bd89fceee494282984d0ed76e4a3acde419e0.tar.bz2 upstream-714bd89fceee494282984d0ed76e4a3acde419e0.zip |
urng: add micro non-physical true RNG based on timing jitter
μrngd is OpenWrt's micro non-physical true random number generator based
on timing jitter.
Using the Jitter RNG core, the rngd provides an entropy source that
feeds into the Linux /dev/random device if its entropy runs low. It
updates the /dev/random entropy estimator such that the newly provided
entropy unblocks /dev/random.
The seeding of /dev/random also ensures that /dev/urandom benefits from
entropy. Especially during boot time, when the entropy of Linux is low,
the Jitter RNGd provides a source of sufficient entropy.
Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'package')
-rw-r--r-- | package/system/urngd/Makefile | 48 | ||||
-rw-r--r-- | package/system/urngd/files/urngd.init | 17 |
2 files changed, 65 insertions, 0 deletions
diff --git a/package/system/urngd/Makefile b/package/system/urngd/Makefile new file mode 100644 index 0000000000..218d602d52 --- /dev/null +++ b/package/system/urngd/Makefile @@ -0,0 +1,48 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=urngd +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/ynezz/openwrt-urngd +PKG_SOURCE_DATE:=2019-05-27 +PKG_SOURCE_VERSION:=41e4163b2e7f4c1c1f51cdfa487d6052ff859cf2 +PKG_MIRROR_HASH:=303595b7ec7367264a159dbd26d1d18c7ee3cf5e10bab25a315a7ec621b80ab4 + +PKG_LICENSE:=GPL-2.0 BSD-3-Clause +PKG_LICENSE_FILES:= + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Base system + TITLE:=OpenWrt non-physical true random number generator based on timing jitter + DEPENDS:=+libubox +endef + +define Package/$(PKG_NAME)/description + urngd is OpenWrt's micro non-physical true random number generator based on + timing jitter. + + Using the Jitter RNG core, the rngd provides an entropy source that feeds into + the Linux /dev/random device if its entropy runs low. It updates the + /dev/random entropy estimator such that the newly provided entropy unblocks + /dev/random. + + The seeding of /dev/random also ensures that /dev/urandom benefits from + entropy. Especially during boot time, when the entropy of Linux is low, the + Jitter RNGd provides a source of sufficient entropy. +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/system/urngd/files/urngd.init b/package/system/urngd/files/urngd.init new file mode 100644 index 0000000000..7531ca8f39 --- /dev/null +++ b/package/system/urngd/files/urngd.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common + +START=00 + +USE_PROCD=1 +NAME=urngd +PROG=/sbin/urngd + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_close_instance +} + +reload_service() { + procd_send_signal $PROG +} |