NetBSD Problem Report #54755

From www@netbsd.org  Wed Dec 11 15:59:31 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EE0857A18C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 11 Dec 2019 15:59:30 +0000 (UTC)
Message-Id: <20191211155929.E60F17A1CD@mollari.NetBSD.org>
Date: Wed, 11 Dec 2019 15:59:29 +0000 (UTC)
From: gnats@xn--rvztrtkrfrgp-bbb7j2b8f0b9d7a21oft.com
Reply-To: gnats@xn--rvztrtkrfrgp-bbb7j2b8f0b9d7a21oft.com
To: gnats-bugs@NetBSD.org
Subject: Making net/dnsmasq build with newer nettle when dnssec is enabled.
X-Send-Pr-Version: www-1.0

>Number:         54755
>Category:       pkg
>Synopsis:       Making net/dnsmasq build with newer nettle when dnssec is enabled.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 11 16:00:01 +0000 2019
>Closed-Date:    Thu Aug 20 00:54:42 +0000 2020
>Last-Modified:  Thu Aug 20 00:54:42 +0000 2020
>Originator:     Ben Gergely
>Release:        current
>Organization:
potato
>Environment:
NetBSD funcube 9.99.19 NetBSD 9.99.19 (FUNCUBE) #0: Fri Dec  6 19:25:40 GMT 2019  potato@funcube:/usr/obj/sys/arch/amd64/compile/FUNCUBE amd64
>Description:
Making net/dnsmasq build with newer nettle when dnssec is enabled.

--- crypto.o ---
crypto.c: In function 'dnsmasq_ecdsa_verify':
crypto.c:297:36: error: 'nettle_secp_256r1' undeclared (first use in this function); did you mean 'nettle_get_secp_256r1'?
    nettle_ecc_point_init(key_256, &nettle_secp_256r1);
                                    ^~~~~~~~~~~~~~~~~
                                    nettle_get_secp_256r1
crypto.c:297:36: note: each undeclared identifier is reported only once for each function it appears in
crypto.c:310:36: error: 'nettle_secp_384r1' undeclared (first use in this function); did you mean 'nettle_secp_256r1'?
    nettle_ecc_point_init(key_384, &nettle_secp_384r1);
                                    ^~~~~~~~~~~~~~~~~
                                    nettle_secp_256r1
*** [crypto.o] Error code 1

>How-To-Repeat:
cd /usr/pkgsrc/net/dnsmasq ; make PKG_OPTIONS.dnsmasq+=dnssec
>Fix:
Patch it, or wait for a new version of dnsmasq I guess.

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/dnsmasq/distinfo,v
retrieving revision 1.37
diff -u -u -r1.37 distinfo
--- distinfo    30 Oct 2018 11:16:06 -0000      1.37
+++ distinfo    11 Dec 2019 15:48:57 -0000
@@ -5,4 +5,5 @@
 SHA512 (dnsmasq-2.80.tar.xz) = 58e56beb553fc41311e5dc16d8b0eb3b6801e2bdfbcd0e7a6659703f08960b6ad10d48b0b14a4d727636faf35483e01597cff2ae49e7fe9fa9e214f437b1c068
 Size (dnsmasq-2.80.tar.xz) = 501072 bytes
 SHA1 (patch-src_bpf.c) = 05dc64c016c608e6b963ce9ee80c28e872a88f9e
+SHA1 (patch-src_crypto.c) = c5cdfb845ab8e5bd4b1f464ba448d9d795641cde
 SHA1 (patch-src_dump.c) = 3e7553e8ed2444536ba94187f7a100a9abdbb353
Index: patches/patch-src_crypto.c
===================================================================
RCS file: patches/patch-src_crypto.c
diff -N patches/patch-src_crypto.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_crypto.c  11 Dec 2019 15:48:57 -0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_bpf.c $
+
+Make compat. with older nettle.
+
+--- src/crypto.c.orig
++++ src/crypto.c
+@@ -275,6 +275,10 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_
+   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_
+         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_
+         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;

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 20 Aug 2020 00:54:42 +0000
State-Changed-Why:
Submitter says this should be closed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.