Skip to content

Commit 756b5f5

Browse files
authored
Merge pull request #106 from bigbrett/compiler-warning
quickfix: compiler warnings for 32-bit targets
2 parents ea4c3db + 5026b2b commit 756b5f5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/wh_client_cryptocb.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ int wh_Client_CryptoCb(int devId, wc_CryptoInfo* info, void* inCtx)
364364
case WC_ALGO_TYPE_CMAC:
365365
{
366366
/* Extract info parameters */
367-
const uint8_t* in = info->cmac.in;
368-
uint32_t in_len = (in == NULL) ? 0 : info->cmac.inSz;
369-
const uint8_t* key = info->cmac.key;
370-
uint32_t key_len = (key == NULL) ? 0 : info->cmac.keySz;
371-
uint8_t* outMac = info->cmac.out;
372-
word32 *out_mac_len = info->cmac.outSz;
373-
Cmac* cmac = info->cmac.cmac;
374-
int type = info->cmac.type;
367+
const uint8_t* in = info->cmac.in;
368+
uint32_t in_len = (in == NULL) ? 0 : info->cmac.inSz;
369+
const uint8_t* key = info->cmac.key;
370+
uint32_t key_len = (key == NULL) ? 0 : info->cmac.keySz;
371+
uint8_t* outMac = info->cmac.out;
372+
uint32_t* out_mac_len = (uint32_t*)info->cmac.outSz;
373+
Cmac* cmac = info->cmac.cmac;
374+
int type = info->cmac.type;
375375

376376
ret = wh_Client_Cmac(ctx, cmac, type, key, key_len, in, in_len, outMac,
377377
out_mac_len);
@@ -671,7 +671,7 @@ int wh_Client_CryptoCbDma(int devId, wc_CryptoInfo* info, void* inCtx)
671671
const uint8_t* in = info->cmac.in;
672672
uint32_t inLen = info->cmac.inSz;
673673
uint8_t* outMac = info->cmac.out;
674-
uint32_t* outMacLen = info->cmac.outSz;
674+
uint32_t* outMacLen = (uint32_t*)info->cmac.outSz;
675675

676676
ret = wh_Client_CmacDma(ctx, cmac, type, key, keyLen, in, inLen, outMac,
677677
outMacLen);

src/wh_server_crypto.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,11 +2819,11 @@ static int _HandleCmacDma(whServerContext* ctx, uint16_t magic, uint16_t seq,
28192819
return ret;
28202820
}
28212821

2822-
Cmac* cmac = ctx->crypto->algoCtx.cmac;
2823-
int clientDevId;
2824-
whKeyId keyId;
2825-
byte tmpKey[AES_256_KEY_SIZE];
2826-
uint32_t keyLen;
2822+
Cmac* cmac = ctx->crypto->algoCtx.cmac;
2823+
int clientDevId = 0;
2824+
whKeyId keyId;
2825+
byte tmpKey[AES_256_KEY_SIZE];
2826+
uint32_t keyLen;
28272827
/* Flag indicating if the CMAC context holds a local key that should not be
28282828
* returned to the client */
28292829
int ctxHoldsLocalKey = 0;

0 commit comments

Comments
 (0)