|
When leaving this method, it tries to delete some
objects (probably crypto++ guarded pointers) and then it crashes. I
even tried to copy the objects to avoid any Qt guarded pointers trying
to delete the same object nothing got better. Here it is: void SharingSecret::secretRecoverFile(int threshold, QString outFilename, std::vector<QString>* inFilenames) { assert(threshold<=1000); if (threshold > 1000) { // throw some exception } char* outFile = new char[outFilename.length() + 1]; std::strcpy(outFile, outFilename.ascii()); CryptoPP::SecretRecovery recovery(threshold, new CryptoPP::FileSink(outFile)); CryptoPP::vector_member_ptrs<CryptoPP::FileSource> fileSources(threshold); CryptoPP::SecByteBlock channel(4); int i; for (i = 0; i < threshold; i++) { QString inFilename = inFilenames->at(i); std::cout << "inFilename: " << inFilename << std::endl; char* filename = new char[inFilename.length() + 1]; std::strcpy(filename, inFilename.ascii()); fileSources[i].reset(new CryptoPP::FileSource(filename, false)); fileSources[i]->Pump(4); fileSources[i]->Get(channel, 4); fileSources[i]->Attach(new CryptoPP::ChannelSwitch(recovery, string((char *)channel.begin(), 4))); } while (fileSources[0]->Pump(256)) { for (i=1; i<threshold; i++) { fileSources[i]->Pump(256); } } for (i=0; i<threshold; i++) { fileSources[i]->PumpAll(); } } Jens Peter Secher escreveu: On 11/28/05, Douglas de Oliveira Mendes <[EMAIL PROTECTED]> wrote: |
- secret sharing is crashing on crypto++ 5.2.1c2-... Douglas de Oliveira Mendes
- Re: secret sharing is crashing on crypto++... Jens Peter Secher
- Re: secret sharing is crashing on cryp... Douglas de Oliveira Mendes
- Re: secret sharing is crashing on ... Jens Peter Secher
- Re: secret sharing is crashing... Douglas de Oliveira Mendes
- Re: secret sharing is cra... Douglas de Oliveira Mendes
- secret sharing is crashing on crypto++ 5.2... Douglas de Oliveira Mendes
