From 66e086a0bf950405a39a2933e55ec97451f97a48 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 12 May 2017 16:40:37 -0600 Subject: [PATCH] check return value of test case --- wolfcrypt/test/test.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 0ae6173d8..7974cbb37 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5246,7 +5246,8 @@ int random_test(void) return -5003; /* Basic RNG generate block test */ - random_rng_test(); + if (random_rng_test() != 0) + return -5004; return 0; } @@ -7658,7 +7659,14 @@ exit_rsa: FREE_VAR(out, HEAP_HINT); FREE_VAR(plain, HEAP_HINT); - return 0; + /* ret can be greater then 0 with certgen but all negative values should + * be returned and treated as an error */ + if (ret >= 0) { + return 0; + } + else { + return ret; + } } #endif