Skip to content

Commit 67bbe1e

Browse files
committed
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.
1 parent de91add commit 67bbe1e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wolfcrypt/src/rsa.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,9 @@ static int wc_RsaFunction_ex(const byte* in, word32 inLen, byte* out,
31413141
}
31423142
#endif
31433143

3144-
#ifndef WOLF_CRYPTO_CB_ONLY_RSA
3144+
#ifdef WOLF_CRYPTO_CB_ONLY_RSA
3145+
return NO_VALID_DEVID;
3146+
#else /* !WOLF_CRYPTO_CB_ONLY_RSA */
31453147
SAVE_VECTOR_REGISTERS(return _svr_ret;);
31463148

31473149
#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,
31923194
wc_RsaCleanup(key);
31933195
}
31943196
return ret;
3195-
#endif /* WOLF_CRYPTO_CB_ONLY_RSA */
3197+
#endif /* !WOLF_CRYPTO_CB_ONLY_RSA */
31963198
}
31973199

31983200
int wc_RsaFunction(const byte* in, word32 inLen, byte* out,

0 commit comments

Comments
 (0)