+
+#ifdef __OpenBSD__
+ /* given that all random loads just fail if the file can't be + * seen on a stat, we stat the file we're returning, if it
+ * fails, use /dev/arandom instead. this allows the user to + * use their own source for good random data, but defaults
+ * to something hopefully decent if that isn't available. + */
+
+ if (!ok)
+ if (BUF_strlcpy(buf,"/dev/arandom",size) >= size) {
+ return(NULL);
+ }
+ if (stat(buf,&sb) == -1)
+ if (BUF_strlcpy(buf,"/dev/arandom",size) >= size) {
+ return(NULL);
+ }
+
+#endif
+ return(buf);
Using /dev/random as a fallback would be pretty much OK on most other platforms, too.
Cheers,
Ben.
-- http://www.apache-ssl.org/ben.html http://www.thebunker.net/
"There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
