=================================================================== RCS file: /cvs/palm/Palm-Keyring/lib/Palm/Keyring.pm,v retrieving revision 1.59 retrieving revision 1.62 diff -u -r1.59 -r1.62 --- palm/Palm-Keyring/lib/Palm/Keyring.pm 2008/09/19 06:39:07 1.59 +++ palm/Palm-Keyring/lib/Palm/Keyring.pm 2008/09/19 07:01:00 1.62 @@ -1,5 +1,5 @@ package Palm::Keyring; -# $RedRiver: Keyring.pm,v 1.58 2008/09/19 02:50:05 andrew Exp $ +# $RedRiver: Keyring.pm,v 1.61 2008/09/19 05:55:35 andrew Exp $ ######################################################################## # Keyring.pm *** Perl class for Keyring for Palm OS databases. # @@ -480,35 +480,26 @@ $encrypted = _encrypt_v4($datav4, $acctv4, $self->{digest}); } elsif ($self->{version} == 5) { - ($encrypted, $ivec) = _encrypt_v5( + ($encrypted, $rec->{ivec}) = _encrypt_v5( $data, $acct, $self->{appinfo}->{key}, $self->{appinfo}->{cipher}, $ivec, ); - if (defined $ivec) { - $rec->{ivec} = $ivec; - } } else { - croak "Unsupported Version $self->{version}"; + croak "Unsupported version $self->{version}"; } $rec->{plaintext}->{0} = $data->{0}; - if ($encrypted) { - if ($encrypted eq '1') { - return 1; - } - + if ($encrypted ne '1') { $rec->{attributes}{Dirty} = 1; $rec->{attributes}{dirty} = 1; $rec->{encrypted} = $encrypted; - - return 1; - } else { - return; } + + return 1; } sub _encrypt_v4 @@ -623,7 +614,7 @@ } } - return 1, 0 if $changed == 0; + return (1, $ivec) if $changed == 0; if ($need_newdate) { my ($day, $month, $year) = (localtime)[3,4,5];