/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/TrustAnchor.pm
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/TrustAnchor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2305 by davidg, Sun Jun 12 20:59:58 2011 UTC revision 2420 by davidg, Fri Sep 9 11:18:11 2011 UTC
# Line 265  sub printAnchorName($) { Line 265  sub printAnchorName($) {
265    print "" . ($self->{"anchorname"} || "undefined") ."\n";    print "" . ($self->{"anchorname"} || "undefined") ."\n";
266  }  }
267    
268    sub displayAnchorName($) {
269      my $self = shift;
270      return ($self->{"anchorname"} || "undefined");
271    }
272    
273  sub loadCAfiles($) {  sub loadCAfiles($) {
274    my $self         = shift;    my $self         = shift;
275    my $idx = 0;    my $idx = 0;
# Line 276  sub loadCAfiles($) { Line 281  sub loadCAfiles($) {
281      $::log->err("CA directory",$cadir,"does not exist") and      $::log->err("CA directory",$cadir,"does not exist") and
282      return 0;      return 0;
283    
284      # add @HASH@ support, inducing a file read and fork, only if really needed
285      my $crlhash;
286      if ( $self->{"catemplate"} =~ /\@HASH\@/ ) {
287        $self->{"crl"}[0]{"data"} ne "" or
288          $::log->err("CA name template contains HASH, but no CRL ".
289                      "could be loaded in time for ".$self->displayAnchorName) and
290          return 0;
291        my $probecrl = CRL->new(undef,$self->{"crl"}[0]{"data"});
292        $crlhash = $probecrl->getAttribute("hash");
293        $::log->verb(3,"Inferred CA template HASH ".($crlhash?$crlhash:"failed").
294                       " for ".$self->displayAnchorName);
295      }
296    
297    @{$self->{"cafile"}} = ();    @{$self->{"cafile"}} = ();
298    do {    do {
299      my $cafile;      my $cafile;
300    
301      foreach my $catpl ( split /\001/, $self->{"catemplate"} ) {      foreach my $catpl ( split /\001/, $self->{"catemplate"} ) {
302        $catpl =~ s/\@R\@/$idx/g;        $catpl =~ s/\@R\@/$idx/g;
303          $catpl =~ s/\@HASH\@/$crlhash/g;
304        -e $cadir.'/'.$catpl and        -e $cadir.'/'.$catpl and
305          $cafile = $cadir.'/'.$catpl and last;          $cafile = $cadir.'/'.$catpl and last;
306      }      }

Legend:
Removed from v.2305  
changed lines
  Added in v.2420

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28