Hi,
I had a problem while I want to debug my applicaiton. I am using a 64
bit system, when compiling the library with MSVS 2008, Debug and x64,
the following Access violation occures:
First-chance exception at 0x00000001400f638a in Crypttest.exe:
0xC0000005: Access violation reading location 0xffffffffffffffff.
Unhandled exception at 0x00000001400f638a in Crypttest.exe:
0xC0000005: Access violation reading location 0xffffffffffffffff.
For compiling, I used the shipped .sln, which was converted to Studio
2008 using the wizzard. Afterwards, I built the Solution and the
cryptlib.Using the Debug mode in during x64, the executable crashes
during signing. Using Release or x86/Debug and Release, no problems
arise.
My system:
Microsft Visual Studio 2008
Windows XP 64Bit Edition
Crypto++ 5.6.0
For a better debugging purpose I extracted the following minimal
program causing the crash. Below there is also a stack trace included.
Any suggestions?
Thanks for your help,
Sven
------------- The program which caused the crash
#include <string>
#include "../RSAToolsLib/CryptoPP/rsa.h"
#include "../RSAToolsLib/CryptoPP/osrng.h" // PRNG
#include "../RSAToolsLib/CryptoPP/hex.h" // Hex Encoder/Decoder
#include "../RSAToolsLib/CryptoPP/files.h" // File Source and Sink
#include "../RSAToolsLib/CryptoPP/filters.h"
#define HANDLE_EXCEPTION( e ) std::cerr << "Error: " << e.what() <<
std::endl; exit( -1 );
void main()
{
try{
std::string signature;
std::string messageToSign;
messageToSign = "Testme";
CryptoPP::AutoSeededRandomPool rng;
// Specify 512 bit modulus, accept e = 17
CryptoPP::RSAES_OAEP_SHA_Decryptor *decryptor = new
CryptoPP::RSAES_OAEP_SHA_Decryptor( rng, 4096 /*, e */ );
CryptoPP::RSASSA_PKCS1v15_SHA_Signer *signer = new
CryptoPP::RSASSA_PKCS1v15_SHA_Signer( *decryptor );
// crypts->mEncryptor = new CryptoPP:: RSAES_OAEP_SHA_Encryptor
( *crypts->mDecryptor );
CryptoPP::StringSource( messageToSign, true,
new CryptoPP::SignerFilter( rng, *signer,
new CryptoPP::HexEncoder(
new CryptoPP::StringSink( signature )
) // HexEncoder
) // SignerFilter
); // StringSource
}
catch( CryptoPP::Exception& e )
{
HANDLE_EXCEPTION( e );
}
}
---------------------------------------------------------------
This is the stack trace:
> Crypttest.exe!Rijndael_Enc_AdvancedProcessBlocks() Line 93 Asm
Crypttest.exe!CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(const
unsigned char * inBlocks=0x000000000012fc88, const unsigned char *
xorBlocks=0x0000000000000000, unsigned char *
outBlocks=0x000000000012fc88, unsigned __int64 length=16, unsigned int
flags=0) Line 976 C++
Crypttest.exe!CryptoPP::Rijndael::Enc::ProcessAndXorBlock(const
unsigned char * inBlock=0x000000000012fc88, const unsigned char *
xorBlock=0x0000000000000000, unsigned char *
outBlock=0x000000000012fc88) Line 289 C++
Crypttest.exe!CryptoPP::BlockTransformation::ProcessBlock(unsigned
char * inoutBlock=0x000000000012fc88) Line 449 + 0x2b bytes C++
Crypttest.exe!
CryptoPP::RandomPool::GenerateIntoBufferedTransformation
(CryptoPP::BufferedTransformation & target={...}, const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
channel="", unsigned __int64 size=256) Line 52 C++
Crypttest.exe!CryptoPP::RandomNumberGenerator::GenerateBlock
(unsigned char * output=0x000000000033a200, unsigned __int64
size=256) Line 260 + 0x2a bytes C++
Crypttest.exe!CryptoPP::Integer::Randomize
(CryptoPP::RandomNumberGenerator & rng={...}, unsigned __int64
nbits=2047) Line 3215 C++
Crypttest.exe!CryptoPP::Integer::Randomize
(CryptoPP::RandomNumberGenerator & rng={...}, const CryptoPP::Integer
& min={...}, const CryptoPP::Integer & max={...}) Line 3232 C++
Crypttest.exe!CryptoPP::Integer::GenerateRandomNoThrow
(CryptoPP::RandomNumberGenerator & i_rng={...}, const
CryptoPP::NameValuePairs & params={...}) Line 3346 C++
Crypttest.exe!CryptoPP::Integer::GenerateRandom
(CryptoPP::RandomNumberGenerator & rng={...}, const
CryptoPP::NameValuePairs & params={...}) Line 250 + 0x1d bytes C++
Crypttest.exe!CryptoPP::InvertibleRSAFunction::GenerateRandom
(CryptoPP::RandomNumberGenerator & rng={...}, const
CryptoPP::NameValuePairs & alg={...}) Line 121 C++
Crypttest.exe!CryptoPP::InvertibleRSAFunction::Initialize
(CryptoPP::RandomNumberGenerator & rng={...}, unsigned int
keybits=4096, const CryptoPP::Integer & e={...}) Line 145 + 0xcc
bytes C++
Crypttest.exe!
CryptoPP::PK_FinalTemplate<CryptoPP::TF_DecryptorImpl<CryptoPP::TF_CryptoSchemeOptions<CryptoPP::TF_ES<CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>,CryptoPP::RSA,int>,CryptoPP::RSA,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>
> >
>::PK_FinalTemplate<CryptoPP::TF_DecryptorImpl<CryptoPP::TF_CryptoSchemeOptions<CryptoPP::TF_ES<CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>,CryptoPP::RSA,int>,CryptoPP::RSA,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>
> > ><CryptoPP::AutoSeededRandomPool,int>
(CryptoPP::AutoSeededRandomPool & v1={...}, const int & v2=4096) Line
1566 + 0x75 bytes C++
Crypttest.exe!main() Line 22 + 0x55 bytes C++
Crypttest.exe!__tmainCRTStartup() Line 266 + 0x19 bytes C
Crypttest.exe!mainCRTStartup() Line 182 C
kernel32.dll!0000000077d596ac()
[Frames below may be incorrect and/or missing, no symbols loaded for
kernel32.dll]
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---