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