diff -Nur -x '*.orig' -x '*.rej' phpki/phpki-0.82/ca/main.php mezzanine_patched_phpki/phpki-0.82/ca/main.php --- phpki/phpki-0.82/ca/main.php 2005-11-17 02:17:20.000000000 +0100 +++ mezzanine_patched_phpki/phpki-0.82/ca/main.php 2008-12-09 01:49:39.000000000 +0100 @@ -10,6 +10,14 @@ switch($stage) { +case 'dl_takey': + upload("$config[private_dir]/takey.pem", "$config[ca_prefix]takey.pem", 'application/octet-stream'); + break; + +case 'dl_dhparam': + upload("$config[private_dir]/dhparam1024.pem", "$config[ca_prefix]dhparam1024.pem", 'application/octet-stream'); + break; + case 'dl_root': upload("$config[cacert_pem]", "$config[ca_prefix]cacert.crt", 'application/x-x509-ca-cert'); break; @@ -50,6 +58,34 @@ } break; +case 'display_takey': + printHeader(false); + + ?> +

OpenVPN pre-shared Key

+

+

method=post> + +
+ '.ta_key_text().''; + break; + +case 'display_dhparam': + printHeader(false); + + ?> +

OpenVPN Diffie-Helman parameters

+

+

method=post> + +
+ '.dhparam_text().''; + break; + + + default: printHeader('ca'); ?> @@ -87,6 +123,17 @@ This is the official list of revoked certificates. Using this list with your e-mail or browser application is optional. Some applications will automagically reference this list. + + ?stage=dl_takey>Download the static pre-shared key

+ ?stage=display_takey>Display the static pre-shared key + This key can be used with OpenVPN as a standalone auth mecanism, or as an additionnal TLS authentication. + + + ?stage=dl_dhparam>Download the Diffie-Hellman parameters

+ ?stage=display_dhparam>Display the Diffie-Hellman parameters + This file is used by OpenVPN for the hand-shake. The Diffie-Hellman key agreement + protocol enables two communication partners to exchange a secret key safely. +

diff -Nur -x '*.orig' -x '*.rej' phpki/phpki-0.82/include/openssl_functions.php mezzanine_patched_phpki/phpki-0.82/include/openssl_functions.php --- phpki/phpki-0.82/include/openssl_functions.php 2008-12-09 01:50:28.000000000 +0100 +++ mezzanine_patched_phpki/phpki-0.82/include/openssl_functions.php 2008-12-09 01:50:05.000000000 +0100 @@ -416,6 +416,20 @@ return(shell_exec(CRL.' -in '.escshellarg($crlfile).' -text 2>&1')); } +// Returns the static takey.pem file +function ta_key_text() { + global $config; + return(shell_exec('cat '.escshellarg($config['private_dir']).'/takey.pem 2>&1')); +} + +// Returns the dhparam file +function dhparam_text() { + global $config; + return(shell_exec('cat '.escshellarg($config['private_dir']).'/dhparam1024.pem 2>&1')); +} + + + // // Returns the subject of a certificate. //