Module Name:    src
Committed By:   riastradh
Date:           Sun Jan 12 21:52:36 UTC 2020

Modified Files:
        src/sys/arch/arm/sunxi: sun8i_crypto.c
        src/sys/arch/evbarm/conf: GENERIC64

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sunxi/sun8i_crypto.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/evbarm/conf/GENERIC64

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sunxi/sun8i_crypto.c
diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.9 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.10
--- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.9	Wed Dec 18 02:26:48 2019
+++ src/sys/arch/arm/sunxi/sun8i_crypto.c	Sun Jan 12 21:52:36 2020
@@ -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 @@ sun8i_crypto_rng_done(struct sun8i_crypt
 		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);

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.130 src/sys/arch/evbarm/conf/GENERIC64:1.131
--- src/sys/arch/evbarm/conf/GENERIC64:1.130	Sat Jan  4 14:18:28 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Jan 12 21:52:36 2020
@@ -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 fdt?			# AMD Cryptograhic Co
 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

Reply via email to