提交 9b56815d 编写于 作者: R Richard Levitte

Do not use redirection on binary files

On some platforms, the shell will determine what attributes a file
will have, so while the program might think it's safely outputting
binary data, it's not always true.

For the sake of the tests, it's therefore safer to use -out than to
use redirection.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 67949615
...@@ -51,10 +51,8 @@ if (!$init) { ...@@ -51,10 +51,8 @@ if (!$init) {
@d = ( "enc", @{$variant{$t}}, "-d" ); @d = ( "enc", @{$variant{$t}}, "-d" );
} }
ok(run(app([$cmd, @e], ok(run(app([$cmd, @e, "-in", $test, "-out", $cipherfile]))
stdin => $test, stdout => $cipherfile)) && run(app([$cmd, @d, "-in", $cipherfile, "-out", $clearfile]))
&& run(app([$cmd, @d],
stdin => $cipherfile, stdout => $clearfile))
&& compare_text($test,$clearfile) == 0, $t); && compare_text($test,$clearfile) == 0, $t);
unlink $cipherfile, $clearfile; unlink $cipherfile, $clearfile;
} }
......
...@@ -53,8 +53,9 @@ sub tconversion { ...@@ -53,8 +53,9 @@ sub tconversion {
ok(run(app([@cmd, ok(run(app([@cmd,
"-in", "$testtype-fff.p", "-in", "$testtype-fff.p",
"-inform", "p", "-inform", "p",
"-outform", $to], "-out", "$testtype-f.$to",
stdout => "$testtype-f.$to")), "p -> $to"); "-outform", $to])),
"p -> $to");
} }
foreach my $to (@conversionforms) { foreach my $to (@conversionforms) {
...@@ -62,8 +63,9 @@ sub tconversion { ...@@ -62,8 +63,9 @@ sub tconversion {
ok(run(app([@cmd, ok(run(app([@cmd,
"-in", "$testtype-f.$from", "-in", "$testtype-f.$from",
"-inform", $from, "-inform", $from,
"-outform", $to], "-out", "$testtype-ff.$from$to",
stdout => "$testtype-ff.$from$to")), "$from -> $to"); "-outform", $to])),
"$from -> $to");
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册