More formatting
This commit is contained in:
@@ -322,7 +322,7 @@ function CAdb_get_entry($serial)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$regexp = "^[VR]\t.*\t.*\t$serial\t.*\t.*$";
|
$regexp = "^[VR]\t.*\t.*\t$serial\t.*\t.*$";
|
||||||
$x = exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
$x = exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
||||||
if ($x) {
|
if ($x) {
|
||||||
return CAdb_explode_entry($x);
|
return CAdb_explode_entry($x);
|
||||||
} else {
|
} else {
|
||||||
@@ -341,7 +341,7 @@ function CAdb_in($email = "", $name = "")
|
|||||||
$email = escshellcmd($email);
|
$email = escshellcmd($email);
|
||||||
$name = escshellcmd($name);
|
$name = escshellcmd($name);
|
||||||
$regexp = "^[V].*CN=$name/(Email|emailAddress)=$email";
|
$regexp = "^[V].*CN=$name/(Email|emailAddress)=$email";
|
||||||
$x =exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
$x = exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
||||||
|
|
||||||
if ($x) {
|
if ($x) {
|
||||||
list($j,$j,$j,$serial,$j,$j) = explode("\t", $x);
|
list($j,$j,$j,$serial,$j,$j) = explode("\t", $x);
|
||||||
@@ -418,26 +418,26 @@ function CAdb_explode_entry($dbentry)
|
|||||||
|
|
||||||
// Compatibility with migrated certs from openvpn-bridge
|
// Compatibility with migrated certs from openvpn-bridge
|
||||||
if (count($b) == 7) {
|
if (count($b) == 7) {
|
||||||
$db['serial'] = $a[3];
|
$db['serial'] = $a[3];
|
||||||
$db['country'] = $b[1];
|
$db['country'] = $b[1];
|
||||||
$db['province'] = $b[2];
|
$db['province'] = $b[2];
|
||||||
$db['locality'] = '';
|
$db['locality'] = '';
|
||||||
$db['organization'] = $b[3];
|
$db['organization'] = $b[3];
|
||||||
$db['issuer'] = '';
|
$db['issuer'] = '';
|
||||||
$db['unit'] = $b[4];
|
$db['unit'] = $b[4];
|
||||||
$db['common_name'] = $b[5];
|
$db['common_name'] = $b[5];
|
||||||
$db['email'] = $b[6];
|
$db['email'] = $b[6];
|
||||||
} // Compatibility with renewed certs from openvpn-bridge
|
} // Compatibility with renewed certs from openvpn-bridge
|
||||||
elseif (count($b) == 8) {
|
elseif (count($b) == 8) {
|
||||||
$db['serial'] = $a[3];
|
$db['serial'] = $a[3];
|
||||||
$db['country'] = $b[1];
|
$db['country'] = $b[1];
|
||||||
$db['province'] = $b[2];
|
$db['province'] = $b[2];
|
||||||
$db['locality'] = $b[3];
|
$db['locality'] = $b[3];
|
||||||
$db['organization'] = $b[4];
|
$db['organization'] = $b[4];
|
||||||
$db['issuer'] = '';
|
$db['issuer'] = '';
|
||||||
$db['unit'] = $b[5];
|
$db['unit'] = $b[5];
|
||||||
$db['common_name'] = $b[6];
|
$db['common_name'] = $b[6];
|
||||||
$db['email'] = $b[7];
|
$db['email'] = $b[7];
|
||||||
} // Else, it's a certificate created with phpki
|
} // Else, it's a certificate created with phpki
|
||||||
else {
|
else {
|
||||||
$db['serial'] = $a[3];
|
$db['serial'] = $a[3];
|
||||||
@@ -462,7 +462,7 @@ function CAdb_is_revoked($serial)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$regexp = "^R\t.*\t.*\t$serial\t.*\t.*$";
|
$regexp = "^R\t.*\t.*\t$serial\t.*\t.*$";
|
||||||
$x = exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
$x = exec('egrep '.escshellarg($regexp).' '.$config['index']);
|
||||||
|
|
||||||
if ($x) {
|
if ($x) {
|
||||||
list($j,$j,$revoke_date,$j,$j,$j) = explode("\t", $x);
|
list($j,$j,$revoke_date,$j,$j,$j) = explode("\t", $x);
|
||||||
@@ -633,6 +633,7 @@ function CA_create_cert($cert_type = 'email', $country, $province, $locality, $o
|
|||||||
|
|
||||||
$userkey = $config['private_dir'] . "/$serial-key.pem";
|
$userkey = $config['private_dir'] . "/$serial-key.pem";
|
||||||
$userreq = $config['req_dir'] ."/$serial-req.pem";
|
$userreq = $config['req_dir'] ."/$serial-req.pem";
|
||||||
|
$usercert = $config['new_certs_dir'].'/'.$serial.'.pem';
|
||||||
$userder = $config['cert_dir'] . "/$serial.der";
|
$userder = $config['cert_dir'] . "/$serial.der";
|
||||||
$userpfx = $config['pfx_dir'] . "/$serial.pfx";
|
$userpfx = $config['pfx_dir'] . "/$serial.pfx";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user