Пример #1
0
function openvpn_refresh_crls()
{
    global $g, $config;
    openvpn_create_dirs();
    if (isset($config['openvpn']['openvpn-server']) && is_array($config['openvpn']['openvpn-server'])) {
        foreach ($config['openvpn']['openvpn-server'] as $settings) {
            if (empty($settings) || isset($settings['disable'])) {
                continue;
            }
            // Write the settings for the keys
            switch ($settings['mode']) {
                case 'p2p_tls':
                case 'server_tls':
                case 'server_tls_user':
                case 'server_user':
                    if (!empty($settings['crlref'])) {
                        $crl = lookup_crl($settings['crlref']);
                        crl_update($crl);
                        $fpath = "/var/etc/openvpn/server{$settings['vpnid']}.crl-verify";
                        file_put_contents($fpath, base64_decode($crl['text']));
                        @chmod($fpath, 0644);
                    }
                    break;
            }
        }
    }
}
Пример #2
0
            ?>
" alt="<?php 
            echo gettext("add crl");
            ?>
" width="17" height="17" border="0" />
							</a>
						<?php 
        }
        ?>
						</td>
					</tr>
					
						<?php 
        if (is_array($ca_crl_map[$ca['refid']])) {
            foreach ($ca_crl_map[$ca['refid']] as $crl) {
                $tmpcrl = lookup_crl($crl);
                $internal = is_crl_internal($tmpcrl);
                $inuse = crl_in_use($tmpcrl['refid']);
                ?>
					<tr>
						<td class="listlr"><?php 
                echo $tmpcrl['descr'];
                ?>
</td>
						<td class="listr"><?php 
                echo $internal ? "YES" : "NO";
                ?>
</td>
						<td class="listr"><?php 
                echo $internal ? count($tmpcrl['cert']) : "Unknown (imported)";
                ?>