Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j0RCw-0002mv-GT for mharc-grub-devel@gnu.org; Sat, 08 Feb 2020 09:35:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49354) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0OKG-0008RL-7n for grub-devel@gnu.org; Sat, 08 Feb 2020 06:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0OKF-0003ep-6B for grub-devel@gnu.org; Sat, 08 Feb 2020 06:31:04 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:52699) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0OKE-0003eJ-WC for grub-devel@gnu.org; Sat, 08 Feb 2020 06:31:03 -0500 Received: by mail-wm1-x343.google.com with SMTP id p9so5064618wmc.2 for ; Sat, 08 Feb 2020 03:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WJ3U8Fr5+0hAjKnQ8t1sMHkCvRq7ZSddwebLJfUuYXE=; b=ciUOYfO8MzsedekT7ydtHzSsoH5k7uz+w64Uu46miJop1aFatQEWdU8+IS3p3IvXGq 29QWbF7Q+ap24pQxfdPG1kZGbtCby0TBHP3QGbAX69lqCewFy4iXS3peWb2VPtOBd+8w lMA1F5TjWR4KTZ2OTx+tZbhUwM3uh32RI4MJWf7w/IHVEY+DPAdYeOhrPfjE6X0Z55YT yPKDUBxzdMp1ssU8XBSTU1Kcu3JHaakA77W29F5AuLk7wPjTRho8KxPxgDqdYYY+1dSe JmjmikfX/TO/wNy8rbhlYsLuqcKZLhxj8rjmsu3ZGX9DpntxeksjIO2v1V6uIsUIFjJ3 7npA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WJ3U8Fr5+0hAjKnQ8t1sMHkCvRq7ZSddwebLJfUuYXE=; b=iv1GCx5z+7/NFD3uLxru+vC0vRcKhkKLVXdu8/sIkcDMdriBFcOoAVjtang/2khIW8 yK7kVfm4vfPR5zRu3jy4GyRaexSeKnl8Epi1CAzg/oDXkxkHMLdmkxorWfN/23COgbVP 4CfSqiH5Zc2uAqa/gDTpby7c17HbTH5nk5hFEJnEtZPhAt/knZQ9HZoldsr3BzFSEXfp 1R9kusWo4HPWn4I2L5HEJGLsxpR1/PUxZfw3/gjuWjNY7ljCPLV/c8njoAwJ3H4Cfo9V seSnerW7gl5vc5EaN07wPPbJLUgSkvxQMmnzTaQA1FFRnvroaotvT99GgCit+QwPnxeC ET2w== X-Gm-Message-State: APjAAAVnf7BshAII9h/+4uyhcT9kRvaj3I5/3s5+2/dje4SRiISanM1g wgOvk0MT/QxORsjDq/ZKznI= X-Google-Smtp-Source: APXvYqwFjbeOvix/lDvubmvJpAFUyWyx6ptKAQKgyuN3kjVtwQ9qbqRJdFUWFYVWAD6+7AmEh6VvzA== X-Received: by 2002:a05:600c:54e:: with SMTP id k14mr3943977wmc.115.1581161456740; Sat, 08 Feb 2020 03:30:56 -0800 (PST) Received: from [192.168.8.101] (89-24-42-168.nat.epc.tmcz.cz. [89.24.42.168]) by smtp.gmail.com with ESMTPSA id t9sm7549760wrv.63.2020.02.08.03.30.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Feb 2020 03:30:56 -0800 (PST) Subject: Re: [PATCH 2/5] argon2: Import Argon2 from cryptsetup To: The development of GNU GRUB , Patrick Steinhardt Cc: Daniel Kiper References: From: Milan Broz Message-ID: Date: Sat, 8 Feb 2020 12:30:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-Mailman-Approved-At: Sat, 08 Feb 2020 09:35:41 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2020 11:31:08 -0000 Hi, On 06/02/2020 15:27, Patrick Steinhardt wrote: > In order to support the Argon2 key derival function for LUKS2, we > obviously need to implement Argon2. It doesn't make a lot of sense to > hand-code any crypto, which is why this commit instead imports Argon2 > from the cryptsetup project. The cryptsetup project was chosen as > upstream simply because it is the de-facto home of LUKS2, making us > bug-to-bug compatible with their Argon2 implementation. > > As the cryptsetup project imported the code themselves from the > repository hosted at https://github.com/P-H-C/phc-winner-argon2, it is > licensed under a mixture of LGPLv2.1+ and CC0 1.0 Universal/Apache 2.0. > Given that both LGPLv2.1+ and Apache 2.0 are compatible with GPLv3, it > should be fine to import that code. Well, it was a temporary solution as we (cryptsetup developers) are trying to include Argon2 in OpenSSL (default crypto backend for cryptsetup) - and perhaps in gcrypt later. So if gcrypt includes Argon2 implementation in future, what is your plan? Switch to it or keep this embedded copy still in place? Just asking :) ... > diff --git a/grub-core/lib/argon2/argon2.c b/grub-core/lib/argon2/argon2.c > new file mode 100644 > index 000000000..1b8b092ae > --- /dev/null > +++ b/grub-core/lib/argon2/argon2.c > @@ -0,0 +1,614 @@ > +/* > + * Argon2 PBKDF2 library wrapper > + * > + * Copyright (C) 2016-2020 Red Hat, Inc. All rights reserved. > + * Copyright (C) 2016-2020 Milan Broz You are missing copyright of the original Argon2 authors here. (This is apparently not the original wrapper code only but internal argon2 implementation.) Anyway, this is interesting addition to GRUB2 (and people often asks cryptsetup upstream about this). Thanks! Milan