Skip to content

Commit

Permalink
Use "canonical" names when matching the output of the commands
Browse files Browse the repository at this point in the history
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from openssl#15028)
  • Loading branch information
t8m committed Apr 28, 2021
1 parent 680dbd1 commit 8365652
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/recipes/20-test_dgst.t
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subtest "HMAC generation with `dgst` CLI" => sub {
my @hmacdata = run(app(['openssl', 'dgst', '-sha256', '-hmac', '123456',
$testdata, $testdata]), capture => 1);
chomp(@hmacdata);
my $expected = qr/HMAC-SHA256\(\Q$testdata\E\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3a155c391b97b9a7c/;
my $expected = qr/HMAC-SHA2-256\(\Q$testdata\E\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3a155c391b97b9a7c/;
ok($hmacdata[0] =~ $expected, "HMAC: Check HMAC value is as expected ($hmacdata[0]) vs ($expected)");
ok($hmacdata[1] =~ $expected,
"HMAC: Check second HMAC value is consistent with the first ($hmacdata[1]) vs ($expected)");
Expand All @@ -125,7 +125,7 @@ subtest "Custom length XOF digest generation with `dgst` CLI" => sub {
my @xofdata = run(app(['openssl', 'dgst', '-shake128', '-xoflen', '64',
$testdata, $testdata]), capture => 1);
chomp(@xofdata);
my $expected = qr/SHAKE128\(\Q$testdata\E\)= bb565dac72640109e1c926ef441d3fa64ffd0b3e2bf8cd73d5182dfba19b6a8a2eab96d2df854b647b3795ef090582abe41ba4e0717dc4df40bc4e17d88e4677/;
my $expected = qr/SHAKE-128\(\Q$testdata\E\)= bb565dac72640109e1c926ef441d3fa64ffd0b3e2bf8cd73d5182dfba19b6a8a2eab96d2df854b647b3795ef090582abe41ba4e0717dc4df40bc4e17d88e4677/;
ok($xofdata[0] =~ $expected, "XOF: Check digest value is as expected ($xofdata[0]) vs ($expected)");
ok($xofdata[1] =~ $expected,
"XOF: Check second digest value is consistent with the first ($xofdata[1]) vs ($expected)");
Expand Down
2 changes: 1 addition & 1 deletion test/recipes/25-test_crl.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ok(compare1stline([qw{openssl crl -noout -fingerprint -in},
'SHA1 Fingerprint=BA:F4:1B:AD:7A:9B:2F:09:16:BC:60:A7:0E:CE:79:2E:36:00:E7:B2'));
ok(compare1stline([qw{openssl crl -noout -fingerprint -sha256 -in},
srctop_file('test', 'testcrl.pem')],
'SHA256 Fingerprint=B3:A9:FD:A7:2E:8C:3D:DF:D0:F1:C3:1A:96:60:B5:FD:B0:99:7C:7F:0E:E4:34:F5:DB:87:62:36:BC:F1:BC:1B'));
'SHA2-256 Fingerprint=B3:A9:FD:A7:2E:8C:3D:DF:D0:F1:C3:1A:96:60:B5:FD:B0:99:7C:7F:0E:E4:34:F5:DB:87:62:36:BC:F1:BC:1B'));

ok(run(app(["openssl", "crl", "-text", "-in", $pem, "-out", $out,
"-nameopt", "utf8"])));
Expand Down

0 comments on commit 8365652

Please sign in to comment.