port string_hashsum from libgcrypt to openssl^gcrypt
This allows resolved and importd to be built without libgcrypt. Note that we now say either 'cryptographic library' or 'cryptolib'. Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "main-func.h"
|
||||
#include "missing_network.h"
|
||||
#include "netlink-util.h"
|
||||
#include "openssl-util.h"
|
||||
#include "pager.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
|
||||
@@ -498,14 +498,14 @@ int manager_parse_config_file(Manager *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
#if ! HAVE_GCRYPT
|
||||
#if !HAVE_OPENSSL_OR_GCRYPT
|
||||
if (m->dnssec_mode != DNSSEC_NO) {
|
||||
log_warning("DNSSEC option cannot be enabled or set to allow-downgrade when systemd-resolved is built without gcrypt support. Turning off DNSSEC support.");
|
||||
log_warning("DNSSEC option cannot be enabled or set to allow-downgrade when systemd-resolved is built without a cryptographic library. Turning off DNSSEC support.");
|
||||
m->dnssec_mode = DNSSEC_NO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ! ENABLE_DNS_OVER_TLS
|
||||
#if !ENABLE_DNS_OVER_TLS
|
||||
if (m->dns_over_tls_mode != DNS_OVER_TLS_NO) {
|
||||
log_warning("DNS-over-TLS option cannot be enabled or set to opportunistic when systemd-resolved is built without DNS-over-TLS support. Turning off DNS-over-TLS support.");
|
||||
m->dns_over_tls_mode = DNS_OVER_TLS_NO;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#if HAVE_GCRYPT
|
||||
#include <gcrypt.h>
|
||||
# include <gcrypt.h>
|
||||
#endif
|
||||
|
||||
#include "alloc-util.h"
|
||||
@@ -776,7 +776,7 @@ int dns_packet_append_opt(
|
||||
static const uint8_t rfc6975[] = {
|
||||
|
||||
0, 5, /* OPTION_CODE: DAU */
|
||||
#if HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600
|
||||
#if PREFER_OPENSSL || (HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600)
|
||||
0, 7, /* LIST_LENGTH */
|
||||
#else
|
||||
0, 6, /* LIST_LENGTH */
|
||||
@@ -787,7 +787,7 @@ int dns_packet_append_opt(
|
||||
DNSSEC_ALGORITHM_RSASHA512,
|
||||
DNSSEC_ALGORITHM_ECDSAP256SHA256,
|
||||
DNSSEC_ALGORITHM_ECDSAP384SHA384,
|
||||
#if HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600
|
||||
#if PREFER_OPENSSL || (HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600)
|
||||
DNSSEC_ALGORITHM_ED25519,
|
||||
#endif
|
||||
|
||||
|
||||
@@ -414,9 +414,9 @@ void link_set_dnssec_mode(Link *l, DnssecMode mode) {
|
||||
|
||||
assert(l);
|
||||
|
||||
#if ! HAVE_GCRYPT
|
||||
#if !HAVE_OPENSSL_OR_GCRYPT
|
||||
if (IN_SET(mode, DNSSEC_YES, DNSSEC_ALLOW_DOWNGRADE))
|
||||
log_warning("DNSSEC option for the link cannot be enabled or set to allow-downgrade when systemd-resolved is built without gcrypt support. Turning off DNSSEC support.");
|
||||
log_warning("DNSSEC option for the link cannot be enabled or set to allow-downgrade when systemd-resolved is built without a cryptographic library. Turning off DNSSEC support.");
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user