Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/wh_client_cryptocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ int wh_Client_CryptoCb(int devId, wc_CryptoInfo* info, void* inCtx)
case WC_ALGO_TYPE_CMAC:
{
/* Extract info parameters */
const uint8_t* in = info->cmac.in;
uint32_t in_len = (in == NULL) ? 0 : info->cmac.inSz;
const uint8_t* key = info->cmac.key;
uint32_t key_len = (key == NULL) ? 0 : info->cmac.keySz;
uint8_t* outMac = info->cmac.out;
word32 *out_mac_len = info->cmac.outSz;
Cmac* cmac = info->cmac.cmac;
int type = info->cmac.type;
const uint8_t* in = info->cmac.in;
uint32_t in_len = (in == NULL) ? 0 : info->cmac.inSz;
const uint8_t* key = info->cmac.key;
uint32_t key_len = (key == NULL) ? 0 : info->cmac.keySz;
uint8_t* outMac = info->cmac.out;
uint32_t* out_mac_len = (uint32_t*)info->cmac.outSz;
Cmac* cmac = info->cmac.cmac;
int type = info->cmac.type;

ret = wh_Client_Cmac(ctx, cmac, type, key, key_len, in, in_len, outMac,
out_mac_len);
Expand Down Expand Up @@ -671,7 +671,7 @@ int wh_Client_CryptoCbDma(int devId, wc_CryptoInfo* info, void* inCtx)
const uint8_t* in = info->cmac.in;
uint32_t inLen = info->cmac.inSz;
uint8_t* outMac = info->cmac.out;
uint32_t* outMacLen = info->cmac.outSz;
uint32_t* outMacLen = (uint32_t*)info->cmac.outSz;

ret = wh_Client_CmacDma(ctx, cmac, type, key, keyLen, in, inLen, outMac,
outMacLen);
Expand Down
10 changes: 5 additions & 5 deletions src/wh_server_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2819,11 +2819,11 @@ static int _HandleCmacDma(whServerContext* ctx, uint16_t magic, uint16_t seq,
return ret;
}

Cmac* cmac = ctx->crypto->algoCtx.cmac;
int clientDevId;
whKeyId keyId;
byte tmpKey[AES_256_KEY_SIZE];
uint32_t keyLen;
Cmac* cmac = ctx->crypto->algoCtx.cmac;
int clientDevId = 0;
whKeyId keyId;
byte tmpKey[AES_256_KEY_SIZE];
uint32_t keyLen;
/* Flag indicating if the CMAC context holds a local key that should not be
* returned to the client */
int ctxHoldsLocalKey = 0;
Expand Down