[openssl] OpenSSL_1_1_1-stable update
bernd.edlinger at hotmail.de
bernd.edlinger at hotmail.de
Tue Nov 23 17:40:11 UTC 2021
The branch OpenSSL_1_1_1-stable has been updated
via 6d022b04748c2a89b7f032a41965df19c584e0cf (commit)
from 79ef18759a4f89af0b1e015766a73fa289095673 (commit)
- Log -----------------------------------------------------------------
commit 6d022b04748c2a89b7f032a41965df19c584e0cf
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date: Fri Nov 19 16:38:55 2021 +0100
Add a test case for duplicate engine loading
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17083)
-----------------------------------------------------------------------
Summary of changes:
test/data.bin | 4 ++++
test/recipes/20-test_dgst.t | 23 +++++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
create mode 100644 test/data.bin
diff --git a/test/data.bin b/test/data.bin
new file mode 100644
index 0000000000..3442255280
--- /dev/null
+++ b/test/data.bin
@@ -0,0 +1,4 @@
+TEST DATA
+
+Please note that if a test involves a new testing executable,
+you will need to do some additions in test/build.info.
diff --git a/test/recipes/20-test_dgst.t b/test/recipes/20-test_dgst.t
index 13c2b3af4b..d1cbabe290 100644
--- a/test/recipes/20-test_dgst.t
+++ b/test/recipes/20-test_dgst.t
@@ -11,12 +11,12 @@ use strict;
use warnings;
use File::Spec;
-use OpenSSL::Test qw/:DEFAULT with srctop_file/;
+use OpenSSL::Test qw/:DEFAULT with srctop_file bldtop_file/;
use OpenSSL::Test::Utils;
setup("test_dgst");
-plan tests => 5;
+plan tests => 6;
sub tsignverify {
my $testtext = shift;
@@ -102,3 +102,22 @@ SKIP: {
srctop_file("test","tested448pub.pem"));
};
}
+
+SKIP: {
+ skip "dgst with engine is not supported by this OpenSSL build", 1
+ if disabled("engine") || disabled("dynamic-engine");
+
+ subtest "SHA1 generation by engine with `dgst` CLI" => sub {
+ plan tests => 1;
+
+ my $testdata = srctop_file('test', 'data.bin');
+ # intentionally using -engine twice, please do not remove the duplicate line
+ my @macdata = run(app(['openssl', 'dgst', '-sha1',
+ '-engine', $^O eq 'linux' ? bldtop_file("engines", "ossltest.so") : "ossltest",
+ '-engine', $^O eq 'linux' ? bldtop_file("engines", "ossltest.so") : "ossltest",
+ $testdata]), capture => 1);
+ chomp(@macdata);
+ my $expected = qr/SHA1\(\Q$testdata\E\)= 000102030405060708090a0b0c0d0e0f10111213/;
+ ok($macdata[0] =~ $expected, "SHA1: Check HASH value is as expected ($macdata[0]) vs ($expected)");
+ }
+}
More information about the openssl-commits
mailing list