From 5e39ebfa909091ee318866248434595d8d41b22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Tue, 21 Apr 2015 15:58:57 +0200 Subject: Added test of access to trng from SW before trying to extract data. --- eim/sw/trng_extractor_eim.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'eim') diff --git a/eim/sw/trng_extractor_eim.c b/eim/sw/trng_extractor_eim.c index 330c153..711ede1 100644 --- a/eim/sw/trng_extractor_eim.c +++ b/eim/sw/trng_extractor_eim.c @@ -134,6 +134,12 @@ int main(int argc, char *argv[]) FILE *output = stdout; uint32_t data; + // Check that we have can talk to the trng. + if (avalanche_check() || rosc_check() || trng_check()) { + fprintf(stderr, "Can't properly access the trng.\n"); + return EXIT_FAILURE; + } + /* parse command line */ while ((opt = getopt(argc, argv, "h?arcn:o:")) != -1) { switch (opt) { -- cgit v1.2.3