Merge pull request #5 from kylejohnson/master

Allow 4096bit keys to be generated, and replace (most) short tags.

Reviewed, approved for merging
This commit is contained in:
Nick Pappas
2013-07-18 09:50:05 -07:00
7 changed files with 163 additions and 163 deletions

View File

@@ -27,10 +27,10 @@ case 'gen_crl':
?> ?>
<center><h2>Certificate Revocation List Updated</h2></center> <center><h2>Certificate Revocation List Updated</h2></center>
<p> <p>
<form action=<?=$PHP_SELF?> method=post> <form action=<?php echo $PHP_SELF?> method=post>
<input type=submit name=submit value="Back to Menu"> <input type=submit name=submit value="Back to Menu">
</form> </form>
<? <?php
print '<pre>'.CA_crl_text().'</pre>'; print '<pre>'.CA_crl_text().'</pre>';
} }
else { else {
@@ -39,14 +39,14 @@ case 'gen_crl':
<h2>There was an error updating the Certificate Revocation List.</h2></font><br> <h2>There was an error updating the Certificate Revocation List.</h2></font><br>
<blockquote> <blockquote>
<h3>Debug Info:</h3> <h3>Debug Info:</h3>
<pre><?=$errtxt?></pre> <pre><?php echo $errtxt?></pre>
</blockquote> </blockquote>
<form action=<?=$PHP_SELF?> method=post> <form action=<?php echo $PHP_SELF?> method=post>
<p> <p>
<input type=submit name=submit value="Back to Menu"> <input type=submit name=submit value="Back to Menu">
<p> <p>
</form> </form>
<? <?php
} }
break; break;
@@ -70,27 +70,27 @@ default:
<strong><cite>Certificate Management Control Panel</cite></strong>.</td></tr> <strong><cite>Certificate Management Control Panel</cite></strong>.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=gen_crl>Update & View the Certificate Revocation List</a></td> <a href=<?php echo $PHP_SELF?>?stage=gen_crl>Update & View the Certificate Revocation List</a></td>
<td>Some applications automagically reference the Certificate Revocation List to determine <td>Some applications automagically reference the Certificate Revocation List to determine
certificate validity. It is not necessary to perform this update function, as the CRL is certificate validity. It is not necessary to perform this update function, as the CRL is
updated when certificates are revoked. However, doing so is harmless. updated when certificates are revoked. However, doing so is harmless.
<a href=../help.php target=_help>Read the online help</a> to learn more about this.</td></tr> <a href=../help.php target=_help>Read the online help</a> to learn more about this.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=dl_root>Download the Root Certificate</a></td> <a href=<?php echo $PHP_SELF?>?stage=dl_root>Download the Root Certificate</a></td>
<td>The "Root" certificate must be installed before using any of the <td>The "Root" certificate must be installed before using any of the
certificates issued here. <a href=../help.php target=_help>Read the online help</a> certificates issued here. <a href=../help.php target=_help>Read the online help</a>
to learn more about this.</td></tr> to learn more about this.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=dl_crl>Download the Certificate Revocation List</a></td> <a href=<?php echo $PHP_SELF?>?stage=dl_crl>Download the Certificate Revocation List</a></td>
<td>This is the official list of revoked certificates. Using this list with your e-mail or <td>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. </td></tr> browser application is optional. Some applications will automagically reference this list. </td></tr>
</table> </table>
</center> </center>
<br><br> <br><br>
<? <?php
printFooter(); printFooter();
} }

View File

@@ -42,7 +42,7 @@ $qstr_sort = "sortfield=$sortfield&ascdec=$ascdec";
switch ($stage) { switch ($stage) {
case 'goaway': case 'goaway':
printHeader(false); printHeader(false);
?> <p><center><h1><font color=red>YOU ARE A VERY BAD BOY!</font></h2></center> <? ?> <p><center><h1><font color=red>YOU ARE A VERY BAD BOY!</font></h2></center> <?php
break; break;
case 'display': case 'display':
@@ -50,8 +50,8 @@ case 'display':
?> ?>
<center><h2>Certificate Details</h2></center> <center><h2>Certificate Details</h2></center>
<center><font color=#0000AA><h3>(#<?=$serial?>)<br><?=htvar(CA_cert_cname($serial).' <'.CA_cert_email($serial).'>')?> </h3></font></center> <center><font color=#0000AA><h3>(#<?php echo $serial?>)<br><?php echo htvar(CA_cert_cname($serial).' <'.CA_cert_email($serial).'>')?> </h3></font></center>
<? <?php
if ($revoke_date = CAdb_is_revoked($serial)) if ($revoke_date = CAdb_is_revoked($serial))
print '<center><font color=red><h2>REVOKED '.$revoke_date.'</h2></font></center>'; print '<center><font color=red><h2>REVOKED '.$revoke_date.'</h2></font></center>';
@@ -65,9 +65,9 @@ case 'dl-confirm':
$rec = CAdb_get_entry($serial); $rec = CAdb_get_entry($serial);
?> ?>
<h3>You are about to download the <font color=red>PRIVATE</font> certificate key for <?=$rec['common_name'].' &lt;'.$rec['email'].'&gt; '?></h3> <h3>You are about to download the <font color=red>PRIVATE</font> certificate key for <?php echo $rec['common_name'].' &lt;'.$rec['email'].'&gt; '?></h3>
<h3><font color=red>DO NOT DISTRIBUTE THIS FILE TO THE PUBLIC!</font></h3> <h3><font color=red>DO NOT DISTRIBUTE THIS FILE TO THE PUBLIC!</font></h3>
<form action="<?=$PHP_SELF.'?stage=download&serial='.$serial.'&'.$qstr_sort.'&'.$qstr_filter?>" method=post> <form action="<?php echo $PHP_SELF.'?stage=download&serial='.$serial.'&'.$qstr_sort.'&'.$qstr_filter?>" method=post>
<strong>File type: </strong> <strong>File type: </strong>
<td><select name=dl_type> <td><select name=dl_type>
<option value="PKCS#12">PKCS#12 Bundle</option> <option value="PKCS#12">PKCS#12 Bundle</option>
@@ -81,7 +81,7 @@ case 'dl-confirm':
&nbsp; or &nbsp; &nbsp; or &nbsp;
<input type=submit name=submit value="Go Back"> <input type=submit name=submit value="Go Back">
</form> </form>
<? <?php
break; break;
@@ -130,7 +130,7 @@ case 'revoke-form':
State/Province<br> State/Province<br>
Country<br> Country<br>
</td> </td>
<? <?php
print ' print '
<td> <td>
@@ -169,13 +169,13 @@ case 'revoke':
.</h2></font><br> .</h2></font><br>
<blockquote> <blockquote>
<h3>Debug Info:</h3> <h3>Debug Info:</h3>
<pre><?=$errtxt?></pre> <pre><?php echo $errtxt?></pre>
</blockquote> </blockquote>
<p> <p>
<input type=submit name=submit value=Back> <input type=submit name=submit value=Back>
<p> <p>
</form> </form>
<? <?php
} }
else else
header("Location: ${PHP_SELF}?$qstr_sort&$qstr_filter"); header("Location: ${PHP_SELF}?$qstr_sort&$qstr_filter");
@@ -206,51 +206,51 @@ case 'renew-form':
?> ?>
<body onLoad="self.focus();document.form.passwd.focus()"> <body onLoad="self.focus();document.form.passwd.focus()">
<form action="<?=$PHP_SELF.'?'.$qstr_sort.'&'.$qstr_filter?>" method=post name=form> <form action="<?php echo $PHP_SELF.'?'.$qstr_sort.'&'.$qstr_filter?>" method=post name=form>
<table width=99%> <table width=99%>
<th colspan=2><h3>Certificate Renewal Form</h3></th> <th colspan=2><h3>Certificate Renewal Form</h3></th>
<tr> <tr>
<td width=25%>Common Name </td> <td width=25%>Common Name </td>
<td><input type=text name=common_name value="<?= htvar($common_name)?>" size=50 maxlength=60 disabled></td> <td><input type=text name=common_name value="<?php echo htvar($common_name)?>" size=50 maxlength=60 disabled></td>
</tr> </tr>
<tr> <tr>
<td>E-mail Address </td> <td>E-mail Address </td>
<td><input type=text name=email value="<?=htvar($email)?>" size=50 maxlength=60 disabled></td> <td><input type=text name=email value="<?php echo htvar($email)?>" size=50 maxlength=60 disabled></td>
</tr> </tr>
<tr> <tr>
<td>Organization </td> <td>Organization </td>
<td><input type=text name=organization value="<?=htvar($organization)?>" size=60 maxlength=60 disabled></td> <td><input type=text name=organization value="<?php echo htvar($organization)?>" size=60 maxlength=60 disabled></td>
</tr> </tr>
<tr> <tr>
<td>Department/Unit </td><td><input type=text name=unit value="<?= htvar($unit) ?>" size=40 maxlength=60 disabled></td> <td>Department/Unit </td><td><input type=text name=unit value="<?php echo htvar($unit) ?>" size=40 maxlength=60 disabled></td>
</tr> </tr>
<tr> <tr>
<td>Locality</td><td><input type=text name=locality value="<?= htvar($locality) ?>" size=30 maxlength=30 disabled></td> <td>Locality</td><td><input type=text name=locality value="<?php echo htvar($locality) ?>" size=30 maxlength=30 disabled></td>
</tr> </tr>
<tr> <tr>
<td>State/Province</td><td><input type=text name=province value="<?= htvar($province) ?>" size=30 maxlength=30 disabled></td> <td>State/Province</td><td><input type=text name=province value="<?php echo htvar($province) ?>" size=30 maxlength=30 disabled></td>
</tr> </tr>
<tr> <tr>
<td>Country</td> <td>Country</td>
<td><input type=text name=country value="<?= htvar($country) ?>" size=2 maxlength=2 disabled></td> <td><input type=text name=country value="<?php echo htvar($country) ?>" size=2 maxlength=2 disabled></td>
</tr> </tr>
<tr> <tr>
<td>Certificate Password </td> <td>Certificate Password </td>
<td><input type=password name=passwd value="<?= htvar($passwd) ?>" size=30></td> <td><input type=password name=passwd value="<?php echo htvar($passwd) ?>" size=30></td>
</tr> </tr>
<tr> <tr>
<td>Certificate Life </td> <td>Certificate Life </td>
<td><select name=expiry> <td><select name=expiry>
<? <?php
print "<option value=0.083 " . ($expiry == 1 ? "selected='selected'" : "") . " >1 Month</option>\n" ; print "<option value=0.083 " . ($expiry == 1 ? "selected='selected'" : "") . " >1 Month</option>\n" ;
print "<option value=0.25 " . ($expiry == 1 ? "selected='selected'" : "") . " >3 Months</option>\n" ; print "<option value=0.25 " . ($expiry == 1 ? "selected='selected'" : "") . " >3 Months</option>\n" ;
@@ -271,12 +271,12 @@ case 'renew-form':
</td> </td>
<td> <td>
<input type=hidden name=stage value=renew> <input type=hidden name=stage value=renew>
<input type=hidden name=serial value=<?=$serial?>> <input type=hidden name=serial value=<?php echo $serial?>>
</td> </td>
</tr> </tr>
</table> </table>
</form> </form>
<? <?php
printFooter(); printFooter();
break; break;
@@ -296,13 +296,13 @@ case 'renew':
.</h2></font><br> .</h2></font><br>
<blockquote> <blockquote>
<h3>Debug Info:</h3> <h3>Debug Info:</h3>
<pre><?=$errtxt?></pre> <pre><?php echo $errtxt?></pre>
</blockquote> </blockquote>
<p> <p>
<input type=submit name=submit value=Back> <input type=submit name=submit value=Back>
<p> <p>
</form> </form>
<? <?php
} }
else { else {
header("Location: $PHP_SELF?$qstr_sort&$qstr_filter"); header("Location: $PHP_SELF?$qstr_sort&$qstr_filter");
@@ -319,17 +319,17 @@ default:
<table> <table>
<tr><th colspan=8><big>CERTIFICATE MANAGEMENT CONTROL PANEL</big></th></tr> <tr><th colspan=8><big>CERTIFICATE MANAGEMENT CONTROL PANEL</big></th></tr>
<tr><td colspan=8><center> <tr><td colspan=8><center>
<form action="<?="$PHP_SELF?$qstr_sort"?>" method=get name=filter> <form action="<?php echo "$PHP_SELF?$qstr_sort"?>" method=get name=filter>
Search: <input type=text name=search value="<?=htvar($search)?>" style="font-size: 11px;" maxlength=60 size=30> Search: <input type=text name=search value="<?php echo htvar($search)?>" style="font-size: 11px;" maxlength=60 size=30>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=checkbox name=show_valid value="V" <?=($show_valid?'checked' &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=checkbox name=show_valid value="V" <?php echo ($show_valid?'checked'
:'')?>>Valid :'')?>>Valid
&nbsp&nbsp<input type=checkbox name=show_revoked value="R" <?=($show_revoked?'checked':'')?>>Revoked &nbsp&nbsp<input type=checkbox name=show_revoked value="R" <?php echo ($show_revoked?'checked':'')?>>Revoked
&nbsp&nbsp<input type=checkbox name=show_expired value="E" <?=($show_expired?'checked':'')?>>Expired &nbsp&nbsp<input type=checkbox name=show_expired value="E" <?php echo ($show_expired?'checked':'')?>>Expired
&nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=submit value="Apply Filter" style="font-size: 11px;"> &nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=submit value="Apply Filter" style="font-size: 11px;">
</form> </form>
</center></td> </center></td>
</tr> </tr>
<? <?php
if (! $sortfield) { if (! $sortfield) {
$sortfield = 'email' ; $sortfield = 'email' ;

View File

@@ -88,12 +88,12 @@ case 'validate':
printHeader(); printHeader();
?> ?>
<form action='<?=$PHP_SELF?>' method=post> <form action='<?php echo $PHP_SELF?>' method=post>
<input type=submit name=submit value='Go Back'> <input type=submit name=submit value='Go Back'>
<font color=#ff0000><?=$er?></font> <font color=#ff0000><?php echo $er?></font>
<br><input type=submit name=submit value='Go Back'> <br><input type=submit name=submit value='Go Back'>
<? <?php
print $hidden_fields; print $hidden_fields;
print "</form>"; print "</form>";
@@ -122,7 +122,7 @@ case 'confirm':
</td> </td>
<td> <td>
<? <?php
print htvar($common_name) . '<br>'; print htvar($common_name) . '<br>';
print htvar($email) . '<br>'; print htvar($email) . '<br>';
print htvar($organization) . '<br>'; print htvar($organization) . '<br>';
@@ -139,14 +139,14 @@ case 'confirm':
</tr></table> </tr></table>
<h4>Are you sure?</h4> <h4>Are you sure?</h4>
<p><form action='<?=$PHP_SELF?>' method=post> <p><form action='<?php echo $PHP_SELF?>' method=post>
<?= $hidden_fields ?> <?php echo $hidden_fields ?>
<input type=hidden name=form_stage value=final> <input type=hidden name=form_stage value=final>
<input type=submit name=submit value='Yes! Create and Download' >&nbsp; <input type=submit name=submit value='Yes! Create and Download' >&nbsp;
<input type=submit name=submit value='Go Back'> <input type=submit name=submit value='Go Back'>
</form> </form>
<? <?php
printFooter(); printFooter();
# Save user's defaults # Save user's defaults
@@ -174,19 +174,19 @@ case 'final':
printHeader(); printHeader();
?> ?>
<form action=<?=$PHP_SELF?> method=post> <form action=<?php echo $PHP_SELF?> method=post>
<font color=#ff0000> <font color=#ff0000>
<h2>There was an error creating your certificate.</h2></font><br> <h2>There was an error creating your certificate.</h2></font><br>
<blockquote> <blockquote>
<h3>Debug Info:</h3> <h3>Debug Info:</h3>
<pre><?=$errtxt?></pre> <pre><?php echo $errtxt?></pre>
</blockquote> </blockquote>
<p> <p>
<?=$hidden_fields?> <?php echo $hidden_fields?>
<input type=submit name=submit value=Back> <input type=submit name=submit value=Back>
<p> <p>
</form> </form>
<? <?php
printFooter(); printFooter();
break; break;
@@ -231,51 +231,51 @@ default:
printHeader(); printHeader();
?> ?>
<body onLoad="self.focus();document.request.common_name.focus()"> <body onLoad="self.focus();document.request.common_name.focus()">
<form action="<?=$PHP_SELF?>" method=post name=request> <form action="<?php echo $PHP_SELF?>" method=post name=request>
<table width=99%> <table width=99%>
<th colspan=2><h3>Certificate Request Form</h3></th> <th colspan=2><h3>Certificate Request Form</h3></th>
<tr> <tr>
<td width=30%>Common Name<br>(i.e. User real name or computer hostname) </td> <td width=30%>Common Name<br>(i.e. User real name or computer hostname) </td>
<td><input type=text name=common_name value="<?= htvar($common_name)?>" size=50 maxlength=60></td> <td><input type=text name=common_name value="<?php echo htvar($common_name)?>" size=50 maxlength=60></td>
</tr> </tr>
<tr> <tr>
<td>E-mail Address </td> <td>E-mail Address </td>
<td><input type=text name=email value="<?=htvar($email)?>" size=50 maxlength=60></td> <td><input type=text name=email value="<?php echo htvar($email)?>" size=50 maxlength=60></td>
</tr> </tr>
<tr> <tr>
<td>Organization (Company/Agency)</td> <td>Organization (Company/Agency)</td>
<td><input type=text name=organization value="<?=htvar($organization)?>" size=60 maxlength=60></td> <td><input type=text name=organization value="<?php echo htvar($organization)?>" size=60 maxlength=60></td>
</tr> </tr>
<tr> <tr>
<td>Department/Unit </td><td><input type=text name=unit value="<?= htvar($unit) ?>" size=40 maxlength=60></td> <td>Department/Unit </td><td><input type=text name=unit value="<?php echo htvar($unit) ?>" size=40 maxlength=60></td>
</tr> </tr>
<tr> <tr>
<td>Locality (City/County)</td><td><input type=text name=locality value="<?= htvar($locality) ?>" size=30 maxlength=30></td> <td>Locality (City/County)</td><td><input type=text name=locality value="<?php echo htvar($locality) ?>" size=30 maxlength=30></td>
</tr> </tr>
<tr> <tr>
<td>State/Province</td><td><input type=text name=province value="<?= htvar($province) ?>" size=30 maxlength=30></td> <td>State/Province</td><td><input type=text name=province value="<?php echo htvar($province) ?>" size=30 maxlength=30></td>
</tr> </tr>
<tr> <tr>
<td>Country</td> <td>Country</td>
<td><input type=text name=country value="<?= htvar($country) ?>" size=2 maxlength=2></td> <td><input type=text name=country value="<?php echo htvar($country) ?>" size=2 maxlength=2></td>
</tr> </tr>
<tr> <tr>
<td>Certificate Password </td> <td>Certificate Password </td>
<td><input type=password name=passwd value="<?= htvar($passwd) ?>" size=30>&nbsp;&nbsp; Again <input type=password name=passwdv value="<?= htvar($passwdv) ?>" size=30></td> <td><input type=password name=passwd value="<?php echo htvar($passwd) ?>" size=30>&nbsp;&nbsp; Again <input type=password name=passwdv value="<?php echo htvar($passwdv) ?>" size=30></td>
</tr> </tr>
<tr> <tr>
<td>Certificate Life </td> <td>Certificate Life </td>
<td><select name=expiry> <td><select name=expiry>
<? <?php
print "<option value=0.083 " . ($expiry == 1 ? "selected='selected'" : "") . " >1 Month</option>\n" ; print "<option value=0.083 " . ($expiry == 1 ? "selected='selected'" : "") . " >1 Month</option>\n" ;
print "<option value=0.25 " . ($expiry == 1 ? "selected='selected'" : "") . " >3 Months</option>\n" ; print "<option value=0.25 " . ($expiry == 1 ? "selected='selected'" : "") . " >3 Months</option>\n" ;
@@ -293,8 +293,8 @@ default:
<tr> <tr>
<td>Key Size </td> <td>Key Size </td>
<td><select name=keysize> <td><select name=keysize>
<? <?php
for ( $i = 512 ; $i < 4096 ; $i+= 512 ) { for ( $i = 512 ; $i <= 4096 ; $i+= 512 ) {
print "<option value=$i " . ($keysize == $i ? "selected='selected'" : "") . " >$i bits</option>\n" ; print "<option value=$i " . ($keysize == $i ? "selected='selected'" : "") . " >$i bits</option>\n" ;
} }
@@ -305,7 +305,7 @@ default:
<tr> <tr>
<td>Certificate Use: </td> <td>Certificate Use: </td>
<td><select name=cert_type> <td><select name=cert_type>
<? <?php
print '<option value="email" '.($cert_type=='email'?'selected':'').'>E-mail, SSL Client</option>'; print '<option value="email" '.($cert_type=='email'?'selected':'').'>E-mail, SSL Client</option>';
print '<option value="email_signing" '.($cert_type=='email_signing'?'selected':'').'>E-mail, SSL Client, Code Signing</option>'; print '<option value="email_signing" '.($cert_type=='email_signing'?'selected':'').'>E-mail, SSL Client, Code Signing</option>';
print '<option value="server" '.($cert_type=='server'?'selected':'').'>SSL Server</option>'; print '<option value="server" '.($cert_type=='server'?'selected':'').'>SSL Server</option>';
@@ -322,7 +322,7 @@ default:
</tr> </tr>
</table> </table>
</form> </form>
<? <?php
printFooter(); printFooter();
} }

View File

@@ -34,29 +34,29 @@ function printHeader($withmenu="default") {
header("Pragma: no-cache"); header("Pragma: no-cache");
?> ?>
<html> <!DOCTYPE html>
<head> <head>
<title>PHPki: <?=$title?> </title> <title>PHPki: <?php echo $title?> </title>
<link rel="stylesheet" type="text/css" href="<?=$style_css?>"> <link rel="stylesheet" type="text/css" href="<?php echo $style_css?>">
</head> </head>
<body> <body>
<? <?php
if (isKonq()) { if (isKonq()) {
$logoclass = 'logo-konq'; $logoclass = '"logo-konq"';
$titleclass = 'title-konq'; $titleclass = '"title-konq"';
$menuclass = 'headermenu-konq'; $menuclass = '"headermenu-konq"';
} }
else { else {
$logoclass = 'logo-ie'; $logoclass = '"logo-ie"';
$titleclass = 'title-ie'; $titleclass = '"title-ie"';
$menuclass = 'headermenu-ie'; $menuclass = '"headermenu-ie"';
} }
?> ?>
<div class=<?=$logoclass?>>PHPki</div> <div class=<?php echo $logoclass?>>PHPki</div>
<div class=<?=$titleclass?>><?=$title?></div> <div class=<?php echo $titleclass?>><?php echo $title?></div>
<? <?php
switch ($withmenu) { switch ($withmenu) {
case false: case false:
@@ -64,67 +64,67 @@ function printHeader($withmenu="default") {
break; break;
case 'setup': case 'setup':
?> ?>
<div class=<?=$menuclass?>> <div class=<?php echo $menuclass?>>
<a class=<?=$menuclass?> href=readme.php>ReadMe</a> <a class=<?php echo $menuclass?> href="readme.php">ReadMe</a>
<a class=<?=$menuclass?> href=setup.php>Setup</a> <a class=<?php echo $menuclass?> href="setup.php">Setup</a>
<a class=<?=$menuclass?> href=about.php target=_about>About</a> <a class=<?php echo $menuclass?> href="about.php" target="_about">About</a>
</div> </div>
<? <?php
break; break;
case 'public': case 'public':
print "<div class=$menuclass>"; print "<div class=$menuclass>";
if (DEMO) { if (DEMO) {
print "<a class=$menuclass href=index.php>Public</a>"; print "<a class=$menuclass href=\"index.php\">Public</a>";
print "<a class=$menuclass href=ca/ >Manage</a>"; print "<a class=$menuclass href=\"ca/\">Manage</a>";
} }
else { else {
print "<a class=$menuclass href=index.php>Menu</a>"; print "<a class=$menuclass href=\"index.php\">Menu</a>";
} }
if (file_exists('policy.html')) { if (file_exists('policy.html')) {
print '<a class='.$menuclass.' style="color: red" href=policy.html target=help>Policy</a>'; print '<a class='.$menuclass.' style="color: red;" href="policy.html" target="help">Policy</a>';
} }
?> ?>
<a class=<?=$menuclass?> href=help.php target=_help>Help</a> <a class=<?php echo $menuclass?> href="help.php" target="_help">Help</a>
<a class=<?=$menuclass?> href=about.php target=_about>About</a> <a class=<?php echo $menuclass?> href="about.php" target="_about">About</a>
</div> </div>
<? <?php
break; break;
case 'ca': case 'ca':
default: default:
print "<div class=$menuclass>"; print "<div class=$menuclass>";
if (DEMO) { if (DEMO) {
print "<a class=$menuclass href=../index.php>Public</a>"; print "<a class=$menuclass href=\"../index.php\">Public</a>";
print "<a class=$menuclass href=../ca/index.php>Manage</a>"; print "<a class=$menuclass href=\"../ca/index.php\">Manage</a>";
} }
else { else {
print "<a class=$menuclass href=index.php>Menu</a>"; print "<a class=$menuclass href=\"index.php\">Menu</a>";
} }
if (file_exists('../policy.html')) { if (file_exists('../policy.html')) {
print '<a class='.$menuclass.' style="color: red" href=../policy.html target=help>Policy</a>'; print '<a class='.$menuclass.' style="color: red;" href=\"../policy.html\" target=\"help\">Policy</a>';
} }
?> ?>
<a class=<?=$menuclass?> href=../help.php target=_help>Help</a> <a class=<?php echo $menuclass?> href="../help.php" target="_help">Help</a>
<a class=<?=$menuclass?> href=../about.php target=_about>About</a> <a class=<?php echo $menuclass?> href="../about.php" target="_about">About</a>
</div> </div>
<? <?php
} }
?><hr width=99% align=left color=#99caff><? ?><hr style="width:99%; align:left; color:#99caff;" /><?php
} }
function printFooter() { function printFooter() {
?> ?>
<br> <br />
<hr width=99% align=left color=#99caff> <hr style="width:99%; align:left; color:#99caff;" />
<center style='margin-top: -5px; font-size: 8pt'>PHPki v<?=PHPKI_VERSION?> - Copyright 2003 - William E. Roadcap</center><br> <p style="margin-top: -5px; font-size: 8pt; text-align:center;">PHPki v<?php echo PHPKI_VERSION?> - Copyright 2003 - William E. Roadcap</p>
</body> </body>
</html> </html>
<? <?php
} }
?> ?>

View File

@@ -20,12 +20,12 @@ case 'display_root':
?> ?>
<center><h2>Root Certificate (PEM Encoded)</h2></center> <center><h2>Root Certificate (PEM Encoded)</h2></center>
<p> <p>
<pre><?= CA_get_root_pem() ?></pre> <pre><?php echo CA_get_root_pem() ?></pre>
<p> <p>
<form action=<?=$PHP_SELF?> method=post> <form action=<?php echo $PHP_SELF?> method=post>
<input type=submit name=submit value="Back to Menu"> <input type=submit name=submit value="Back to Menu">
</form> </form>
<? <?php
break; break;
case 'dl_crl': case 'dl_crl':
@@ -46,26 +46,26 @@ default:
<td>Find a digital certificate to download and install in your e-mail or browser application.</td></tr> <td>Find a digital certificate to download and install in your e-mail or browser application.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=dl_root>Download Our Root Certificate</a></td> <a href=<?php echo $PHP_SELF?>?stage=dl_root>Download Our Root Certificate</a></td>
<td>You must install our "Root" certificate before you can use any of the <td>You must install our "Root" certificate before you can use any of the
certificates issued here. <a href=help.php target=_help>Read the online help</a> certificates issued here. <a href=help.php target=_help>Read the online help</a>
to learn more about this.</td></tr> to learn more about this.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=display_root>Display Our Root Certificate (PEM Encoded)</a></td> <a href=<?php echo $PHP_SELF?>?stage=display_root>Display Our Root Certificate (PEM Encoded)</a></td>
<td>This option provides the "Root" certificate PEM encoded text for advanced users <td>This option provides the "Root" certificate PEM encoded text for advanced users
to manually install via copy and paste. <a href=help.php target=_help>Read the online help</a> to manually install via copy and paste. <a href=help.php target=_help>Read the online help</a>
to learn more about this.</td></tr> to learn more about this.</td></tr>
<tr><td style="text-align: center; vertical-align: middle; font-weight: bold;"> <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
<a href=<?=$PHP_SELF?>?stage=dl_crl>Download Our Certificate Revocation List</a></td> <a href=<?php echo $PHP_SELF?>?stage=dl_crl>Download Our Certificate Revocation List</a></td>
<td>The official list of certificates revoked by this site. Installation and use of <td>The official list of certificates revoked by this site. Installation and use of
this list is optional. Some e-mail programs will reference this list automagically. </td></tr> this list is optional. Some e-mail programs will reference this list automagically. </td></tr>
</table> </table>
</center> </center>
<br><br> <br><br>
<? <?php
printFooter(); printFooter();
} }

View File

@@ -49,15 +49,15 @@ case search:
?> ?>
<center> <center>
<h2>Nothing Found</h2> <h2>Nothing Found</h2>
<form action=<?=$PHP_SELF?> method=post name=form> <form action=<?php echo $PHP_SELF?> method=post name=form>
<input type=hidden name=search value="<?=htvar($search)?>"> <input type=hidden name=search value="<?php echo htvar($search)?>">
<input type=hidden name=show_valid value="<?=htvar($show_valid)?>"> <input type=hidden name=show_valid value="<?php echo htvar($show_valid)?>">
<input type=hidden name=show_revoked value="<?=htvar($show_revoked)?>"> <input type=hidden name=show_revoked value="<?php echo htvar($show_revoked)?>">
<input type=hidden name=show_expired value="<?=htvar($show_expired)?>"> <input type=hidden name=show_expired value="<?php echo htvar($show_expired)?>">
<input type=submit name=submit value="Go Back"> <input type=submit name=submit value="Go Back">
</form> </form>
</center> </center>
<? <?php
printFooter(); printFooter();
break; break;
} }
@@ -83,21 +83,21 @@ case search:
?> ?>
<tr style="font-size: 11px;"> <tr style="font-size: 11px;">
<td style="color: <?=$stcolor[$rec['status']]?>; font-weight: bold"><?=htvar($rec['status'])?></td> <td style="color: <?php echo $stcolor[$rec['status']]?>; font-weight: bold"><?php echo htvar($rec['status'])?></td>
<td style="white-space: nowrap"><?=htvar($rec['issued'])?></td> <td style="white-space: nowrap"><?php echo htvar($rec['issued'])?></td>
<td style="white-space: nowrap"><?=htvar($rec['expires'])?></td> <td style="white-space: nowrap"><?php echo htvar($rec['expires'])?></td>
<td><?=htvar($rec[common_name])?></td> <td><?php echo htvar($rec[common_name])?></td>
<td style="white-space: nowrap"><a href="mailto:<?=htvar($rec['common_name']).' <'.htvar($rec['email']).'>"'?>><?=htvar($rec['email'])?></a></td> <td style="white-space: nowrap"><a href="mailto:<?php echo htvar($rec['common_name']).' <'.htvar($rec['email']).'>"'?>><?php echo htvar($rec['email'])?></a></td>
<td><?=htvar($rec['organization'])?></td> <td><?php echo htvar($rec['organization'])?></td>
<td><?=htvar($rec['unit'])?></td> <td><?php echo htvar($rec['unit'])?></td>
<td><?=htvar($rec['locality'])?></td> <td><?php echo htvar($rec['locality'])?></td>
<td><?=htvar($rec['province'])?></td> <td><?php echo htvar($rec['province'])?></td>
<td><a href=<?=$PHP_SELF?>?stage=display&serial=<?=htvar($rec['serial'])?> target=_certdisp><img src=images/display.png alt="Display" title="Display the certificate in excruciating detail"></a> <td><a href=<?php echo $PHP_SELF?>?stage=display&serial=<?php echo htvar($rec['serial'])?> target=_certdisp><img src=images/display.png alt="Display" title="Display the certificate in excruciating detail"></a>
<? <?php
if ($rec['status'] != 'Revoked') { if ($rec['status'] != 'Revoked') {
?> ?>
<a href=<?=$PHP_SELF?>?stage=download&serial=<?=htvar($rec['serial'])?>><img src=images/download.png alt="Download" title="Download the certificate so that you may send encrypted e-mail"></a> <a href=<?php echo $PHP_SELF?>?stage=download&serial=<?php echo htvar($rec['serial'])?>><img src=images/download.png alt="Download" title="Download the certificate so that you may send encrypted e-mail"></a>
<? <?php
} }
print '</td></tr>'; print '</td></tr>';
} }
@@ -105,14 +105,14 @@ case search:
?> ?>
</table> </table>
<form action=<?=$PHP_SELF?> method=post name=form> <form action=<?php echo $PHP_SELF?> method=post name=form>
<input type=submit name=submit value="Another Search"> <input type=submit name=submit value="Another Search">
<input type=hidden name=search value="<?=htvar($search)?>"> <input type=hidden name=search value="<?php echo htvar($search)?>">
<input type=hidden name=show_valid value="<?=htvar($show_valid)?>"> <input type=hidden name=show_valid value="<?php echo htvar($show_valid)?>">
<input type=hidden name=show_revoked value="<?=htvar($show_revoked)?>"> <input type=hidden name=show_revoked value="<?php echo htvar($show_revoked)?>">
<input type=hidden name=show_expired value="<?=htvar($show_expired)?>"> <input type=hidden name=show_expired value="<?php echo htvar($show_expired)?>">
</form> </form>
<? <?php
printFooter(); printFooter();
break; break;
@@ -123,17 +123,17 @@ default:
?> ?>
<body onLoad="self.focus();document.search.search.focus()"> <body onLoad="self.focus();document.search.search.focus()">
<center><h2>Certificate Search</h2> <center><h2>Certificate Search</h2>
<form action=<?=$PHP_SELF?> method=post name=search> <form action=<?php echo $PHP_SELF?> method=post name=search>
<input type=text name=search value="<?=htvar($search)?>" maxlength=60 size=40> <input type=text name=search value="<?php echo htvar($search)?>" maxlength=60 size=40>
<input type=submit name=submit value="Find It!"><br> <input type=submit name=submit value="Find It!"><br>
<input type=checkbox name=show_valid value="V" <?=($show_valid?'checked':'')?>>Valid <input type=checkbox name=show_valid value="V" <?php echo ($show_valid?'checked':'')?>>Valid
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=show_revoked value="R" <?=($show_revoked?'checked':'')?>>Revoked &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=show_revoked value="R" <?php echo ($show_revoked?'checked':'')?>>Revoked
&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=show_expired value="E" <?=($show_expired?'checked':'')?>>Expired &nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=show_expired value="E" <?php echo ($show_expired?'checked':'')?>>Expired
<input type=hidden name=stage value=search> <input type=hidden name=stage value=search>
</form></center> </form></center>
<br><br> <br><br>
<? <?php
printFooter(); printFooter();
} }

View File

@@ -140,12 +140,12 @@ case 'validate':
printHeader('setup'); printHeader('setup');
?> ?>
<form action='<?=$PHP_SELF?>' method=post> <form action='<?php echo $PHP_SELF?>' method=post>
<input type=submit name=Submit value='Go Back'> <input type=submit name=Submit value='Go Back'>
<font color=#ff0000><?=$er?></font> <font color=#ff0000><?php echo $er?></font>
<br><input type=submit name=Submit2 value='Go Back'> <br><input type=submit name=Submit2 value='Go Back'>
<? <?php
print $hidden_fields; print $hidden_fields;
print "</form>"; print "</form>";
@@ -630,7 +630,7 @@ EOS;
<input type=submit name=submit value="Proceed To The PHPki Main Menu"> <input type=submit name=submit value="Proceed To The PHPki Main Menu">
</form> </form>
</center> </center>
<? <?php
printFooter(); printFooter();
break; break;
@@ -683,7 +683,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
printHeader('setup'); printHeader('setup');
?> ?>
<form action=<?=$PHP_SELF?> method=post> <form action=<?php echo $PHP_SELF?> method=post>
<center><h2>Certificate Authority Initial Setup</h2></center> <center><h2>Certificate Authority Initial Setup</h2></center>
<table width=99%> <table width=99%>
<tr> <tr>
@@ -692,12 +692,12 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
<tr> <tr>
<td width=35%><strong>Organization</strong> <font color=red>*</font></td> <td width=35%><strong>Organization</strong> <font color=red>*</font></td>
<td><input type=text name=organization value="<?=htvar($organization)?>" maxlength=60 size=50></td> <td><input type=text name=organization value="<?php echo htvar($organization)?>" maxlength=60 size=50></td>
</tr> </tr>
<tr> <tr>
<td><strong>Department/Unit</strong> <font color=red>*</font></td> <td><strong>Department/Unit</strong> <font color=red>*</font></td>
<td><input type=text name=unit value="<?=htvar($unit)?>" maxlength=60 size=30></td> <td><input type=text name=unit value="<?php echo htvar($unit)?>" maxlength=60 size=30></td>
</tr> </tr>
<tr> <tr>
@@ -707,7 +707,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
e-mail clients as the <cite>Issued By:</cite> text. This is usually e-mail clients as the <cite>Issued By:</cite> text. This is usually
the full name of your certificate authority (i.e. ACME Certificate Authority). the full name of your certificate authority (i.e. ACME Certificate Authority).
</td> </td>
<td><input type=text name=common_name value="<?=htvar($common_name)?>" maxlength=60 size=60></td> <td><input type=text name=common_name value="<?php echo htvar($common_name)?>" maxlength=60 size=60></td>
</tr> </tr>
<tr> <tr>
@@ -717,22 +717,22 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
regarding your certificate authority and the certificates you issue. regarding your certificate authority and the certificates you issue.
</td> </td>
<td><input type=text name=contact value="<?=htvar($contact)?>" maxlength=60 size=30></td> <td><input type=text name=contact value="<?php echo htvar($contact)?>" maxlength=60 size=30></td>
</tr> </tr>
<tr> <tr>
<td><strong>Locality</strong> <font color=red>*</font></td> <td><strong>Locality</strong> <font color=red>*</font></td>
<td><input type=text name=locality value="<?=htvar($locality)?>" maxlength=60 size=30></td> <td><input type=text name=locality value="<?php echo htvar($locality)?>" maxlength=60 size=30></td>
</tr> </tr>
<tr> <tr>
<td><strong>State/Province</strong> <font color=red>*</font></td> <td><strong>State/Province</strong> <font color=red>*</font></td>
<td><input type=text name=province value="<?=htvar($province)?>" maxlength=60 size=20></td> <td><input type=text name=province value="<?php echo htvar($province)?>" maxlength=60 size=20></td>
</tr> </tr>
<tr> <tr>
<td><strong>Country</strong> <font color=red>*</font></td> <td><strong>Country</strong> <font color=red>*</font></td>
<td><input type=text name=country value="<?=htvar($country)?>" maxlength=2 size=2></td> <td><input type=text name=country value="<?php echo htvar($country)?>" maxlength=2 size=2></td>
</tr> </tr>
<tr> <tr>
@@ -741,7 +741,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
This password will be used to protect your root certificate private This password will be used to protect your root certificate private
key.<br/>Can't contain single quote ! <strong><font color=red>Do not lose or forget this password.</font></strong> key.<br/>Can't contain single quote ! <strong><font color=red>Do not lose or forget this password.</font></strong>
</td> </td>
<td><input type=password name=passwd value="<?=htvar($passwd)?>" size=30>&nbsp;&nbsp; Again <input type=password name=passwdv value="<?=htvar($passwdv)?>" size=30></td> <td><input type=password name=passwd value="<?php echo htvar($passwd)?>" size=30>&nbsp;&nbsp; Again <input type=password name=passwdv value="<?php echo htvar($passwdv)?>" size=30></td>
</tr> </tr>
<tr> <tr>
@@ -751,7 +751,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
</td> </td>
<td><select name=expiry> <td><select name=expiry>
<? <?php
for ( $i = 5 ; $i < 20 ; $i+=5 ) { for ( $i = 5 ; $i < 20 ; $i+=5 ) {
print "<option value=$i " . ($expiry == $i ? "selected='selected print "<option value=$i " . ($expiry == $i ? "selected='selected
'" : "") . " >$i Years</option>\n" ; '" : "") . " >$i Years</option>\n" ;
@@ -768,7 +768,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
</td> </td>
<td><select name=keysize> <td><select name=keysize>
<? <?php
for ( $i = 512 ; $i <= 4096 ; $i+=512 ) { for ( $i = 512 ; $i <= 4096 ; $i+=512 ) {
print "<option value=$i " . ($keysize == $i ? "selected='selected print "<option value=$i " . ($keysize == $i ? "selected='selected
'" : "") . " >$i bits</option>\n" ; '" : "") . " >$i bits</option>\n" ;
@@ -787,7 +787,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
by your CA, for informational purposes. by your CA, for informational purposes.
</td> </td>
<td> <td>
<input type=text name=base_url value="<?=htvar($base_url)?>" size=50> <input type=text name=base_url value="<?php echo htvar($base_url)?>" size=50>
</td> </td>
</tr> </tr>
@@ -803,11 +803,11 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
<td width=35%> <td width=35%>
<strong>Storage Directory <font color=red>*</font></strong><br> <strong>Storage Directory <font color=red>*</font></strong><br>
Enter the location where PHPki will store its files. This should be a directory where Enter the location where PHPki will store its files. This should be a directory where
the web server has full read/write access (chown <?=$uname?> ; chmod 700), and is preferably the web server has full read/write access (chown <?php echo $uname?> ; chmod 700), and is preferably
outside of DOCUMENT_ROOT (<?=$_SERVER['DOCUMENT_ROOT']?>). You may have to manually create the directory before completing this form. outside of DOCUMENT_ROOT (<?php echo $_SERVER['DOCUMENT_ROOT']?>). You may have to manually create the directory before completing this form.
</td> </td>
<td> <td>
<input type=text name=store_dir value="<?=htvar($store_dir)?>" size=35> <input type=text name=store_dir value="<?php echo htvar($store_dir)?>" size=35>
</td> </td>
</tr> </tr>
@@ -817,7 +817,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
Enter the location of your OpenSSL binary. The default is usually ok. Enter the location of your OpenSSL binary. The default is usually ok.
</td> </td>
<td> <td>
<input type=text name=openssl_bin value="<?=htvar($openssl_bin)?>" size=35> <input type=text name=openssl_bin value="<?php echo htvar($openssl_bin)?>" size=35>
</td> </td>
</tr> </tr>
@@ -827,7 +827,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
Enter the location of your PHPki user password file. The default is usually ok. Enter the location of your PHPki user password file. The default is usually ok.
</td> </td>
<td> <td>
<input type=text name=passwd_file value="<?=htvar($passwd_file)?>" size=35> <input type=text name=passwd_file value="<?php echo htvar($passwd_file)?>" size=35>
</td> </td>
</tr> </tr>
@@ -841,7 +841,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
<cite>"acme_caroot.crt"</cite>. <cite>"acme_caroot.crt"</cite>.
</td> </td>
<td> <td>
<input type=text name=ca_prefix value="<?=htvar($ca_prefix)?>" maxlength=10 size=10> <input type=text name=ca_prefix value="<?php echo htvar($ca_prefix)?>" maxlength=10 size=10>
</td> </td>
</tr> </tr>
@@ -852,7 +852,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
top of every page. top of every page.
</td> </td>
<td> <td>
<input type=text name=header_title value="<?=htvar($header_title)?>" maxlength=40 size=40> <input type=text name=header_title value="<?php echo htvar($header_title)?>" maxlength=40 size=40>
</td> </td>
</tr> </tr>
@@ -865,7 +865,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
tags to improve presentation. tags to improve presentation.
</td> </td>
<td> <td>
<textarea name=getting_help cols=50 rows=15><?=htvar($getting_help)?></textarea> <textarea name=getting_help cols=50 rows=15><?php echo htvar($getting_help)?></textarea>
</td> </td>
</tr> </tr>
</table> </table>
@@ -876,7 +876,7 @@ E-mail: <a href=mailto:someone@somewhere.com>someone@somewhere.com</a>&nbsp;&nbs
<input type=hidden name=stage value='validate'> <input type=hidden name=stage value='validate'>
</form> </form>
<? <?php
printFooter(); printFooter();
break; break;
} }