52 |
+ # and we redirect old config to our new safer script |
+ # and we redirect old config to our new safer script |
53 |
+ RewriteEngine On |
+ RewriteEngine On |
54 |
+ RewriteCond %{QUERY_STRING} stage=dl_crl |
+ RewriteCond %{QUERY_STRING} stage=dl_crl |
55 |
+ RewriteRule ^ /phpki/dl_crl.php? [R=302,L] |
+ RewriteRule ^ /phpki/dl_crl.php [QSD,R=302,L] |
56 |
|
|
57 |
HERE |
HERE |
58 |
+ # safely redirect crl request to php script striping all GET requests |
+ # safely redirect crl request to php script striping all GET requests |
189 |
+ || warn "Cannot open input file /opt/phpki/html/config.php: $!\n"; |
+ || warn "Cannot open input file /opt/phpki/html/config.php: $!\n"; |
190 |
+ while (<RD>) |
+ while (<RD>) |
191 |
+ { |
+ { |
192 |
+ chop; |
+ chomp; |
193 |
+ next if grep { /^$/ } $_ ; |
+ next if grep { /^$/ } $_ ; |
194 |
+ next if grep { /^\?>/ } $_; |
+ next if grep { /^\?/ } $_; |
195 |
+ push @lines, $_; |
+ push @lines, $_; |
196 |
+ $lines{$_} = 1; |
+ $lines{$_} = 1; |
197 |
+ } |
+ } |
198 |
+ close(RD); |
+ close(RD); |
199 |
+ ""; |
+ ""; |
200 |
+} |
+} |
201 |
|
diff -Nur --no-dereference smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28phpkiProxyPass smeserver-phpki-ng-0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28phpkiProxyPass |
202 |
|
--- smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28phpkiProxyPass 2022-12-17 01:56:20.627000000 -0500 |
203 |
|
+++ smeserver-phpki-ng-0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28phpkiProxyPass 2022-12-17 02:07:46.903000000 -0500 |
204 |
|
@@ -48,10 +48,15 @@ |
205 |
|
<Location /phpki/dl_crl.php> |
206 |
|
Require all granted |
207 |
|
</Location> |
208 |
|
+ <Location /phpki/dl_crl_pem.php> |
209 |
|
+ Require all granted |
210 |
|
+ </Location> |
211 |
|
# and we redirect old config to our new safer script |
212 |
|
RewriteEngine On |
213 |
|
- RewriteCond %{QUERY_STRING} stage=dl_crl |
214 |
|
+ RewriteCond %{QUERY_STRING} stage=dl_crl(&|\$) |
215 |
|
RewriteRule ^ /phpki/dl_crl.php [QSD,R=302,L] |
216 |
|
+ RewriteCond %{QUERY_STRING} stage=dl_crl_pem(&|\$) |
217 |
|
+ RewriteRule ^ /phpki/dl_crl_pem.php [QSD,R=302,L] |
218 |
|
|
219 |
|
HERE |
220 |
|
# safely redirect crl request to php script striping all GET requests |
221 |
|
diff -Nur --no-dereference smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates/opt/phpki/html/config.php/99writefile smeserver-phpki-ng-0.3/root/etc/e-smith/templates/opt/phpki/html/config.php/99writefile |
222 |
|
--- smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates/opt/phpki/html/config.php/99writefile 2022-12-17 01:56:20.628000000 -0500 |
223 |
|
+++ smeserver-phpki-ng-0.3/root/etc/e-smith/templates/opt/phpki/html/config.php/99writefile 2022-12-17 02:09:54.412000000 -0500 |
224 |
|
@@ -2,6 +2,10 @@ |
225 |
|
$OUT .= ""; |
226 |
|
foreach my $line (@lines) |
227 |
|
{ |
228 |
|
+ chomp $line; |
229 |
|
+ next if grep { /^$/ } $line ; |
230 |
|
+ push @lines, $_; |
231 |
|
+ |
232 |
|
$OUT .= "$line\n"; |
233 |
|
} |
234 |
|
$OUT .= "?>"; |
235 |
|
diff -Nur --no-dereference smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates.metadata/opt/phpki/html/config.php smeserver-phpki-ng-0.3/root/etc/e-smith/templates.metadata/opt/phpki/html/config.php |
236 |
|
--- smeserver-phpki-ng-0.3.old/root/etc/e-smith/templates.metadata/opt/phpki/html/config.php 1969-12-31 19:00:00.000000000 -0500 |
237 |
|
+++ smeserver-phpki-ng-0.3/root/etc/e-smith/templates.metadata/opt/phpki/html/config.php 2022-12-17 02:08:38.149000000 -0500 |
238 |
|
@@ -0,0 +1 @@ |
239 |
|
+FILTER=sub { $_[0] =~ /^\s*$/ ? '' : $_[0] } |