Skip to content

Commit

Permalink
Fix issue with opdata memory initialization
Browse files Browse the repository at this point in the history
Change-Id: I6c3e7663b014cc10edd8f8409874d334706f78eb
Signed-off-by: Steve Linsell <stevenx.linsell@intel.com>
  • Loading branch information
Yogaraj-Alamenda authored and stevelinsell committed Sep 4, 2017
1 parent d931d66 commit d9369b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qat_dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ int qat_dh_generate_key(DH *dh)
return ok;
}

memset(opData, 0, sizeof(CpaCyDhPhase1KeyGenOpData));

opData->primeP.pData = NULL;
opData->baseG.pData = NULL;
opData->privateValueX.pData = NULL;
Expand Down Expand Up @@ -525,6 +527,8 @@ int qat_dh_compute_key(unsigned char *key, const BIGNUM *in_pub_key, DH *dh)
return ret;
}

memset(opData, 0, sizeof(CpaCyDhPhase2SecretKeyGenOpData));

opData->primeP.pData = NULL;
opData->remoteOctetStringPV.pData = NULL;
opData->privateValueX.pData = NULL;
Expand Down
2 changes: 2 additions & 0 deletions qat_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ int qat_ecdh_compute_key(unsigned char **outX, size_t *outlenX,
return ret;
}

memset(opData, 0, sizeof(CpaCyEcPointMultiplyOpData));

opData->k.pData = NULL;
opData->xg.pData = NULL;
opData->yg.pData = NULL;
Expand Down

0 comments on commit d9369b9

Please sign in to comment.