1. Toby Inkster
  2. p5-cgi-auth-foaf-ssl

Commits

Toby Inkster  committed caa65c2

Style changes, mostly indentation.

  • Participants
  • Parent commits 0bf287e
  • Branches CGI-Auth-FOAF_SSL

Comments (0)

Files changed (1)

File lib/CGI/Auth/FOAF_SSL.pm

View file
 	return unless $self->validation(VALIDATION_PEM);
 	
 	my $now = DateTime->now;
-	if (defined $self->cert_not_before && $now < $self->cert_not_before) {
-        warn "Certificate isn't valid yet! Try again on " . $self->cert_not_before->iso8601;
-        return
-    }
-	if (defined $self->cert_not_after  && $now > $self->cert_not_after) {
-        warn "Certificate has expired on " . $self->cert_not_after->iso8601;
-        return;
-    }
-
+	if (defined $self->cert_not_before && $now < $self->cert_not_before)
+	{
+		warn "Certificate isn't valid yet! Try again on " . $self->cert_not_before->iso8601;
+		return;
+	}
+	if (defined $self->cert_not_after  && $now > $self->cert_not_after)
+	{
+		warn "Certificate has expired on " . $self->cert_not_after->iso8601;
+		return;
+	}
+	
 	$self->validation(VALIDATION_DATES);
 	
 	my $verified;
 		<%s> cert:key ?key .
 		?key
 			cert:modulus ?modulus ;
-            cert:exponent ?exponent .
+			cert:exponent ?exponent .
 	}
 	OPTIONAL { ?modulus cert:hex ?hexModulus . }
 	OPTIONAL { ?exponent cert:decimal ?decExponent . }
 
 	RESULT: while (my $result = $results->next)
 	{
-        # trim any whitespace around modulus (HACK for MyProfile WebIDs)
-        $result->{modulus}->[0] =~ s/^\s*//;
-        $result->{modulus}->[0] =~ s/\s*$//;
-
+		# trim any whitespace around modulus (HACK for MyProfile WebIDs)
+		$result->{modulus}->[0] =~ s/(^\s+)|(\s+$)//g;
+		
 		my $correct_modulus  = $self->make_bigint_from_node(
 			$result->{modulus},
 			fallback      => $result->{hexModulus},
 			);
 		next RESULT
 			unless $correct_exponent == $self->cert_exponent;
-
+		
 		$self->validation(VALIDATION_WEBID);
 		$self->subject_uri($uri);
 		
 	
 	if ($node->is_literal)
 	{
-        # HACK to make MyProfile WebIDs parseable (missing the xsd namespace)
-        $node->[2] =~ s@^xsd:@http://www.w3.org/2001/XMLSchema#@;
-
+		# HACK to make MyProfile WebIDs parseable (missing the xsd namespace)
+		$node->[2] =~ s@^xsd:@http://www.w3.org/2001/XMLSchema#@;
+		
 		if ( $node->literal_datatype eq 'http://www.w3.org/ns/auth/cert#hex'
 		or   $node->literal_datatype eq 'http://www.w3.org/2001/XMLSchema#hexBinary' )
 		{