mirror of
https://github.com/qpdf/qpdf.git
synced 2024-06-06 04:10:52 +00:00
More testing for Unicode passwords
This commit is contained in:
parent
edc3b309bc
commit
0a3057dc0a
|
@ -3378,7 +3378,8 @@ foreach my $d (@unicode_pw_cases)
|
|||
}
|
||||
}
|
||||
|
||||
$n_tests += 2;
|
||||
$n_tests += 5;
|
||||
|
||||
$td->runtest("bytes fallback warning",
|
||||
{$td->COMMAND =>
|
||||
"qpdf --encrypt \@password-bare-complex-utf8 o 128 --" .
|
||||
|
@ -3402,6 +3403,23 @@ $td->runtest("bytes fallback warning",
|
|||
$td->NORMALIZE_NEWLINES);
|
||||
}
|
||||
|
||||
# Exercise passing Unicode passwords via the command line. This tests
|
||||
# wmain for Windows and assumes a UTF-8 locale for other platforms.
|
||||
$td->runtest("Unicode at CLI",
|
||||
{$td->COMMAND =>
|
||||
"qpdf --encrypt π ʬ 256 --" .
|
||||
" minimal.pdf a.pdf"},
|
||||
{$td->STRING => "", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("Decrypt using user password",
|
||||
{$td->COMMAND => "qpdf --show-encryption a.pdf --password=π"},
|
||||
{$td->FILE => "unicode-up.out", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("Decrypt using owner password",
|
||||
{$td->COMMAND => "qpdf --show-encryption a.pdf --password=ʬ"},
|
||||
{$td->FILE => "unicode-op.out", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
|
||||
show_ntests();
|
||||
# ----------
|
||||
$td->notify("--- Check from C API ---");
|
||||
|
|
15
qpdf/qtest/qpdf/unicode-op.out
Normal file
15
qpdf/qtest/qpdf/unicode-op.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
R = 6
|
||||
P = -4
|
||||
User password =
|
||||
extract for accessibility: allowed
|
||||
extract for any purpose: allowed
|
||||
print low resolution: allowed
|
||||
print high resolution: allowed
|
||||
modify document assembly: allowed
|
||||
modify forms: allowed
|
||||
modify annotations: allowed
|
||||
modify other: allowed
|
||||
modify anything: allowed
|
||||
stream encryption method: AESv3
|
||||
string encryption method: AESv3
|
||||
file encryption method: AESv3
|
15
qpdf/qtest/qpdf/unicode-up.out
Normal file
15
qpdf/qtest/qpdf/unicode-up.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
R = 6
|
||||
P = -4
|
||||
User password = π
|
||||
extract for accessibility: allowed
|
||||
extract for any purpose: allowed
|
||||
print low resolution: allowed
|
||||
print high resolution: allowed
|
||||
modify document assembly: allowed
|
||||
modify forms: allowed
|
||||
modify annotations: allowed
|
||||
modify other: allowed
|
||||
modify anything: allowed
|
||||
stream encryption method: AESv3
|
||||
string encryption method: AESv3
|
||||
file encryption method: AESv3
|
Loading…
Reference in New Issue
Block a user