Add some session API tests
[openssl.git] / test / recipes / 80-test_cms.t
index 8dc6e9039a277e5f617d7e00b0914b8091e23203..40fcf7cc5346d8579b8fb6d2b4cc5f4f2897f93e 100644 (file)
@@ -1,4 +1,11 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
+# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 
 use strict;
 use warnings;
@@ -11,10 +18,13 @@ use OpenSSL::Test::Utils;
 
 setup("test_cms");
 
+plan skip_all => "CMS is not supported by this OpenSSL build"
+    if disabled("cms");
+
 my $smdir    = srctop_dir("test", "smime-certs");
 my $smcont   = srctop_file("test", "smcont.txt");
-my ($no_des, $no_dh, $no_ec, $no_ec2m, $no_rc2, $no_zlib)
-    = disabled qw/des dh ec ec2m rc2 zlib/;
+my ($no_des, $no_dh, $no_dsa, $no_ec, $no_ec2m, $no_rc2, $no_zlib)
+    = disabled qw/des dh dsa ec ec2m rc2 zlib/;
 
 plan tests => 4;
 
@@ -59,7 +69,7 @@ my @smime_pkcs7_tests = (
        "-content", $smcont ]
     ],
 
-    [ "signed detached content DER format, add RSA signer",
+    [ "signed detached content DER format, add RSA signer (with DSA existing)",
       [ "-resign", "-inform", "DER", "-in", "test.cms", "-outform", "DER",
        "-signer", catfile($smdir, "smrsa1.pem"), "-out", "test2.cms" ],
       [ "-verify", "-in", "test2.cms", "-inform", "DER",
@@ -477,6 +487,8 @@ sub check_availability {
         if ($no_rc2 && $tnam =~ /RC2/);
     return "$tnam: skipped, DES disabled\n"
         if ($no_des && $tnam =~ /DES/);
+    return "$tnam: skipped, DSA disabled\n"
+        if ($no_dsa && $tnam =~ / DSA/);
 
     return "";
 }