All of lore.kernel.org
 help / color / mirror / Atom feed
* add IV generation method null
@ 2007-02-16 14:21 Ludwig Nussel
  2007-02-28 14:47 ` Ludwig Nussel
  0 siblings, 1 reply; 4+ messages in thread
From: Ludwig Nussel @ 2007-02-16 14:21 UTC (permalink / raw)
  To: Alasdair G Kergon; +Cc: device-mapper development, Christophe Saout

Hi,

Following patch (against SUSE's 2.6.18) adds the IV generation
method 'null' to be able to read old filesystem images created with
SuSE's loop_fish2 module.

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Acked-By: Christophe Saout <christophe@saout.de>

--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -103,6 +103,8 @@ static kmem_cache_t *_crypt_io_pool;
  *         encrypted with the bulk cipher using a salt as key. The salt
  *         should be derived from the bulk cipher's key via hashing.
  *
+ * null: For mounting legacy images only.
+ *
  * plumb: unimplemented, see:
  * http://article.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/454
  */
@@ -203,6 +205,13 @@ static int crypt_iv_essiv_gen(struct cry
 	return 0;
 }
 
+static int crypt_iv_null_gen(struct crypt_config *cc, u8 *iv, sector_t sector)
+{
+	memset(iv, 0, cc->iv_size);
+
+	return 0;
+}
+
 static struct crypt_iv_operations crypt_iv_plain_ops = {
 	.generator = crypt_iv_plain_gen
 };
@@ -213,6 +222,9 @@ static struct crypt_iv_operations crypt_
 	.generator = crypt_iv_essiv_gen
 };
 
+static struct crypt_iv_operations crypt_iv_null_ops = {
+	.generator = crypt_iv_null_gen
+};
 
 static int
 crypt_convert_scatterlist(struct crypt_config *cc, struct scatterlist *out,
@@ -594,6 +606,8 @@ static int crypt_ctr(struct dm_target *t
 		cc->iv_gen_ops = &crypt_iv_plain_ops;
 	else if (strcmp(ivmode, "essiv") == 0)
 		cc->iv_gen_ops = &crypt_iv_essiv_ops;
+	else if (strcmp(ivmode, "null") == 0)
+		cc->iv_gen_ops = &crypt_iv_null_ops;
 	else {
 		ti->error = "Invalid IV mode";
 		goto bad2;

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE Labs
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add IV generation method null
  2007-02-16 14:21 add IV generation method null Ludwig Nussel
@ 2007-02-28 14:47 ` Ludwig Nussel
  2007-03-01 14:41   ` Alasdair G Kergon
  0 siblings, 1 reply; 4+ messages in thread
From: Ludwig Nussel @ 2007-02-28 14:47 UTC (permalink / raw)
  To: dm-devel

Ludwig Nussel wrote:
> Following patch (against SUSE's 2.6.18) adds the IV generation
> method 'null' to be able to read old filesystem images created with
> SuSE's loop_fish2 module.

Any comments/objections on the patch? Is there any additional action
from my side required to get this into the mainline kernel?

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE Labs
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add IV generation method null
  2007-02-28 14:47 ` Ludwig Nussel
@ 2007-03-01 14:41   ` Alasdair G Kergon
  2007-03-01 15:16     ` Ludwig Nussel
  0 siblings, 1 reply; 4+ messages in thread
From: Alasdair G Kergon @ 2007-03-01 14:41 UTC (permalink / raw)
  To: dm-devel

On Wed, Feb 28, 2007 at 03:47:54PM +0100, Ludwig Nussel wrote:
> Any comments/objections on the patch? Is there any additional action
> from my side required to get this into the mainline kernel?

This comment ought to be more descriptive:

  null: For mounting legacy images only.


I'll include it in the next set of patches I send upstream.
 
Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add IV generation method null
  2007-03-01 14:41   ` Alasdair G Kergon
@ 2007-03-01 15:16     ` Ludwig Nussel
  0 siblings, 0 replies; 4+ messages in thread
From: Ludwig Nussel @ 2007-03-01 15:16 UTC (permalink / raw)
  To: dm-devel

Alasdair G Kergon wrote:
> On Wed, Feb 28, 2007 at 03:47:54PM +0100, Ludwig Nussel wrote:
> > Any comments/objections on the patch? Is there any additional action
> > from my side required to get this into the mainline kernel?
> 
> This comment ought to be more descriptive:
> 
>   null: For mounting legacy images only.

Ok, patch with better comment included.

> I'll include it in the next set of patches I send upstream.

Thanks! :-)

Add IV generation method 'null' to be able to read old filesystem
images created with SuSE's loop_fish2 module.

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Acked-By: Christophe Saout <christophe@saout.de>

--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -103,6 +103,10 @@ static kmem_cache_t *_crypt_io_pool;
  *         encrypted with the bulk cipher using a salt as key. The salt
  *         should be derived from the bulk cipher's key via hashing.
  *
+ * null: the initial vector is always zero. This method is for
+ *       compatability with SuSE's obsolete loop_fish2 only. Do not
+ *       use it for creating new content.
+ *
  * plumb: unimplemented, see:
  * http://article.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/454
  */
@@ -203,6 +207,13 @@ static int crypt_iv_essiv_gen(struct cry
 	return 0;
 }
 
+static int crypt_iv_null_gen(struct crypt_config *cc, u8 *iv, sector_t sector)
+{
+	memset(iv, 0, cc->iv_size);
+
+	return 0;
+}
+
 static struct crypt_iv_operations crypt_iv_plain_ops = {
 	.generator = crypt_iv_plain_gen
 };
@@ -213,6 +224,9 @@ static struct crypt_iv_operations crypt_
 	.generator = crypt_iv_essiv_gen
 };
 
+static struct crypt_iv_operations crypt_iv_null_ops = {
+	.generator = crypt_iv_null_gen
+};
 
 static int
 crypt_convert_scatterlist(struct crypt_config *cc, struct scatterlist *out,
@@ -594,6 +608,8 @@ static int crypt_ctr(struct dm_target *t
 		cc->iv_gen_ops = &crypt_iv_plain_ops;
 	else if (strcmp(ivmode, "essiv") == 0)
 		cc->iv_gen_ops = &crypt_iv_essiv_ops;
+	else if (strcmp(ivmode, "null") == 0)
+		cc->iv_gen_ops = &crypt_iv_null_ops;
 	else {
 		ti->error = "Invalid IV mode";
 		goto bad2;

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE Labs
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-01 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16 14:21 add IV generation method null Ludwig Nussel
2007-02-28 14:47 ` Ludwig Nussel
2007-03-01 14:41   ` Alasdair G Kergon
2007-03-01 15:16     ` Ludwig Nussel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.