]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
openvpn: Renamed CA chart, added ta.key to chart.
authorErik Kapfer <erik.kapfer@ipfire.org>
Thu, 12 Jun 2014 07:11:52 +0000 (09:11 +0200)
committerErik Kapfer <erik.kapfer@ipfire.org>
Thu, 12 Jun 2014 07:11:52 +0000 (09:11 +0200)
* Added keys to CA chart and renamed CA specifics infos to
CA and key infos.
* Added ta.key to CA/key chart listing.

html/cgi-bin/ovpnmain.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 506dce5d0f6048ba722cd75d04e4314708929e67..ed614d86831d6f8994ce8c3eaf9cae458df81bf0 100644 (file)
@@ -1530,6 +1530,17 @@ END
        exit(0);
     }
 
+###
+### Download tls-auth key
+###
+}elsif ($cgiparams{'ACTION'} eq $Lang::tr{'download tls-auth key'}) {
+    if ( -f "${General::swroot}/ovpn/certs/ta.key" ) {
+       print "Content-Type: application/octet-stream\r\n";
+       print "Content-Disposition: filename=ta.key\r\n\r\n";
+       print `/bin/cat ${General::swroot}/ovpn/certs/ta.key`;
+       exit(0);
+    }
+
 ###
 ### Form for generating a root certificate
 ###
@@ -2369,6 +2380,28 @@ if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') {
                exit(0);
     }
 
+###
+### Display tls-auth key
+###
+} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'show tls-auth key'}) {
+
+    if (! -e "${General::swroot}/ovpn/certs/ta.key") {
+       $errormessage = $Lang::tr{'not present'};
+       } else {
+               &Header::showhttpheaders();
+               &Header::openpage($Lang::tr{'ovpn'}, 1, '');
+               &Header::openbigbox('100%', 'LEFT', '', '');
+               &Header::openbox('100%', 'LEFT', "$Lang::tr{'ta key'}:");
+               my $output = `/bin/cat ${General::swroot}/ovpn/certs/ta.key`;
+               $output = &Header::cleanhtml($output,"y");
+               print "<pre>$output</pre>\n";
+               &Header::closebox();
+               print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>";
+               &Header::closebigbox();
+               &Header::closepage();
+               exit(0);
+    }
+
 ###
 ### Display Certificate Revoke List
 ###
@@ -5214,6 +5247,8 @@ END
     ;
        &Header::closebox();
        }
+
+    # CA/key listing
     &Header::openbox('100%', 'LEFT', "$Lang::tr{'certificate authorities'}");
     print <<END;
     <table width='100%' cellspacing='1' cellpadding='0' class='tbl'>
@@ -5228,6 +5263,8 @@ END
     my $col2="bgcolor='$color{'color20'}'";
     # DH parameter line
     my $col3="bgcolor='$color{'color22'}'";
+    # ta.key line
+    my $col4="bgcolor='$color{'color20'}'";
 
     if (-f "${General::swroot}/ovpn/ca/cacert.pem") {
                my $casubject = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/ca/cacert.pem`;
@@ -5333,6 +5370,40 @@ END
                ;
     }
 
+    # Adding ta.key to chart
+    if (-f "${General::swroot}/ovpn/certs/ta.key") {
+               my $tasubject = `/bin/cat ${General::swroot}/ovpn/certs/ta.key`;
+               $tasubject    =~ /# (.*)[\n]/;
+               $tasubject    = $1;
+               print <<END;
+
+               <tr>
+                       <td class='base' $col4>$Lang::tr{'ta key'}</td>
+                       <td class='base' $col4>$tasubject</td>
+                       <form method='post' name='frmtakey'><td width='3%' align='center' $col4>
+                       <input type='hidden' name='ACTION' value='$Lang::tr{'show tls-auth key'}' />
+                       <input type='image' name='$Lang::tr{'edit'}' src='/images/info.gif' alt='$Lang::tr{'show tls-auth key'}' title='$Lang::tr{'show tls-auth key'}' width='20' height='20' border='0' />
+                       </form>
+                       <form method='post' name='frmtakey'><td width='3%' align='center' $col4>
+                       <input type='image' name='$Lang::tr{'download tls-auth key'}' src='/images/media-floppy.png' alt='$Lang::tr{'download tls-auth key'}' title='$Lang::tr{'download tls-auth key'}' border='0' />
+                       <input type='hidden' name='ACTION' value='$Lang::tr{'download tls-auth key'}' />
+                       </form>
+                       <td width='4%' $col4>&nbsp;</td>
+               </tr>
+END
+               ;
+    } else {
+               # Nothing
+               print <<END;
+               <tr>
+                       <td width='25%' class='base' $col4>$Lang::tr{'ta key'}:</td>
+                       <td class='base' $col4>$Lang::tr{'not present'}</td>
+                       <td colspan='3' $col4>&nbsp;</td>
+               </tr>
+END
+               ;
+    }
+
     if (! -f "${General::swroot}/ovpn/ca/cacert.pem") {
         print "<tr><td colspan='5' align='center'><form method='post'>";
                print "<input type='submit' name='ACTION' value='$Lang::tr{'generate root/host certificates'}' />";
@@ -5391,6 +5462,9 @@ END
        <hr size='1'>
        <form method='post' enctype='multipart/form-data'>
        <table width='100%' border='0'cellspacing='1' cellpadding='0'>
+       <tr>
+               <td class'base'><b>CA-Upload</b></td>
+       </tr>
        <tr>
                <td class='base' nowrap='nowrap'>$Lang::tr{'ca name'}:</td>
                <td nowrap='nowrap'><input type='text' name='CA_NAME' value='$cgiparams{'CA_NAME'}' size='15' align='left'/></td>
index c604ef05a97a5cb5d2b299ff91c9c0717f71e32d..8437def7f9345e777e42a95ddbabd5df8a0136ae 100644 (file)
 'ccd used' => 'Genutzte Adressen',
 'cert' => 'Zertifikat',
 'certificate' => 'Zertifikat',
-'certificate authorities' => 'Zertifizierungsstellen (CAs)',
+'certificate authorities' => 'Zertifizierungsstellen und -keys',
 'certificate does not have a valid ca associated with it' => 'Mit dem Zertifikat ist keine gültige CA verbunden.',
 'certificate file move failed' => 'Verschieben der Zertifikatsdatei fehlgeschlagen',
 'cfg restart' => 'Nach dem Wiederherstellen eines Konfigurationsarchivs wird ein Neustart empfohlen.',
 'downlink std class' => 'Downloadstandardklasse',
 'download' => 'herunterladen',
 'download ca certificate' => 'CA-Zertifikat herunterladen',
-'download certificate' => 'Zertifikate herunterladen',
+'download certificate' => 'File herunterladen',
 'download dh parameter' => 'Diffie-Hellman-Parameter herunterladen',
 'download host certificate' => 'Host-Zertifikat herunterladen',
 'download new ruleset' => 'Neuen Regelsatz herunterladen',
 'download pkcs12 file' => 'PKCS12-Datei herunterladen',
 'download root certificate' => 'Root-Zertifikat herunterladen',
+'download tls-auth key' => 'tls-auth Key herunterladen',
 'dpd action' => 'Aktion für Dead Peer Detection',
 'dpd delay' => 'Verzögerung',
 'dpd timeout' => 'Zeitüberschreitung',
 'shares' => 'Freigaben',
 'show ajax speedmeter in footer' => 'Ajax Speed Anzeige',
 'show ca certificate' => 'CA Zertifikat anzeigen',
-'show certificate' => 'Zertifikat anzeigen',
+'show certificate' => 'File anzeigen',
 'show crl' => 'Certificate Revocation List anzeigen',
 'show dh' => 'Diffie-Hellman-Parameter anzeigen',
 'show host certificate' => 'Host-Zertifikat anzeigen',
 'time server' => 'Zeitserver',
 'timeout must be a number' => 'Wartezeit muss eine Zahl sein.',
 'title' => 'Titel',
+'ta key' => 'Key tls-auth',
 'to' => 'Bis',
 'to email adr' => 'An Email Adresse',
 'to install an update' => 'Um ein Update zu installieren, laden Sie zuerst die folgende .tgz.gpg Datei hoch:',
index f87607fbb99fb64904ea4eeb7f9bd038e347bf95..5efbe1c23ad798b4bb342a74efff9e0bdd4d34b8 100644 (file)
 'ccd used' => 'Used addresses',
 'cert' => 'Certificate',
 'certificate' => 'Certificate',
-'certificate authorities' => 'Certificate Authorities',
+'certificate authorities' => 'Certificate Authorities and -keys',
 'certificate does not have a valid ca associated with it' => 'Certificate does not have a valid CA associated with it.',
 'certificate file move failed' => 'Certificate file move failed',
 'cfg restart' => 'A reboot is suggested after restoring a configuration archive.',
 'downlink std class' => 'downlink standard class',
 'download' => 'download',
 'download ca certificate' => 'Download CA certificate',
-'download certificate' => 'Download certificate',
+'download certificate' => 'Download file',
 'download dh parameter' => 'Download Diffie-Hellman parameters',
 'download host certificate' => 'Download host certificate',
 'download new ruleset' => 'Download new ruleset',
 'download pkcs12 file' => 'Download PKCS12 file',
 'download root certificate' => 'Download root certificate',
+'download tls-auth key' => 'Download tls-auth key',
 'dpd action' => 'Action',
 'dpd delay' => 'Delay',
 'dpd timeout' => 'Timeout',
 'show ajax speedmeter in footer' => 'Show Ajax speedmeter',
 'show areas' => 'show areas',
 'show ca certificate' => 'Show CA certificate',
-'show certificate' => 'Show certificate',
+'show certificate' => 'Show file',
 'show crl' => 'Show certificate revocation list',
 'show dh' => 'Show Diffie-Hellman parameters',
 'show host certificate' => 'Show host certificate',
 'show lines' => 'Show lines',
 'show root certificate' => 'Show root certificate',
 'show share options' => 'Show shares options',
+'show tls-auth key' => 'Show tls-auth key',
 'shuffle' => 'Shuffle',
 'shutdown' => 'Shutdown',
 'shutdown ask' => 'Shutdown?',
 'system log viewer' => 'System Log Viewer',
 'system logs' => 'System Logs',
 'system status information' => 'System Status Information',
+'ta key' => 'Key tls-auth',
 'telephone not set' => 'Telephone not set.',
 'template' => 'Preset',
 'template warning' => 'You have two options to set up Qos. The First, you press the save button and generate the classes and rules on your own. The second, you press the preset button and classes and rules will be set up by a template.',