Revision c86c2b8b
Added by Ermal Luçi over 10 years ago
etc/inc/vpn.inc | ||
---|---|---|
487 | 487 |
$myid = isset($ph1ent['mobile']) ? trim($myid_data) . " " : ""; |
488 | 488 |
$peerid = ($peerid_data != "allusers") ? trim($peerid_data) : ""; |
489 | 489 |
if (!empty($ph1ent['pre-shared-key'])) |
490 |
$pskconf .= $myid . $peerid . " : PSK \"" . trim($ph1ent['pre-shared-key']) . "\"\n";
|
|
490 |
$pskconf .= $myid . $peerid . " : PSK 00" . base64_encode(trim($ph1ent['pre-shared-key'])) . "\n";
|
|
491 | 491 |
} |
492 | 492 |
} |
493 | 493 |
} |
... | ... | |
496 | 496 |
if (is_array($config['system']) && is_array($config['system']['user'])) { |
497 | 497 |
foreach ($config['system']['user'] as $user) { |
498 | 498 |
if (!empty($user['ipsecpsk'])) { |
499 |
$pskconf .= "{$myid} {$user['name']} : PSK \"{$user['ipsecpsk']}\"\n";
|
|
499 |
$pskconf .= "{$myid} {$user['name']} : PSK 00" . base64_encode($user['ipsecpsk']) . "\n";
|
|
500 | 500 |
} |
501 | 501 |
} |
502 | 502 |
unset($user); |
... | ... | |
506 | 506 |
if (is_array($ipseccfg['mobilekey'])) { |
507 | 507 |
foreach ($ipseccfg['mobilekey'] as $key) { |
508 | 508 |
if ($key['ident'] == "allusers") |
509 |
$key['ident'] = ''; |
|
510 |
$pskconf .= "{$myid} {$key['ident']} : PSK \"{$key['pre-shared-key']}\"\n";
|
|
509 |
$key['ident'] = '%any';
|
|
510 |
$pskconf .= "{$myid} {$key['ident']} : PSK 00" . base64_encode($key['pre-shared-key']) . "\n";
|
|
511 | 511 |
} |
512 | 512 |
unset($key); |
513 | 513 |
} |
Also available in: Unified diff
Use base64 encoded secrets which Fixes #4158