On Wednesday, July 8, 2015 at 11:26:53 AM UTC-4, Jeffrey Walton wrote: > > Testing of RandomNumberGenerator::GenerateWord32 revealed a bug in > GenerateBlock. > > GenerateBlock calls GenerateIntoBufferedTransformation. > GenerateIntoBufferedTransformation, in turn, calls, GenerateBlock. Ad > infinitum. > > This patch fixes the circularity by calling OS_GenerateRandomBlock using > the OS's default entropy pool for userspace in a non-blocking mode. > > Another way to address t is to have GenerateIntoBufferedTransformation > throw an Exception with type set to NOT_IMPLEMENTED. But I think that > course will be less useful. > > Any comments or suggestions? >
This has come up again offlist. Someone reported the same issue against 5.6.3rc4 while debugging a SHA failure with a bleeding edge GCC. I opened an issue against it at "Crash in RandomNumberGenerator::GenerateWord32 due to stack recursion" (https://github.com/weidai11/cryptopp/issues/38). I also dug up an old email between Wei and I about it. Here's what Wei had to say about it: Yeah, you're not supposed to use it directly. It's just meant to define the interface that other RNGs are supposed to implement, and includes some helper functions. I should probably make it so that it can't be instantiated. I think we should remove the implementations for GenerateIntoBufferedTransforma and GenerateBlock, and turn them into pure virtuals. Any thoughts or objections? Jeff -- -- 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.
