Skip to content

Commit 62aba30

Browse files
author
root
committed
tRNG test added
1 parent 8a4d6ef commit 62aba30

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

install/install.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@
174174
//** Select installation mode
175175
$install_mode = $inst->simple_query('Installation mode', array('standard', 'expert'), 'standard','install_mode');
176176

177+
//** tRNG dependencies
178+
$conf['tRNG']='';
177179

178180
//** Get the hostname
179181
$tmp_out = array();
@@ -428,9 +430,7 @@
428430
swriteln('Configuring BIND');
429431
$inst->configure_bind();
430432
$conf['services']['dns'] = true;
431-
if(!is_installed('haveged')) {
432-
swriteln("[INFO] haveged not detected - DNSSEC can fail");
433-
}
433+
$conf['tRNG'] .= 'DNSSEC with BIND, ';
434434
}
435435
//* Configure MyDNS
436436
if($conf['mydns']['installed']) {
@@ -623,6 +623,8 @@
623623
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '') system($inst->getinitcommand($conf['ufw']['init_script'], 'restart').' &> /dev/null');
624624
if($conf['xmpp']['installed'] == true && $conf['xmpp']['init_script'] != '') system($inst->getinitcommand($conf['xmpp']['init_script'], 'restart').' &> /dev/null');
625625

626+
//* test tRNG
627+
if($conf['tRNG']) tRNG();
626628

627629
$inst->create_mount_script();
628630

install/lib/install.lib.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,4 +948,14 @@ function getapachemodules() {
948948
return $modules;
949949
}
950950

951+
function tRNG(){
952+
global $conf;
953+
$path='/dev/random';$test='/tmp/ispconfig.tRNG';$time=8;$warn=8192;
954+
echo "Testing $time seconds throughput of $path ...";
955+
exec("cat $path > $test & PID=\$!; sleep $time; kill \$PID");
956+
if(($result=filesize($test)) < $warn) {
957+
echo "\n[WARN] these services may fail: {$conf['tRNG']}result: $result bytes, minimum recommended: $warn\n";
958+
}else echo " OK\n";
959+
unlink($test);
960+
}
951961
?>

install/update.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
include_once 'dist/lib/'.$dist['id'].'.lib.php';
140140
include_once 'dist/conf/'.$dist['confid'].'.conf.php';
141141

142+
//** tRNG dependencies
143+
$conf['tRNG']='';
144+
142145
//** Get hostname
143146
exec('hostname -f', $tmp_out);
144147
$conf['hostname'] = $tmp_out[0];
@@ -407,9 +410,7 @@
407410
} elseif($conf['bind']['installed'] == true) {
408411
swriteln('Configuring BIND');
409412
$inst->configure_bind();
410-
if(!is_installed('haveged')) {
411-
swriteln("[INFO] haveged not detected - DNSSEC can fail");
412-
}
413+
$conf['tRNG'] .= 'DNSSEC with BIND, ';
413414
} else {
414415
swriteln('Configuring MyDNS');
415416
$inst->configure_mydns();
@@ -570,6 +571,9 @@
570571
//* Set default servers
571572
setDefaultServers();
572573

574+
//* test tRNG
575+
if($conf['tRNG']) tRNG();
576+
573577
$inst->create_mount_script();
574578

575579
//* Create md5 filelist

0 commit comments

Comments
 (0)