Fix 12 Boring tests involving NULL-SHA ciphersuites
[openssl.git] / test / ossl_shim / test_config.cc
index 0fe7ba81a4ac7892d4eaa9cd150ae0f640862ea0..6e43c8da771fcb53abea9974789d878158404b35 100644 (file)
@@ -133,12 +133,26 @@ bool ParseConfig(int argc, char **argv, TestConfig *out_config) {
 
     std::string *string_field = FindField(out_config, kStringFlags, argv[i]);
     if (string_field != NULL) {
+      const char *val;
+
       i++;
       if (i >= argc) {
         fprintf(stderr, "Missing parameter\n");
         return false;
       }
-      string_field->assign(argv[i]);
+
+      /*
+       * Fix up the -cipher argument. runner uses "DEFAULT:NULL-SHA" to enable
+       * the NULL-SHA cipher. However in OpenSSL "DEFAULT" permanently switches
+       * off NULL ciphers, so we use "ALL:NULL-SHA" instead.
+       */
+      if (strcmp(argv[i - 1], "-cipher") == 0
+          && strcmp(argv[i], "DEFAULT:NULL-SHA") == 0)
+        val = "ALL:NULL-SHA";
+      else
+        val = argv[i];
+
+      string_field->assign(val);
       continue;
     }