diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2015-04-21 15:58:57 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2015-04-21 15:58:57 +0200 |
commit | 5e39ebfa909091ee318866248434595d8d41b22d (patch) | |
tree | de657f80b35da336e8380564a615842e2de8423e /eim/sw | |
parent | 7bc543a279dca902bbbefedb66e5f639b82de635 (diff) |
Added test of access to trng from SW before trying to extract data.
Diffstat (limited to 'eim/sw')
-rw-r--r-- | eim/sw/trng_extractor_eim.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |