lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wnkervre.fsf@suse.de>
Date:   Thu, 09 Dec 2021 10:08:05 +0100
From:   Nicolai Stange <nstange@...e.de>
To:     Hannes Reinecke <hare@...e.de>
Cc:     Nicolai Stange <nstange@...e.de>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Stephan Müller <smueller@...onox.de>,
        Torsten Duwe <duwe@...e.de>, Zaibo Xu <xuzaibo@...wei.com>,
        Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
        David Howells <dhowells@...hat.com>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        qat-linux@...el.com, keyrings@...r.kernel.org
Subject: Re: [PATCH 03/18] crypto: dh - optimize domain parameter serialization for well-known groups

Hannes Reinecke <hare@...e.de> writes:

> On 12/1/21 1:48 AM, Nicolai Stange wrote:
>> diff --git a/crypto/dh_helper.c b/crypto/dh_helper.c
>> index aabc91e4f63f..a6c9389d8219 100644
>> --- a/crypto/dh_helper.c
>> +++ b/crypto/dh_helper.c
>> @@ -10,7 +10,32 @@
>>   #include <crypto/dh.h>
>>   #include <crypto/kpp.h>
>>   -#define DH_KPP_SECRET_MIN_SIZE (sizeof(struct kpp_secret) + 3 *
>> sizeof(int))
>> +#define DH_KPP_SECRET_MIN_SIZE (sizeof(struct kpp_secret) + \
>> +				sizeof(enum dh_group_id) + 3 * sizeof(int))
>
> That is not a good practise; 'enum' doesn't have a defined size, and
> will typically default to 'unsigned int'.
> But this might well be compiler dependent, so I suggest using a fixes
> size here.

Good point, in particular as a certain encoding is assumed for the test
vectors. Changed in v2.

Thanks,

Nicolai

-- 
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg), GF: Ivo Totev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ