Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LUKS2 ist nun neuer Default ab sys-fs/cryptsetup-2.3.0
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Fri Feb 07, 2020 11:50 am    Post subject: LUKS2 ist nun neuer Default ab sys-fs/cryptsetup-2.3.0 Reply with quote

Ich wollte da mal drauf hinweisen. Heute vormittag beim Updaten:

Quote:

>>> Running pre-merge checks for sys-fs/cryptsetup-2.3.0
* WARNING! WARNING! WARNING!
* You have chosen LUKS2 as your default format.
* This can break LUKS1 backwards compatibility.
* Enable "luks1_default" USE flag if you need backwards compatibility.


Und ja ich hätte das ohne die Warnung übersehen:
diff /var/db/pkg/sys-fs/cryptsetup-2.2.2/cryptsetup-2.2.2.ebuild /usr/portage/sys-fs/cryptsetup/cryptsetup-2.3.0.ebuild:


1c1
< # Copyright 1999-2019 Gentoo Authors
---
> # Copyright 1999-2020 Gentoo Authors
19c19
< IUSE="${CRYPTO_BACKENDS} +argon2 libressl +luks1_default nls pwquality reencrypt static static-libs +udev urandom"
---
> IUSE="${CRYPTO_BACKENDS} +argon2 libressl luks1_default nls pwquality reencrypt static static-libs +udev urandom"


Das heisst das Useflag "luks1_default" muss man jetzt selber für cryptsetup setzen oder es wird auf LUKS2 umgestellt.

Ein Check zeigt:
cryptsetup luksDump /dev/sde1:

LUKS header information for /dev/sde1

Version:        1
[...]


Also das wäre dann LUKS-Version 1.

Ich habe dazu in der man-Page dann folgendes gefunden:
Quote:

LUKS2 is a new version of header format that allows additional
extensions like different PBKDF algorithm or authenticated
encryption. You can format device with LUKS2 header if you specify
--type luks2 in luksFormat command. For activation, the format is
already recognized automatically.


Wenn ich das richtig verstehe kann ich jetzt wie folgt auf das neue Format konvertieren? Die man-Page schreibt:
Quote:

convert <device> --type <format>

Converts the device between LUKS1 and LUKS2 format (if
possible). The conversion will not be performed if there is
an additional LUKS2 feature or LUKS1 has unsupported header
size.

Conversion (both directions) must be performed on inactive
device. There must not be active dm-crypt mapping established
for LUKS header requested for conversion.

--type option is mandatory with following accepted values:
luks1 or luks2.

WARNING: The convert action can destroy the LUKS header in the
case of a crash during conversion or if a media error occurs.
Always create a header backup before performing this
operation!

<options> can be [--header, --type].


Gibt es sonst noch was zu beachten für eine Umstellung?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Feb 07, 2020 5:43 pm    Post subject: Reply with quote

Danke für Deinen Hinweis!

Ich habe ein bisschen recherchiert und ich sehe keinen Grund für einen Wechsel des LUKS Formats. Das LUKS 1 Format hat keine Nachteile und wird auch weiterhin unterstützt:

https://askubuntu.com/questions/1032546/should-i-use-luks1-or-luks2-for-partition-encryption

Die Release Notes von cryptsetup 2.0 schreiben das auch:
Quote:
This version introduces a new on-disk LUKS2 format.

The legacy LUKS (referenced as LUKS1) will be fully supported
forever
as well as a traditional and fully backward compatible format.

Das Gentoo Paket sys-fs/cryptsetup-2.3.0-rc0 habe ich mir noch nicht angeschaut. Es ist ja noch masked! Und das alte cryptsetup funktioniert seit Jahren einwandfrei. Falls man in Zukunft tatsächlich ein USE Flag setzen muss, um weiterhin das LUKS1 Format nutzen zu können, werde ich das setzen. Aber ich würde es für verkehrt halten. Gentoo sollte weiterhin standardmäßig LUKS1 anbieten.
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Fri Feb 07, 2020 6:43 pm    Post subject: Reply with quote

Hallo mike.

sys-fs/cryptsetup-2.3.0 ist im Portage-Tree. Und ja sicher es steht auf unstable.
Bis Version 2.2.2 hatte das Ebuild das Useflag luks1_default standardmässig aktiviert über IUSE. Der Diff in meinem ersten Post zeigt das diese Aktivierung nun weggefallen ist.
Mir ist das erst nicht aufgefallen, weil heute ein größeres KDE-Update für die Apps auf Version 19.2.2 war und die Änderung zwar angezeigt wurde, aber mir durchgegangen war.

Deswegen gabs ja zum Glück diese Warnung dann.

Ich würde es so deuten das die Absicht besteht cryptsetup zukünftlich auf LUKS2 umzustellen. Also auch für die stable Version dann.

Schaut man in den Ebuild von cryptsetup-2.3.0 findet man für die Konfiguration:
Code:

local myeconfargs=(
      --disable-internal-argon2
      --enable-shared
      --sbindir=/sbin
      # for later use
      --with-default-luks-format=LUKS$(usex luks1_default 1 2)
      --with-tmpfilesdir="${EPREFIX}/usr/lib/tmpfiles.d"
      --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/} ; do usev ${x} ; done)
      $(use_enable argon2 libargon2)
      $(use_enable nls)
      $(use_enable pwquality)
      $(use_enable reencrypt cryptsetup-reencrypt)
      $(use_enable static static-cryptsetup)
      $(use_enable static-libs static)
      $(use_enable udev)
      $(use_enable !urandom dev-random)
   )
   econf "${myeconfargs[@]}"


Was macht "--with-default-luks-format". Dazu kann man hier nachschauen. Kurzbeschreibung:
Quote:


Add --with-default-luks-format configure time option.

Add option to override default LUKS format version (currently LUKS1).


Mir ist grade wegen der Warnung zur Abwärtskompatibilität jetzt unklar ob ich auch mit einem LUKS2 als default für cryptsetup weiter meine alten LUKS1-Partitionen nutzen kann. Wenn ich das von dir schon genannte Zitat nehme, steht da "fully backward compatible format". Die Warnung sagt das die Abwärtskompatibiliät verloren gehen könnte.

Ansonsten wirklich Danke erstmal für deine zusätzlichen Informationen und das Feedback.
Mein Gedanke war der erst mal noch paar Tage zu warten und zu schauen was passiert. Dann könnte ich ein älteres Laptop vielleicht darauf umstellen und mir das im Betrieb einfach mal eine Weile anzusehen. Auch was das Zusammenspiel von externen Datenträgern angeht die LUKS1 haben.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Feb 07, 2020 7:51 pm    Post subject: Reply with quote

Hallo Tyrus,

ich habe gerade ein "emerge --sync" durchgeführt. Dabei hat sys-fs/cryptsetup-2.3.0 von masked auf unstable/testing gewechselt.

In der Tat ist das USE Flag "luks1_default" bei cryptsetup-2.3.0 nicht mehr standardmäßig gesetzt.

Laut Doku hat das USE Flag folgende Bedeutung:
Code:
luks1_default: Default to LUKS1 on disk encryption format rather than new LUKS2

Ich interpretiere das so, dass es hier darum geht, in welchem Format neu angelegte verschlüsselte Partitionen formatiert werden. Es hat aber vermutlich nichts damit zu tun, ob cryptsetup weiterhin alte Partitionen mit LUKS1 Format unterstützt.

Mike
Back to top
View user's profile Send private message
kurisu
Apprentice
Apprentice


Joined: 19 Jan 2011
Posts: 177
Location: Munich, Germany

PostPosted: Fri Feb 07, 2020 11:42 pm    Post subject: Reply with quote

Sehr richtig. Es geht einzig darum, dass neu angelegte LUKS-Partitionen fortan standardmäßig das LUKS2-Format verwenden werden. Support für LUKS1 bleibt gemäß Upstream für alle Zeiten – was auch immer das heißen mag – erhalten.
_________________
#1 Ryzen 7 2700 | Asus ROG Strix X470-F Gaming | G.Skill 32 GB DDR4-3000 | PowerColor Radeon RX 5700 Red Dragon | Samsung SSD 970 EVO Plus 1TB NVMe
#2 Ryzen 5 2400G | ASRock B450 Steel Legend | G.Skill 16 GB DDR4-3000 | Samsung SSD 850 PRO 512GB SATA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum