summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-04-28 02:11:19 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-04-28 02:11:19 +0000
commitf2493c615991fca0c457a9f340b509c1a622f18b (patch)
tree07f9a8bccb55ff9c6caed5ee628c018011c63a06 /etc/inc
parent3875f8211d5b6d9f8b7317187cbe9f399f54041b (diff)
downloadpfsense-f2493c615991fca0c457a9f340b509c1a622f18b.zip
pfsense-f2493c615991fca0c457a9f340b509c1a622f18b.tar.gz
* Obtain keysize
* Use keyname for server
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/openvpn.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 28fd79f..43a0198 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -302,8 +302,11 @@ function openvpn_server_create_cert($mode, $id) {
global $g, $config;
$settings = $config['installedpackages']["openvpn$mode"]['config'][$id];
log_error("Creating server certificate for {$settings['description']}.");
- $cakeysize = $settings['keysize'];
- $caname = $settings['cipherpki'];
+ $caname = $settings['cipherpki'];
+ foreach($config['openvpn']['keys'] as $ca) {
+ if($ca == $caname)
+ $cakeysize = $ca['keysize'];
+ }
$ovpncapath = $g['varetc_path']."/openvpn/certificates";
$easyrsapath = $g['easyrsapath'];
config_lock();
@@ -311,7 +314,7 @@ function openvpn_server_create_cert($mode, $id) {
fwrite($fd, "#!/bin/tcsh\n");
fwrite($fd, "cd $ovpncapath \n");
fwrite($fd, "source $ovpncapath/$caname/vars \n");
- fwrite($fd, "$easyrsapath/pkitool --batch --server server \n");
+ fwrite($fd, "$easyrsapath/pkitool --batch --server {$caname} \n");
fwrite($fd, "openssl dhparam -out $ovpncapath/$caname/dh_params.dh $cakeysize \n");
fclose($fd);
system("/bin/chmod a+rx $ovpncapath/RUNME_2ND");
OpenPOWER on IntegriCloud