Add RSA to unit test.

This commit is contained in:
jrblixt
2017-06-05 15:04:56 -06:00
parent f8c0a52170
commit 00724c95a9
6 changed files with 1188 additions and 12 deletions
+12 -3
View File
@@ -928,6 +928,10 @@ int wc_RsaPrivateKeyDecode(const byte* input, word32* inOutIdx, RsaKey* key,
int ctxSz, pSz, qSz;
IppStatus ret;
if (input == NULL || inOutIdx == NULL || key == NULL) {
return USER_CRYPTO_ERROR;
}
USER_DEBUG(("Entering wc_RsaPrivateKeyDecode\n"));
/* read in key information */
@@ -1066,6 +1070,10 @@ int wc_RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey* key,
byte b;
#endif
if (input == NULL || inOutIdx == NULL || key == NULL) {
return USER_CRYPTO_ERROR;
}
USER_DEBUG(("Entering wc_RsaPublicKeyDecode\n"));
if (GetSequence(input, inOutIdx, &length, inSz) < 0)
@@ -1246,7 +1254,7 @@ int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz, const byte* e,
key->eSz = eSz;
key->type = RSA_PUBLIC;
return USER_CRYPTO_ERROR;
return 0;
}
@@ -1636,13 +1644,14 @@ int wc_RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen,
USER_DEBUG(("Entering wc_RsaSSL_Sign\n"));
sz = key->sz;
if (in == NULL || out == NULL || key == NULL || rng == NULL) {
USER_DEBUG(("Bad argument to wc_RsaSSL_Sign\n"));
return USER_CRYPTO_ERROR;
}
sz = key->sz;
/* sanity check on key being used */
if (key->pipp == NULL || key->qipp == NULL || key->uipp == NULL ||
key->dPipp == NULL || key->dQipp == NULL) {