[squash]Build works with/out NO_ENGINE and NO_AFALG
[openssl.git] / test / danetest.c
index d473b126894eb9c56482aaf6a292a6fa2340c17f..7fa6a2f44f1138e3c33db69f7aaf2e478deae966 100644 (file)
@@ -317,7 +317,7 @@ static int allws(const char *cp)
     return 1;
 }
 
-static int test_tlsafile(SSL_CTX *ctx, const char *basename,
+static int test_tlsafile(SSL_CTX *ctx, const char *base_name,
                          BIO *f, const char *path)
 {
     char *line;
@@ -329,6 +329,7 @@ static int test_tlsafile(SSL_CTX *ctx, const char *basename,
         STACK_OF(X509) *chain;
         int ntlsa;
         int ncert;
+        int noncheck;
         int want;
         int want_depth;
         int off;
@@ -341,7 +342,8 @@ static int test_tlsafile(SSL_CTX *ctx, const char *basename,
             continue;
 
         ++testno;
-        if (sscanf(line, "%d %d %d %d%n", &ntlsa, &ncert, &want, &want_depth, &off) != 4
+        if (sscanf(line, "%d %d %d %d %d%n",
+                   &ntlsa, &ncert, &noncheck, &want, &want_depth, &off) != 5
             || !allws(line + off)) {
             fprintf(stderr, "Expected tlsa count, cert count and result"
                     " at test %d of %s\n", testno, path);
@@ -351,10 +353,12 @@ static int test_tlsafile(SSL_CTX *ctx, const char *basename,
         if ((ssl = SSL_new(ctx)) == NULL)
             return -1;
         SSL_set_connect_state(ssl);
-        if (SSL_dane_enable(ssl, basename) <= 0) {
+        if (SSL_dane_enable(ssl, base_name) <= 0) {
             SSL_free(ssl);
             return -1;
         }
+        if (noncheck)
+            SSL_dane_set_flags(ssl, DANE_FLAG_NO_DANE_EE_NAMECHECKS);
 
         for (i = 0; i < ntlsa; ++i) {
             if ((line = read_to_eol(f)) == NULL || !tlsa_import_rr(ssl, line)) {