From e1a0a9dc10aeecd95071d5eeca8c7a6f7e22d2f1 Mon Sep 17 00:00:00 2001 From: Ken MacKay Date: Sat, 3 May 2014 21:48:58 -0700 Subject: [PATCH] Make tests check for failures in uECC_make_key() --- test/test_ecdh.c | 7 +++++-- test/test_ecdsa.c | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/test_ecdh.c b/test/test_ecdh.c index 3b606db..713eeb2 100644 --- a/test/test_ecdh.c +++ b/test/test_ecdh.c @@ -34,8 +34,11 @@ int main() printf("."); fflush(stdout); - uECC_make_key(l_public1, l_private1); - uECC_make_key(l_public2, l_private2); + if(!uECC_make_key(l_public1, l_private1) || !uECC_make_key(l_public2, l_private2)) + { + printf("uECC_make_key() failed\n"); + return 1; + } if(!uECC_shared_secret(l_public2, l_private1, l_secret1)) { diff --git a/test/test_ecdsa.c b/test/test_ecdsa.c index 46022ec..d3a84f9 100644 --- a/test/test_ecdsa.c +++ b/test/test_ecdsa.c @@ -23,7 +23,11 @@ int main() printf("."); fflush(stdout); - uECC_make_key(l_public, l_private); + if(!uECC_make_key(l_public, l_private)) + { + printf("uECC_make_key() failed\n"); + continue; + } memcpy(l_hash, l_public, uECC_BYTES); if(!uECC_sign(l_private, l_hash, l_sig))