Operating System - Linux
1820694 Members
2498 Online
109627 Solutions
New Discussion юеВ

SecureRandom SetSeed Issue

 
Saritha_1
Occasional Contributor

SecureRandom SetSeed Issue

In java1.5.0 release notes following was mentioned as an known issue.
--------------------------------------------
SecureRandom engine implementation (11i HP Integrity and HP9000 PA-RISC)
Beginning with 5.0, Sun Microsystems' SecureRandom engine implementation supports a new algorithm, NativePRNG, in addition to SHA1PRNG. NativePRNG will only be available if /dev/random and /dev/urandom are installed in your system. Because HP-UX does not support seeding entropy generating devices such as /dev/random, applications that rely on this will not be able to use NativePRNG. An attempt to seed the device will cause an exception. This defect is expected to be fixed in a future release.
---------------------------------------------

But in Java1.5.0.01 the above known issue is not mentioned in the release notes. It seems this problem has been fixed in this release.
When we try to start webserver or appserver with root as a user, we are still getting following exception
----------------------------------------------
Sun ONE Web Server 6.1SP5 B08/03/2005 19:53
info: CORE3016: daemon is running as super-user
info: CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0.01] from [Hewle
tt-Packard Company]
info: WEB0100: Loading web module in virtual server [vs-admin] at [/admin-app]
failure: StandardManager[/admin-app] WEB3420: Exception initializing random numb
er generator of class java.security.SecureRandom
java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java
:253)
at sun.security.provider.NativePRNG$RandomIO.access$100(NativePRNG.java:
108)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:92)
at java.security.SecureRandom.setSeed(SecureRandom.java:400)
at org.apache.catalina.session.ManagerBase.getRandom(ManagerBase.java:46
1)
at org.apache.catalina.session.ManagerBase.generateSessionId(ManagerBase
.java:658)
at org.apache.catalina.session.StandardManager.start(StandardManager.jav
a:622)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
672)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355
)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
Caused by: java.io.IOException: No such device (errno:19)
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:247)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java
:251)
... 16 more
-----------------------------------------------
Can u please help us in solving this issue. Do let us know if any fix available for this problem.
Thanks
Saritha

2 REPLIES 2
Florian Heigl (new acc)
Honored Contributor

Re: SecureRandom SetSeed Issue

I think the root error is the following:
Caused by: java.io.IOException: No such
device (errno:19)

Can You check if You have /dev/randon and /dev/urandom available and that the HP-UX Kernel Random Number generator is installed?

root@lala:/>swlist KRNG11i
# Initializing...
# Contacting target "lala"...
#
# Target: lala:/
#

# KRNG11i B.11.11.08 HP-UX 11.11 Strong Random Number Generator
KRNG11i.RandomNumGen B.11.11.07 HP-UX 11.11 Strong Random Number Generator Kernel Enablement
KRNG11i.PHKL_27750 1.0 vPar enablement, KRNG enablement
KRNG11i.RandomNumGenDyn B.11.11.08 HP-UX 11.11 Strong Random Number Generator product
yesterday I stood at the edge. Today I'm one step ahead.
Saritha_1
Occasional Contributor

Re: SecureRandom SetSeed Issue

Hi Florian Hiegl,

Thanks for ur response

Yes, the root cause is whatever u mentioned.
"Caused by: java.io.IOException: No such
device (errno:19)"

I checked in my test machine. /dev/random and /dev/urandom is there and KRNG11i is installed.

One more observation is, if /dev/random and KRNG11i is there, then only we are getting above exception. If either of one is not present then there are no issues.

Can u please help us

Thanks
Saritha