Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 20 Feb 2020 07:37:36 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id q9so724482wmj.5 for ; Wed, 19 Feb 2020 22:37:35 -0800 (PST) Received: from [10.43.17.53] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id h13sm3422510wrw.54.2020.02.19.22.37.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2020 22:37:34 -0800 (PST) References: <7fc85398-a14e-bba1-c996-5d398fef8e7d@gmail.com> <9d9951e1-03a2-fcc5-8d2d-8b2276ab584c@yahoo.com> <0acf7f14-ae82-686a-bc13-847b01cd5aab@gmail.com> <20200220022335.GA29182@tansi.org> From: Milan Broz Message-ID: Date: Thu, 20 Feb 2020 07:37:32 +0100 MIME-Version: 1.0 In-Reply-To: <20200220022335.GA29182@tansi.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] Bug in cryptsetup 2.3.0 (BitLocker key-file support) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 20/02/2020 03:23, Arno Wagner wrote: > On Wed, Feb 19, 2020 at 21:57:23 CET, Milan Broz wrote: >> On 19/02/2020 21:13, Quentin Lefebvre wrote: >>> The on-disk keyfile was the printed recovery passphrase provided by >>> Windows... >>> >>> > So what is the exact content of your keyfile? Is there additional EOL, >>> > or it had some more characters there? >>> >>> ls -l >>> showed a 56 bytes file and >>> >>> hexdump -C >>> showed a trailing '\x0a' character added by my favorite editor. >>> >>> Removing it with dd(!) solved my problem... >> >> ok, thanks for the info. >> >> But I think we should perhaps process even this file (recovery >> passphrase has a special format - if it is detected, we try to use it, >> otherwise we parse it as a normal passphrase). >> I think we can do this even if it is has an additional EOL there. > > I would suggest giving a verbose warning in this case. > Something like, "recovery passphrase detected, extra EOL chars stripped." If it fails to open through a recovery passphrase slot, then code tries it as a normal one (key derivation is quite fast here, so it is just a small delay) - so this is really not necessary. m.