[BACK]Return to Keyring.pm CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring / lib / Palm

Diff for /palm/Palm-Keyring/lib/Palm/Keyring.pm between version 1.19 and 1.21

version 1.19, 2007/01/31 04:17:15 version 1.21, 2007/01/31 05:32:20
Line 1 
Line 1 
 package Palm::Keyring;  package Palm::Keyring;
   
 # $RedRiver: Keyring.pm,v 1.18 2007/01/30 05:18:06 andrew Exp $  # $RedRiver: Keyring.pm,v 1.20 2007/01/31 04:29:08 andrew Exp $
 #  #
 # Perl class for dealing with Keyring for Palm OS databases.  # Perl class for dealing with Keyring for Palm OS databases.
 #  #
Line 126 
Line 126 
     $data->{'password'} ||= $EMPTY;      $data->{'password'} ||= $EMPTY;
     $data->{'notes'}    ||= $EMPTY;      $data->{'notes'}    ||= $EMPTY;
   
     my %Modified;      my ($day, $month, $year);
     my ($day, $month, $year) = (localtime)[3,4,5];  
     $year -= 4;  
     $month++;  
   
       # XXX the 0 here is a placeholder for $record_has_changed.
       if ( 0 || ! $data->{'lastchange'}) {
           ($day, $month, $year) = (localtime)[3,4,5];
           $year -= 4;
           $month++;
       }
   
     my $p = $day | ($month << 5) | ($year << 9);      my $p = $day | ($month << 5) | ($year << 9);
     my $packeddate = pack 'n', $p;      my $packeddate = pack 'n', $p;
   
Line 192 
Line 196 
     }      }
   
     return {      return {
         name     => $rec->{'name'},          name       => $rec->{'name'},
         account  => $account,          account    => $account,
         password => $password,          password   => $password,
         notes    => $notes,          notes      => $notes,
         date     => \%Modified,          lastchange => \%Modified,
     };      };
 }  }
   
Line 453 
Line 457 
 $acct is a hashref in the format below.  $acct is a hashref in the format below.
   
     my $acct = {      my $acct = {
         account  => $account,          name       => $rec->{'name'},
         password => $password,          account    => $account,
         notes    => $notes,          password   => $password,
           notes      => $notes,
           lastchange => {
               year  => 107, # years since 1900
               month =>   0, # 0-11, 0 = January, 11 = December
               day   =>  30, # 1-31, same as localtime
           },
     };      };
   
 =head2 Decrypt  =head2 Decrypt
Line 463 
Line 473 
     my $acct = $pdb->Decrypt($rec[, $password]);      my $acct = $pdb->Decrypt($rec[, $password]);
   
 Decrypts the record and returns a hashref for the account as described  Decrypts the record and returns a hashref for the account as described
 under Encrypt();  under Encrypt().
   However, it ignores the "lastchange" field and generates its own.
   It also only uses the "name" field if there is not already a $rec->{'name'}.
   
     foreach (0..$#{ $pdb->{'records'}) {      foreach (0..$#{ $pdb->{'records'}) {
         next if $_ == 0;          next if $_ == 0;

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.21

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>