From d4434c05e7c0cf05d87089404cfa2deedc60811a Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Mon, 29 Oct 2018 16:47:40 +0100 Subject: [PATCH] crypto: Add support for LUKS2 Cryptsetup version 2.0 added support for LUKS2. This patch adds support for mounting LUKS2 volumes with pam_mount. Signed-off-by: Ingo Franzki --- src/crypto-dmc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/crypto-dmc.c b/src/crypto-dmc.c index d0ab6ca..abd0358 100644 --- a/src/crypto-dmc.c +++ b/src/crypto-dmc.c @@ -21,6 +21,12 @@ #include "libcryptmount.h" #include "pam_mount.h" +#ifndef CRYPT_LUKS + #define CRYPT_LUKS NULL /* Passing NULL to crypt_load will + default to LUKS(1) on older + libcryptsetup versions. */ +#endif + /** * dmc_is_luks - check if @path points to a LUKS volume (cf. normal dm-crypt) * @path: path to the crypto container @@ -48,7 +54,7 @@ EXPORT_SYMBOL int ehd_is_luks(const char *path, bool blkdev) ret = crypt_init(&cd, device); if (ret == 0) { - ret = crypt_load(cd, CRYPT_LUKS1, NULL); + ret = crypt_load(cd, CRYPT_LUKS, NULL); if (ret == -EINVAL) ret = false; else if (ret == 0) @@ -106,7 +112,7 @@ static bool dmc_run(const struct ehd_mount_request *req, #endif } - ret = crypt_load(cd, CRYPT_LUKS1, NULL); + ret = crypt_load(cd, CRYPT_LUKS, NULL); if (ret == 0) { ret = crypt_activate_by_passphrase(cd, mt->crypto_name, CRYPT_ANY_SLOT, req->key_data, req->key_size, flags); -- 2.21.0 get' action='/guix/log/gnu/compression.scm'>
s='left'>Author
AgeCommit message (Expand)Author
2021-04-20import: Remove Nix importer....This importer has suffered from bitrot and no longer works with current Nix and Nixpkgs. See <https://bugs.gnu.org/32339> and <https://bugs.gnu.org/36255>. * guix/import/snix.scm, guix/scripts/import/nix.scm, tests/snix.scm: Remove. * Makefile.am (MODULES, SCM_TESTS): Remove them. * guix/scripts/import.scm (importers): Remove "nix". * build-aux/test-env.in: Remove NIXPKGS variable. * configure.ac: Remove '--with-nixpkgs' option. * doc/guix.texi (Invoking guix import): Remove bit about "guix import nix". * etc/completion/fish/guix.fish: Likewise. Ludovic Courtès
2019-10-16build: Remove references to 'NIX_LOCALSTATE_DIR'....* build-aux/test-env.in: Remove references to 'NIX_LOCALSTATE_DIR'. Ludovic Courtès
2019-10-16daemon: Remove traces of 'NIX_ROOT_FINDER'....This is a followup to 2e3e5d21988fc2cafb2a9eaf4b00976ea425629d. * build-aux/test-env.in: Remove mentions of 'NIX_ROOT_FINDER'. * nix/libstore/gc.cc (LocalStore::collectGarbage): Adjust comment accordingly. Ludovic Courtès
2019-02-04daemon: Rename 'NIX_STATE_DIR' and 'NIX_DB_DIR' environment variables....Fixes <https://bugs.gnu.org/22459>. Reported by Jeff Mickey <j@codemac.net>. * guix/config.scm.in (%state-directory): Change NIX_STATE_DIR to GUIX_STATE_DIRECTORY. (%store-database-directory): Change NIX_DB_DIR to GUIX_DATABASE_DIRECTORY. * nix/libstore/globals.cc (Settings::processEnvironment): Likewise. * guix/self.scm (make-config.scm): Likewise. * build-aux/build-self.scm (make-config.scm): Likewise. * build-aux/test-env.in: Likewise. * tests/derivations.scm ("derivation #:leaked-env-vars"): Likewise. * tests/guix-build.sh (GUIX_DAEMON_SOCKET): Likewise. * tests/guix-daemon.sh (socket): Likewise. Ludovic Courtès
2018-05-13build: 'test-env' does not 'guix download' non-existent files....Reported by uniq10. * build-aux/test-env.in: Check whether FILE exists before invoking 'guix download'. Ludovic Courtès
2018-04-22build: Fix possible race condition in 'test-env'....Reported by Mark H Weaver <mhw@netris.org>. * build-aux/test-env.in: Add 'guile' invocation before 'guix download' invocation to make sure 'guix-daemon' is listening. Ludovic Courtès
2017-08-28build: Remove code to download the Guile bootstrap tarball....* build-aux/download.scm: Remove. * Makefile.am (EXTRA_DIST): Remove it. (check-system): Remove dependency on $(BOOTSTRAP_GUILE_TARBALLS). * gnu/local.mk (nodist_bootstrap_x86_64_linux_DATA) (nodist_bootstrap_i686_linux_DATA, nodist_bootstrap_armhf_linux_DATA) (nodist_bootstrap_aarch64_linux_DATA, nodist_bootstrap_mips64el_linux_DATA) (BOOTSTRAP_GUILE_TARBALLS, DISTCLEANFILES, DOWNLOAD_FILE) (%D%/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz) (%D%/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz) (%D%/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz) (%D%/packages/bootstrap/aarch64-linux/guile-2.0.14.tar.xz) (%D%/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz): Remove. * build-aux/test-env.in: Add "guix download" invocation when gnu/packages/bootstrap/guile* exists. Ludovic Courtès