Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Enable sun8icrypto in GENERIC64.



details:   https://anonhg.NetBSD.org/src/rev/ace7814c81a8
branches:  trunk
changeset: 968338:ace7814c81a8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jan 12 21:52:36 2020 +0000

description:
Enable sun8icrypto in GENERIC64.

But set its entropy estimate to zero until we have a better idea of
how it works.  Can't really hurt this way unless sun8icrypto is
maliciously dependent on all other inputs to the entropy pool, which
seems unlikely.

diffstat:

 sys/arch/arm/sunxi/sun8i_crypto.c |  10 ++++++++--
 sys/arch/evbarm/conf/GENERIC64    |   4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (50 lines):

diff -r f6565ce4a983 -r ace7814c81a8 sys/arch/arm/sunxi/sun8i_crypto.c
--- a/sys/arch/arm/sunxi/sun8i_crypto.c Sun Jan 12 21:49:39 2020 +0000
+++ b/sys/arch/arm/sunxi/sun8i_crypto.c Sun Jan 12 21:52:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun8i_crypto.c,v 1.9 2019/12/18 02:26:48 riastradh Exp $       */
+/*     $NetBSD: sun8i_crypto.c,v 1.10 2020/01/12 21:52:36 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.9 2019/12/18 02:26:48 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.10 2020/01/12 21:52:36 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -971,6 +971,12 @@
                entropybits = 0;
        }
 
+       /*
+        * Actually we don't believe in any of the entropy until this
+        * device has had more scrutiny.
+        */
+       entropybits = 0;
+
        /* Success!  Enter and erase the data.  */
        rnd_add_data(&rng->cr_rndsource, buf, SUN8I_CRYPTO_RNGBYTES,
            entropybits);
diff -r f6565ce4a983 -r ace7814c81a8 sys/arch/evbarm/conf/GENERIC64
--- a/sys/arch/evbarm/conf/GENERIC64    Sun Jan 12 21:49:39 2020 +0000
+++ b/sys/arch/evbarm/conf/GENERIC64    Sun Jan 12 21:52:36 2020 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: GENERIC64,v 1.130 2020/01/04 14:18:28 skrll Exp $
+#      $NetBSD: GENERIC64,v 1.131 2020/01/12 21:52:36 riastradh Exp $
 #
 #      GENERIC ARM (aarch64) kernel
 #
@@ -393,7 +393,7 @@
 amdccp*                at acpi?
 bcmrng*                at fdt?                 # Broadcom BCM283x RNG
 mesonrng*      at fdt?                 # Amlogic Meson RNG
-#sun8icrypto*  at fdt?                 # Allwinner Crypto Engine
+sun8icrypto*   at fdt?                 # Allwinner Crypto Engine
 
 # RTC
 plrtc*         at fdt?                 # ARM PrimeCell RTC



Home | Main Index | Thread Index | Old Index