-I$(top_srcdir)/doc/examples
AM_LDFLAGS = -no-install
-LDADD = ../lib/libgnutls.la \
- libutils.la \
+COMMON_LDADD = ../lib/libgnutls.la \
$(LIBSOCKET) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSECCOMP)
+LDADD = $(COMMON_LDADD) \
+ libutils.la
+
dane_LDADD = $(LDADD) ../libdane/libgnutls-dane.la
if ENABLE_MINITASN1
endif
if HAVE_CMOCKA
-LDADD += $(CMOCKA_LIBS)
+CMOCKA_LDADD = $(COMMON_LDADD) $(CMOCKA_LIBS)
ctests += dtls-sliding-window ip-utils name-constraints-ip conv-utf8
+
+dtls_sliding_window_LDADD = $(CMOCKA_LDADD)
+ip_utils_LDADD = $(CMOCKA_LDADD)
+name_constraints_ip_LDADD = $(CMOCKA_LDADD)
+conv_utf8_LDADD = $(CMOCKA_LDADD)
+
endif
mini_dtls_pthread_LDADD = $(LDADD) -lpthread
#include <gnutls/x509.h>
#include "../lib/x509/ip.h"
-extern int debug;
-void doit(void);
-
typedef struct test_vars_t {
gnutls_x509_name_constraints_t nc;
gnutls_x509_name_constraints_t nc2;
char ip_out[60];
gnutls_global_set_log_function(tls_log_func);
- if (debug)
- gnutls_global_set_log_level(6000);
+ gnutls_global_set_log_level(2);
/* 1: test the generation of name constraints */
i = 0;
do {
ret = gnutls_x509_name_constraints_get_permitted(nc, i++, &type, &name);
- if (debug) {
+#ifdef DEBUG
_gnutls_cidr_to_string(name.data, name.size, ip_out, sizeof(ip_out));
printf("Loaded name constraint: %s\n",ip_out);
- }
+#endif
} while(ret == 0);
if (i-1 != num_permitted) {
i = 0;
do {
ret = gnutls_x509_name_constraints_get_excluded(nc, i++, &type, &name);
- if (debug) {
+#ifdef DEBUG
_gnutls_cidr_to_string(name.data, name.size, ip_out, sizeof(ip_out));
printf("Loaded name constraint: %s\n",ip_out);
- }
+#endif
} while(ret == 0);
if (i-1 != num_excluded) {
return 0;
}
-void doit(void)
+int main()
{
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(check_generation_reading_basic_checking, setup, teardown),