Feature #2032 » pfsense-openvpn-export-password-viscocity.patch
/usr/local/pkg/openvpn-client-export.inc 2011-11-28 22:33:33.000000000 +0000 | ||
---|---|---|
541 | 541 |
file_put_contents($crtfile, base64_decode($cert['crt'])); |
542 | 542 | |
543 | 543 |
// write user .key |
544 |
$keyfile = "{$tempdir}/key.key"; |
|
545 |
file_put_contents($keyfile, base64_decode($cert['prv'])); |
|
544 |
if (!empty($outpass)) { |
|
545 |
$keyfile = "{$tempdir}/key.key"; |
|
546 |
$clearkeyfile = "{$tempdir}/key-clear.key"; |
|
547 |
file_put_contents($clearkeyfile, base64_decode($cert['prv'])); |
|
548 |
$eoutpass = escapeshellarg($outpass); |
|
549 |
$ekeyfile = escapeshellarg($keyfile); |
|
550 |
$eclearkeyfile = escapeshellarg($clearkeyfile); |
|
551 |
exec("/usr/bin/openssl rsa -in ${eclearkeyfile} -out ${ekeyfile} -des3 -passout pass:${eoutpass}"); |
|
552 |
unlink($clearkeyfile); |
|
553 |
} else { |
|
554 |
$keyfile = "{$tempdir}/key.key"; |
|
555 |
file_put_contents($keyfile, base64_decode($cert['prv'])); |
|
556 |
} |
|
546 | 557 |
} |
547 | 558 | |
548 | 559 |
// TLS support? |