From 4cc7f9e4a9443bca048bcf2a35a4c9dfa56ed6f3 Mon Sep 17 00:00:00 2001 From: Tesfa Mael Date: Thu, 16 Jul 2020 10:39:03 -0700 Subject: [PATCH] Check correct returned value --- wolfcrypt/test/test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index d9e653a30..7cf78c58d 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -11579,9 +11579,12 @@ static int rsa_decode_test(RsaKey* keyPub) ret = -7473; goto done; } - /* TODO: probably should fail when length is -1! */ ret = wc_RsaPublicKeyDecodeRaw(n, (word32)-1, e, sizeof(e), keyPub); +#ifndef WOLFSSL_SP_MATH if (ret != 0) { +#else + if (ret != ASN_GETINT_E) { +#endif ret = -7474; goto done; } @@ -11590,7 +11593,11 @@ static int rsa_decode_test(RsaKey* keyPub) if (ret != 0) return -7475; ret = wc_RsaPublicKeyDecodeRaw(n, sizeof(n), e, (word32)-1, keyPub); +#ifndef WOLFSSL_SP_MATH if (ret != 0) { +#else + if (ret != ASN_GETINT_E) { +#endif ret = -7476; goto done; }