[Pkg-loop-aes-commits] r1370 - in /upstream/loop-aes/current: ChangeLog Makefile README aes-x86.S dkms.conf gnupg-1.4.2.diff gnupg-1.4.3.diff kernel-2.4.32.diff kernel-2.6.15.diff kernel-2.6.16.diff loop.c-2.4.patched util-linux-2.12r.diff

xam at users.alioth.debian.org xam at users.alioth.debian.org
Sun Feb 25 12:22:39 CET 2007


Author: xam
Date: Sun Feb 25 12:22:39 2007
New Revision: 1370

URL: http://svn.debian.org/wsvn/pkg-loop-aes/?sc=1&rev=1370
Log:
Import loop-AES v3.1d

Added:
    upstream/loop-aes/current/gnupg-1.4.3.diff
      - copied, changed from r1367, upstream/loop-aes/current/gnupg-1.4.2.diff
    upstream/loop-aes/current/kernel-2.6.16.diff
      - copied, changed from r1368, upstream/loop-aes/current/kernel-2.6.15.diff
Removed:
    upstream/loop-aes/current/gnupg-1.4.2.diff
    upstream/loop-aes/current/kernel-2.6.15.diff
Modified:
    upstream/loop-aes/current/ChangeLog
    upstream/loop-aes/current/Makefile
    upstream/loop-aes/current/README
    upstream/loop-aes/current/aes-x86.S
    upstream/loop-aes/current/dkms.conf
    upstream/loop-aes/current/kernel-2.4.32.diff
    upstream/loop-aes/current/loop.c-2.4.patched
    upstream/loop-aes/current/util-linux-2.12r.diff

Modified: upstream/loop-aes/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/ChangeLog?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/ChangeLog (original)
+++ upstream/loop-aes/current/ChangeLog Sun Feb 25 12:22:39 2007
@@ -468,3 +468,15 @@
       handling them.
     - Semaphores are not used/needed anymore on 2.6 kernels.
     - Makefile changed to work around 2.6.16-rc1 build breakage.
+
+loop-AES-v3.1d    April 10 2006
+    - Fixed Makefile incompatibility with USE_KBUILD=y build option.
+    - Fixed incompatibility with CONFIG_PAX_KERNEXEC=y PAX config option.
+    - Fixed incompatibility with old SuSE 8.0 kernel that caused scheduler
+      interface to be misdetected.
+    - Changed mount to honor offset=N and sizelimit=N mount options when
+      they were used in combination with random keys generating phash=random
+      mount option. Old encrypted data is used in new keys generation, but
+      earlier buggy version always read and erased old data at offset=0.
+    - Added mount patch from Max Vozeler that makes it easier to first fsck
+      and then mount encrypted file systems.

Modified: upstream/loop-aes/current/Makefile
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/Makefile?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/Makefile (original)
+++ upstream/loop-aes/current/Makefile Sun Feb 25 12:22:39 2007
@@ -1,7 +1,7 @@
 #
 #  Makefile
 #
-#  Written by Jari Ruusu, January 6 2006
+#  Written by Jari Ruusu, January 27 2006
 #
 #  Copyright 2001-2006 by Jari Ruusu.
 #  Redistribution of this file is permitted under the GNU Public License.
@@ -118,10 +118,12 @@
 	SR1:=$(shell if grep -q -s "^basename_flags.*KBUILD_BASENAME.*KBUILD_STR" $(LS)/scripts/Makefile.lib; then echo y; fi)
 endif
 
+ifneq ($(USE_KBUILD),y)
 ifeq ($(SR1),y)
 	EF += -D"KBUILD_STR(s)=\#s"
 else
 	EF += -D"KBUILD_STR(s)=s"
+endif
 endif
 
 ifeq ($(KEYSCRUB),y)

Modified: upstream/loop-aes/current/README
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/README?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/README (original)
+++ upstream/loop-aes/current/README Sun Feb 25 12:22:39 2007
@@ -1,6 +1,6 @@
-Written by Jari Ruusu <jariruusu at users.sourceforge.net>, September 24 2005
-
-Copyright 2001-2005 by Jari Ruusu.
+Written by Jari Ruusu <jariruusu at users.sourceforge.net>, April 10 2006
+
+Copyright 2001-2006 by Jari Ruusu.
 Redistribution of this file is permitted under the GNU Public License.
 
 
@@ -364,9 +364,9 @@
 These commands, as root user, will recompile and install gpg and gpgv and
 their man pages:
 
-    zcat gnupg-1.4.2.tar.gz | tar xvf -
-    cd gnupg-1.4.2
-    patch -p1 <../gnupg-1.4.2.diff
+    zcat gnupg-1.4.3.tar.gz | tar xvf -
+    cd gnupg-1.4.3
+    patch -p1 <../gnupg-1.4.3.diff
     CFLAGS="-O2" LDFLAGS="-static -s" ./configure --prefix=/usr --enable-static-rnd=linux
     make
     rm -f /usr/share/man/man1/{gpg,gpgv}.1.gz
@@ -1261,8 +1261,8 @@
 
 2.6 kernels include anticipatory (the default) and deadline I/O schedulers.
 Deadline I/O scheduler may improve performance of device backed loop
-devices. Please read kernel's Documentation/as-iosched.txt file for more
-information.
+devices. Please read kernel's Documentation/block/as-iosched.txt file for
+more information.
 
 
 10. Files

Modified: upstream/loop-aes/current/aes-x86.S
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/aes-x86.S?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/aes-x86.S (original)
+++ upstream/loop-aes/current/aes-x86.S Sun Feb 25 12:22:39 2007
@@ -718,6 +718,7 @@
 //
 // Here is precomputed output (it's more portable this way):
 
+	.section .rodata
 	.align	ALIGN32BYTES
 aes_rcon_tab:
 	.long	0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80

Modified: upstream/loop-aes/current/dkms.conf
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/dkms.conf?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/dkms.conf (original)
+++ upstream/loop-aes/current/dkms.conf Sun Feb 25 12:22:39 2007
@@ -1,7 +1,7 @@
 # dkms.conf for Dynamic Kernel Module Support
 # http://linux.dell.com/dkms/dkms.html for more info
 
-PACKAGE_VERSION=v3.1c
+PACKAGE_VERSION=v3.1d
 
 # Items below here should not have to change with each driver version
 PACKAGE_NAME="loop-AES"

Copied: upstream/loop-aes/current/gnupg-1.4.3.diff (from r1367, upstream/loop-aes/current/gnupg-1.4.2.diff)
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/gnupg-1.4.3.diff?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/gnupg-1.4.2.diff (original)
+++ upstream/loop-aes/current/gnupg-1.4.3.diff Sun Feb 25 12:22:39 2007
@@ -1,6 +1,6 @@
---- gnupg-1.4.2/g10/passphrase.c.old	2005-07-26 18:54:18.000000000 +0300
-+++ gnupg-1.4.2/g10/passphrase.c	2005-07-29 19:10:34.000000000 +0300
-@@ -1030,7 +1030,7 @@
+--- gnupg-1.4.3/g10/passphrase.c.old	2006-01-26 17:31:03.000000000 +0200
++++ gnupg-1.4.3/g10/passphrase.c	2006-04-03 20:36:45.000000000 +0300
+@@ -1036,7 +1036,7 @@
  	    if( create && !pass ) {
  		randomize_buffer(s2k->salt, 8, 1);
  		if( s2k->mode == 3 )

Modified: upstream/loop-aes/current/kernel-2.4.32.diff
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/kernel-2.4.32.diff?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/kernel-2.4.32.diff (original)
+++ upstream/loop-aes/current/kernel-2.4.32.diff Sun Feb 25 12:22:39 2007
@@ -55,7 +55,7 @@
  tristate 'RAM disk support' CONFIG_BLK_DEV_RAM
 diff -urN linux-2.4.32-noloop/drivers/block/loop.c linux-2.4.32-AES/drivers/block/loop.c
 --- linux-2.4.32-noloop/drivers/block/loop.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/block/loop.c	2005-11-18 18:12:26.000000000 +0200
++++ linux-2.4.32-AES/drivers/block/loop.c	2006-01-27 15:36:39.000000000 +0200
 @@ -0,0 +1,2271 @@
 +/*
 + *  linux/drivers/block/loop.c
@@ -975,7 +975,7 @@
 + * This is loop helper thread nice value in range
 + * from 0 (low priority) to -20 (high priority).
 + */
-+#if defined(DEF_NICE) && defined(DEF_COUNTER)
++#if defined(DEF_NICE)
 +static int lo_nice = -20;   /* old scheduler default */
 +#else
 +static int lo_nice = -1;    /* O(1) scheduler default */
@@ -1450,7 +1450,7 @@
 +		lo_nice = 0;
 +	if (lo_nice < -20)
 +		lo_nice = -20;
-+#if defined(DEF_NICE) && defined(DEF_COUNTER)
++#if defined(DEF_NICE)
 +	/* old scheduler syntax */
 +	current->policy = SCHED_OTHER;
 +	current->nice = lo_nice;
@@ -3266,8 +3266,8 @@
 +	im_data7(v3)
 diff -urN linux-2.4.32-noloop/drivers/misc/aes-x86.S linux-2.4.32-AES/drivers/misc/aes-x86.S
 --- linux-2.4.32-noloop/drivers/misc/aes-x86.S	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/aes-x86.S	2005-11-18 18:12:26.000000000 +0200
-@@ -0,0 +1,922 @@
++++ linux-2.4.32-AES/drivers/misc/aes-x86.S	2006-02-22 14:22:34.000000000 +0200
+@@ -0,0 +1,923 @@
 +//
 +// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
 +// All rights reserved.
@@ -3988,6 +3988,7 @@
 +//
 +// Here is precomputed output (it's more portable this way):
 +
++	.section .rodata
 +	.align	ALIGN32BYTES
 +aes_rcon_tab:
 +	.long	0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80

Copied: upstream/loop-aes/current/kernel-2.6.16.diff (from r1368, upstream/loop-aes/current/kernel-2.6.15.diff)
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/kernel-2.6.16.diff?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/kernel-2.6.15.diff (original)
+++ upstream/loop-aes/current/kernel-2.6.16.diff Sun Feb 25 12:22:39 2007
@@ -3,9 +3,9 @@
 
     rm -f drivers/block/loop.c include/linux/loop.h
 
-diff -urN linux-2.6.15-noloop/drivers/block/Kconfig linux-2.6.15-AES/drivers/block/Kconfig
---- linux-2.6.15-noloop/drivers/block/Kconfig	2006-01-03 16:26:46.000000000 +0200
-+++ linux-2.6.15-AES/drivers/block/Kconfig	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/block/Kconfig linux-2.6.16-AES/drivers/block/Kconfig
+--- linux-2.6.16-noloop/drivers/block/Kconfig	2006-03-20 19:48:36.000000000 +0200
++++ linux-2.6.16-AES/drivers/block/Kconfig	2006-03-20 19:56:36.000000000 +0200
 @@ -285,14 +285,6 @@
  	  bits of, say, a sound file). This is also safe if the file resides
  	  on a remote file server.
@@ -65,9 +65,9 @@
  
  config BLK_DEV_NBD
  	tristate "Network block device support"
-diff -urN linux-2.6.15-noloop/drivers/block/Makefile linux-2.6.15-AES/drivers/block/Makefile
---- linux-2.6.15-noloop/drivers/block/Makefile	2006-01-03 16:26:47.000000000 +0200
-+++ linux-2.6.15-AES/drivers/block/Makefile	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/block/Makefile linux-2.6.16-AES/drivers/block/Makefile
+--- linux-2.6.16-noloop/drivers/block/Makefile	2006-01-03 16:26:47.000000000 +0200
++++ linux-2.6.16-AES/drivers/block/Makefile	2006-03-20 19:56:36.000000000 +0200
 @@ -1,6 +1,9 @@
  #
  # Makefile for the kernel block device drivers.
@@ -78,9 +78,9 @@
  # 12 June 2000, Christoph Hellwig <hch at infradead.org>
  # Rewritten to use lists instead of if-statements.
  # 
-diff -urN linux-2.6.15-noloop/drivers/block/loop.c linux-2.6.15-AES/drivers/block/loop.c
---- linux-2.6.15-noloop/drivers/block/loop.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/block/loop.c	2006-01-12 20:22:48.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/block/loop.c linux-2.6.16-AES/drivers/block/loop.c
+--- linux-2.6.16-noloop/drivers/block/loop.c	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/block/loop.c	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,2795 @@
 +/*
 + *  linux/drivers/block/loop.c
@@ -2877,9 +2877,9 @@
 +}
 +EXPORT_SYMBOL(loop_add_keyscrub_fn);
 +#endif
-diff -urN linux-2.6.15-noloop/drivers/misc/Makefile linux-2.6.15-AES/drivers/misc/Makefile
---- linux-2.6.15-noloop/drivers/misc/Makefile	2005-06-18 11:22:48.000000000 +0300
-+++ linux-2.6.15-AES/drivers/misc/Makefile	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/Makefile linux-2.6.16-AES/drivers/misc/Makefile
+--- linux-2.6.16-noloop/drivers/misc/Makefile	2005-06-18 11:22:48.000000000 +0300
++++ linux-2.6.16-AES/drivers/misc/Makefile	2006-03-20 19:56:36.000000000 +0200
 @@ -1,6 +1,28 @@
  #
  # Makefile for misc devices that really don't fit anywhere else.
@@ -2909,9 +2909,9 @@
  obj- := misc.o	# Dummy rule to force built-in.o to be made
  
  obj-$(CONFIG_IBM_ASM)	+= ibmasm/
-diff -urN linux-2.6.15-noloop/drivers/misc/aes-amd64.S linux-2.6.15-AES/drivers/misc/aes-amd64.S
---- linux-2.6.15-noloop/drivers/misc/aes-amd64.S	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/aes-amd64.S	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/aes-amd64.S linux-2.6.16-AES/drivers/misc/aes-amd64.S
+--- linux-2.6.16-noloop/drivers/misc/aes-amd64.S	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/aes-amd64.S	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,893 @@
 +//
 +// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
@@ -3806,10 +3806,10 @@
 +	im_data5(v3)
 +	im_data6(v3)
 +	im_data7(v3)
-diff -urN linux-2.6.15-noloop/drivers/misc/aes-x86.S linux-2.6.15-AES/drivers/misc/aes-x86.S
---- linux-2.6.15-noloop/drivers/misc/aes-x86.S	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/aes-x86.S	2006-01-03 17:27:14.000000000 +0200
-@@ -0,0 +1,922 @@
+diff -urN linux-2.6.16-noloop/drivers/misc/aes-x86.S linux-2.6.16-AES/drivers/misc/aes-x86.S
+--- linux-2.6.16-noloop/drivers/misc/aes-x86.S	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/aes-x86.S	2006-03-20 19:56:36.000000000 +0200
+@@ -0,0 +1,923 @@
 +//
 +// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
 +// All rights reserved.
@@ -4530,6 +4530,7 @@
 +//
 +// Here is precomputed output (it's more portable this way):
 +
++	.section .rodata
 +	.align	ALIGN32BYTES
 +aes_rcon_tab:
 +	.long	0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
@@ -4732,9 +4733,9 @@
 +	im_data5(v3)
 +	im_data6(v3)
 +	im_data7(v3)
-diff -urN linux-2.6.15-noloop/drivers/misc/aes.c linux-2.6.15-AES/drivers/misc/aes.c
---- linux-2.6.15-noloop/drivers/misc/aes.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/aes.c	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/aes.c linux-2.6.16-AES/drivers/misc/aes.c
+--- linux-2.6.16-noloop/drivers/misc/aes.c	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/aes.c	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,1479 @@
 +// I retain copyright in this code but I encourage its free use provided
 +// that I don't carry any responsibility for the results. I am especially 
@@ -6215,9 +6216,9 @@
 +
 +    state_out(out_blk, b0);
 +}
-diff -urN linux-2.6.15-noloop/drivers/misc/aes.h linux-2.6.15-AES/drivers/misc/aes.h
---- linux-2.6.15-noloop/drivers/misc/aes.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/aes.h	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/aes.h linux-2.6.16-AES/drivers/misc/aes.h
+--- linux-2.6.16-noloop/drivers/misc/aes.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/aes.h	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,113 @@
 +// I retain copyright in this code but I encourage its free use provided
 +// that I don't carry any responsibility for the results. I am especially 
@@ -6332,9 +6333,9 @@
 +// if their parameters have not changed.
 +
 +#endif  // _AES_H
-diff -urN linux-2.6.15-noloop/drivers/misc/crypto-ksym.c linux-2.6.15-AES/drivers/misc/crypto-ksym.c
---- linux-2.6.15-noloop/drivers/misc/crypto-ksym.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/crypto-ksym.c	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/crypto-ksym.c linux-2.6.16-AES/drivers/misc/crypto-ksym.c
+--- linux-2.6.16-noloop/drivers/misc/crypto-ksym.c	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/crypto-ksym.c	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,7 @@
 +#include <linux/module.h>
 +#include "aes.h"
@@ -6343,9 +6344,9 @@
 +EXPORT_SYMBOL(aes_encrypt);
 +EXPORT_SYMBOL(aes_decrypt);
 +EXPORT_SYMBOL(md5_transform_CPUbyteorder);
-diff -urN linux-2.6.15-noloop/drivers/misc/md5-amd64.S linux-2.6.15-AES/drivers/misc/md5-amd64.S
---- linux-2.6.15-noloop/drivers/misc/md5-amd64.S	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/md5-amd64.S	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/md5-amd64.S linux-2.6.16-AES/drivers/misc/md5-amd64.S
+--- linux-2.6.16-noloop/drivers/misc/md5-amd64.S	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/md5-amd64.S	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,200 @@
 +//
 +//  md5-amd64.S
@@ -6547,9 +6548,9 @@
 +	addl	%ecx,8(%rdi)
 +	addl	%edx,12(%rdi)
 +	ret
-diff -urN linux-2.6.15-noloop/drivers/misc/md5-x86.S linux-2.6.15-AES/drivers/misc/md5-x86.S
---- linux-2.6.15-noloop/drivers/misc/md5-x86.S	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/md5-x86.S	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/md5-x86.S linux-2.6.16-AES/drivers/misc/md5-x86.S
+--- linux-2.6.16-noloop/drivers/misc/md5-x86.S	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/md5-x86.S	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,207 @@
 +//
 +//  md5-x86.S
@@ -6758,9 +6759,9 @@
 +	pop	%ebx
 +	pop	%ebp
 +	ret
-diff -urN linux-2.6.15-noloop/drivers/misc/md5.c linux-2.6.15-AES/drivers/misc/md5.c
---- linux-2.6.15-noloop/drivers/misc/md5.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/md5.c	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/md5.c linux-2.6.16-AES/drivers/misc/md5.c
+--- linux-2.6.16-noloop/drivers/misc/md5.c	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/md5.c	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,106 @@
 +/*
 + * MD5 Message Digest Algorithm (RFC1321).
@@ -6868,9 +6869,9 @@
 +    hash[2] += c;
 +    hash[3] += d;
 +}
-diff -urN linux-2.6.15-noloop/drivers/misc/md5.h linux-2.6.15-AES/drivers/misc/md5.h
---- linux-2.6.15-noloop/drivers/misc/md5.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/drivers/misc/md5.h	2006-01-03 17:27:14.000000000 +0200
+diff -urN linux-2.6.16-noloop/drivers/misc/md5.h linux-2.6.16-AES/drivers/misc/md5.h
+--- linux-2.6.16-noloop/drivers/misc/md5.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/drivers/misc/md5.h	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,11 @@
 +/* md5.h */
 +
@@ -6883,9 +6884,9 @@
 + asmlinkage
 +#endif
 +extern void md5_transform_CPUbyteorder(u_int32_t *, u_int32_t const *);
-diff -urN linux-2.6.15-noloop/include/linux/loop.h linux-2.6.15-AES/include/linux/loop.h
---- linux-2.6.15-noloop/include/linux/loop.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.15-AES/include/linux/loop.h	2006-01-12 20:22:48.000000000 +0200
+diff -urN linux-2.6.16-noloop/include/linux/loop.h linux-2.6.16-AES/include/linux/loop.h
+--- linux-2.6.16-noloop/include/linux/loop.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.16-AES/include/linux/loop.h	2006-03-20 19:56:36.000000000 +0200
 @@ -0,0 +1,167 @@
 +#ifndef _LINUX_LOOP_H
 +#define _LINUX_LOOP_H

Modified: upstream/loop-aes/current/loop.c-2.4.patched
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/loop.c-2.4.patched?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/loop.c-2.4.patched (original)
+++ upstream/loop-aes/current/loop.c-2.4.patched Sun Feb 25 12:22:39 2007
@@ -222,7 +222,7 @@
  * This is loop helper thread nice value in range
  * from 0 (low priority) to -20 (high priority).
  */
-#if defined(DEF_NICE) && defined(DEF_COUNTER)
+#if defined(DEF_NICE)
 static int lo_nice = -20;   /* old scheduler default */
 #else
 static int lo_nice = -1;    /* O(1) scheduler default */
@@ -748,7 +748,7 @@
 		lo_nice = 0;
 	if (lo_nice < -20)
 		lo_nice = -20;
-#if defined(DEF_NICE) && defined(DEF_COUNTER)
+#if defined(DEF_NICE)
 	/* old scheduler syntax */
 	current->policy = SCHED_OTHER;
 	current->nice = lo_nice;

Modified: upstream/loop-aes/current/util-linux-2.12r.diff
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/util-linux-2.12r.diff?rev=1370&op=diff
==============================================================================
--- upstream/loop-aes/current/util-linux-2.12r.diff (original)
+++ upstream/loop-aes/current/util-linux-2.12r.diff Sun Feb 25 12:22:39 2007
@@ -470,7 +470,7 @@
 +#endif  // _AES_H
 diff -urN util-linux-2.12r/mount/lomount.c util-linux-2.12r-AES/mount/lomount.c
 --- util-linux-2.12r/mount/lomount.c	2004-12-21 00:11:04.000000000 +0200
-+++ util-linux-2.12r-AES/mount/lomount.c	2005-09-24 14:48:53.000000000 +0300
++++ util-linux-2.12r-AES/mount/lomount.c	2006-04-09 09:45:15.000000000 +0300
 @@ -1,4 +1,15 @@
 -/* Originally from Ted's losetup.c */
 +/* Taken from Ted's losetup.c - Mitch <m.dsouza at mrc-apu.cam.ac.uk> */
@@ -602,7 +602,7 @@
  
  	if ((fd = open(device, O_RDONLY)) < 0) {
  		int errsv = errno;
-@@ -74,70 +104,60 @@
+@@ -74,73 +104,64 @@
  			device, strerror (errsv));
  		return 2;
  	}
@@ -707,11 +707,11 @@
 -	return 1;
 -}
 -#endif
--
+ 
 -int
 -is_loop_device (const char *device) {
 -	struct stat statbuf;
- 
+-
 -	return (stat(device, &statbuf) == 0 &&
 -		S_ISBLK(statbuf.st_mode) &&
 -		major(statbuf.st_rdev) == LOOPMAJOR);
@@ -721,7 +721,11 @@
  
  #define SIZE(a) (sizeof(a)/sizeof(a[0]))
  
-@@ -148,9 +168,8 @@
++#if !defined(MAIN)
+ char *
+ find_unused_loop_device (void) {
+ 	/* Just creating a device, say in /tmp, is probably a bad idea -
+@@ -148,9 +169,8 @@
  	   So, we just try /dev/loop[0-7]. */
  	char dev[20];
  	char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
@@ -732,7 +736,7 @@
  
  	for (j = 0; j < SIZE(loop_formats); j++) {
  	    for(i = 0; i < 256; i++) {
-@@ -159,16 +178,14 @@
+@@ -159,16 +179,14 @@
  			somedev++;
  			fd = open (dev, O_RDONLY);
  			if (fd >= 0) {
@@ -751,7 +755,7 @@
  			continue;/* continue trying as long as devices exist */
  		}
  		break;
-@@ -176,75 +193,571 @@
+@@ -176,75 +194,609 @@
  	}
  
  	if (!somedev)
@@ -803,6 +807,28 @@
 -		}
 -		if (read(pfd, pass+i, 1) != 1 ||
 -		    pass[i] == '\n' || pass[i] == 0)
++int is_loop_active(const char *dev, const char *backdev)
++{
++	int fd;
++	int ret = 0;
++	struct stat statbuf;
++	struct loop_info64 loopinfo;
++	if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
++		fd = open (dev, O_RDONLY);
++		if (fd < 0)
++			return 0;
++		if ((loop_get_status64_ioctl(fd, &loopinfo) == 0)
++		    && (stat (backdev, &statbuf) == 0)
++		    && (statbuf.st_dev == loopinfo.lo_device)
++		    && (statbuf.st_ino == loopinfo.lo_inode))
++			ret = 1; /* backing device matches */
++		memset(&loopinfo, 0, sizeof(loopinfo));
++		close(fd);
++	}
++	return ret;
++}
++#endif
++
 +static int rd_wr_retry(int fd, char *buf, int cnt, int w)
 +{
 +	int x, y, z;
@@ -1055,7 +1081,7 @@
 +		}
 +		if(strlen(multiKeyPass[x]) < LOOP_PASSWORD_MIN_LENGTH) break;
 +		x++;
-+	}
+ 	}
 +	warnAboutBadKeyData(x);
 +	if(x >= 65)
 +		multiKeyMode = 65;
@@ -1066,12 +1092,16 @@
 +	if(!multiKeyPass[0]) goto nomem1;
 +	return multiKeyPass[0];
 +}
-+
+ 
+-	if (pass == NULL)
+-		return "";
 +static char *sGetPass(int minLen, int warnLen)
 +{
 +	char *p, *s, *seed;
 +	int i, ask2;
-+
+ 
+-	pass[i] = 0;
+-	return pass;
 +	if(!passFDnumber) {
 +		p = getpass(_("Password: "));
 +		ask2 = passAskTwice ? 1 : 0;
@@ -1146,24 +1176,26 @@
 +			return(NULL);
 +		}
 +		memset(p, 0, i);
- 	}
++	}
 +	if(i < warnLen) {
 +		fprintf(stderr, _("WARNING - Please use longer password (%d or more characters)\n"), LOOP_PASSWORD_MIN_LENGTH);
 +	}
 +	strcat(s, seed);
 +	return(s);
-+}
- 
--	if (pass == NULL)
--		return "";
+ }
+ 
+-static int
+-digits_only(const char *s) {
+-	while (*s)
+-		if (!isdigit(*s++))
+-			return 0;
+-	return 1;
 +/* this is for compatibility with historic loop-AES version */
 +static void unhashed1_key_setup(unsigned char *keyStr, int ile, unsigned char *keyBuf, int bufSize)
 +{
 +	register int    x, y, z, cnt = ile;
 +	unsigned char   *kp;
- 
--	pass[i] = 0;
--	return pass;
++
 +	memset(keyBuf, 0, bufSize);
 +	kp = keyStr;
 +	for(x = 0; x < (bufSize * 8); x += 6) {
@@ -1186,22 +1218,16 @@
 +			keyBuf[z] |= y >> (8 - (x & 7));
 +		}
 +	}
- }
- 
--static int
--digits_only(const char *s) {
--	while (*s)
--		if (!isdigit(*s++))
--			return 0;
--	return 1;
++}
++
 +/* this is for compatibility with mainline mount */
 +static void unhashed2_key_setup(unsigned char *keyStr, int ile, unsigned char *keyBuf, int bufSize)
 +{
 +	memset(keyBuf, 0, bufSize);
 +	strncpy((char *)keyBuf, (char *)keyStr, bufSize - 1);
 +	keyBuf[bufSize - 1] = 0;
-+}
-+
+ }
+ 
 +static void rmd160HashTwiceWithA(unsigned char *ib, int ile, unsigned char *ob, int ole)
 +{
 +	char tmpBuf[20 + 20];
@@ -1220,12 +1246,22 @@
 +	memset(pwdCopy, 0, sizeof(pwdCopy));
 +}
 +
-+static int loop_create_random_keys(char *partition, int loopro, unsigned char *k)
++extern long long llseek(int, long long, int);
++
++static long long xx_lseek(int fd, long long offset, int whence)
 +{
-+	int x, y;
++	if(sizeof(off_t) >= 8) {
++		return lseek(fd, offset, whence);
++	} else {
++		return llseek(fd, offset, whence);
++	}
++}
++
++static int loop_create_random_keys(char *partition, long long offset, long long sizelimit, int loopro, unsigned char *k)
++{
++	int x, y, fd;
 +	sha512_context s;
 +	unsigned char b[4096];
-+	FILE *f;
 +
 +	if(loopro) {
 +		fprintf(stderr, _("Error: read-only device %s\n"), partition);
@@ -1236,14 +1272,20 @@
 +	 * Compute SHA-512 over first 40 KB of old fs data. SHA-512 hash
 +	 * output is then used as entropy for new fs encryption key.
 +	 */
-+	if(!(f = fopen(partition, "r+"))) {
-+		fprintf(stderr, _("Error: unable to open device %s\n"), partition);
++	if((fd = open(partition, O_RDWR)) == -1) {
++		seekFailed:
++		fprintf(stderr, _("Error: unable to open/seek device %s\n"), partition);
 +		return 1;
 +	}
-+	fseek(f, (long)0, SEEK_SET);
++	if(offset < 0) offset = -offset;
++	if(xx_lseek(fd, offset, SEEK_SET) == -1) {
++		close(fd);
++		goto seekFailed;
++	}
 +	sha512_init(&s);
-+	for(x = 0; x < 10; x++) {
-+		if(fread(&b[0], sizeof(b), 1, f) != 1) break;
++	for(x = 1; x <= 10; x++) {
++		if((sizelimit > 0) && ((sizeof(b) * x) > sizelimit)) break;
++		if(rd_wr_retry(fd, &b[0], sizeof(b), 0) != sizeof(b)) break;
 +		sha512_write(&s, &b[0], sizeof(b));
 +	}
 +	sha512_final(&s);
@@ -1259,23 +1301,23 @@
 +			unsigned char h[64];
 +			int x,y,z;
 +		} j;
-+		if(fseek(f, (long)0, SEEK_SET)) break;
++		if(xx_lseek(fd, offset, SEEK_SET) == -1) break;
 +		memcpy(&j.h[0], &s.sha_out[0], 64);
 +		gettimeofday(&j.tv, NULL);
 +		j.y = y;
-+		for(x = 0; x < 10; x++) {
++		for(x = 1; x <= 10; x++) {
 +			j.x = x;
 +			for(z = 0; z < sizeof(b); z += 64) {
 +				j.z = z;
 +				sha512_hash_buffer((unsigned char *)&j, sizeof(j), &b[z], 64);
 +			}
-+			if(fwrite(&b[0], sizeof(b), 1, f) != 1) break;
++			if((sizelimit > 0) && ((sizeof(b) * x) > sizelimit)) break;
++			if(rd_wr_retry(fd, &b[0], sizeof(b), 1) != sizeof(b)) break;
 +		}
 +		memset(&j, 0, sizeof(j));
-+		if(fflush(f)) break;
-+		if(fsync(fileno(f))) break;
-+	}
-+	fclose(f);
++		if(fsync(fd)) break;
++	}
++	close(fd);
 +
 +	/*
 +	 * Use all 512 bits of hash output
@@ -1290,22 +1332,22 @@
 +	 * SHA-512 of old fs data is used as workaround for missing
 +	 * entropy in kernel's random number generator.
 +	 */
-+	if(!(f = fopen("/dev/urandom", "r"))) {
++	if((fd = open("/dev/urandom", O_RDONLY)) == -1) {
 +		fprintf(stderr, _("Error: unable to open /dev/urandom\n"));
 +		return 1;
 +	}
-+	fread(&b[64], 32, 1, f);
++	rd_wr_retry(fd, &b[64], 32, 0);
 +
 +	/* generate multi-key hashes */
 +	x = 0;
 +	while(x < 65) {
-+		fread(&b[64+32], 16, 1, f);
++		rd_wr_retry(fd, &b[64+32], 16, 0);
 +		sha512_hash_buffer(&b[0], 64+32+16, k, 32);
 +		k += 32;
 +		x++;
 +	}
 +
-+	fclose(f);
++	close(fd);
 +	memset(&b[0], 0, sizeof(b));
 +	return 0;
 +}
@@ -1354,9 +1396,9 @@
 +		return 1;
 +	}
 +	return 0;
- }
++}
 +#endif
- 
++
  int
 -set_loop(const char *device, const char *file, unsigned long long offset,
 -	 const char *encryption, int pfd, int *loopro) {
@@ -1376,7 +1418,7 @@
  	mode = (*loopro ? O_RDONLY : O_RDWR);
  	if ((ffd = open(file, mode)) < 0) {
  		if (!*loopro && errno == EROFS)
-@@ -256,32 +769,25 @@
+@@ -256,32 +808,25 @@
  	}
  	if ((fd = open(device, mode)) < 0) {
  		perror (device);
@@ -1388,15 +1430,7 @@
 -	memset(&loopinfo64, 0, sizeof(loopinfo64));
 -
 -	xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
-+	memset (&loopinfo, 0, sizeof (loopinfo));
-+	xstrncpy ((char *)loopinfo.lo_file_name, file, LO_NAME_SIZE);
-+	if (loopEncryptionType)
-+		loopinfo.lo_encrypt_type = loop_crypt_type (loopEncryptionType, &loopinfo.lo_encrypt_key_size, &apiName);
-+	if (loopOffsetBytes)
-+		loopinfo.lo_offset = mystrtoull(loopOffsetBytes, 1);
-+	if (loopSizeBytes)
-+		loopinfo.lo_sizelimit = mystrtoull(loopSizeBytes, 0);
- 
+-
 -	if (encryption && *encryption) {
 -		if (digits_only(encryption)) {
 -			loopinfo64.lo_encrypt_type = atoi(encryption);
@@ -1406,7 +1440,15 @@
 -				 "%s", encryption);
 -		}
 -	}
--
++	memset (&loopinfo, 0, sizeof (loopinfo));
++	xstrncpy ((char *)loopinfo.lo_file_name, file, LO_NAME_SIZE);
++	if (loopEncryptionType)
++		loopinfo.lo_encrypt_type = loop_crypt_type (loopEncryptionType, &loopinfo.lo_encrypt_key_size, &apiName);
++	if (loopOffsetBytes)
++		loopinfo.lo_offset = mystrtoull(loopOffsetBytes, 1);
++	if (loopSizeBytes)
++		loopinfo.lo_sizelimit = mystrtoull(loopSizeBytes, 0);
+ 
 -	loopinfo64.lo_offset = offset;
 -
 -#ifdef MCL_FUTURE  
@@ -1420,7 +1462,7 @@
  	if(mlockall(MCL_CURRENT | MCL_FUTURE)) {
  		perror("memlock");
  		fprintf(stderr, _("Couldn't lock into memory, exiting.\n"));
-@@ -289,126 +795,223 @@
+@@ -289,126 +834,223 @@
  	}
  #endif
  
@@ -1478,7 +1520,7 @@
 +				/* random hash type sets up 65 random keys */
 +				/* WARNING! DO NOT USE RANDOM HASH TYPE ON PARTITION WITH EXISTING */
 +				/* IMPORTANT DATA ON IT. RANDOM HASH TYPE WILL DESTROY YOUR DATA.  */
-+				if(loop_create_random_keys((char*)file, *loopro, &multiKeyBits[0][0])) {
++				if(loop_create_random_keys((char*)file, loopinfo.lo_offset, loopinfo.lo_sizelimit, *loopro, &multiKeyBits[0][0])) {
 +					goto close_fd_ffd_return1;
 +				}
 +				memcpy(&loopinfo.lo_encrypt_key[0], &multiKeyBits[0][0], sizeof(loopinfo.lo_encrypt_key));
@@ -1733,7 +1775,7 @@
  	exit(1);
  }
  
-@@ -439,107 +1042,247 @@
+@@ -439,107 +1081,247 @@
  	fprintf (stderr, "\n");
  }
  
@@ -1986,9 +2028,21 @@
 -	} else if (find) {
 -		if (argc < optind || argc > optind+1)
 -			usage();
--	} else {
++		/* delete loop */
++		if (argc != optind+1) usage();
++		res = del_loop(argv[optind]);
++	} else if (option_R) {
++		/* resize existing loop */
++		if (argc != optind+1) usage();
++		res = recompute_loop_dev_size(argv[optind]);
++	} else if ((argc == optind+1) && !setup_o) {
++		/* show one loop */
++		res = show_loop(argv[optind]);
+ 	} else {
 -		if (argc < optind+1 || argc > optind+2)
--			usage();
++		/* set up new loop */
++		if ((argc < optind+1) || ((argc == optind+1) && !option_F) || (argc > optind+2))
+ 			usage();
 -	}
 -
 -	if (find) {
@@ -2002,17 +2056,7 @@
 -			return 0;
 -		}
 -		file = argv[optind];
-+		/* delete loop */
-+		if (argc != optind+1) usage();
-+		res = del_loop(argv[optind]);
-+	} else if (option_R) {
-+		/* resize existing loop */
-+		if (argc != optind+1) usage();
-+		res = recompute_loop_dev_size(argv[optind]);
-+	} else if ((argc == optind+1) && !setup_o) {
-+		/* show one loop */
-+		res = show_loop(argv[optind]);
- 	} else {
+-	} else {
 -		device = argv[optind];
 -		if (argc == optind+1)
 -			file = NULL;
@@ -2026,9 +2070,7 @@
 -		res = show_loop(device);
 -	else {
 -		if (offset && sscanf(offset, "%llu", &off) != 1)
-+		/* set up new loop */
-+		if ((argc < optind+1) || ((argc == optind+1) && !option_F) || (argc > optind+2))
- 			usage();
+-			usage();
 -		if (passfd && sscanf(passfd, "%d", &pfd) != 1)
 -			usage();
 -		res = set_loop(device, file, off, encryption, pfd, &ro);
@@ -2054,14 +2096,15 @@
  #endif
 diff -urN util-linux-2.12r/mount/lomount.h util-linux-2.12r-AES/mount/lomount.h
 --- util-linux-2.12r/mount/lomount.h	2004-07-11 20:23:46.000000000 +0300
-+++ util-linux-2.12r-AES/mount/lomount.h	2005-09-24 14:48:53.000000000 +0300
-@@ -1,6 +1,17 @@
++++ util-linux-2.12r-AES/mount/lomount.h	2006-04-09 09:45:15.000000000 +0300
+@@ -1,6 +1,18 @@
  extern int verbose;
 -extern int set_loop(const char *, const char *, unsigned long long,
 -		    const char *, int, int *);
 +extern int set_loop(const char *, const char *, int *, const char **, unsigned int *);
  extern int del_loop(const char *);
  extern int is_loop_device(const char *);
++extern int is_loop_active(const char *, const char *);
  extern char * find_unused_loop_device(void);
 +
 +extern char *passFDnumber;
@@ -2806,7 +2849,7 @@
  .B mount
 diff -urN util-linux-2.12r/mount/mount.c util-linux-2.12r-AES/mount/mount.c
 --- util-linux-2.12r/mount/mount.c	2004-12-22 00:00:36.000000000 +0200
-+++ util-linux-2.12r-AES/mount/mount.c	2005-09-24 14:48:53.000000000 +0300
++++ util-linux-2.12r-AES/mount/mount.c	2006-04-09 09:45:15.000000000 +0300
 @@ -11,6 +11,7 @@
  #include <string.h>
  #include <getopt.h>
@@ -2872,7 +2915,18 @@
    *loopfile = *spec;
  
    if (*loop) {
-@@ -624,9 +628,7 @@
+@@ -615,6 +619,10 @@
+     if (fake) {
+       if (verbose)
+ 	printf(_("mount: skipping the setup of a loop device\n"));
++    } else if (*loopdev && is_loop_active(*loopdev, *loopfile)) {
++      if (verbose)
++	printf(_("mount: skipping the setup of a loop device\n"));
++      *spec = *loopdev;
+     } else {
+       int loopro = (*flags & MS_RDONLY);
+ 
+@@ -624,9 +632,7 @@
  	return EX_SYSERR;	/* no more loop devices */
        if (verbose)
  	printf(_("mount: going to use the loop device %s\n"), *loopdev);
@@ -2883,7 +2937,7 @@
  	if (verbose)
  	  printf(_("mount: failed setting up loop device\n"));
  	return EX_FAIL;
-@@ -687,14 +689,6 @@
+@@ -687,14 +693,6 @@
  }
  
  static void
@@ -2898,7 +2952,7 @@
  cdrom_setspeed(const char *spec) {
  #define CDROM_SELECT_SPEED      0x5322  /* Set the CD-ROM speed */
  	if (opt_speed) {
-@@ -788,6 +782,7 @@
+@@ -788,6 +786,7 @@
    const char *opts, *spec, *node, *types;
    char *user = 0;
    int loop = 0;
@@ -2906,7 +2960,7 @@
    const char *loopdev = 0, *loopfile = 0;
    struct stat statbuf;
    int nfs_mount_version = 0;	/* any version */
-@@ -820,7 +815,7 @@
+@@ -820,7 +819,7 @@
         * stale assignments of files to loop devices. Nasty when used for
         * encryption.
         */
@@ -2915,7 +2969,7 @@
        if (res)
  	  goto out;
    }
-@@ -855,9 +850,20 @@
+@@ -855,9 +854,20 @@
  
    block_signals (SIG_BLOCK);
  
@@ -2937,7 +2991,7 @@
  
    if (fake || mnt5_res == 0) {
        /* Mount succeeded, report this (if verbose) and write mtab entry.  */
-@@ -1530,8 +1536,8 @@
+@@ -1530,8 +1540,8 @@
  			else
  				test_opts = xstrdup(optarg);
  			break;




More information about the Pkg-loop-aes-commits mailing list