mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-16 09:47:44 -04:00
Update wolfSSL to the latest version(v.4.5.0) (#303)
* deleted old version wolfSSL before updating * updated wolfSSL to the latest version(v4.4.0) * updated wolfSSL to the latest version(v4.4.0) * added macros for timing resistance * Add wolfSSL-FIPS-Ready to Demo and Source * Add wolfSSL-FIPS-Ready to Demo and Source * Update README_wolfSSL_FIPS_Ready.md * Remove unused files * Update to wolfSSL-4.5.0-FIPS-Ready * Increase FIPS version number for the default * Update wolfSSL to the latest version(v.4.5.0) * Fix version number * Fix comments from github Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Co-authored-by: Ming Yue <mingyue86010@gmail.com> Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com> Co-authored-by: Alfred Gedeon <alfred2g@hotmail.com>
This commit is contained in:
parent
ee588710dd
commit
c44794cd11
471 changed files with 792175 additions and 60158 deletions
|
@ -67,7 +67,7 @@ int wc_ed448_make_public(ed448_key* key, unsigned char* pubKey, word32 pubKeySz)
|
|||
byte az[ED448_PRV_KEY_SIZE];
|
||||
ge448_p2 A;
|
||||
|
||||
if ((key == NULL) || (pubKeySz != ED448_PUB_KEY_SIZE)) {
|
||||
if ((key == NULL) || (pubKey == NULL) || (pubKeySz != ED448_PUB_KEY_SIZE)) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ static int ed448_sign_msg(const byte* in, word32 inLen, byte* out,
|
|||
if (ret == 0) {
|
||||
ret = wc_Shake256_Update(&sha, &contextLen, sizeof(contextLen));
|
||||
}
|
||||
if (ret == 0 && context != NULL) {
|
||||
if ((ret == 0) && (context != NULL)) {
|
||||
ret = wc_Shake256_Update(&sha, context, contextLen);
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
@ -230,7 +230,7 @@ static int ed448_sign_msg(const byte* in, word32 inLen, byte* out,
|
|||
if (ret == 0) {
|
||||
ret = wc_Shake256_Update(&sha, &contextLen, sizeof(contextLen));
|
||||
}
|
||||
if (ret == 0 && context != NULL) {
|
||||
if ((ret == 0) && (context != NULL)) {
|
||||
ret = wc_Shake256_Update(&sha, context, contextLen);
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
@ -379,7 +379,7 @@ static int ed448_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
|
|||
*res = 0;
|
||||
|
||||
/* check on basics needed to verify signature */
|
||||
if (sigLen < ED448_SIG_SIZE) {
|
||||
if (sigLen != ED448_SIG_SIZE) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ static int ed448_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
|
|||
if (ret == 0) {
|
||||
ret = wc_Shake256_Update(&sha, &contextLen, sizeof(contextLen));
|
||||
}
|
||||
if (ret == 0 && context != NULL) {
|
||||
if ((ret == 0) && (context != NULL)) {
|
||||
ret = wc_Shake256_Update(&sha, context, contextLen);
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
@ -615,6 +615,10 @@ int wc_ed448_import_public(const byte* in, word32 inLen, ed448_key* key)
|
|||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (inLen < ED448_PUB_KEY_SIZE) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
/* compressed prefix according to draft
|
||||
* https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-06 */
|
||||
|
@ -699,7 +703,8 @@ int wc_ed448_import_private_key(const byte* priv, word32 privSz,
|
|||
}
|
||||
|
||||
/* key size check */
|
||||
if ((ret == 0) && (privSz < ED448_KEY_SIZE || pubSz < ED448_PUB_KEY_SIZE)) {
|
||||
if ((ret == 0) && ((privSz < ED448_KEY_SIZE) ||
|
||||
(pubSz < ED448_PUB_KEY_SIZE))) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue