Check correct returned value

This commit is contained in:
Tesfa Mael
2020-07-16 10:39:03 -07:00
parent cebb283822
commit 4cc7f9e4a9

View File

@ -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;
}