[Cryptech-Commits] [core/platform/novena] 01/01: Added test of access to trng from SW before trying to extract data.

git at cryptech.is git at cryptech.is
Tue Apr 21 13:59:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch master
in repository core/platform/novena.

commit 5e39ebfa909091ee318866248434595d8d41b22d
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Tue Apr 21 15:58:57 2015 +0200

    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(+)

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) {



More information about the Commits mailing list