Merge pull request #2468 from tmael/RSA_inline

Fix for RSA inline
This commit is contained in:
toddouska
2019-09-13 13:46:33 -07:00
committed by GitHub
2 changed files with 4 additions and 5 deletions

View File

@ -4195,7 +4195,7 @@ void bench_rsaKeyGen_size(int doAsync, int keySz)
#define RSA_BUF_SIZE 384 /* for up to 3072 bit */ #define RSA_BUF_SIZE 384 /* for up to 3072 bit */
#if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY) #if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
#elif defined(WOLFSSL_PUBLIC_MP) #elif defined(WOLFSSL_PUBLIC_MP) || !defined(WOLFSSL_RSA_PUBLIC_ONLY)
#if defined(USE_CERT_BUFFERS_2048) #if defined(USE_CERT_BUFFERS_2048)
static unsigned char rsa_2048_sig[] = { static unsigned char rsa_2048_sig[] = {
0x8c, 0x9e, 0x37, 0xbf, 0xc3, 0xa6, 0xba, 0x1c, 0x8c, 0x9e, 0x37, 0xbf, 0xc3, 0xa6, 0xba, 0x1c,

View File

@ -2677,8 +2677,7 @@ static int RsaPrivateDecryptEx(byte* in, word32 inLen, byte* out,
ret = wc_RsaFunction(key->data, inLen, key->data, &key->dataLen, ret = wc_RsaFunction(key->data, inLen, key->data, &key->dataLen,
rsa_type, key, rng); rsa_type, key, rng);
#else #else
ret = wc_RsaFunction(out, inLen, out, &key->dataLen, rsa_type, key, ret = wc_RsaFunction(in, inLen, out, &key->dataLen, rsa_type, key, rng);
rng);
#endif #endif
if (ret >= 0 || ret == WC_PENDING_E) { if (ret >= 0 || ret == WC_PENDING_E) {
@ -2705,13 +2704,13 @@ static int RsaPrivateDecryptEx(byte* in, word32 inLen, byte* out,
if (rsa_type == RSA_PUBLIC_DECRYPT && ret > (int)outLen) if (rsa_type == RSA_PUBLIC_DECRYPT && ret > (int)outLen)
ret = RSA_BUFFER_E; ret = RSA_BUFFER_E;
else if (ret >= 0 && pad != NULL) { else if (ret >= 0 && pad != NULL) {
#if !defined(WOLFSSL_RSA_VERIFY_ONLY) #if !defined(WOLFSSL_RSA_VERIFY_ONLY) && !defined(WOLFSSL_RSA_VERIFY_INLINE)
signed char c; signed char c;
#endif #endif
/* only copy output if not inline */ /* only copy output if not inline */
if (outPtr == NULL) { if (outPtr == NULL) {
#if !defined(WOLFSSL_RSA_VERIFY_ONLY) #if !defined(WOLFSSL_RSA_VERIFY_ONLY) && !defined(WOLFSSL_RSA_VERIFY_INLINE)
word32 i, j; word32 i, j;
int start = (int)((size_t)pad - (size_t)key->data); int start = (int)((size_t)pad - (size_t)key->data);