nixos: add jitter_sponge entropy source

Share an entropy generator amount the systemd services. Would be nice to
have that virtio_rng driver.
This commit is contained in:
Ehmry - 2020-12-02 19:25:07 +01:00
parent bb08952553
commit 3215190568
7 changed files with 42 additions and 7 deletions

View File

@ -116,6 +116,7 @@ in {
++ (with pkgs.genodePackages; [ ++ (with pkgs.genodePackages; [
init init
cached_fs_rom cached_fs_rom
jitter_sponge
report_rom report_rom
vfs vfs
]))); ])));

View File

@ -41,11 +41,12 @@ in {
in Genode.Init::{ in Genode.Init::{
, routes = , routes =
[ Genode.Init.ServiceRoute.parent "File_system" [ Genode.Init.ServiceRoute.parent "File_system"
, Genode.Init.ServiceRoute.parent "Rtc"
, Genode.Init.ServiceRoute.parent "Timer"
, Genode.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "IO_MEM" , Genode.Init.ServiceRoute.parent "IO_MEM"
, Genode.Init.ServiceRoute.parent "IO_PORT" , Genode.Init.ServiceRoute.parent "IO_PORT"
, Genode.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "Rtc"
, Genode.Init.ServiceRoute.parent "Terminal"
, Genode.Init.ServiceRoute.parent "Timer"
] ]
} }
''; '';

View File

@ -39,6 +39,22 @@ in λ(subinit : Init.Type) →
, routes = [ Init.ServiceRoute.parent "IO_PORT" ] , routes = [ Init.ServiceRoute.parent "IO_PORT" ]
} }
) )
, child
"jitter_sponge"
( Child.flat
Child.Attributes::{
, binary = "jitter_sponge"
, provides = [ "Terminal" ]
, config = Init.Config::{
, policies =
[ Init.Config.Policy::{
, service = "Terminal"
, label = Init.LabelSelector.suffix "entropy"
}
]
}
}
)
, child , child
"store_fs" "store_fs"
( Child.flat ( Child.flat

View File

@ -36,7 +36,8 @@ in λ ( params
let init = let init =
Init::{ Init::{
, routes = parentRoutes [ "Timer", "Rtc", "File_system" ] , routes =
parentRoutes [ "File_system", "Rtc", "Terminal", "Timer" ]
, children = toMap , children = toMap
{ vfs = { vfs =
Child.flat Child.flat
@ -56,6 +57,13 @@ in λ ( params
( [ VFS.dir "pipes" [ VFS.leaf "pipe" ] ( [ VFS.dir "pipes" [ VFS.leaf "pipe" ]
, VFS.leaf "log" , VFS.leaf "log"
, VFS.leaf "null" , VFS.leaf "null"
, VFS.leafAttrs
"terminal"
( toMap
{ name = "entropy"
, label = "entropy"
}
)
, VFS.leaf "rtc" , VFS.leaf "rtc"
, VFS.leaf "zero" , VFS.leaf "zero"
] ]
@ -101,7 +109,7 @@ in λ ( params
, binary = "cached_fs_rom" , binary = "cached_fs_rom"
, provides = [ "ROM" ] , provides = [ "ROM" ]
, resources = Genode.Init.Resources::{ , resources = Genode.Init.Resources::{
, ram = Genode.units.MiB 16 , ram = Genode.units.MiB 32
} }
, config = Init.Config::{ , config = Init.Config::{
, policies = , policies =
@ -129,7 +137,7 @@ in λ ( params
, stdout = Some "/dev/log" , stdout = Some "/dev/log"
, stderr = Some "/dev/log" , stderr = Some "/dev/log"
, pipe = Some "/dev/pipes" , pipe = Some "/dev/pipes"
, rng = Some "/dev/random" , rng = Some "/dev/entropy"
, rtc = Some "/dev/rtc" , rtc = Some "/dev/rtc"
, socket = Some "/dev/sockets" , socket = Some "/dev/sockets"
, vfs = [ VFS.leaf "fs" ] , vfs = [ VFS.leaf "fs" ]

View File

@ -43,7 +43,6 @@ with lib; {
libc libc
posix posix
vfs vfs
vfs_jitterentropy
vfs_pipe vfs_pipe
]; ];
configFile = let configFile = let

View File

@ -101,6 +101,10 @@ in {
}; };
ipxe_nic_drv.portInputs = with ports; [ dde_ipxe ]; ipxe_nic_drv.portInputs = with ports; [ dde_ipxe ];
jbig2dec = { }; jbig2dec = { };
jitter_sponge = {
portInputs = with ports; [ jitterentropy xkcp ];
preConfigure = "cp -r ${self.worldSources} repos/world";
};
jpeg = { }; jpeg = { };
lan9118_nic_drv = { }; lan9118_nic_drv = { };
libarchive = { }; libarchive = { };

View File

@ -64,5 +64,11 @@ with pkgs;
nativeBuildInputs = [ iasl libxslt unzip yasm ]; nativeBuildInputs = [ iasl libxslt unzip yasm ];
}; };
x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w="; x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w=";
xkcp = {
extraRepos = [ genodePackages.worldSources ];
hash = "sha256-oB7oFikCFnEtB/ZlV7Gayw3wNa0BU/vi7O5gfzeFGLg=";
nativeBuildInputs = [ libxslt ];
version = "cafc03";
};
zlib.hash = "sha256-j3JXN0f8thrPCvLhYHIPjbGa0t3iynQ/gO7KMlgljq0="; zlib.hash = "sha256-j3JXN0f8thrPCvLhYHIPjbGa0t3iynQ/gO7KMlgljq0=";
} }