alanchan 0 Newbie Poster

I have some questions about using Cavium CSP, which need your kindness help.

According to the explain in MSDN, the function 'CryptDestroyKey' of CRYPTAPI
will not only destory the key handle, but also free the memory that the key
occupied.

But using Cavium CSP, the function does not free the memory. What is the
problem?

It is my code below. This circle will only run 64 times around, then it
fails because of lack of memory in Card.

while(1)
{
 if(!CryptImportPublicKeyInfo(hCryptProv,
MY_ENCODING_TYPE,&(pCertContext->pCertInfo->SubjectPublicKeyInfo),&hPubKey))
 {
  cout<<hex<<GetLastError()<<endl;
  break;
             goto while_end;
 }
 else
 {
  bSuceess = TURE;
 }

 

while_end:
 if(hPubKey) CryptDestroyKey(hPubKey); 

 

 if(bSuceess){iSuccess++;}
 else{iFalse++;}
}

Thank you for your help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.