Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsmasq can be built with dnssec support in new nettle versions #14282

Merged
merged 1 commit into from Sep 7, 2019
Merged

dnsmasq can be built with dnssec support in new nettle versions #14282

merged 1 commit into from Sep 7, 2019

Conversation

ghost
Copy link

@ghost ghost commented Sep 7, 2019

Added a patch which allows dnsmasq to be successfully compiled with new nettle versions, with different function names.

@Duncaen
Copy link
Member

Duncaen commented Sep 7, 2019

Hm I don't think a revbump would be necessary as this code is disabled by default.

And maybe use the patch with the commit message etc, so its easier to follow that this patch comes from upstream and can be removed next update.

From: Vladislav Grishenko <themiron@mail.ru>
Date: Wed, 26 Jun 2019 15:27:11 +0000 (+0500)
Subject: Fix build with libnettle 3.5
X-Git-Url: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff_plain;h=ab73a746a0d6fcac2e682c5548eeb87fb9c9c82e;hp=69bc94779c2f035a9fffdb5327a54c3aeca73ed5

Fix build with libnettle 3.5
---

diff --git a/src/crypto.c b/src/crypto.c
index ebb871e..fecc64a 100644
--- src/crypto.c
+++ src/crypto.c
@@ -275,6 +275,10 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_data, unsigned int key_len
   static struct ecc_point *key_256 = NULL, *key_384 = NULL;
   static mpz_t x, y;
   static struct dsa_signature *sig_struct;
+#if NETTLE_VERSION_MAJOR == 3 && NETTLE_VERSION_MINOR < 4
+#define nettle_get_secp_256r1() (&nettle_secp_256r1)
+#define nettle_get_secp_384r1() (&nettle_secp_384r1)
+#endif

   if (!sig_struct)
     {
@@ -294,7 +298,7 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_data, unsigned int key_len
          if (!(key_256 = whine_malloc(sizeof(struct ecc_point))))
            return 0;

-         nettle_ecc_point_init(key_256, &nettle_secp_256r1);
+         nettle_ecc_point_init(key_256, nettle_get_secp_256r1());
        }

       key = key_256;
@@ -307,7 +311,7 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_data, unsigned int key_len
          if (!(key_384 = whine_malloc(sizeof(struct ecc_point))))
            return 0;

-         nettle_ecc_point_init(key_384, &nettle_secp_384r1);
+         nettle_ecc_point_init(key_384, nettle_get_secp_384r1());
        }

       key = key_384;

@Duncaen
Copy link
Member

Duncaen commented Sep 7, 2019

And please change the commit message to something like dnsmasq: add patch for dnssec with nettle 3.5.1.

@Duncaen Duncaen merged commit e0fd253 into void-linux:master Sep 7, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant