summarylogtreecommitdiffstats
path: root/nettle35.patch
blob: f999cf9320fdc2c1ce487b5cdfc807b382f9b63b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff -uprN FTL-4.3.1/dnsmasq/crypto.c FTL-4.3.1.cust/dnsmasq/crypto.c
--- FTL-4.3.1/dnsmasq/crypto.c	2019-05-25 21:37:26.000000000 +0200
+++ FTL-4.3.1.cust/dnsmasq/crypto.c	2019-07-08 16:55:49.765967849 +0200
@@ -275,6 +275,10 @@ static int dnsmasq_ecdsa_verify(struct b
   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 b
 	  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 b
 	  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;