Move address hashing from init_main.c to kern_sysctl.c. This way rump gets it automatically. Make sure blake2s is in librumpkern.so, not just in librumpkern_crypto.so, for this to work.diff -r1.528 -r1.529 src/sys/kern/init_main.c
(riastradh)
--- src/sys/kern/init_main.c 2020/08/26 22:56:55 1.528
+++ src/sys/kern/init_main.c 2020/08/27 14:01:36 1.529
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: init_main.c,v 1.528 2020/08/26 22:56:55 christos Exp $ */ | 1 | /* $NetBSD: init_main.c,v 1.529 2020/08/27 14:01:36 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -87,27 +87,27 @@ | @@ -87,27 +87,27 @@ | |||
87 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 87 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
88 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 88 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
89 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 89 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
90 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 90 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
91 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 91 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
92 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 92 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
93 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 93 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
94 | * SUCH DAMAGE. | 94 | * SUCH DAMAGE. | |
95 | * | 95 | * | |
96 | * @(#)init_main.c 8.16 (Berkeley) 5/14/95 | 96 | * @(#)init_main.c 8.16 (Berkeley) 5/14/95 | |
97 | */ | 97 | */ | |
98 | 98 | |||
99 | #include <sys/cdefs.h> | 99 | #include <sys/cdefs.h> | |
100 | __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.528 2020/08/26 22:56:55 christos Exp $"); | 100 | __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.529 2020/08/27 14:01:36 riastradh Exp $"); | |
101 | 101 | |||
102 | #include "opt_ddb.h" | 102 | #include "opt_ddb.h" | |
103 | #include "opt_inet.h" | 103 | #include "opt_inet.h" | |
104 | #include "opt_ipsec.h" | 104 | #include "opt_ipsec.h" | |
105 | #include "opt_modular.h" | 105 | #include "opt_modular.h" | |
106 | #include "opt_ntp.h" | 106 | #include "opt_ntp.h" | |
107 | #include "opt_pipe.h" | 107 | #include "opt_pipe.h" | |
108 | #include "opt_syscall_debug.h" | 108 | #include "opt_syscall_debug.h" | |
109 | #include "opt_sysv.h" | 109 | #include "opt_sysv.h" | |
110 | #include "opt_fileassoc.h" | 110 | #include "opt_fileassoc.h" | |
111 | #include "opt_ktrace.h" | 111 | #include "opt_ktrace.h" | |
112 | #include "opt_pax.h" | 112 | #include "opt_pax.h" | |
113 | #include "opt_compat_netbsd.h" | 113 | #include "opt_compat_netbsd.h" | |
@@ -218,28 +218,26 @@ extern void *_binary_splash_image_end; | @@ -218,28 +218,26 @@ extern void *_binary_splash_image_end; | |||
218 | #include <uvm/uvm.h> /* extern struct uvm uvm */ | 218 | #include <uvm/uvm.h> /* extern struct uvm uvm */ | |
219 | 219 | |||
220 | #include <dev/cons.h> | 220 | #include <dev/cons.h> | |
221 | #include <dev/splash/splash.h> | 221 | #include <dev/splash/splash.h> | |
222 | 222 | |||
223 | #include <net/bpf.h> | 223 | #include <net/bpf.h> | |
224 | #include <net/if.h> | 224 | #include <net/if.h> | |
225 | #include <net/pfil.h> | 225 | #include <net/pfil.h> | |
226 | #include <net/raw_cb.h> | 226 | #include <net/raw_cb.h> | |
227 | #include <net/if_llatbl.h> | 227 | #include <net/if_llatbl.h> | |
228 | 228 | |||
229 | #include <prop/proplib.h> | 229 | #include <prop/proplib.h> | |
230 | 230 | |||
231 | #include <crypto/blake2/blake2s.h> | |||
232 | ||||
233 | #include <sys/userconf.h> | 231 | #include <sys/userconf.h> | |
234 | 232 | |||
235 | extern struct lwp lwp0; | 233 | extern struct lwp lwp0; | |
236 | extern time_t rootfstime; | 234 | extern time_t rootfstime; | |
237 | 235 | |||
238 | #ifndef curlwp | 236 | #ifndef curlwp | |
239 | struct lwp *curlwp = &lwp0; | 237 | struct lwp *curlwp = &lwp0; | |
240 | #endif | 238 | #endif | |
241 | struct proc *initproc; | 239 | struct proc *initproc; | |
242 | 240 | |||
243 | struct vnode *rootvp, *swapdev_vp; | 241 | struct vnode *rootvp, *swapdev_vp; | |
244 | int boothowto; | 242 | int boothowto; | |
245 | int cold __read_mostly = 1; /* still working on startup */ | 243 | int cold __read_mostly = 1; /* still working on startup */ | |
@@ -722,44 +720,26 @@ main(void) | @@ -722,44 +720,26 @@ main(void) | |||
722 | /* | 720 | /* | |
723 | * Okay, now we can let init(8) exec! It's off to userland! | 721 | * Okay, now we can let init(8) exec! It's off to userland! | |
724 | */ | 722 | */ | |
725 | mutex_enter(&proc_lock); | 723 | mutex_enter(&proc_lock); | |
726 | start_init_exec = 1; | 724 | start_init_exec = 1; | |
727 | cv_broadcast(&lbolt); | 725 | cv_broadcast(&lbolt); | |
728 | mutex_exit(&proc_lock); | 726 | mutex_exit(&proc_lock); | |
729 | 727 | |||
730 | /* The scheduler is an infinite loop. */ | 728 | /* The scheduler is an infinite loop. */ | |
731 | uvm_scheduler(); | 729 | uvm_scheduler(); | |
732 | /* NOTREACHED */ | 730 | /* NOTREACHED */ | |
733 | } | 731 | } | |
734 | 732 | |||
735 | static uint8_t address_key[32]; /* key used in address hashing */ | |||
736 | static ONCE_DECL(random_inithook); | |||
737 | ||||
738 | static int | |||
739 | random_address_init(void) | |||
740 | { | |||
741 | cprng_strong(kern_cprng, address_key, sizeof(address_key), 0); | |||
742 | return 0; | |||
743 | } | |||
744 | ||||
745 | void | |||
746 | hash_value(void *d, size_t ds, const void *s, size_t ss) | |||
747 | { | |||
748 | ||||
749 | RUN_ONCE(&random_inithook, random_address_init); | |||
750 | blake2s(d, ds, address_key, sizeof(address_key), s, ss); | |||
751 | } | |||
752 | ||||
753 | /* | 733 | /* | |
754 | * Configure the system's hardware. | 734 | * Configure the system's hardware. | |
755 | */ | 735 | */ | |
756 | static void | 736 | static void | |
757 | configure(void) | 737 | configure(void) | |
758 | { | 738 | { | |
759 | 739 | |||
760 | /* | 740 | /* | |
761 | * XXX | 741 | * XXX | |
762 | * callout_setfunc() requires mutex(9) so it can't be in config_init() | 742 | * callout_setfunc() requires mutex(9) so it can't be in config_init() | |
763 | * on amiga and atari which use config_init() and autoconf(9) fucntions | 743 | * on amiga and atari which use config_init() and autoconf(9) fucntions | |
764 | * to initialize console devices. | 744 | * to initialize console devices. | |
765 | */ | 745 | */ |
--- src/sys/kern/kern_sysctl.c 2019/07/03 17:31:32 1.264
+++ src/sys/kern/kern_sysctl.c 2020/08/27 14:01:36 1.265
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kern_sysctl.c,v 1.264 2019/07/03 17:31:32 maxv Exp $ */ | 1 | /* $NetBSD: kern_sysctl.c,v 1.265 2020/08/27 14:01:36 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Brown. | 8 | * by Andrew Brown. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -58,47 +58,51 @@ | @@ -58,47 +58,51 @@ | |||
58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
61 | * SUCH DAMAGE. | 61 | * SUCH DAMAGE. | |
62 | * | 62 | * | |
63 | * @(#)kern_sysctl.c 8.9 (Berkeley) 5/20/95 | 63 | * @(#)kern_sysctl.c 8.9 (Berkeley) 5/20/95 | |
64 | */ | 64 | */ | |
65 | 65 | |||
66 | /* | 66 | /* | |
67 | * sysctl system call. | 67 | * sysctl system call. | |
68 | */ | 68 | */ | |
69 | 69 | |||
70 | #include <sys/cdefs.h> | 70 | #include <sys/cdefs.h> | |
71 | __KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.264 2019/07/03 17:31:32 maxv Exp $"); | 71 | __KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.265 2020/08/27 14:01:36 riastradh Exp $"); | |
72 | 72 | |||
73 | #ifdef _KERNEL_OPT | 73 | #ifdef _KERNEL_OPT | |
74 | #include "opt_defcorename.h" | 74 | #include "opt_defcorename.h" | |
75 | #endif | 75 | #endif | |
76 | 76 | |||
77 | #include "ksyms.h" | 77 | #include "ksyms.h" | |
78 | 78 | |||
79 | #include <sys/param.h> | 79 | #include <sys/param.h> | |
80 | #define __COMPAT_SYSCTL | 80 | #define __COMPAT_SYSCTL | |
81 | #include <sys/sysctl.h> | 81 | #include <sys/sysctl.h> | |
82 | #include <sys/systm.h> | 82 | #include <sys/systm.h> | |
83 | #include <sys/buf.h> | 83 | #include <sys/buf.h> | |
84 | #include <sys/ksyms.h> | 84 | #include <sys/ksyms.h> | |
85 | #include <sys/malloc.h> | 85 | #include <sys/malloc.h> | |
86 | #include <sys/mount.h> | 86 | #include <sys/mount.h> | |
87 | #include <sys/cprng.h> | |||
88 | #include <sys/once.h> | |||
87 | #include <sys/syscallargs.h> | 89 | #include <sys/syscallargs.h> | |
88 | #include <sys/kauth.h> | 90 | #include <sys/kauth.h> | |
89 | #include <sys/ktrace.h> | 91 | #include <sys/ktrace.h> | |
90 | #include <sys/rndsource.h> | 92 | #include <sys/rndsource.h> | |
91 | 93 | |||
94 | #include <crypto/blake2/blake2s.h> | |||
95 | ||||
92 | #define MAXDESCLEN 1024 | 96 | #define MAXDESCLEN 1024 | |
93 | MALLOC_DEFINE(M_SYSCTLNODE, "sysctlnode", "sysctl node structures"); | 97 | MALLOC_DEFINE(M_SYSCTLNODE, "sysctlnode", "sysctl node structures"); | |
94 | MALLOC_DEFINE(M_SYSCTLDATA, "sysctldata", "misc sysctl data"); | 98 | MALLOC_DEFINE(M_SYSCTLDATA, "sysctldata", "misc sysctl data"); | |
95 | 99 | |||
96 | static int sysctl_mmap(SYSCTLFN_PROTO); | 100 | static int sysctl_mmap(SYSCTLFN_PROTO); | |
97 | static int sysctl_alloc(struct sysctlnode *, int); | 101 | static int sysctl_alloc(struct sysctlnode *, int); | |
98 | static int sysctl_realloc(struct sysctlnode *); | 102 | static int sysctl_realloc(struct sysctlnode *); | |
99 | 103 | |||
100 | static int sysctl_cvt_in(struct lwp *, int *, const void *, size_t, | 104 | static int sysctl_cvt_in(struct lwp *, int *, const void *, size_t, | |
101 | struct sysctlnode *); | 105 | struct sysctlnode *); | |
102 | static int sysctl_cvt_out(struct lwp *, int, const struct sysctlnode *, | 106 | static int sysctl_cvt_out(struct lwp *, int, const struct sysctlnode *, | |
103 | void *, size_t, size_t *); | 107 | void *, size_t, size_t *); | |
104 | 108 | |||
@@ -2806,13 +2810,31 @@ sysctl_cvt_out(struct lwp *l, int v, con | @@ -2806,13 +2810,31 @@ sysctl_cvt_out(struct lwp *l, int v, con | |||
2806 | } | 2810 | } | |
2807 | 2811 | |||
2808 | if (ovp != NULL && left >= sz) { | 2812 | if (ovp != NULL && left >= sz) { | |
2809 | error = sysctl_copyout(l, src, ovp, sz); | 2813 | error = sysctl_copyout(l, src, ovp, sz); | |
2810 | if (error) | 2814 | if (error) | |
2811 | return (error); | 2815 | return (error); | |
2812 | } | 2816 | } | |
2813 | 2817 | |||
2814 | if (szp != NULL) | 2818 | if (szp != NULL) | |
2815 | *szp = sz; | 2819 | *szp = sz; | |
2816 | 2820 | |||
2817 | return (0); | 2821 | return (0); | |
2818 | } | 2822 | } | |
2823 | ||||
2824 | static uint8_t address_key[32]; /* key used in address hashing */ | |||
2825 | static ONCE_DECL(random_inithook); | |||
2826 | ||||
2827 | static int | |||
2828 | random_address_init(void) | |||
2829 | { | |||
2830 | cprng_strong(kern_cprng, address_key, sizeof(address_key), 0); | |||
2831 | return 0; | |||
2832 | } | |||
2833 | ||||
2834 | void | |||
2835 | hash_value(void *d, size_t ds, const void *s, size_t ss) | |||
2836 | { | |||
2837 | ||||
2838 | RUN_ONCE(&random_inithook, random_address_init); | |||
2839 | blake2s(d, ds, address_key, sizeof(address_key), s, ss); | |||
2840 | } |
--- src/sys/rump/kern/lib/libcrypto/Makefile 2020/08/26 15:49:56 1.20
+++ src/sys/rump/kern/lib/libcrypto/Makefile 2020/08/27 14:01:36 1.21
@@ -1,22 +1,21 @@ | @@ -1,22 +1,21 @@ | |||
1 | # $NetBSD: Makefile,v 1.20 2020/08/26 15:49:56 riastradh Exp $ | 1 | # $NetBSD: Makefile,v 1.21 2020/08/27 14:01:36 riastradh Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | SODIUM_IMPORTDIR=${.CURDIR}/../../../../external/isc/libsodium | 4 | SODIUM_IMPORTDIR=${.CURDIR}/../../../../external/isc/libsodium | |
5 | SODIUM_DIR=${.CURDIR}/../../../../external/isc/libsodium/dist/src/libsodium | 5 | SODIUM_DIR=${.CURDIR}/../../../../external/isc/libsodium/dist/src/libsodium | |
6 | 6 | |||
7 | .PATH: ${.CURDIR}/../../../../crypto/adiantum \ | 7 | .PATH: ${.CURDIR}/../../../../crypto/adiantum \ | |
8 | ${.CURDIR}/../../../../crypto/aes \ | 8 | ${.CURDIR}/../../../../crypto/aes \ | |
9 | ${.CURDIR}/../../../../crypto/blake2 \ | |||
10 | ${.CURDIR}/../../../../crypto/blowfish \ | 9 | ${.CURDIR}/../../../../crypto/blowfish \ | |
11 | ${.CURDIR}/../../../../crypto/camellia \ | 10 | ${.CURDIR}/../../../../crypto/camellia \ | |
12 | ${.CURDIR}/../../../../crypto/cast128 \ | 11 | ${.CURDIR}/../../../../crypto/cast128 \ | |
13 | ${.CURDIR}/../../../../crypto/des \ | 12 | ${.CURDIR}/../../../../crypto/des \ | |
14 | ${.CURDIR}/../../../../crypto/skipjack \ | 13 | ${.CURDIR}/../../../../crypto/skipjack \ | |
15 | ${SODIUM_DIR}/crypto_scalarmult/curve25519/ref10 \ | 14 | ${SODIUM_DIR}/crypto_scalarmult/curve25519/ref10 \ | |
16 | ${SODIUM_DIR}/crypto_scalarmult/curve25519 \ | 15 | ${SODIUM_DIR}/crypto_scalarmult/curve25519 \ | |
17 | ${SODIUM_DIR}/crypto_scalarmult \ | 16 | ${SODIUM_DIR}/crypto_scalarmult \ | |
18 | ${SODIUM_DIR}/crypto_onetimeauth/poly1305/donna \ | 17 | ${SODIUM_DIR}/crypto_onetimeauth/poly1305/donna \ | |
19 | ${SODIUM_DIR}/crypto_onetimeauth/poly1305 \ | 18 | ${SODIUM_DIR}/crypto_onetimeauth/poly1305 \ | |
20 | ${SODIUM_DIR}/crypto_onetimeauth \ | 19 | ${SODIUM_DIR}/crypto_onetimeauth \ | |
21 | ${SODIUM_DIR}/crypto_stream/chacha20/ref \ | 20 | ${SODIUM_DIR}/crypto_stream/chacha20/ref \ | |
22 | ${SODIUM_DIR}/crypto_stream/chacha20 \ | 21 | ${SODIUM_DIR}/crypto_stream/chacha20 \ | |
@@ -47,29 +46,26 @@ SRCS+= bf_ecb.c bf_enc.c bf_cbc.c bf_ske | @@ -47,29 +46,26 @@ SRCS+= bf_ecb.c bf_enc.c bf_cbc.c bf_ske | |||
47 | 46 | |||
48 | # camellia | 47 | # camellia | |
49 | SRCS+= camellia.c camellia-api.c | 48 | SRCS+= camellia.c camellia-api.c | |
50 | 49 | |||
51 | # cast128 | 50 | # cast128 | |
52 | SRCS+= cast128.c | 51 | SRCS+= cast128.c | |
53 | 52 | |||
54 | # DES | 53 | # DES | |
55 | SRCS+= des_ecb.c des_setkey.c des_enc.c des_cbc.c des_module.c | 54 | SRCS+= des_ecb.c des_setkey.c des_enc.c des_cbc.c des_module.c | |
56 | 55 | |||
57 | # skipjack | 56 | # skipjack | |
58 | SRCS+= skipjack.c | 57 | SRCS+= skipjack.c | |
59 | 58 | |||
60 | # BLAKE2 | |||
61 | SRCS+= blake2s.c | |||
62 | ||||
63 | # libsodium | 59 | # libsodium | |
64 | SODIUM_CPPFLAGS+= -I${SODIUM_IMPORTDIR}/include | 60 | SODIUM_CPPFLAGS+= -I${SODIUM_IMPORTDIR}/include | |
65 | SODIUM_CPPFLAGS+= -I${SODIUM_IMPORTDIR}/dist/src/libsodium/include/sodium | 61 | SODIUM_CPPFLAGS+= -I${SODIUM_IMPORTDIR}/dist/src/libsodium/include/sodium | |
66 | 62 | |||
67 | #SODIUM_CPPFLAGS+= -DHAVE_TI_MODE | 63 | #SODIUM_CPPFLAGS+= -DHAVE_TI_MODE | |
68 | 64 | |||
69 | SODIUM_CWARNFLAGS+= -Wno-shadow | 65 | SODIUM_CWARNFLAGS+= -Wno-shadow | |
70 | SODIUM_CWARNFLAGS+= -Wno-unused-function | 66 | SODIUM_CWARNFLAGS+= -Wno-unused-function | |
71 | SODIUM_CWARNFLAGS+= -Wno-unused-variable | 67 | SODIUM_CWARNFLAGS+= -Wno-unused-variable | |
72 | 68 | |||
73 | SODIUM_SRCS+= x25519_ref10.c | 69 | SODIUM_SRCS+= x25519_ref10.c | |
74 | SODIUM_SRCS+= scalarmult_curve25519.c | 70 | SODIUM_SRCS+= scalarmult_curve25519.c | |
75 | SODIUM_SRCS+= crypto_scalarmult.c | 71 | SODIUM_SRCS+= crypto_scalarmult.c |
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern 2020/08/14 00:53:16 1.185
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern 2020/08/27 14:01:36 1.186
@@ -1,31 +1,32 @@ | @@ -1,31 +1,32 @@ | |||
1 | # $NetBSD: Makefile.rumpkern,v 1.185 2020/08/14 00:53:16 riastradh Exp $ | 1 | # $NetBSD: Makefile.rumpkern,v 1.186 2020/08/27 14:01:36 riastradh Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | IOCONFDIR:= ${.PARSEDIR} | 4 | IOCONFDIR:= ${.PARSEDIR} | |
5 | IOCONF= MAINBUS.ioconf | 5 | IOCONF= MAINBUS.ioconf | |
6 | 6 | |||
7 | LIB= rump | 7 | LIB= rump | |
8 | COMMENT= Rump kernel base | 8 | COMMENT= Rump kernel base | |
9 | 9 | |||
10 | MAN= rump.3 rump_lwproc.3 | 10 | MAN= rump.3 rump_lwproc.3 | |
11 | 11 | |||
12 | .PATH: ${RUMPTOP}/librump/rumpkern \ | 12 | .PATH: ${RUMPTOP}/librump/rumpkern \ | |
13 | ${RUMPTOP}/librump/rumpkern/arch/generic \ | 13 | ${RUMPTOP}/librump/rumpkern/arch/generic \ | |
14 | ${RUMPTOP}/../kern \ | 14 | ${RUMPTOP}/../kern \ | |
15 | ${RUMPTOP}/../uvm \ | 15 | ${RUMPTOP}/../uvm \ | |
16 | ${RUMPTOP}/../conf \ | 16 | ${RUMPTOP}/../conf \ | |
17 | ${RUMPTOP}/../dev \ | 17 | ${RUMPTOP}/../dev \ | |
18 | ${RUMPTOP}/../crypto/nist_hash_drbg \ | 18 | ${RUMPTOP}/../crypto/nist_hash_drbg \ | |
19 | ${RUMPTOP}/../crypto/blake2 \ | |||
19 | ${RUMPTOP}/../crypto/cprng_fast \ | 20 | ${RUMPTOP}/../crypto/cprng_fast \ | |
20 | ${RUMPTOP}/../crypto/chacha \ | 21 | ${RUMPTOP}/../crypto/chacha \ | |
21 | ${RUMPTOP}/../secmodel \ | 22 | ${RUMPTOP}/../secmodel \ | |
22 | ${RUMPTOP}/../secmodel/suser \ | 23 | ${RUMPTOP}/../secmodel/suser \ | |
23 | ${RUMPTOP}/../compat/common | 24 | ${RUMPTOP}/../compat/common | |
24 | 25 | |||
25 | # | 26 | # | |
26 | # Source modules, first the ones specifically implemented for librump. | 27 | # Source modules, first the ones specifically implemented for librump. | |
27 | # | 28 | # | |
28 | SRCS+= rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c \ | 29 | SRCS+= rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c \ | |
29 | lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c \ | 30 | lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c \ | |
30 | signals.c sleepq.c threads.c vm.c hyperentropy.c \ | 31 | signals.c sleepq.c threads.c vm.c hyperentropy.c \ | |
31 | accessors.c | 32 | accessors.c | |
@@ -152,26 +153,30 @@ SRCS+= vnode_if.c | @@ -152,26 +153,30 @@ SRCS+= vnode_if.c | |||
152 | 153 | |||
153 | # sys/dev | 154 | # sys/dev | |
154 | SRCS+= clock_subr.c | 155 | SRCS+= clock_subr.c | |
155 | 156 | |||
156 | # sys/dev/crypto | 157 | # sys/dev/crypto | |
157 | # Note: these are here only for cprng. More crypto algos for drivers | 158 | # Note: these are here only for cprng. More crypto algos for drivers | |
158 | # are available from the rumpkern_crypto component | 159 | # are available from the rumpkern_crypto component | |
159 | SRCS+= nist_hash_drbg.c | 160 | SRCS+= nist_hash_drbg.c | |
160 | SRCS+= cprng_fast.c | 161 | SRCS+= cprng_fast.c | |
161 | SRCS+= chacha_impl.c | 162 | SRCS+= chacha_impl.c | |
162 | SRCS+= chacha_ref.c | 163 | SRCS+= chacha_ref.c | |
163 | SRCS+= chacha_selftest.c | 164 | SRCS+= chacha_selftest.c | |
164 | 165 | |||
166 | # BLAKE2 | |||
167 | # for hash_address | |||
168 | SRCS+= blake2s.c | |||
169 | ||||
165 | .include "${RUMPTOP}/Makefile.rump" | 170 | .include "${RUMPTOP}/Makefile.rump" | |
166 | .include <bsd.own.mk> | 171 | .include <bsd.own.mk> | |
167 | 172 | |||
168 | # compat | 173 | # compat | |
169 | .if !empty(RUMP_NBCOMPAT:M50) | 174 | .if !empty(RUMP_NBCOMPAT:M50) | |
170 | SRCS+= kern_select_50.c | 175 | SRCS+= kern_select_50.c | |
171 | SRCS+= kern_time_50.c | 176 | SRCS+= kern_time_50.c | |
172 | SRCS+= rndpseudo_50.c | 177 | SRCS+= rndpseudo_50.c | |
173 | .endif | 178 | .endif | |
174 | 179 | |||
175 | 180 | |||
176 | .ifdef RUMP_LOCKDEBUG | 181 | .ifdef RUMP_LOCKDEBUG | |
177 | SRCS+= subr_lockdebug.c | 182 | SRCS+= subr_lockdebug.c |