On Wednesday, October 1, 2014 12:44:38 PM UTC-4, Pierre Chanquion wrote:
>
>
> I have been using crypto++'s RSA cryptographic methods for a project. 
> Encryption, decryption, signing and verifying all worked well until about 
> two days ago, when I updated xcode and its libraries. Since then signing 
> and verification has completely stopped working returning the error: 
> *PK_Signer: 
> key too short for this signature scheme*. I am using the recommended 3072 
> byte key size and all my methods are essentially copies of the RSA 
> examples. 
> ...
>  
>
Encryption and Decryption works fine with the generated keys, but signing 
> and verification are both problematic. As the code was working fine before, 
> I am at a loss as to what is wrong... Anyone got any ideas. 
>
 
Both of these look problematic to me, but I'm not sure I have the whole 
picture...
 
****
 
Sign:
  StringSource(msg, true, new SignerFilter(rng, *snr, new StringSink(sig), 
false));
 
(1) Name your StringSource declaration, and don't use an anonymous 
declaration. I've seen problems with GCC generating code that causes 
destructors to run too soon when using anonymous declarations.
 
The '*snr" is a red flag. Its a pointer, and it should be destroyed when 
the SignerFilter destructor runs. I'm inclined to believe you need 
something like:
 
  StringSource ss(msg, true, new SignerFilter(rng, new Redirector(*snr), 
new StringSink(sig), false));
 
This way, `snr` will not be accidentally destroyed too early.
 
It appears `snr` is a class member of Crypto::RSADecryptor. Let `snr` be 
reclaimed when the destructors for Crypto::RSADecryptor run.
 
*****
 
Encrypt:
   StringSource ss(msg, true, new PK_EncryptorFilter(rng, *enc, new 
StringSink(cphr)));
 
Same potential issue with `dec`:
 
  StringSource ss(msg, true, new PK_EncryptorFilter(rng, new 
Redirector(*enc), new StringSink(cphr)));
 

-- 
-- 
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.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to