use parent qw(HTTP::Server::Simple::CGI);
require Crypt::X509;
+ use Regexp::Common qw /net/;
use Convert::ASN1;
use MIME::Base64;
use IO::Socket;
sub getuid {
my $data = shift;
- if ($data->{context} =~ /(https|ssh)/) {
+ if ($data->{context} =~ /^(https|ssh)$/) {
$data->{context} = $1;
- } else {
- return [];
- }
- if ($data->{peer} =~ /(^[^\s]*$)/) {
- $data->{peer} = $1;
- } else {
- return [];
+ if ($data->{peer} =~ /^($RE{net}{domain})$/) {
+ $data->{peer} = $1;
+ return $data->{context}.'://'.$data->{peer};
+ }
}
- return $data->{context}.'://'.$data->{peer};
}
sub reviewcert {