public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-apps/rng-tools/files: rngd-initd-3 rngd-confd-3 rngd_tpm_support2.patch rngd_tpm_support.patch
@ 2010-11-08 12:18 Krzysztof Pawlik (nelchael)
  0 siblings, 0 replies; only message in thread
From: Krzysztof Pawlik (nelchael) @ 2010-11-08 12:18 UTC (permalink / raw
  To: gentoo-commits

nelchael    10/11/08 12:18:53

  Added:                rngd-initd-3 rngd-confd-3
  Removed:              rngd_tpm_support2.patch rngd_tpm_support.patch
  Log:
  Version bump, remove old versions. rng-tools-3 contains support for TPM devices.
  
  (Portage version: 2.1.9.24/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-apps/rng-tools/files/rngd-initd-3

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/rngd-initd-3?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/rngd-initd-3?rev=1.1&content-type=text/plain

Index: rngd-initd-3
===================================================================
#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/files/rngd-initd-3,v 1.1 2010/11/08 12:18:53 nelchael Exp $

depend() {
	need localmount
	after random
}

BINARY=/usr/sbin/rngd
# Do NOT add /dev/tpm to this.
DEFAULT_DEVICE="/dev/hw_random* /dev/hwrandom* /dev/i810_rng /dev/hwrng*"
DEFAULT_TPM_DEVICE="/dev/tpm*"
[ $DO_NOT_REMIX_URANDOM -eq 0 ] && DEFAULT_DEVICE="${DEFAULT_DEVICE} /dev/urandom"

find_device() {
	# The echo is to cause globbing
	for d in $*; do
		[ -e "$d" ] && break
	done
	echo "$d"
}

find_rng_device() {
	local d="$(find_device $(echo ${DEVICE-${DEFAULT_DEVICE}}))"
	[ -z "${d}" ] && d=/dev/null
	echo "$d"
}

find_tpm_device() {
	local d="$(find_device $(echo ${TPM_DEVICE-${DEFAULT_TPM_DEVICE}}))"
	[ -z "${d}" ] && d=/dev/null
	echo "$d"
}

start() {
	local d t
	d="$(find_rng_device)"
	[ "${NO_TPM}" == "1" ] || t="$(find_tpm_device)"
	[ -z "${d}" ] && d=/dev/null
	[ -z "${t}" ] && t=/dev/null
	# TODO: find a better way to handle multiple feedback devices.
	# Notice that we only warn if TPM is not available.
	[ "$d" == "/dev/urandom" -a "$t" == "/dev/null" ] && ewarn "No hardware RNG found, using $d as feedback input"
	# Now sanity check and start.
	if [ "$d" != "/dev/null" -o "$t" != "/dev/null" ]; then
		ebegin "Starting hardware RNG daemon"
		start-stop-daemon --start --quiet --exec ${BINARY} -- -b -s ${STEP-64} -t ${TIMEOUT-60} --no-tpm=${NO_TPM-0} -W ${WATERMARK-2048} -r $d
		eend $? "Failed to start hardware RNG daemon"
	else
		eerror "No hardware RNG or feedback source available."
		return 1
	fi
}

stop() {
	ebegin "Stopping hardware RNG daemon"
	start-stop-daemon --stop --quiet --exec ${BINARY}
	eend $? "Failed to stop hardware RNG daemon"
}



1.1                  sys-apps/rng-tools/files/rngd-confd-3

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/rngd-confd-3?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/rngd-confd-3?rev=1.1&content-type=text/plain

Index: rngd-confd-3
===================================================================
# /etc/conf.d/rngd

# Please see "/usr/sbin/rngd --help" and "man rngd" for more information

# If a single device is preferred, then specify it here, otherwise we will
# search for suitable devices. TPM is specified via a later option, not this
# one.
#DEVICE=
#TPM_DEVICE=

# Random step (Number of bytes written to random-device at a time):
STEP=64

# Timeout (Interval written to random-device when the entropy pool is full):
TIMEOUT=60

# Should TPM be avoided?
NO_TPM=0

# Fill watermark
# 0 <= n <= 4096
WATERMARK=2048

# Bug #292239: Remixing /dev/urandom back into /dev/random is considered a
# security vulnerability in some cases where not enough entropy is present on
# systems.
DO_NOT_REMIX_URANDOM=0






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-08 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 12:18 [gentoo-commits] gentoo-x86 commit in sys-apps/rng-tools/files: rngd-initd-3 rngd-confd-3 rngd_tpm_support2.patch rngd_tpm_support.patch Krzysztof Pawlik (nelchael)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox