Add DRBG self tests
[openssl.git] / test / recipes / 03-test_fipsinstall.t
index e77e09d550c674eff0b913ad337d0349ed37809c..71e8db10e428884eb0fdbc03e4d2282eadbbb0d1 100644 (file)
@@ -24,7 +24,7 @@ use platform;
 
 plan skip_all => "Test only supported in a fips build" if disabled("fips");
 
-plan tests => 9;
+plan tests => 10;
 
 my $infile = bldtop_file('providers', platform->dso('fips'));
 $ENV{OPENSSL_MODULES} = bldtop_dir("providers");
@@ -92,3 +92,10 @@ ok(!run(app(['openssl', 'fipsinstall', '-out', 'fips.conf', '-module', $infile,
             '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
             '-section_name', 'fips_install', '-corrupt_desc', 'SHA3'])),
    "fipsinstall fails when the digest result is corrupted");
+
+# corrupt DRBG
+ok(!run(app(['openssl', 'fipsinstall', '-out', 'fips.conf', '-module', $infile,
+            '-provider_name', 'fips', '-mac_name', 'HMAC',
+            '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
+            '-section_name', 'fips_install', '-corrupt_desc', 'CTR'])),
+   "fipsinstall fails when the DRBG CTR result is corrupted");