#!/usr/local/bin/perl # cert_issue_ie.cgi require './acl-lib.pl'; &ReadParse(); &error_setup($text{'cert_err'}); &get_miniserv_config(\%miniserv); # Save certificate request to a file $req = $in{'data'}; $req =~ s/\r|\n//g; $temp = &transname(); open(TEMP, ">$temp"); print TEMP "-----BEGIN CERTIFICATE REQUEST-----\n"; $result = 1; while($result) { $result = substr($req, 0, 72); if($result) { print TEMP "$result\n"; $req = substr($req, 72); } } print TEMP "-----END CERTIFICATE REQUEST-----\n"; close(TEMP); # Call the openssl CA command to process the request $temp2 = &transname(); $cmd = &get_ssleay(); $out = &backquote_logged("yes | $cmd ca -in $temp -out $temp2 -config $module_config_directory/openssl.cnf -days 1095 2>&1"); if ($?) { unlink($temp); &error("
$out"); } unlink($temp); # Create CRL if needed $crl = "$module_config_directory/crl.pem"; if (!-r $crl_file) { $out = &backquote_logged("$config{'ssleay'} ca -gencrl -out $crl -config $module_config_directory/openssl.cnf 2>&1"); if ($?) { &error("
$out"); } } # Call the openssl crl2pkcs7 command to add to the CRL $temp3 = &transname(); $out = &backquote_logged("$config{'ssleay'} crl2pkcs7 -certfile $temp2 -in $crl -out $temp3 2>&1"); if ($?) { unlink($temp2); &error("
$out"); } unlink($temp2); open(OUT, $temp3); while(