Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys cprng_strong(kern_cprng, ...) never blocks, pass 0 for f...



details:   https://anonhg.NetBSD.org/src/rev/f0e7f95cbd66
branches:  trunk
changeset: 337367:f0e7f95cbd66
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Apr 13 15:51:00 2015 +0000

description:
cprng_strong(kern_cprng, ...) never blocks, pass 0 for flags.

FASYNC was wrong anyway!  It's FNONBLOCK.

diffstat:

 sys/crypto/cprng_fast/cprng_fast.c |  8 ++++----
 sys/netinet/tcp_subr.c             |  6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 60abc38eba1e -r f0e7f95cbd66 sys/crypto/cprng_fast/cprng_fast.c
--- a/sys/crypto/cprng_fast/cprng_fast.c        Mon Apr 13 15:44:03 2015 +0000
+++ b/sys/crypto/cprng_fast/cprng_fast.c        Mon Apr 13 15:51:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cprng_fast.c,v 1.11 2014/08/11 22:36:49 justin Exp $   */
+/*     $NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cprng_fast.c,v 1.11 2014/08/11 22:36:49 justin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -233,7 +233,7 @@
        struct cprng_fast *const cprng = p;
        uint8_t seed[CPRNG_FAST_SEED_BYTES];
 
-       cprng_strong(kern_cprng, seed, sizeof seed, FASYNC);
+       cprng_strong(kern_cprng, seed, sizeof seed, 0);
        cprng_fast_seed(cprng, seed);
        cprng->have_initial = rnd_initial_entropy;
        (void)explicit_memset(seed, 0, sizeof seed);
@@ -278,7 +278,7 @@
        uint8_t seed[CPRNG_FAST_SEED_BYTES];
        int s;
 
-       cprng_strong(kern_cprng, seed, sizeof(seed), FASYNC);
+       cprng_strong(kern_cprng, seed, sizeof(seed), 0);
 
        cprng = percpu_getref(cprng_fast_percpu);
        s = splvm();
diff -r 60abc38eba1e -r f0e7f95cbd66 sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c    Mon Apr 13 15:44:03 2015 +0000
+++ b/sys/netinet/tcp_subr.c    Mon Apr 13 15:51:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_subr.c,v 1.258 2015/02/14 12:57:53 he Exp $        */
+/*     $NetBSD: tcp_subr.c,v 1.259 2015/04/13 15:51:00 riastradh Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.258 2015/02/14 12:57:53 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.259 2015/04/13 15:51:00 riastradh Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -2248,7 +2248,7 @@
         */
        if (tcp_iss_gotten_secret == false) {
                cprng_strong(kern_cprng,
-                            tcp_iss_secret, sizeof(tcp_iss_secret), FASYNC);
+                            tcp_iss_secret, sizeof(tcp_iss_secret), 0);
                tcp_iss_gotten_secret = true;
        }
 



Home | Main Index | Thread Index | Old Index