RE: CSM_Free3::SMTI_Sign bug
"Colestock, Robert" <[email protected]> Thu, 12 Jul 2001 17:46:32 -0400
| Newsgroups | gmane.ietf.sfl |
|---|---|
| Message-ID | <[email protected]> |
Eric: Oops! I believe you are right. It would be simpler to simply delete that line (where the "delete pTempDigest;" is performed). We do not have any customers I am aware of that write to the SMTI_Sign(...) level. Thank you for reporting this error. Bob Colestock VDA -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: Thursday, July 12, 2001 4:18 PM To: [email protected] Subject: CSM_Free3::SMTI_Sign bug Hi, I think CSM_Free3::SMTI_Sign have a bug. This bug crash the application. (in version 1.9) /***************************************************/ SM_RET_VAL CSM_Free3::SMTI_Sign( CSM_Buffer *pData, // input, data to be signed CSM_Buffer *pEncryptedDigest, // signature output CSM_Buffer *pDigest) // digest { CSM_Buffer *pbufX = NULL; // temp spot for X value char *pszPassword = NULL; // temp spot for password Integer *px; // x value in integer form CSM_OID *pSigOID=NULL; CSM_OID *pDigOID=NULL; CryptoPP::ByteQueue privateKey; CSM_Buffer bufferDigest; CSM_Buffer *pTempDigest = &bufferDigest; <-------------------------- ?????? CSM_Buffer tmpEncryptedDigest; DigestInfo rsaDigestInfo; CSM_Buffer *pTempBuf = NULL; pSigOID=GetPrefDigestEncryption(); pDigOID=GetPrefDigest(); SME_SETUP("CSM_Free3::SMTI_Sign"); if ((pData == NULL) || (pEncryptedDigest == NULL)) SME_THROW(SM_MISSING_PARAM, NULL, NULL) // if pDigest was passed in, use it, otherwise, use local temp if (pDigest != NULL) pTempDigest = pDigest; // digest the incoming data if (pTempDigest == NULL || !pTempDigest->Length()) <------------- ?????? { SME(SMTI_DigestData(pData, pTempDigest)); } ........... if (pTempDigest && pTempDigest != pDigest) delete pTempDigest; <----------------------------------- Ouch !!!! if (pDigOID) delete pDigOID; SME_FINISH SME_CATCH_SETUP // catch/cleanup logic as necessary if (pbufX) delete pbufX; if (pszPassword) free (pszPassword); if (pSigOID) delete pSigOID; if (pDigOID) delete pDigOID; SME_CATCH_FINISH return SM_NO_ERROR; } /***************************************************/ Beacause we are not forced to put pDigest in parameter we need pTempDigest and that's correct. What i suggest is that we allocate pTempDigest dynamically and remove bufferDigest. ************************************************************************** Eric Boudreault ------------------------------------------------ Programmeur ------------------------------------------------ Motus Technologies 390, St-Vallier Est Bureau 100 Québec, Qc G1K 3P6 Tél.: 521-2100 ext.#242 Fax.: 521-2101 courriel: [email protected] **************************************************************************