I am very disappointed in Crypto++ 5.4  - two days ago i have
downloaded latest release of this library from www.cryptopp.com and
used  public cryptography algorithms in my application. I have used
RSA cryptography and I discovered memory leaks in Constructor of
RSAES_OAEP_SHA_Encryptor when I want to use  RSAES_OAEP_SHA_Decryptor
as input parameter to that constructor. I check this by reusing simple
example from "test.cpp" of generation RSA keys. I have created MFC
Dialog application and override btnOKClick with this code:
//-----------------------------
........
#include "randpool.h"
#include "rsa.h"
#include "hex.h"
#include "files.h"
.......
//---------------------------------
void CCryptoMfcTestDlg::OnBnClickedOk()
{
    using namespace  std;
    using namespace CryptoPP;
    RandomPool randPool;
    char * seed="this is seed string";
    randPool.Put((byte *)seed, strlen(seed));
    string privFilename = "11.bin";
    string pubFilename = "11pub.bin";
    RSAES_OAEP_SHA_Decryptor priv(randPool,1024);
    HexEncoder privFile(new FileSink(privFilename.c_str()));
    priv.DEREncode(privFile);
    privFile.MessageEnd();

    RSAES_OAEP_SHA_Encryptor pub(priv); // --->   here is memory
leaks
    // lines below can be commented - memory leaks is allready created
    HexEncoder pubFile(new FileSink(pubFilename.c_str()));
    pub.DEREncode(pubFile);
    pubFile.MessageEnd();
}
//-------------------
My observation of RSA implementation is that all classes with
Constructor with parameter CryptoMaterial &m  - cause memory leaks - 2
leaks for each constructor


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to