For IPsec mobile clients, write out a more specific ipsec.secrets line to help clients find the right key with strongSwan's new lookup code. Fixes #8426

This commit is contained in:
jim-p 2018-04-12 12:19:44 -04:00
parent 6ad146e044
commit af7c0311b8

View File

@ -714,6 +714,7 @@ EOD;
if (!empty($ph1ent['pre-shared-key'])) {
$pskconf .= "{$myid} {$peerid} : PSK 0s" . base64_encode(trim($ph1ent['pre-shared-key'])) . "\n";
if (isset($ph1ent['mobile'])) {
$pskconf .= "{$myid} %any : PSK 0s" . base64_encode(trim($ph1ent['pre-shared-key'])) . "\n";
$pskconf .= " : PSK 0s" . base64_encode(trim($ph1ent['pre-shared-key'])) . "\n";
}
}