Re: Re: Current BC master (Java) fails tests

David Hook <dgh-rTAZ0PM/[email protected]>
Newsgroups gmane.comp.encryption.bouncy-castle.devel
Message-ID <[email protected]>
I don't know if that would be it, might be, but I would have thought
/dev/random would make the problem worse.

There's two things going on: SecureRandom.getDefaultPRNG() seems to be
returning the SunNative RNG and not the BC one despite the addition of
BC as the number 1 provider in the test, and then it's getting an
IOException because it cannot write the seed material to the device the
native RNG is using (I guess).

Is there another version of BC somewhere - it's a two line test, neither
line appears to be working, and in neither case is it due to anything in BC.

Regards,

David

On 12/08/18 13:44, Uri Blumenthal wrote:
> The only change I'm aware of is that is uses /dev/urandom. Otherwise -
> a perfectly standard installation, same as all the previous JVM/JDK
> that were installed (and had BC built and tested on them).
>
> I'll experiment with reverting it back to /dev/random, and report
> here. Though of course, BC shouldn't fail tests because of that.
>
> Sent from my test iPhone
>
> On Aug 11, 2018, at 23:21, David Hook <dgh-rTAZ0PM/[email protected]
> <mailto:dgh-rTAZ0PM/[email protected]>> wrote:
>
>>
>> This appears to be saying that a setSeed call on the native PRNG has
>> failed. It's not actually managing to call any Bouncy Castle provider
>> code.
>>
>> The "Caused by: java.io.IOException: Operation not permitted" is the
>> give away.
>>
>> Is there anything unusual about the way the JVM is configured?
>>
>> Regards,
>>
>> David
>>
>> On 12/08/18 13:05, Uri Blumenthal wrote:
>>> HereÂ’s the error:
>>>
>>> setSeed() failed
>>>
>>> java.security.ProviderException: setSeed() failed
>>> at
>>> sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:472)
>>> at
>>> sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:331)
>>> at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:214)
>>> at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:209)
>>> at java.security.SecureRandom.<init>(SecureRandom.java:190)
>>> at
>>> org.bouncycastle.jcajce.provider.test.HybridRandomProviderTest.testCheckForStackOverflow(Unknown
>>> Source)
>>> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:23)
>>> at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
>>> at junit.extensions.TestSetup.run(TestSetup.java:27)
>>> Caused by: java.io.IOException: Operation not permitted
>>> at java.io.FileOutputStream.writeBytes(Native Method)
>>> at java.io.FileOutputStream.write(FileOutputStream.java:313)
>>> at
>>> sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:470)
>>>
>>> MacOS 10.13.6, JDK-1.8.0_181.
>>>
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.