version 1.18, 2008/09/18 02:53:27 |
version 1.19, 2008/09/18 03:02:50 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: keyring.t,v 1.17 2007/09/13 15:41:36 andrew Exp $ |
# $RedRiver: keyring.t,v 1.18 2008/09/18 01:53:27 andrew Exp $ |
use strict; |
use strict; |
use warnings; |
use warnings; |
|
|
|
|
}, |
}, |
); |
); |
|
|
my $acct = { |
my $acct = { |
0 => { |
0 => { |
label => 'name', |
label => 'name', |
label_id => 0, |
label_id => 0, |
data => 'test3', |
data => 'test3', |
font => 0, |
font => 0, |
|
}, |
|
1 => { |
|
label => 'account', |
|
label_id => 1, |
|
data => 'atestaccount', |
|
font => 0, |
|
}, |
|
2 => { |
|
label => 'password', |
|
label_id => 2, |
|
data => $password, |
|
font => 0, |
|
}, |
|
3 => { |
|
label => 'lastchange', |
|
label_id => 3, |
|
data => { |
|
day => 2, |
|
month => 2, |
|
year => 99, |
}, |
}, |
1 => { |
font => 0, |
label => 'account', |
}, |
label_id => 1, |
255 => { |
data => 'atestaccount', |
label => 'notes', |
font => 0, |
label_id => 255, |
}, |
data => 'now that really roxorZ!', |
2 => { |
font => 0, |
label => 'password', |
}, |
label_id => 2, |
}; |
data => $password, |
|
font => 0, |
|
}, |
|
3 => { |
|
label => 'lastchange', |
|
label_id => 3, |
|
data => { |
|
day => 2, |
|
month => 2, |
|
year => 99, |
|
}, |
|
font => 0, |
|
}, |
|
255 => { |
|
label => 'notes', |
|
label_id => 255, |
|
data => 'now that really roxorZ!', |
|
font => 0, |
|
}, |
|
}; |
|
|
|
foreach my $options (@o) { |
foreach my $options (@o) { |
my $pdb; |
my $pdb; |
|
|
|
|
$pdb = undef; |
$pdb = undef; |
|
|
ok( $pdb = new Palm::PDB(), 'new Palm::Keyring' ); |
ok( $pdb = new Palm::Keyring(), 'new Palm::Keyring' ); |
|
|
ok( $pdb->Load($file), 'Load File' ); |
ok( $pdb->Load($file), 'Load File' ); |
|
|
|
|
|
|
is_deeply( $old_date, $new_date, 'Date didn\'t change' ); |
is_deeply( $old_date, $new_date, 'Date didn\'t change' ); |
|
|
$acct->{2}->{data} = $new_password; |
$decrypted->{2}->{data} = $new_password; |
|
|
$pdb->{records}->[$rec_num]->{plaintext} = $acct; |
$pdb->{records}->[$rec_num]->{plaintext} = $decrypted; |
|
|
ok( $pdb->Encrypt( $pdb->{'records'}->[$rec_num] ), 'Change record' ); |
ok( $pdb->Encrypt( $pdb->{'records'}->[$rec_num] ), 'Change record' ); |
|
|