This has been added to avoid the situation where some host ctype.h functions
[openssl.git] / test / recipes / 80-test_ssl_old.t
index a790d9be2aaa033fe1527467d12ff78fba456ae9..ea7623125cd64ddae19b3ee060d3bc4b1a5a63a6 100644 (file)
@@ -101,7 +101,7 @@ testssl("keyU.ss", $Ucert, $CAcert);
 # subtest functions
 sub testss {
     open RND, ">>", ".rnd";
-    print RND "string to make the random number generator think it has entropy";
+    print RND "string to make the random number generator think it has randomness";
     close RND;
 
     my @req_dsa = ("-newkey",
@@ -424,12 +424,18 @@ sub testssl {
        push @protocols, "-ssl3" unless $no_ssl3;
        my $protocolciphersuitecount = 0;
        my %ciphersuites = ();
+       my %ciphersstatus = ();
        foreach my $protocol (@protocols) {
-           $ciphersuites{$protocol} =
-               [ map { s|\R||; split(/:/, $_) }
-                 run(app(["openssl", "ciphers", "-s", $protocol,
-                           "ALL:$ciphers"]), capture => 1) ];
-           $protocolciphersuitecount += scalar @{$ciphersuites{$protocol}};
+           my $ciphersstatus = undef;
+           my @ciphers = run(app(["openssl", "ciphers", "-s", $protocol,
+                                  "ALL:$ciphers"]),
+                             capture => 1, statusvar => \$ciphersstatus);
+           $ciphersstatus{$protocol} = $ciphersstatus;
+           if ($ciphersstatus) {
+               $ciphersuites{$protocol} = [ map { s|\R||; split(/:/, $_) }
+                                            @ciphers ];
+               $protocolciphersuitecount += scalar @{$ciphersuites{$protocol}};
+           }
        }
 
         plan skip_all => "None of the ciphersuites to test are available in this OpenSSL build"
@@ -437,7 +443,12 @@ sub testssl {
 
         # The count of protocols is because in addition to the ciphersuits
         # we got above, we're running a weak DH test for each protocol
-        plan tests => $protocolciphersuitecount + scalar(keys %ciphersuites);
+        plan tests => scalar(@protocols) + $protocolciphersuitecount
+            + scalar(keys %ciphersuites);
+
+        foreach my $protocol (@protocols) {
+            ok($ciphersstatus{$protocol}, "Getting ciphers for $protocol");
+        }
 
         foreach my $protocol (sort keys %ciphersuites) {
             note "Testing ciphersuites for $protocol";