Skip to content

Commit 60b22a5

Browse files
Skoll Fixes
1 parent 22f5185 commit 60b22a5

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

tests/api/test_aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3274,7 +3274,7 @@ int test_wc_AesGcmEncryptDecrypt_Sizes(void)
32743274
}
32753275

32763276
i = 0;
3277-
for (sz = WC_AES_BLOCK_SIZE; sz < GCM_LEN; sz *= 2) {
3277+
for (sz = WC_AES_BLOCK_SIZE; sz <= GCM_LEN; sz *= 2) {
32783278
XMEMSET(cipher, 0, GCM_LEN);
32793279
ExpectIntEQ(wc_AesGcmEncrypt(&aes, cipher, plain, sz, iv, ivLen, tag,
32803280
sizeof(tag), NULL, 0), 0);

wolfcrypt/src/port/devcrypto/devcrypto_hash.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int wc_Sha256Final(wc_Sha256* sha, byte* hash)
175175
ret = GetDigest(sha, CRYPTO_SHA2_256, hash);
176176
if (ret != 0) {
177177
wc_Sha256Free(sha);
178-
return ret;
178+
return ret;
179179
}
180180

181181
wc_Sha256Free(sha);
@@ -199,9 +199,10 @@ int wc_Sha256GetHash(wc_Sha256* sha, byte* hash)
199199
* in wc_Sha256Copy() does not close fd 0 (cfd == -1 is the
200200
* "no session" sentinel, matching wc_AesInit()) */
201201
cpy.ctx.cfd = -1;
202-
wc_Sha256Copy(sha, &cpy);
202+
ret = wc_Sha256Copy(sha, &cpy);
203203

204-
if ((ret = HashUpdate(&cpy, CRYPTO_SHA2_256, cpy.msg, cpy.used)) == 0) {
204+
if (ret == 0 &&
205+
(ret = HashUpdate(&cpy, CRYPTO_SHA2_256, cpy.msg, cpy.used)) == 0) {
205206
/* help static analysis tools out */
206207
XMEMSET(hash, 0, WC_SHA256_DIGEST_SIZE);
207208
ret = GetDigest(&cpy, CRYPTO_SHA2_256, hash);
@@ -225,9 +226,9 @@ int wc_Sha256Copy(wc_Sha256* src, wc_Sha256* dst)
225226
return BAD_FUNC_ARG;
226227
}
227228

229+
#ifdef WOLFSSL_DEVCRYPTO_HASH_KEEP
228230
wc_Sha256Free(dst);
229231
wc_InitSha256_ex(dst, src->heap, 0);
230-
#ifdef WOLFSSL_DEVCRYPTO_HASH_KEEP
231232
dst->len = src->len;
232233
dst->used = src->used;
233234
dst->msg = (byte*)XMALLOC(src->len, dst->heap, DYNAMIC_TYPE_TMP_BUFFER);

wolfcrypt/src/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3726,7 +3726,7 @@ static int wc_GenerateSeed_IntelRD(OS_Seed* os, byte* output, word32 sz)
37263726

37273727
for (; (sz / sizeof(word64)) > 0; sz -= sizeof(word64),
37283728
output += sizeof(word64)) {
3729-
word32 rndTmplocal;
3729+
word64 rndTmpLocal;
37303730
ret = IntelRDseed64_r(&rndTmpLocal);
37313731
if (ret != 0)
37323732
return ret;

wolfssl/wolfcrypt/ecc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ struct ecc_key {
532532
#endif
533533

534534
#ifdef WOLFSSL_CAAM
535-
#ifndef CAAM_ADDRESS
535+
#ifdef CAAM_ADDRESS
536536
CAAM_ADDRESS blackKey; /* address of key encrypted and in secure memory */
537537
CAAM_ADDRESS securePubKey; /* address of public key in secure memory */
538538
#else

0 commit comments

Comments
 (0)