esac
AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support]))
+AC_ARG_ENABLE(dane-verify, AC_HELP_STRING([--disable-dane-verify], [Disable DANE verify support]))
AC_ARG_ENABLE(dane-ta-usage, AC_HELP_STRING([--disable-dane-ta-usage], [Disable DANE-TA usage type support]))
case "$enable_dane" in
no)
AC_SUBST(ldns_build_config_use_dane, 0)
+ AC_SUBST(ldns_build_config_use_dane_verify, 0)
AC_SUBST(ldns_build_config_use_dane_ta_usage, 0)
;;
*) dnl default
AC_MSG_ERROR([DANE enabled, but no SSL support])
fi
AC_CHECK_FUNC(X509_check_ca, [], [AC_MSG_ERROR([OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane])])
- AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.])
AC_SUBST(ldns_build_config_use_dane, 1)
- case "$enable_dane_ta_usage" in
+ AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.])
+ case "$enable_dane_verify" in
no)
+ AC_SUBST(ldns_build_config_use_dane_verify, 0)
AC_SUBST(ldns_build_config_use_dane_ta_usage, 0)
- ;;
- *) dnl default
- LIBS="$LIBS -lssl"
- AC_CHECK_FUNC(SSL_get0_dane, [], [AC_MSG_ERROR([OpenSSL does not support offline DANE verification (Needed for the DANE-TA usage type). Please upgrade OpenSSL to version >= 1.1.0 or rerun with --disable-dane-ta-usage])])
- LIBSSL_LIBS="$LIBSSL_LIBS -lssl"
- AC_DEFINE_UNQUOTED([USE_DANE_TA_USAGE], [1], [Define this to enable DANE-TA usage type support.])
- AC_SUBST(ldns_build_config_use_dane_ta_usage, 1)
- ;;
+ ;;
+ *)
+ AC_SUBST(ldns_build_config_use_dane_verify, 1)
+ AC_DEFINE_UNQUOTED([USE_DANE_VERIFY], [1], [Define this to enable DANE verify support.])
+ case "$enable_dane_ta_usage" in
+ no)
+ AC_SUBST(ldns_build_config_use_dane_ta_usage, 0)
+ ;;
+ *) dnl default
+ LIBS="$LIBS -lssl"
+ AC_CHECK_FUNC(SSL_get0_dane, [], [AC_MSG_ERROR([OpenSSL does not support offline DANE verification (Needed for the DANE-TA usage type). Please upgrade OpenSSL to version >= 1.1.0 or rerun with --disable-dane-verify or --disable-dane-ta-usage])])
+ LIBSSL_LIBS="$LIBSSL_LIBS -lssl"
+ AC_SUBST(ldns_build_config_use_dane_ta_usage, 1)
+ AC_DEFINE_UNQUOTED([USE_DANE_TA_USAGE], [1], [Define this to enable DANE-TA usage type support.])
+ ;;
+ esac
esac
;;
esac
}
+#ifdef USE_DANE_VERIFY
/* Return tlsas that actually are TLSA resource records with known values
* for the Certificate usage, Selector and Matching type rdata fields.
*/
}
return s;
}
-#endif
+#endif /* !defined(USE_DANE_TA_USAGE) */
+#endif /* USE_DANE_VERIFY */
+#ifdef USE_DANE_VERIFY
ldns_status
ldns_dane_verify_rr(const ldns_rr* tlsa_rr,
X509* cert, STACK_OF(X509)* extra_certs,
ldns_rr_list_free(usable_tlsas);
return s;
}
+#endif /* USE_DANE_VERIFY */
#endif /* HAVE_SSL */
#endif /* USE_DANE */
static void
print_usage(const char* progname)
{
+#ifdef USE_DANE_VERIY
printf("Usage: %s [OPTIONS] verify <name> <port>\n", progname);
printf(" or: %s [OPTIONS] -t <tlsafile> verify\n", progname);
printf("\n\tVerify the TLS connection at <name>:<port> or"
"\n\tuse TLSA record(s) from <tlsafile> to verify the\n"
"\tTLS service they reference.\n");
printf("\n or: %s [OPTIONS] create <name> <port> [<usage> "
+#else
+ printf("Usage: %s [OPTIONS] create <name> <port> [<usage> "
+#endif
"[<selector> [<type>]]]\n", progname);
printf("\n\tUse the TLS connection(s) to <name> <port> "
"to create the TLSA\n\t"
}
+#ifdef USE_DANE_VERIFY
static void
ssl_interact(SSL* ssl)
{
} /* for (;;) */
}
+#endif /* USE_DANE_VERIFY */
static ldns_rr_list*
}
}
+#ifdef USE_DANE_VERIFY
static bool
dane_verify(ldns_rr_list* tlsas, ldns_rdf* address,
X509* cert, STACK_OF(X509)* extra_certs,
ldns_get_errorstr_by_id(s));
return false;
}
+#endif /* USE_DANE_VERIFY */
/**
* Return either an A or AAAA rdf, based on the given
argc--;
argv++;
+#ifdef USE_DANE_VERIFY
} else if (strncasecmp(*argv, "verify", strlen(*argv)) == 0) {
mode = VERIFY;
} else {
fprintf(stderr, "Specify create or verify mode\n");
+#else
+ } else {
+ fprintf(stderr, "Specify create mode\n");
+#endif
exit(EXIT_FAILURE);
}
+#ifndef USE_DANE_VERIFY
+ (void)transport_str;
+ (void)transport_rdf;
+ (void)port_str;
+ (void)port_rdf;
+ (void)interact;
+#else
if (mode == VERIFY && argc == 0) {
if (! tlsas_file) {
}
- } else if (argc < 2) {
+ } else
+#endif /* USE_DANE_VERIFY */
+ if (argc < 2) {
print_usage("ldns-dane");
cert, extra_certs, store,
verify_server_name, name);
break;
+#ifdef USE_DANE_VERIFY
case VERIFY: if (! dane_verify(tlsas, NULL,
cert, extra_certs, store,
verify_server_name, name,
success = false;
}
break;
+#endif
default: break; /* suppress warning */
}
SSL_free(ssl);
verify_server_name, name);
break;
+#ifdef USE_DANE_VERIFY
case VERIFY: if (! dane_verify(tlsas, address,
cert, extra_certs, store,
verify_server_name, name,
ssl_interact(ssl);
}
break;
+#endif
default: break; /* suppress warning */
}
while (SSL_shutdown(ssl) == 0);