Add test case for #21986
authorPauli <pauli@openssl.org>
Thu, 7 Sep 2023 02:35:10 +0000 (12:35 +1000)
committerPauli <pauli@openssl.org>
Fri, 8 Sep 2023 06:31:47 +0000 (16:31 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/21988)

test/recipes/80-test_cms.t

index a0e6e874c3eb172de714cb35a2d1fb618fb7f2c2..21c683c4046a7fc75585fc3c6684bff10f8fbe68 100644 (file)
@@ -50,7 +50,7 @@ my ($no_des, $no_dh, $no_dsa, $no_ec, $no_ec2m, $no_rc2, $no_zlib)
 
 $no_rc2 = 1 if disabled("legacy");
 
-plan tests => 20;
+plan tests => 21;
 
 ok(run(test(["pkcs7_test"])), "test pkcs7");
 
@@ -1140,3 +1140,13 @@ with({ exit_checker => sub { return shift == 6; } },
                    ])),
             "Check failure during BIO setup with -stream is handled correctly");
     });
+
+# Test case for return value mis-check reported in #21986
+with({ exit_checker => sub { return shift == 3; } },
+    sub {
+        ok(run(app(['openssl', 'cms', '-sign',
+                    '-in', srctop_file("test", "smcont.txt"),
+                    '-signer', srctop_file("test/smime-certs", "smdsa1.pem"),
+                    '-md', 'SHAKE256'])),
+           "issue#21986");
+    });