summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuenter Knauf <lists@gknw.net>2009-10-03 23:24:26 +0200
committerJim Meyering <meyering@redhat.com>2009-10-07 09:31:27 +0200
commitb95be30e3fc4831391355f89a959d0c503bed5fb (patch)
tree1356f05b3c6cc1de7d19a55902e07f6034917a36 /tests
parentd183a15cbb26691e0a05bab06ab700ec46fcfba4 (diff)
downloadcoreutils-b95be30e3fc4831391355f89a959d0c503bed5fb.tar.xz
md5sum, sha*sum: also accept openssl checksum syntax
* src/md5sum.c (split_3): Accept openssl checksum syntax, which differs only by two spaces from that of the bsd checksum tools: openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e bsd: MD5 (f) = d41d8cd98f00b204e9800998ecf8427e
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/md5sum10
-rwxr-xr-xtests/misc/sha1sum11
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/misc/md5sum b/tests/misc/md5sum
index 2fb024d16..30edd9e7f 100755
--- a/tests/misc/md5sum
+++ b/tests/misc/md5sum
@@ -67,6 +67,16 @@ my @Tests =
['check-bsd3', '--check', '--status',
{IN=> {'f.md5' => "MD5 (f) = $degenerate\n"}},
{AUX=> {f=> 'bar'}}, {EXIT=> 1}],
+ ['check-openssl', '--check', {IN=> {'f.sha1' => "SHA1(f)= $degenerate\n"}},
+ {AUX=> {f=> ''}},
+ {ERR=>"md5sum: f.sha1: no properly formatted "
+ . "MD5 checksum lines found\n"},
+ {EXIT=> 1}],
+ ['check-openssl2', '--check', {IN=> {'f.md5' => "MD5(f)= $degenerate\n"}},
+ {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}],
+ ['check-openssl3', '--check', '--status',
+ {IN=> {'f.md5' => "MD5(f)= $degenerate\n"}},
+ {AUX=> {f=> 'bar'}}, {EXIT=> 1}],
['bsd-segv', '--check', {IN=> {'z' => "MD5 ("}}, {EXIT=> 1},
{ERR=> "$prog: z: no properly formatted MD5 checksum lines found\n"}],
diff --git a/tests/misc/sha1sum b/tests/misc/sha1sum
index 3f09abaae..d084204d0 100755
--- a/tests/misc/sha1sum
+++ b/tests/misc/sha1sum
@@ -60,6 +60,17 @@ my @Tests =
['check-bsd3', '--check', '--status',
{IN=> {'f.sha1' => "SHA1 (f) = $sha_degenerate\n"}},
{AUX=> {f=> 'bar'}}, {EXIT=> 1}],
+ ['check-openssl', '--check', {IN=> {'f.md5' => "MD5(f)= $sha_degenerate\n"}},
+ {AUX=> {f=> ''}},
+ {ERR=>"sha1sum: f.md5: no properly formatted "
+ . "SHA1 checksum lines found\n"},
+ {EXIT=> 1}],
+ ['check-openssl2', '--check',
+ {IN=> {'f.sha1' => "SHA1(f)= $sha_degenerate\n"}},
+ {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}],
+ ['check-openssl3', '--check', '--status',
+ {IN=> {'f.sha1' => "SHA1(f)= $sha_degenerate\n"}},
+ {AUX=> {f=> 'bar'}}, {EXIT=> 1}],
['bsd-segv', '--check', {IN=> {'z' => "SHA1 ("}}, {EXIT=> 1},
{ERR=> "$prog: z: no properly formatted SHA1 checksum lines found\n"}],
);