]> git.proxmox.com Git - systemd.git/commitdiff
Replace cryptsetup fix with upstream commit
authorMartin Pitt <martin.pitt@ubuntu.com>
Fri, 17 Apr 2015 15:57:42 +0000 (10:57 -0500)
committerMartin Pitt <martin.pitt@ubuntu.com>
Fri, 17 Apr 2015 15:57:42 +0000 (10:57 -0500)
debian/patches/cryptsetup-Implement-offset-and-skip-options.patch
debian/patches/series

index 086a46375c901811a15f538ae898f096b25a84e6..91f1a7ffc8e991db3c17c653810a42c180087314 100644 (file)
@@ -11,11 +11,47 @@ https://bugs.freedesktop.org/show_bug.cgi?id=87717
 https://bugs.debian.org/751707
 https://launchpad.net/bugs/953875
 ---
- src/cryptsetup/cryptsetup.c | 21 +++++++++++++++++++--
- 1 file changed, 19 insertions(+), 2 deletions(-)
+ man/crypttab.xml            | 24 ++++++++++++++++++++++++
+ src/cryptsetup/cryptsetup.c | 31 ++++++++++++++++++++++++++++---
+ 2 files changed, 52 insertions(+), 3 deletions(-)
 
+diff --git a/man/crypttab.xml b/man/crypttab.xml
+index 3e249ad..d4ff760 100644
+--- a/man/crypttab.xml
++++ b/man/crypttab.xml
+@@ -146,6 +146,30 @@
+       </varlistentry>
+       <varlistentry>
++        <term><option>offset=</option></term>
++
++        <listitem><para>Start offset in the backend device, in 512-byte sectors.
++        This option is only relevant for plain devices.
++        </para></listitem>
++      </varlistentry>
++
++      <varlistentry>
++        <term><option>skip=</option></term>
++
++        <listitem><para>How many 512-byte sectors of the encrypted data to skip
++        at the beginning. This is different from the <option>--offset</option>
++        option with respect to the sector numbers used in initialization vector
++        (IV) calculation. Using <option>--offset</option> will shift the IV
++        calculation by the same negative amount.  Hence, if <option>--offset n</option>,
++        sector n will  get a sector number of 0 for the IV calculation.
++        Using <option>--skip</option> causes sector n to also be the first
++        sector of the mapped device, but with its number for IV generation is n.</para>
++
++        <para>This option is only relevant for plain devices.</para>
++        </listitem>
++      </varlistentry>
++
++      <varlistentry>
+         <term><option>keyfile-offset=</option></term>
+         <listitem><para>Specifies the number of bytes to skip at the
 diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
-index 3f613d9..8b56a10 100644
+index 3f613d9..ab67674 100644
 --- a/src/cryptsetup/cryptsetup.c
 +++ b/src/cryptsetup/cryptsetup.c
 @@ -51,12 +51,12 @@ static bool arg_discards = false;
@@ -54,13 +90,30 @@ index 3f613d9..8b56a10 100644
          } else if (!streq(option, "none"))
                  log_error("Encountered unknown /etc/crypttab option '%s', ignoring.", option);
  
-@@ -428,6 +442,9 @@ static int attach_luks_or_plain(struct crypt_device *cd,
-                          * package is to not hash when a key file is provided */
-                         params.hash = "ripemd160";
+@@ -210,6 +224,14 @@ static int parse_options(const char *options) {
+                         return r;
+         }
  
-+                params.offset = arg_offset;
-+                params.skip = arg_skip;
++        /* sanity-check options */
++        if (arg_type != NULL && !streq(arg_type, CRYPT_PLAIN)) {
++                if (arg_offset)
++                      log_warning("offset= ignored with type %s", arg_type);
++                if (arg_skip)
++                      log_warning("skip= ignored with type %s", arg_type);
++        }
 +
-                 if (arg_cipher) {
-                         size_t l;
+         return 0;
+ }
+@@ -415,7 +437,10 @@ static int attach_luks_or_plain(struct crypt_device *cd,
+         }
+         if ((!arg_type && r < 0) || streq_ptr(arg_type, CRYPT_PLAIN)) {
+-                struct crypt_params_plain params = {};
++                struct crypt_params_plain params = {
++                        .offset = arg_offset,
++                        .skip = arg_skip,
++                };
+                 const char *cipher, *cipher_mode;
+                 _cleanup_free_ char *truncated_cipher = NULL;
  
index 7c3e27361af2883eed9f51aaa2253267d747c3cf..a1e016ca6772da2ec1e732c837025f9fb943c3bf 100644 (file)
@@ -4,6 +4,7 @@ sysv-generator-fix-wrong-Overwriting-existing-symlin.patch
 Add-gettext-support.patch
 units-move-After-systemd-hwdb-update.service-depende.patch
 timesyncd-enable-timesyncd-in-virtual-machines.patch
+cryptsetup-Implement-offset-and-skip-options.patch
 
 ## Debian specific patches
 Add-back-support-for-Debian-specific-config-files.patch
@@ -63,4 +64,3 @@ syslog-Increase-max_dgram_qlen-by-pulling-in-systemd.patch
 fsckd-daemon-for-inter-fsckd-communication.patch
 Add-fsckd-po-files.patch
 Skip-filesystem-check-if-already-done-by-the-initram.patch
-cryptsetup-Implement-offset-and-skip-options.patch