1

OpenSSL application is throwing "unable to write 'random state'" error when creating self signed certificate.

I found Using OpenSSL what does "unable to write 'random state'" mean? and learned that this is the case of version newer than 0.9.6a, and deleting or changing ownership of .rnd or running as root will solve the problem. But we are using embedded Linux with busy box so we don't have sudo/su utility and also the file system is a read only file system.

I am calling the OpenSSL app from a application using system(). Please help is there any other way to resolve it.

Community
  • 1
  • 1
Chu
  • 620
  • 1
  • 8
  • 14
  • So I'm clear (I don't have a Busybox device to test on): doing a `export RANDFILE=/tmp` or `export RANDFILE=/dev/null` does not work? You should also show the code calling `system()` since it could be relevant. – jww Aug 13 '14 at 12:49
  • 2
    "But we are using embedded Linux with busy box so we don't have sudo/su utility and also the file system is a read only file system." If that is actually related to the issue, it sounds like you need to learn a bit more about managing your embedded linux installation. Perhaps you should symlink the file in question to a tmpfs partition, or even switch to a scheme where your running filesystem is either a ramdisk uncompressed from flash, or some kind of union of a tmpfs atop a read only flash file system. – Chris Stratton Aug 13 '14 at 16:06
  • @Chris - good observation. But Busybox is not the easiest to work with (speaking from experience). He may need to bring in a consultant, but the budget may not have the room. – jww Aug 13 '14 at 19:02
  • From application i did "export RANDFILE=/dev/null" and then i ran openssl, using system(). But it didn't work, the mistake i did was i used two different system() calls. But when i used both commands in a single call it worked. But isn't there a permanent solution rather than calling export every time . – Chu Aug 16 '14 at 09:03

0 Answers0