use /dev/arandom instead of /dev/urandom. reading from /dev/urandom

is too slow.

ok martynas@
This commit is contained in:
jakemsr 2009-03-23 00:50:52 +00:00
parent ea40a65f12
commit f44059c898
2 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.28 2009/02/14 12:01:48 sthen Exp $
# $OpenBSD: Makefile,v 1.29 2009/03/23 00:50:52 jakemsr Exp $
# $FreeBSD: /repoman/r/pcvs/ports/devel/nspr/Makefile,v 1.13 2003/12/13 21:30:19 peter Exp $
ONLY_FOR_ARCHS= alpha amd64 arm i386 powerpc sparc sparc64 hppa
@ -8,7 +8,7 @@ COMMENT-docs= HTML Documentation for NSPR
VER= 4.7.3
DISTNAME= nspr-${VER}
PKGNAME-main= ${DISTNAME}
PKGNAME-main= ${DISTNAME}p0
PKGNAME-docs= nspr-docs-${VER}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
nspr-reference${EXTRACT_SUFX}:0

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-mozilla_nsprpub_pr_src_md_unix_uxrng_c,v 1.1 2009/03/23 00:50:52 jakemsr Exp $
--- mozilla/nsprpub/pr/src/md/unix/uxrng.c.orig Tue Oct 7 14:45:09 2008
+++ mozilla/nsprpub/pr/src/md/unix/uxrng.c Sun Mar 22 01:28:01 2009
@@ -150,7 +150,11 @@ static PRCallOnceType coOpenDevURandom;
static PRStatus OpenDevURandom( void )
{
+#if defined(OPENBSD)
+ fdDevURandom = open( "/dev/arandom", O_RDONLY );
+#else
fdDevURandom = open( "/dev/urandom", O_RDONLY );
+#endif
return((-1 == fdDevURandom)? PR_FAILURE : PR_SUCCESS );
} /* end OpenDevURandom() */