Sorry for the ambiguity in my question. I am having this issue with the latest BouncyCastle-PCL 1.8.1 code from GitHub.
Mat Robichaud p: 507.358.9419 e: matrobich...@gmail.com On Jan 15, 2016 6:09 AM, "Edward Ned Harvey (bouncycastle)" < bouncycas...@nedharvey.com> wrote: > > From: Mat Robichaud [mailto:matrobich...@gmail.com] > > > > I am working on a TLS PSK handler for DotNetty TCP server solution using > > Bouncy Castle for TLS PSK. A TLS PSK handler will be created for each > > connection--we are anticipating 10,000+. Should I share one SecureRandom > > object for all handlers for use in the TlsServerProcotol class, or > should I create > > a new SecureRandom for each handler? > > > > DotNetty creates a new handler on a thread for each new connection that > is > > established. I am noticing that when I create a new SecureRandom object > in > > the constructor of the handler it will never complete. What I am > observing is > > in the ThreadedSeedGenerator class, the DoGenerateSeed function is stuck > > in what appears to be an infinite loop as the Run method is never hit to > > increase the counter. Any ideas on this behavior and how to fix it > (assuming I > > should not share a SecureRandom object with all connections) would be > > greatly appreciated! > > I don't know about TLS PSK or DotNetty, but I know about a year ago I > reported a bug in which ThreadedSeedGenerator was shown to produce very > (very) non-random output. It was fixed in version ... I think 1.8? What > version of BouncyCastle are you running? I think if you upgrade to a > current version of BC, you'll find that ThreadedSeedGenerator isn't used > anymore. > > If the NuGet package hasn't been upgraded to 1.8 yet ... In fact > regardless of whether or not it has... I recommend cloning the github > repository, switching to the latest "release" tag, which is currently > 1.8.1, and then building your own BouncyCastle.dll. >