I tried a few other examples, and none of them seem to work, same error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
int xxz568::rsaSign(InvertibleRSAFunction rsa, string message, string &output) {
AutoSeededRandomPool rng;
// Signer object
RSASS< PKCS1v15, SHA >::Signer signer( rsa );
// Create signature space
byte* signature = new byte[ signer.MaxSignatureLength() ];
if( NULL == signature ) {
return -1;
}
// Sign message
signer.SignMessage(rng, (const byte*) message.c_str(), message.length(), signature);
return 1;
}
|
The crash comes when it hits: signer.SignMessage(rng, (const byte*) message.c_str(), message.length(), signature);
This time, I'm using a byte array above. I have no idea why this one is crashing at that spot, if the array was incorrect, that if would catch it. I'm not even storing the signature anywhere yet which brings up a red flag to me to this crash.
*EDIT*
Here is the other method I tried:
1 2 3 4 5 6 7 8 9 10
|
AutoSeededRandomPool rng;
// Signer object
RSASS< PKCS1v15, SHA1 >::Signer signer(rsa);
StringSource(message, true,
new SignerFilter(rng,
RSASS< PKCS1v15, SHA1>::Signer(signer),
new HexEncoder(
new StringSink(output))
)
);
|
Got this error, VS debugger has the size of the message returned to be over 100,000, which is obviously not correct.
1 2
|
First-chance exception at 0x75aff328 in cppauth.exe: Microsoft C++ exception: CryptoPP::Exception at memory location 0x0038f200..
Unhandled exception at 0x75aff328 in cppauth.exe: Microsoft C++ exception: CryptoPP::Exception at memory location 0x0038f200..
|
*END EDIT*
Do you have anything I can go off of to help me fix this?