wolfcrypt/src/rsa.c: in wc_RsaFunction_ex(), if defined(WOLF_CRYPTO_CB_ONLY_RSA), add clause to return NO_VALID_DEVID if key->devId == INVALID_DEVID. fixes "control reaches end of non-void function" in PRB-single-flag.txt.

This commit is contained in:
Daniel Pouzzner
2024-01-29 22:00:20 -06:00
parent de91add3d9
commit 67bbe1e1bb

View File

@ -3141,7 +3141,9 @@ static int wc_RsaFunction_ex(const byte* in, word32 inLen, byte* out,
} }
#endif #endif
#ifndef WOLF_CRYPTO_CB_ONLY_RSA #ifdef WOLF_CRYPTO_CB_ONLY_RSA
return NO_VALID_DEVID;
#else /* !WOLF_CRYPTO_CB_ONLY_RSA */
SAVE_VECTOR_REGISTERS(return _svr_ret;); SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if !defined(WOLFSSL_RSA_VERIFY_ONLY) && !defined(TEST_UNPAD_CONSTANT_TIME) && \ #if !defined(WOLFSSL_RSA_VERIFY_ONLY) && !defined(TEST_UNPAD_CONSTANT_TIME) && \
@ -3192,7 +3194,7 @@ static int wc_RsaFunction_ex(const byte* in, word32 inLen, byte* out,
wc_RsaCleanup(key); wc_RsaCleanup(key);
} }
return ret; return ret;
#endif /* WOLF_CRYPTO_CB_ONLY_RSA */ #endif /* !WOLF_CRYPTO_CB_ONLY_RSA */
} }
int wc_RsaFunction(const byte* in, word32 inLen, byte* out, int wc_RsaFunction(const byte* in, word32 inLen, byte* out,