Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2021-11-13 22:48:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Sat Nov 13 22:48:25 2021 rev:135 rq:931138 version:4.4.56 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2021-10-29 22:34:28.491687596 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1890/libstorage-ng.changes 2021-11-13 22:48:46.685261564 +0100 @@ -1,0 +2,21 @@ +Fri Nov 12 12:53:45 UTC 2021 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#842 +- support PBKDF for LUKS2 (jsc#SLE-21309) +- updated documentation +- refactored pool generation +- 4.4.56 + +-------------------------------------------------------------------- +Fri Nov 12 02:10:45 UTC 2021 - opensuse-packag...@opensuse.org + +- Translated using Weblate (Indonesian) (bsc#1149754) +- 4.4.55 + +-------------------------------------------------------------------- +Sun Oct 31 14:01:15 UTC 2021 - opensuse-packag...@opensuse.org + +- Translated using Weblate (Catalan) (bsc#1149754) +- 4.4.54 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.4.53.tar.xz New: ---- libstorage-ng-4.4.56.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.kcqftt/_old 2021-11-13 22:48:47.141261914 +0100 +++ /var/tmp/diff_new_pack.kcqftt/_new 2021-11-13 22:48:47.145261916 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.4.53 +Version: 4.4.56 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.4.53.tar.xz -> libstorage-ng-4.4.56.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/LIBVERSION new/libstorage-ng-4.4.56/LIBVERSION --- old/libstorage-ng-4.4.53/LIBVERSION 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/LIBVERSION 2021-11-12 13:53:45.000000000 +0100 @@ -1 +1 @@ -1.65.1 +1.66.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/VERSION new/libstorage-ng-4.4.56/VERSION --- old/libstorage-ng-4.4.53/VERSION 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/VERSION 2021-11-12 13:53:45.000000000 +0100 @@ -1 +1 @@ -4.4.53 +4.4.56 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/doc/history.md new/libstorage-ng-4.4.56/doc/history.md --- old/libstorage-ng-4.4.53/doc/history.md 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/doc/history.md 2021-11-12 13:53:45.000000000 +0100 @@ -41,3 +41,10 @@ Included in openSUSE Tumbleweed, replacing legacy libstorage. + +November 2021 +------------- + +Used by [barrel](https://github.com/aschnell/barrel) included in +openSUSE Tumbleweed. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/integration-tests/luks/create.py new/libstorage-ng-4.4.56/integration-tests/luks/create.py --- old/libstorage-ng-4.4.53/integration-tests/luks/create.py 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/integration-tests/luks/create.py 2021-11-12 13:53:45.000000000 +0100 @@ -21,6 +21,7 @@ luks = to_luks(sdc1.create_encryption("cr-test")) luks.set_type(EncryptionType_LUKS2) +luks.set_pbkdf("argon2i") luks.set_format_options("--pbkdf-memory=1024") luks.set_password("12345678") luks.set_label("TOP-SECRET") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/po/ca.po new/libstorage-ng-4.4.56/po/ca.po --- old/libstorage-ng-4.4.53/po/ca.po 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/po/ca.po 2021-11-12 13:53:45.000000000 +0100 @@ -9,16 +9,16 @@ "Project-Id-Version: YaST (@memory@)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-13 15:31+0200\n" -"PO-Revision-Date: 2021-07-09 16:11+0000\n" +"PO-Revision-Date: 2021-10-31 16:12+0000\n" "Last-Translator: David Medina <medi...@gmail.com>\n" -"Language-Team: Catalan <https://l10n.opensuse.org/projects/libstorage/ng-" -"master/ca/>\n" +"Language-Team: Catalan <https://l10n.opensuse.org/projects/libstorage/" +"ng-master/ca/>\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.6.2\n" +"X-Generator: Weblate 4.8.1\n" msgid "" "\n" @@ -2150,9 +2150,8 @@ msgstr "Linux" #. TRANSLATORS: name of partition type -#, fuzzy msgid "Linux Home" -msgstr "Linux" +msgstr "Llar de Linux" #. TRANSLATORS: name of partition type msgid "Linux LVM" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/po/id.po new/libstorage-ng-4.4.56/po/id.po --- old/libstorage-ng-4.4.53/po/id.po 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/po/id.po 2021-11-12 13:53:45.000000000 +0100 @@ -10,16 +10,16 @@ "Project-Id-Version: YaST (@memory@)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-13 15:31+0200\n" -"PO-Revision-Date: 2021-09-04 16:11+0000\n" +"PO-Revision-Date: 2021-11-12 04:13+0000\n" "Last-Translator: Kukuh Syafaat <syafaatku...@gmail.com>\n" -"Language-Team: Indonesian <https://l10n.opensuse.org/projects/libstorage/ng-" -"master/id/>\n" +"Language-Team: Indonesian <https://l10n.opensuse.org/projects/libstorage/" +"ng-master/id/>\n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.7.1\n" +"X-Generator: Weblate 4.8.1\n" msgid "" "\n" @@ -2141,9 +2141,8 @@ msgstr "Linux" #. TRANSLATORS: name of partition type -#, fuzzy msgid "Linux Home" -msgstr "Linux" +msgstr "Beranda Linux" #. TRANSLATORS: name of partition type msgid "Linux LVM" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/BcacheImpl.h new/libstorage-ng-4.4.56/storage/Devices/BcacheImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/BcacheImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/BcacheImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -96,6 +96,8 @@ BcacheType get_type() const { return type; } + virtual string pool_name() const override { return ""; } + CacheMode get_cache_mode() const { return cache_mode; } void set_cache_mode(CacheMode mode) { cache_mode = mode; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/DasdImpl.cc new/libstorage-ng-4.4.56/storage/Devices/DasdImpl.cc --- old/libstorage-ng-4.4.53/storage/Devices/DasdImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/DasdImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -134,6 +134,25 @@ } + string + Dasd::Impl::pool_name() const + { + if (get_type() == DasdType::ECKD) + { + if (get_format() == DasdFormat::CDL) + return "DASDs ECKD CDL"; + else if (get_format() == DasdFormat::LDL) + return "DASDs ECKD LDL"; + } + else if (get_type() == DasdType::FBA) + { + return "DASDs FBA"; + } + + return ""; + } + + vector<PtType> Dasd::Impl::get_possible_partition_table_types() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/DasdImpl.h new/libstorage-ng-4.4.56/storage/Devices/DasdImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/DasdImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/DasdImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -84,6 +84,8 @@ virtual bool is_usable_as_partitionable() const override; + virtual string pool_name() const override; + virtual vector<PtType> get_possible_partition_table_types() const override; static void probe_dasds(Prober& prober); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/DiskImpl.cc new/libstorage-ng-4.4.56/storage/Devices/DiskImpl.cc --- old/libstorage-ng-4.4.53/storage/Devices/DiskImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/DiskImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -147,6 +147,20 @@ } + string + Disk::Impl::pool_name() const + { + if (is_pmem()) + return "PMEMs"; + else if (is_nvme()) + return "NVMes"; + else if (is_brd()) + return "BRDs"; + + return is_rotational() ? "HDDs" : "SSDs"; + } + + void Disk::Impl::probe_disks(Prober& prober) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/DiskImpl.h new/libstorage-ng-4.4.56/storage/Devices/DiskImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/DiskImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/DiskImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -64,6 +64,8 @@ virtual bool is_usable_as_blk_device() const override; virtual bool is_usable_as_partitionable() const override; + virtual string pool_name() const override; + virtual Impl* clone() const override { return new Impl(*this); } virtual void save(xmlNode* node) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/DmRaidImpl.h new/libstorage-ng-4.4.56/storage/Devices/DmRaidImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/DmRaidImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/DmRaidImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -61,6 +61,8 @@ virtual ResizeInfo detect_resize_info(const BlkDevice* blk_device = nullptr) const override; + virtual string pool_name() const override { return ""; } + virtual void save(xmlNode* node) const override; virtual void check(const CheckCallbacks* check_callbacks) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/Encryption.cc new/libstorage-ng-4.4.56/storage/Devices/Encryption.cc --- old/libstorage-ng-4.4.53/storage/Devices/Encryption.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/Encryption.cc 2021-11-12 13:53:45.000000000 +0100 @@ -201,6 +201,20 @@ } + const string& + Encryption::get_pbkdf() const + { + return get_impl().get_pbkdf(); + } + + + void + Encryption::set_pbkdf(const std::string& pbkdf) + { + get_impl().set_pbkdf(pbkdf); + } + + BlkDevice* Encryption::get_blk_device() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/Encryption.h new/libstorage-ng-4.4.56/storage/Devices/Encryption.h --- old/libstorage-ng-4.4.53/storage/Devices/Encryption.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/Encryption.h 2021-11-12 13:53:45.000000000 +0100 @@ -129,6 +129,21 @@ void set_key_size(unsigned int key_size); /** + * Get the PBKDF (of the first used keyslot). + * + * Currently only supported for LUKS2. + */ + const std::string& get_pbkdf() const; + + /** + * Set the PBKDF. Only used during creation. If empty the default of cryptsetup + * will be used. + * + * Currently only supported for LUKS2. + */ + void set_pbkdf(const std::string& pbkdf); + + /** * Get the mount-by method. For encrypted devices the mount-by method * defines the name used for the second parameter in /etc/crypttab. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/EncryptionImpl.cc new/libstorage-ng-4.4.56/storage/Devices/EncryptionImpl.cc --- old/libstorage-ng-4.4.53/storage/Devices/EncryptionImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/EncryptionImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -73,6 +73,7 @@ getChildValue(node, "cipher", cipher); getChildValue(node, "key-size", key_size); + getChildValue(node, "pbkdf", pbkdf); if (getChildValue(node, "mount-by", tmp)) mount_by = toValueWithFallback(tmp, MountByType::DEVICE); @@ -200,6 +201,7 @@ setChildValueIf(node, "cipher", cipher, !cipher.empty()); setChildValueIf(node, "key-size", key_size, key_size != 0); + setChildValueIf(node, "pbkdf", pbkdf, !pbkdf.empty()); setChildValue(node, "mount-by", toString(mount_by)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/EncryptionImpl.h new/libstorage-ng-4.4.56/storage/Devices/EncryptionImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/EncryptionImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/EncryptionImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -83,6 +83,9 @@ unsigned int get_key_size() const { return key_size; } void set_key_size(unsigned int key_size) { Impl::key_size = key_size; } + const string& get_pbkdf() const { return pbkdf; } + void set_pbkdf(const string& pbkdf) { Impl::pbkdf = pbkdf; } + MountByType get_mount_by() const { return mount_by; } void set_mount_by(MountByType mount_by) { Impl::mount_by = mount_by; } @@ -173,6 +176,7 @@ string cipher; unsigned int key_size = 0; + string pbkdf; MountByType mount_by = MountByType::DEVICE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/LuksImpl.cc new/libstorage-ng-4.4.56/storage/Devices/LuksImpl.cc --- old/libstorage-ng-4.4.53/storage/Devices/LuksImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/LuksImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -46,7 +46,7 @@ Luks::Impl::Impl(const xmlNode* node) - : Encryption::Impl(node), uuid(), label(), format_options() + : Encryption::Impl(node) { getChildValue(node, "uuid", uuid); getChildValue(node, "label", label); @@ -410,6 +410,7 @@ luks->get_impl().Encryption::Impl::set_type(cmd_cryptsetup_luks_dump.get_encryption_type()); luks->get_impl().set_cipher(cmd_cryptsetup_luks_dump.get_cipher()); luks->get_impl().set_key_size(cmd_cryptsetup_luks_dump.get_key_size()); + luks->get_impl().set_pbkdf(cmd_cryptsetup_luks_dump.get_pbkdf()); if (crypttab_entry) { @@ -600,6 +601,9 @@ if (get_key_size() != 0) cmd_line += " --key-size " + to_string(get_key_size() * 8); + if (!get_pbkdf().empty()) + cmd_line += " --pbkdf " + quote(get_pbkdf()); + if (!get_format_options().empty()) cmd_line += " " + get_format_options(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/MdImpl.h new/libstorage-ng-4.4.56/storage/Devices/MdImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/MdImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/MdImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -78,6 +78,8 @@ virtual void parent_has_new_region(const Device* parent) override; + virtual string pool_name() const override { return ""; } + bool is_numeric() const; unsigned int get_number() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/MultipathImpl.h new/libstorage-ng-4.4.56/storage/Devices/MultipathImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/MultipathImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/MultipathImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -69,6 +69,8 @@ static bool is_valid_name(const string& name); + virtual string pool_name() const override { return "MPs"; } + const string& get_vendor() const { return vendor; } const string& get_model() const { return model; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/PartitionableImpl.cc new/libstorage-ng-4.4.56/storage/Devices/PartitionableImpl.cc --- old/libstorage-ng-4.4.53/storage/Devices/PartitionableImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/PartitionableImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -299,6 +299,8 @@ string Partitionable::Impl::partition_name(int number) const { + // Note: Seems as if other distros use "p" instead of "-part". + if (boost::starts_with(get_name(), DEV_MAPPER_DIR "/")) return get_name() + "-part" + to_string(number); else if (isdigit(get_name().back())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/Devices/PartitionableImpl.h new/libstorage-ng-4.4.56/storage/Devices/PartitionableImpl.h --- old/libstorage-ng-4.4.53/storage/Devices/PartitionableImpl.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/Devices/PartitionableImpl.h 2021-11-12 13:53:45.000000000 +0100 @@ -74,6 +74,8 @@ virtual string partition_name(int number) const; + virtual string pool_name() const = 0; + virtual bool equal(const Device::Impl& rhs) const override; virtual void log_diff(std::ostream& log, const Device::Impl& rhs_base) const override; virtual void print(std::ostream& out) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/StorageImpl.cc new/libstorage-ng-4.4.56/storage/StorageImpl.cc --- old/libstorage-ng-4.4.53/storage/StorageImpl.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/StorageImpl.cc 2021-11-12 13:53:45.000000000 +0100 @@ -492,44 +492,7 @@ })) continue; - string name; - - if (is_disk(partitionable)) - { - const Disk* disk = to_disk(partitionable); - - if (disk->is_pmem()) - name = "PMEMs"; - else if (disk->is_nvme()) - name = "NVMes"; - else if (disk->get_impl().is_brd()) - name = "BRDs"; - else if (!disk->is_rotational()) - name = "SSDs"; - else - name = "HDDs"; - } - else if (is_multipath(partitionable)) - { - name = "MPs"; - } - else if (is_dasd(partitionable)) - { - const Dasd* dasd = to_dasd(partitionable); - - if (dasd->get_type() == DasdType::ECKD) - { - if (dasd->get_format() == DasdFormat::CDL) - name = "DASDs ECKD CDL"; - else if (dasd->get_format() == DasdFormat::LDL) - name = "DASDs ECKD LDL"; - } - else if (dasd->get_type() == DasdType::FBA) - { - name = "DASDs FBA"; - } - } - + string name = partitionable->get_impl().pool_name(); if (name.empty()) continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/SystemInfo/CmdCryptsetup.cc new/libstorage-ng-4.4.56/storage/SystemInfo/CmdCryptsetup.cc --- old/libstorage-ng-4.4.53/storage/SystemInfo/CmdCryptsetup.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/SystemInfo/CmdCryptsetup.cc 2021-11-12 13:53:45.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2014] Novell, Inc. - * Copyright (c) [2019-2020] SUSE LLC + * Copyright (c) [2019-2021] SUSE LLC * * All Rights Reserved. * @@ -92,7 +92,7 @@ CmdCryptsetupLuksDump::CmdCryptsetupLuksDump(const string& name) - : name(name), encryption_type(EncryptionType::UNKNOWN), cipher(), key_size(0) + : name(name) { SystemCmd cmd(CRYPTSETUP_BIN " luksDump " + quote(name), SystemCmd::DoThrow); @@ -187,10 +187,14 @@ static const regex cipher_regex("[ \t]*cipher:[ \t]*([^ \t]+)[ \t]*", regex::extended); + static const regex keyslot_number_regex("[ \t]*([0-9]+): .*", regex::extended); static const regex key_regex("[ \t]*Key:[ \t]*([0-9]+) bits[ \t]*", regex::extended); + static const regex pbkdf_regex("[ \t]*PBKDF:[ \t]*([^ \t]+)[ \t]*", regex::extended); enum { DATA_SECTION, KEYSLOT_SECTION, UNUSED_SECTION } section = UNUSED_SECTION; + int keyslot_cnt = 0; + smatch match; for (const string& line : lines) @@ -217,10 +221,20 @@ case KEYSLOT_SECTION: { - if (regex_match(line, match, key_regex) && match.size() == 2) + if (regex_match(line, match, keyslot_number_regex)) + ++keyslot_cnt; + + if (keyslot_cnt == 1) { - match[1] >> key_size; - key_size /= 8; + if (regex_match(line, match, key_regex) && match.size() == 2) + { + match[1] >> key_size; + key_size /= 8; + } + else if (regex_match(line, match, pbkdf_regex) && match.size() == 2) + { + pbkdf = match[1]; + } } } break; @@ -243,6 +257,9 @@ << cmd_cryptsetup_luks_dump.cipher << " key-size:" << cmd_cryptsetup_luks_dump.key_size; + if (!cmd_cryptsetup_luks_dump.pbkdf.empty()) + s << " pbkdf:" << cmd_cryptsetup_luks_dump.pbkdf; + return s; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/storage/SystemInfo/CmdCryptsetup.h new/libstorage-ng-4.4.56/storage/SystemInfo/CmdCryptsetup.h --- old/libstorage-ng-4.4.53/storage/SystemInfo/CmdCryptsetup.h 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/storage/SystemInfo/CmdCryptsetup.h 2021-11-12 13:53:45.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2014] Novell, Inc. - * Copyright (c) 2019 SUSE LLC + * Copyright (c) [2019-2021] SUSE LLC * * All Rights Reserved. * @@ -71,6 +71,7 @@ EncryptionType get_encryption_type() const { return encryption_type; } const string& get_cipher() const { return cipher; } unsigned int get_key_size() const { return key_size; } + const string& get_pbkdf() const { return pbkdf; } private: @@ -84,7 +85,7 @@ /** * Either UNKNOWN, LUKS1 or LUKS2 */ - EncryptionType encryption_type; + EncryptionType encryption_type = EncryptionType::UNKNOWN; /** * The cipher, e.g. aes-xts-plain64, twofish-cbc-plain or aes-cbc-plain:sha512. @@ -95,7 +96,12 @@ * The size of the master key, e.g. 32 or 64 bytes. Note: * Usually displayed in bits. */ - unsigned int key_size; + unsigned int key_size = 0; + + /** + * The PBKDF, e.g. argon2i or argon2id, of the first used slot. Only for LUKS2. + */ + string pbkdf; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.53/testsuite/SystemInfo/cryptsetup-luks-dump.cc new/libstorage-ng-4.4.56/testsuite/SystemInfo/cryptsetup-luks-dump.cc --- old/libstorage-ng-4.4.53/testsuite/SystemInfo/cryptsetup-luks-dump.cc 2021-10-26 09:19:39.000000000 +0200 +++ new/libstorage-ng-4.4.56/testsuite/SystemInfo/cryptsetup-luks-dump.cc 2021-11-12 13:53:45.000000000 +0100 @@ -123,7 +123,7 @@ }; vector<string> output = { - "name:/dev/sdc1 encryption-type:luks2 cipher:aes-xts-plain64 key-size:64" + "name:/dev/sdc1 encryption-type:luks2 cipher:aes-xts-plain64 key-size:64 pbkdf:argon2i" }; check("/dev/sdc1", input, output); @@ -177,8 +177,80 @@ }; vector<string> output = { - "name:/dev/dasdb1 encryption-type:luks2 cipher:paes-xts-plain64 key-size:128" + "name:/dev/dasdb1 encryption-type:luks2 cipher:paes-xts-plain64 key-size:128 pbkdf:argon2i" }; check("/dev/dasdb1", input, output); } + + +BOOST_AUTO_TEST_CASE(parse4_two_keyslots) +{ + vector<string> input = { + "LUKS header information", + "Version: 2", + "Epoch: 4", + "Metadata area: 16384 [bytes]", + "Keyslots area: 16744448 [bytes]", + "UUID: 30c4e059-7c30-4913-9c89-2d18bb818c87", + "Label: (no label)", + "Subsystem: (no subsystem)", + "Flags: (no flags)", + "", + "Data segments:", + " 0: crypt", + " offset: 16777216 [bytes]", + " length: (whole device)", + " cipher: aes-xts-plain64", + " sector: 4096 [bytes]", + "", + "Keyslots:", + " 0: luks2", + " Key: 512 bits", + " Priority: normal", + " Cipher: aes-xts-plain64", + " Cipher key: 512 bits", + " PBKDF: argon2id", + " Time cost: 10", + " Memory: 1048576", + " Threads: 4", + " Salt: df 02 b0 b5 07 32 7c 21 ec 78 23 e8 94 06 fd fe ", + " 3f 38 23 03 97 dd 17 fd 1c b9 55 06 59 a5 bf a2 ", + " AF stripes: 4000", + " AF hash: sha256", + " Area offset:32768 [bytes]", + " Area length:258048 [bytes]", + " Digest ID: 0", + " 1: luks2", + " Key: 512 bits", + " Priority: normal", + " Cipher: aes-xts-plain64", + " Cipher key: 256 bits", + " PBKDF: argon2i", + " Time cost: 9", + " Memory: 1048576", + " Threads: 4", + " Salt: f7 e6 6a be 6a 05 38 57 cb 6a 1f 91 00 b9 e4 ab ", + " bd dd 69 e7 2f c3 97 ee 99 3d a4 ba e8 6c d0 a8 ", + " AF stripes: 4000", + " AF hash: sha256", + " Area offset:290816 [bytes]", + " Area length:258048 [bytes]", + " Digest ID: 0", + "Tokens:", + "Digests:", + " 0: pbkdf2", + " Hash: sha256", + " Iterations: 136818", + " Salt: f0 d5 dd a7 ba 83 53 77 2f 62 89 ad 9b 87 03 46 ", + " c7 c1 84 c9 bb 83 06 d0 7a c2 d5 fb 6b 6f 42 89 ", + " Digest: 5b da 8b c4 58 69 29 61 aa 77 1a 48 17 99 ef 6e ", + " 37 ba e2 64 35 c4 61 e0 27 38 98 61 0a fb 13 e1 " + }; + + vector<string> output = { + "name:/dev/ram0p1 encryption-type:luks2 cipher:aes-xts-plain64 key-size:64 pbkdf:argon2id" + }; + + check("/dev/ram0p1", input, output); +}