I have found the same problem. The fix that i have make is:
FileSource f(messageFilename, true, new SignerFilter(GlobalRNG(), priv,
new HexEncoder(new FileSink(signatureFilename))));

-----Messaggio originale-----
Da: Colin Thomsen [mailto:[EMAIL PROTECTED]
Inviato: mercoled� 9 aprile 2003 3.29
A: [EMAIL PROTECTED]
Oggetto: Signing files with RSA


I'm just trying to run the test.cpp file that comes with Crypto++ 5.1 to
sign a file using RSA, using the command:

CTDebug\cryptest.exe rs key_priv.txt infile.txt sign.txt

I get the error message:
CryptoPP::Exception caught: NullRNG: NullRNG should only be passed to
functions
that don't need to generate random bytes

The stack trace is:


::::NullRNG::GenerateByte() line 126
CryptoPP::RandomNumberGenerator::GenerateBlock(unsigned char *
0x0031f860, unsigned int 128) line 91 + 11 bytes
CryptoPP::Integer::Randomize(CryptoPP::RandomNumberGenerator & {...},
unsigned int 1024) line 2977
CryptoPP::Integer::Randomize(CryptoPP::RandomNumberGenerator & {...},
const CryptoPP::Integer & {...}, const CryptoPP::Integer & {...}) line
2994
CryptoPP::Integer::GenerateRandomNoThrow(CryptoPP::RandomNumberGenerator
& {...}, const CryptoPP::NameValuePairs & {...}) line 3080
CryptoPP::Integer::Randomize(CryptoPP::RandomNumberGenerator & {...},
const CryptoPP::Integer & {...}, const CryptoPP::Integer & {...},
CryptoPP::Integer::RandomNumberType ANY, const CryptoPP::Integer &
{...}, const CryptoPP::Integer & {...}) line 3001 + 258 bytes
CryptoPP::Integer::Integer(CryptoPP::RandomNumberGenerator & {...},
const CryptoPP::Integer & {...}, const CryptoPP::Integer & {...},
CryptoPP::Integer::RandomNumberType ANY, const CryptoPP::Integer &
{...}, const CryptoPP::Integer & {...}) line 2617 + 32 bytes
CryptoPP::InvertibleRSAFunction::CalculateInverse(CryptoPP::RandomNumber
Generator & {...}, const CryptoPP::Integer & {...}) line 220 + 89 bytes
CryptoPP::TrapdoorFunctionInverse::CalculateRandomizedInverse(CryptoPP::
RandomNumberGenerator & {...}, const CryptoPP::Integer & {...}) line 100
+ 42 bytes
CryptoPP::TF_SignerBase::SignAndRestart(CryptoPP::RandomNumberGenerator
& {...}, CryptoPP::PK_MessageAccumulator & {...}, unsigned char *
0x009d0620, unsigned char 0) line 70 + 60 bytes
CryptoPP::PK_Signer::Sign(CryptoPP::RandomNumberGenerator & {...},
CryptoPP::PK_MessageAccumulator * 0x0031e558, unsigned char *
0x009d0620) line 620 + 30 bytes
CryptoPP::SignerFilter::Put2(const unsigned char * 0x00000000, unsigned
int 0, int -1, unsigned char 1) line 723
CryptoPP::BufferedTransformation::ChannelPut2(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
{}, const unsigned char * 0x00000000, unsigned int 0, int -1, unsigned
char 1) line 189 + 27 bytes
CryptoPP::BufferedTransformation::ChannelMessageEnd(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
{}, int -1, unsigned char 1) line 881 + 66 bytes
CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::Buffered
Transformation & {...}, unsigned int & 0, const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
{}, unsigned char 1) line 354 + 28 bytes
CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTrans
formation & {...}, const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
{}, unsigned char 1) line 395 + 24 bytes
CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpAll2(unsigned char 1)
line 647 + 47 bytes
CryptoPP::Source::PumpAll() line 616 + 28 bytes
CryptoPP::Source::SourceInitialize(unsigned char 1, const
CryptoPP::NameValuePairs & {...}) line 628
CryptoPP::FileSource::FileSource(const char * 0x00313b3c, unsigned char
1, CryptoPP::BufferedTransformation * 0x0031c2e0, unsigned char 1) line
58 + 182 bytes
RSASignFile(const char * 0x00313b2f, const char * 0x00313b3c, const char
* 0x00313b6e) line 558 + 407 bytes
main(int 5, char * * 0x00313af0) line 167 + 26 bytes


Anyone know what the problem is?

cheers,

Colin


Reply via email to