]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add a test to ensure that instantiation of drbgs work
authorNeil Horman <nhorman@openssl.org>
Wed, 7 Jan 2026 14:34:51 +0000 (09:34 -0500)
committerNeil Horman <nhorman@openssl.org>
Fri, 9 Jan 2026 15:07:59 +0000 (10:07 -0500)
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29560)

test/recipes/20-test_rand_config.t

index 5919eef56d6b65817fd59313591e79b3d7d1eca8..044a63f30ca9b797ee91fc8506d801f7a2d1b1ae 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 use warnings;
 
-use OpenSSL::Test;
+use OpenSSL::Test qw/:DEFAULT result_dir/;
 use OpenSSL::Test::Utils;
 
 setup("test_rand_config");
@@ -57,7 +57,7 @@ my @aria_tests = (
 
 push @rand_tests, @aria_tests unless disabled("aria");
 
-plan tests => scalar @rand_tests;
+plan tests => scalar @rand_tests * 2;
 
 my $contents =<<'CONFIGEND';
 openssl_conf = openssl_init
@@ -86,6 +86,9 @@ foreach (@rand_tests) {
     $ENV{OPENSSL_CONF} = $tmpfile;
 
     ok(comparelines($_->{expected}), $_->{desc});
+    # Also check that instantiating the drbg works
+    my $result_dir = result_dir();
+    ok(run(app(["openssl", "rand", "-writerand", "$result_dir/$tmpfile.bin"])));
 }
 
 # Check that the stdout output contains the expected values.