fixed parsing of password expire field (github issue 5+6)

This commit is contained in:
git@daemon.de
2013-07-05 09:39:50 +02:00
parent 0820428be8
commit 90260e757d
7 changed files with 26 additions and 12 deletions

View File

@@ -1,3 +1,17 @@
1.11
fixed:
https://github.com/TLINDEN/Crypt--PWSafe3/issues/6
https://github.com/TLINDEN/Crypt--PWSafe3/issues/5
This was NOT caused by polish characters, but by the
password expire field being set (I didn't use it so far
and my test database doesn't contain records with this
field set). The 'W<*' pack identifier had been used
for this field and W doesn't support < indeed. I changed
it to use 'S<' now, which is a 2 byte little endian
value according to the db-spec. I also edited the
test database so that it contains the field now, so that
a make test catches it.
1.10
I forgot to fix the pack() format as well.

View File

@@ -22,7 +22,7 @@ use Data::Dumper;
use Exporter ();
use vars qw(@ISA @EXPORT);
$Crypt::PWSafe3::VERSION = '1.10';
$Crypt::PWSafe3::VERSION = '1.11';
use Crypt::PWSafe3::Field;
use Crypt::PWSafe3::HeaderField;
@@ -942,7 +942,7 @@ in this module are his ideas ported to perl.
=head1 COPYRIGHT
Copyright (c) 2011-2012 by T.Linden <tlinden@cpan.org>.
Copyright (c) 2011-2013 by T.Linden <tlinden@cpan.org>.
All rights reserved.
=head1 LICENSE
@@ -952,7 +952,7 @@ and/or modify it under the same terms as Perl itself.
=head1 VERSION
Crypt::PWSafe3 Version 1.10.
Crypt::PWSafe3 Version 1.11.
=cut

View File

@@ -7,7 +7,7 @@ use Exporter ();
use vars qw(@ISA @EXPORT);
use utf8;
$Crypt::PWSafe3::Field::VERSION = '1.03';
$Crypt::PWSafe3::Field::VERSION = '1.04';
%Crypt::PWSafe3::Field::map2type = (
uuid => 0x01,
@@ -76,11 +76,11 @@ sub new {
$self->{value} = unpack('H*', $param{raw});
}
elsif (grep { $_ eq $param{type} } @convbyte) {
$self->{value} = unpack('W<*', $param{raw});
$self->{value} = unpack('S<', $param{raw});
}
else {
$self->{value} = $param{raw};
utf8::decode($self->{value});
utf8::decode($self->{value});
}
$self->{len} = length($param{raw});
}
@@ -93,11 +93,11 @@ sub new {
$self->{raw} = pack('H*', $param{value});
}
elsif (grep { $_ eq $param{type} } @convbyte) {
$self->{raw} = pack('W<*', $param{value});
$self->{raw} = pack('S<', $param{value});
}
else {
$self->{raw} = $param{value};
utf8::encode($param{raw});
utf8::encode($param{raw});
}
}
else {
@@ -170,7 +170,7 @@ T. Linden <tlinden@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2011 by T.Linden <tlinden@cpan.org>.
Copyright (c) 2011-2013 by T.Linden <tlinden@cpan.org>.
All rights reserved.
=head1 LICENSE

View File

@@ -195,7 +195,7 @@ T. Linden <tlinden@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2011 by T.Linden <tlinden@cpan.org>.
Copyright (c) 2011-2013 by T.Linden <tlinden@cpan.org>.
All rights reserved.
=head1 LICENSE

View File

@@ -300,7 +300,7 @@ T. Linden <tlinden@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2011-2012 by T.Linden <tlinden@cpan.org>.
Copyright (c) 2011-2013 by T.Linden <tlinden@cpan.org>.
All rights reserved.
=head1 LICENSE

View File

@@ -44,7 +44,7 @@ L<Digest::HMAC>
=head1 COPYRIGHT
Copyright (c) 2011 by T.Linden <tlinden@cpan.org>.
Copyright (c) 2011-2013 by T.Linden <tlinden@cpan.org>.
All rights reserved.
=head1 LICENSE

Binary file not shown.