Redact BGP MD5 password/key in status output. Fixes #7642

(cherry picked from commit aa18c5b9b6)
(cherry picked from commit 4122033534)
This commit is contained in:
jim-p 2017-06-13 13:11:23 -04:00
parent 12b9eedf21
commit 0b2f2d4122

View File

@ -143,6 +143,8 @@ function doCmdT($title, $command, $method) {
$line = preg_replace("/<passwordagain>.*?<\\/passwordagain>/", "<passwordagain>xxxxx</passwordagain>", $line);
$line = preg_replace("/<crypto_password>.*?<\\/crypto_password>/", "<crypto_password>xxxxx</crypto_password>", $line);
$line = preg_replace("/<crypto_password2>.*?<\\/crypto_password2>/", "<crypto_password2>xxxxx</crypto_password2>", $line);
$line = preg_replace("/<md5sigpass>.*?<\\/md5sigpass>/", "<md5sigpass>xxxxx</md5sigpass>", $line);
$line = preg_replace("/<md5sigkey>.*?<\\/md5sigkey>/", "<md5sigkey>xxxxx</md5sigkey>", $line);
$line = str_replace("\t", " ", $line);
echo htmlspecialchars($line, ENT_NOQUOTES);
fwrite($ofd, $line);