[Dnsmasq-discuss] [PATCH dnsmasq] crypto: use nettle ecc_curve access functions

Simon Kelley simon at thekelleys.org.uk
Wed Aug 14 21:39:37 BST 2019


Vladislav's patch looks better, for backward compatibility reasons.

Merged into git repo.

Simon.

On 11/08/2019 13:10, Dominik wrote:
> Does this patch break compatibility with nettle < 3.4?
> 
> The solution offered here seems to be better:
> https://github.com/themiron/dnsmasq/commit/6fd9aba7abe1e084123bc5002959350897774ace
> 
> Best,
> Dominik
> 
> On Sat, 2019-08-10 at 13:30 +0200, Hans Dedecker wrote:
>> Nettle 3.5.1 has made ecc_curve definitions (nettle_secp_192r1,
>> nettle_secp_224r1, nettle_secp_256r1, ...) private and forces
>> users to make use of the accessor functions (nettle_get_secp_192r1,
>> ...) to retrieve the specific ecc_curve structs.
>>
>> Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
>> ---
>>  src/crypto.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/crypto.c b/src/crypto.c
>> index ebb871e..dacecb6 100644
>> --- a/src/crypto.c
>> +++ b/src/crypto.c
>> @@ -294,7 +294,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 +307,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;
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list