View | Details | Raw Unified | Return to bug 2141
Collapse All | Expand All

(-)b/dnscrypt/dnscrypt.c (+13 lines)
 Lines 870-875   dnsc_parse_keys(struct dnsc_env *env, struct config_file *cfg) Link Here 
870
	return cert_id;
870
	return cert_id;
871
}
871
}
872
872
873
static void
874
sodium_misuse_handler(void)
875
{
876
	fatal_exit(
877
		"dnscrypt: libsodium could not be initialized, this typically"
878
		" happens when no good source of entropy is found. If you run"
879
		" unbound in a chroot, make sure /dev/random is available. See"
880
		" https://www.unbound.net/documentation/unbound.conf.html");
881
}
882
873
883
874
/**
884
/**
875
 * #########################################################
885
 * #########################################################
 Lines 933-938   struct dnsc_env * Link Here 
933
dnsc_create(void)
943
dnsc_create(void)
934
{
944
{
935
	struct dnsc_env *env;
945
	struct dnsc_env *env;
946
#ifdef SODIUM_MISUSE_HANDLER
947
	sodium_set_misuse_handler(sodium_misuse_handler);
948
#endif
936
	if (sodium_init() == -1) {
949
	if (sodium_init() == -1) {
937
		fatal_exit("dnsc_create: could not initialize libsodium.");
950
		fatal_exit("dnsc_create: could not initialize libsodium.");
938
	}
951
	}
(-)b/dnscrypt/dnscrypt.m4 (-1 / +8 lines)
 Lines 28-33   AC_DEFUN([dnsc_DNSCRYPT], Link Here 
28
        [
28
        [
29
            AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0])
29
            AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0])
30
        ])
30
        ])
31
    AC_SEARCH_LIBS([sodium_set_misuse_handler], [sodium],
32
        [
33
            AC_DEFINE(
34
                [SODIUM_MISUSE_HANDLER], [1],
35
                [Define to 1 if libsodium supports sodium_set_misuse_handler])
36
        ],
37
        [
38
        ])
31
    $1
39
    $1
32
  else
40
  else
33
    AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0])
41
    AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0])
34
- 

Return to bug 2141