aboutsummaryrefslogtreecommitdiff
path: root/eim
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-21 15:58:57 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-21 15:58:57 +0200
commit5e39ebfa909091ee318866248434595d8d41b22d (patch)
treede657f80b35da336e8380564a615842e2de8423e /eim
parent7bc543a279dca902bbbefedb66e5f639b82de635 (diff)
Added test of access to trng from SW before trying to extract data.
Diffstat (limited to 'eim')
-rw-r--r--eim/sw/trng_extractor_eim.c6
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) {