/* mop up from a badly implemented ssh keys -> cf backup */
if($config['ssh']['dsa_key']<>""){
unset($config['ssh']['dsa_key']);
unset($config['ssh']['ecdsa_key']);
unset($config['ssh']['ed25519_key']);
unset($config['ssh']['rsa_key']);
unset($config['ssh']['rsa1_key']);
unset($config['ssh']['dsa']);
unset($config['ssh']['rsa']);
unset($config['ssh']['rsa1']);
unset($config['ssh']['ak']);
write_config("Clearing SSH keys from config.xml");
}
/* are we already running? if so exit */
if(is_subsystem_dirty('sshdkeys')){
unset($keys);
return;
}
// Check for all needed key files. If any are missing, the keys need to be regenerated.
$generate_keys=false;
foreach($keysas$f2c){
if(!file_exists("/etc/ssh/{$f2c}")){
$generate_keys=true;
break;
}
}
if($generate_keys){
/* remove previous keys and regen later */
file_notice("SSH","{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.","SSH KeyGen","");
/* mop up from a badly implemented ssh keys -> cf backup */
if($config['ssh']['dsa_key']<>""){
unset($config['ssh']['dsa_key']);
unset($config['ssh']['ecdsa_key']);
unset($config['ssh']['ed25519_key']);
unset($config['ssh']['rsa_key']);
unset($config['ssh']['rsa1_key']);
unset($config['ssh']['dsa']);
unset($config['ssh']['rsa']);
unset($config['ssh']['rsa1']);
unset($config['ssh']['ak']);
write_config("Clearing SSH keys from config.xml");
}
/* are we already running? if so exit */
if(is_subsystem_dirty('sshdkeys')){
unset($keys);
return;
}
// Check for all needed key files. If any are missing, the keys need to be regenerated.
$generate_keys=false;
foreach($keysas$f2c){
if(!file_exists("/etc/ssh/{$f2c}")){
$generate_keys=true;
break;
}
}
if($generate_keys){
/* remove previous keys and regen later */
file_notice("SSH","{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.","SSH KeyGen","");