]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/security/cert_validators/fake/security_fake_certverify.pl.in
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / security / cert_validators / fake / security_fake_certverify.pl.in
index 1dc205d696ea04b41e6953de2977d65213018ecf..2b665a38ec2db22ba833e2e8d6d71b4253e0a27c 100755 (executable)
@@ -1,8 +1,4 @@
 #!@PERL@
-#
-# A dummy SSL certificate validator helper that
-# echos back all the SSL errors sent by Squid.
-#
 
 use warnings;
 use strict;
@@ -25,6 +21,12 @@ security_fake_certverify - A fake cert validation helper for Squid
 
 security_fake_certverify [-d | --debug] [-h | --help]
 
+=head1 DESCRIPTION
+
+Retrieves the SSL certificate error list from Squid and echo back without any change.
+
+=head1 OPTIONS
+
 =over 8
 
 =item  B<-h | --help>
@@ -37,13 +39,14 @@ enable debug messages to stderr
 
 =back
 
-=head1 DESCRIPTION
+=head1 AUTHOR
 
-Retrieves the SSL certificate error list from squid and echo back without any change.
+This program and documentation was written by
+I<Christos Tsantilas <chtsanti@users.sourceforge.net>>
 
 =head1 COPYRIGHT
 
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -55,6 +58,29 @@ This program is free software. You may redistribute copies of it under the
 terms of the GNU General Public License version 2, or (at your opinion) any
 later version.
 
+=head1 QUESTIONS
+
+Questions on the usage of this program can be sent to the I<Squid Users mailing list <squid-users@lists.squid-cache.org>>
+
+=head1 REPORTING BUGS
+
+Bug reports need to be made in English.
+See http://wiki.squid-cache.org/SquidFaq/BugReporting for details of what you need to include with your bug report.
+
+Report bugs or bug fixes using http://bugs.squid-cache.org/
+
+Report serious security bugs to I<Squid Bugs <squid-bugs@lists.squid-cache.org>>
+
+Report ideas for new improvements to the I<Squid Developers mailing list <squid-dev@lists.squid-cache.org>>
+
+=head1 SEE ALSO
+
+squid (8), GPL (7),
+
+The Squid FAQ wiki http://wiki.squid-cache.org/SquidFaq
+
+The Squid Configuration Manual http://www.squid-cache.org/Doc/config/
+
 =cut
 
 GetOptions(
@@ -90,7 +116,7 @@ while (<>) {
         my @responseErrors = ();
 
         while($readlen < $bodylen) {
-           my $t = <>;
+            my $t = <>;
             if (defined $t) {
                 $body  = $body . $t;
                 $readlen = length($body);
@@ -116,16 +142,16 @@ while (<>) {
             print(STDERR logPrefix()."\tFOUND cert ".$key.": ".$certs{$key}->subject() . "\n") if ($debug);
         }
 
-        #got the peer certificate ID. Assume that the peer certificate is the first one.
+#got the peer certificate ID. Assume that the peer certificate is the first one.
         my $peerCertId = (keys %certs)[0];
 
       # Echo back the errors: fill the responseErrors array  with the errors we read.
+ # Echo back the errors: fill the responseErrors array  with the errors we read.
         foreach my $err (keys %errors) {
             $haserror = 1;
-            appendError (\@responseErrors, 
-                         $errors{$err}{"name"}, #The error name
-                         "Checked by Cert Validator", # An error reason
-                         $errors{$err}{"cert"} # The cert ID. We are always filling with the peer certificate.
+            appendError (\@responseErrors,
+                $errors{$err}{"name"}, #The error name
+                "Checked by Cert Validator", # An error reason
+                $errors{$err}{"cert"} # The cert ID. We are always filling with the peer certificate.
                 );
         }
 
@@ -224,5 +250,5 @@ sub parseRequest
 
 sub logPrefix
 {
-  return strftime("%Y/%m/%d %H:%M:%S.0", localtime)." ".$0." ".$$." | " ;
+    return strftime("%Y/%m/%d %H:%M:%S.0", localtime)." ".$0." ".$$." | " ;
 }