forked from wolfSSL/wolfssl
Merge pull request #2668 from ejohnstown/maintenance-scanbuild
Fixed a couple initialization issues scan-build indicated
This commit is contained in:
@ -5670,6 +5670,7 @@ int AES_GCM_encrypt_C(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
#endif
|
||||
ctr = counter;
|
||||
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
|
||||
XMEMSET(scratch, 0, AES_BLOCK_SIZE);
|
||||
if (ivSz == GCM_NONCE_MID_SZ) {
|
||||
XMEMCPY(initialCounter, iv, ivSz);
|
||||
initialCounter[AES_BLOCK_SIZE - 1] = 1;
|
||||
@ -6681,6 +6682,7 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
|
||||
authTagSz > AES_BLOCK_SIZE)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
XMEMSET(A, 0, sizeof(A));
|
||||
XMEMCPY(B+1, nonce, nonceSz);
|
||||
lenSz = AES_BLOCK_SIZE - 1 - (byte)nonceSz;
|
||||
B[0] = (authInSz > 0 ? 64 : 0)
|
||||
|
Reference in New Issue
Block a user