From 40acdc111d34b7ed040f4cb652f65ca7ed22afd6 Mon Sep 17 00:00:00 2001 From: pyllyukko Date: Mon, 6 Jan 2020 21:22:00 +0200 Subject: Added CRYP-8004 --- include/tests_crypto | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include/tests_crypto') diff --git a/include/tests_crypto b/include/tests_crypto index 44f19cdc..9c40ff47 100644 --- a/include/tests_crypto +++ b/include/tests_crypto @@ -194,6 +194,33 @@ fi # ################################################################################# +# + # 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" + 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) + if [ "${DATA}" != "none" ]; then + LogText "Result: found HW 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" + fi + else + Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color RED + LogText "Result: no HW RNG available" + fi + else + Display --indent 2 --text "- HW RNG & rngd" --result "${STATUS_NO}" --color RED + LogText "Result: could not find ${ROOTDIR}sys/class/misc/hw_random/rng_current" + fi + fi +# +################################################################################# # WaitForKeyPress -- cgit v1.2.3