Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2020-02-15 16:09:56 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2020-02-15 16:09:56 +0300
commit3bbe34ea736968e572dbc65aaec2d91e217c6eff (patch)
tree164dd0070e7518c3ab0de6ff814f87e968c0fb37 /include/tests_crypto
parent5ca8baf7a8b3a31a4893d8130fa85f085d3b1ef2 (diff)
[CRYP-8004] enhanced after pulling in initital test
Diffstat (limited to 'include/tests_crypto')
-rw-r--r--include/tests_crypto16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/tests_crypto b/include/tests_crypto
index 9c40ff47..548ba0a0 100644
--- a/include/tests_crypto
+++ b/include/tests_crypto
@@ -196,22 +196,24 @@
#################################################################################
#
# Test : CRYP-8004
- # Description : Test for HWRNG & rngd
- Register --test-no CRYP-8004 --os Linux --weight L --network NO --root-only NO --category security --description "Test for HWRNG & rngd"
+ # Description : Test for presence of random number generators
+ Register --test-no CRYP-8004 --os Linux --weight L --network NO --root-only NO --category security --description "Presence of random number generators"
if [ ${SKIPTEST} -eq 0 ]; then
- if [ -f ${ROOTDIR}sys/class/misc/hw_random/rng_current ]; then
- DATA=$(${CAT_BINARY} ${ROOTDIR}sys/class/misc/hw_random/rng_current)
+ LogText "Test: looking for ${ROOTDIR}sys/class/misc/hw_random/rng_current"
+ if [ -f "${ROOTDIR}sys/class/misc/hw_random/rng_current" ]; then
+ DATA=$(${HEADBINARY} --lines=1 ${ROOTDIR}sys/class/misc/hw_random/rng_current | ${TRBINARY} -d '[[:cntrl:]]')
if [ "${DATA}" != "none" ]; then
- LogText "Result: found HW RNG: ${DATA}"
+ LogText "Result: positive match, found RNG: ${DATA}"
if IsRunning "rngd"; then
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_YES}" --color GREEN
LogText "Result: rngd is running"
else
Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color YELLOW
- ReportSuggestion "${TEST_NO}" "Utilize HW RNG by running rngd"
+ # TODO - enable suggestion when website has listing for this control
+ # ReportSuggestion "${TEST_NO}" "Utilize hardware random number generation by running rngd"
fi
else
- Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color RED
+ Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color YELLOW
LogText "Result: no HW RNG available"
fi
else