[Pkg-loop-aes-commits] r1372 - in /upstream/loop-aes/current:
ChangeLog README build-initrd.sh
dkms.conf gnupg-1.4.3.diff gnupg-1.4.5.diff kernel-2.4.32.diff
kernel-2.4.33.diff kernel-2.6.16.diff kernel-2.6.18.diff loop.c-2.6.patched
util-linux-2.12r.diff
xam at users.alioth.debian.org
xam at users.alioth.debian.org
Sun Feb 25 12:25:40 CET 2007
Author: xam
Date: Sun Feb 25 12:25:39 2007
New Revision: 1372
URL: http://svn.debian.org/wsvn/pkg-loop-aes/?sc=1&rev=1372
Log:
Import loop-AES v3.1e
Added:
upstream/loop-aes/current/gnupg-1.4.5.diff
- copied, changed from r1370, upstream/loop-aes/current/gnupg-1.4.3.diff
upstream/loop-aes/current/kernel-2.4.33.diff
- copied, changed from r1370, upstream/loop-aes/current/kernel-2.4.32.diff
upstream/loop-aes/current/kernel-2.6.18.diff
- copied, changed from r1370, upstream/loop-aes/current/kernel-2.6.16.diff
Removed:
upstream/loop-aes/current/gnupg-1.4.3.diff
upstream/loop-aes/current/kernel-2.4.32.diff
upstream/loop-aes/current/kernel-2.6.16.diff
Modified:
upstream/loop-aes/current/ChangeLog
upstream/loop-aes/current/README
upstream/loop-aes/current/build-initrd.sh
upstream/loop-aes/current/dkms.conf
upstream/loop-aes/current/loop.c-2.6.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=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/ChangeLog (original)
+++ upstream/loop-aes/current/ChangeLog Sun Feb 25 12:25:39 2007
@@ -480,3 +480,15 @@
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.
+
+loop-AES-v3.1e October 28 2006
+ - Changed swapon program to use getpagesize() instead of PAGE_SIZE
+ macro. Fixes build failure on some architectures. Patch form Max
+ Vozeler.
+ - Fixed some confusing bits in README. Fix from Jens Lechtenboerger.
+ - Work around vanished <linux/config.h> in 2.6.19-rc2 kernel. Fixes
+ build failure.
+ - Changed loop code to use kthread_create() instead of kernel_thread()
+ on 2.6.19-rc and newer kernels.
+ - Changed losetup and mount programs to output error message if gpg
+ program does not exist when gpg encrypted key file is used.
Modified: upstream/loop-aes/current/README
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/README?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/README (original)
+++ upstream/loop-aes/current/README Sun Feb 25 12:25:39 2007
@@ -1,4 +1,4 @@
-Written by Jari Ruusu <jariruusu at users.sourceforge.net>, April 10 2006
+Written by Jari Ruusu <jariruusu at users.sourceforge.net>, October 28 2006
Copyright 2001-2006 by Jari Ruusu.
Redistribution of this file is permitted under the GNU Public License.
@@ -96,23 +96,20 @@
the loop device. Multi-key-v2 mode uses cryptographically more secure MD5 IV
and 64 different AES keys to encrypt and decrypt sectors in the loop device.
In multi-key mode first key is used for first sector, second key for second
-sector, and so on. Multi-key-v3 is same as multi-key-v2 except is uses one
-extra 65th key as additional input to MD5 IV computation.
-
-Password string has a minimum length of 20 characters. Optional password
-seed (salt) and key iteration count can be used to slow down dictionary
-attacks. Password seed is appended to user supplied password before password
-is hashed using one way hash. If password iteration count is specified,
-password hash output is encrypted N thousand times using AES-256. Unique
-seed prevents an adversary from precomputing hashes of passwords in his
-dictionary in advance, and thus making an optimized attack slower. Large
-password iteration count makes dictionary attack painfully slow.
-
-If encryption type is specified as AES128 or AES, password string is hashed
-with SHA-256, and 128 bit AES encryption is used. If encryption type is
-specified as AES192, password string is hashed with SHA-384, and 192 bit AES
-encryption is used. If encryption type is specified as AES256, password
-string is hashed with SHA-512, and 256 bit AES encryption is used.
+sector, and so on. Multi-key-v3 is same as multi-key-v2 except that it uses
+one extra 65th key as additional input to MD5 IV computation.
+
+Recommended key setup mode is multi-key-v3, which is based on gpg encrypted
+key files. In this mode, the passphrase is protected against optimized
+dictionary attacks via salting and key iteration of gpg. Passphrase length
+should be 20 characters or more.
+
+If encryption type is specified as AES128 or AES, gpg decrypted key strings
+are hashed with SHA-256, and 128 bit AES encryption is used. If encryption
+type is specified as AES192, gpg decrypted key strings are hashed with
+SHA-384, and 192 bit AES encryption is used. If encryption type is specified
+as AES256, gpg decrypted key strings are hashed with SHA-512, and 256 bit
+AES encryption is used.
2.2. Use of journaling file systems on loop device
@@ -245,6 +242,7 @@
To compile and install loop.o driver, as root, use commands:
+ cd /PATH/TO/LOOP-AES
make clean
make
@@ -321,7 +319,7 @@
These commands, as root user, will recompile and install mount, umount,
losetup, swapon, swapoff and their man pages:
- bzip2 -d -c util-linux-2.12r.tar.gz | tar xvf -
+ bzip2 -d -c util-linux-2.12r.tar.bz2 | tar xvf -
cd util-linux-2.12r
patch -p1 </PATH/TO/LOOP-AES/util-linux-2.12r.diff
CFLAGS=-O2 ./configure
@@ -364,15 +362,16 @@
These commands, as root user, will recompile and install gpg and gpgv and
their man pages:
- zcat gnupg-1.4.3.tar.gz | tar xvf -
- cd gnupg-1.4.3
- patch -p1 <../gnupg-1.4.3.diff
+ bzip2 -d -c gnupg-1.4.5.tar.bz2 | tar xvf -
+ cd gnupg-1.4.5
+ patch -p1 </PATH/TO/LOOP-AES/gnupg-1.4.5.diff
CFLAGS="-O2" LDFLAGS="-static -s" ./configure --prefix=/usr --enable-static-rnd=linux
make
rm -f /usr/share/man/man1/{gpg,gpgv}.1.gz
make install
chown root:root /usr/bin/gpg
chmod 4755 /usr/bin/gpg
+ cd ..
Note: Above instructions create statically linked version of gpg. Static
linking is necessary if you ever decide to encrypt your root partition.
@@ -391,8 +390,9 @@
6. Testing the loop.o driver and losetup program
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Run this command, as root, and Makefile will run series of tests.
-
+Run these commands, as root, and Makefile will run series of tests.
+
+ cd /PATH/TO/LOOP-AES
make tests
Makefile will display "*** Test results ok ***" message if tests are
@@ -548,6 +548,14 @@
losetup -F /dev/loop3
fsck -t ext2 -f -y /dev/loop3
losetup -d /dev/loop3
+
+Although mount point directory is not a symbolic link, it should be thought
+of as changing symbolic link, where mounting and unmounting changes target
+of symbolic link. It matters whether mount point path name is referenced
+before or after mount operation. Commands "cd /mnt666 ; mount /mnt666 ; ls"
+will show you contents of unencrypted mount point directory, and commands
+"mount /mnt666 ; cd /mnt666 ; ls" will show you contents of encrypted file
+system directory.
7.3. Example 3 - Encrypted partition that multiple users can mount
Modified: upstream/loop-aes/current/build-initrd.sh
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/build-initrd.sh?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/build-initrd.sh (original)
+++ upstream/loop-aes/current/build-initrd.sh Sun Feb 25 12:25:39 2007
@@ -2,9 +2,9 @@
#
# build-initrd.sh
#
-# Written by Jari Ruusu, September 17 2005
-#
-# Copyright 2001-2005 by Jari Ruusu.
+# Written by Jari Ruusu, September 23 2006
+#
+# Copyright 2001-2006 by Jari Ruusu.
# Redistribution of this file is permitted under the GNU Public License.
#
# Changes by Hauke Johannknecht <ash at ash.de> 11/2001
@@ -87,9 +87,11 @@
CIPHERTYPE=AES128
# Optional password seed for root partition
+# (this option is obsolete when gpg encrypted key file is used)
#PSEED="-S XXXXXX"
# Optional password iteration count for root partition
+# (this option is obsolete when gpg encrypted key file is used)
#ITERCOUNTK="-C 100"
# This code is passed to cipher transfer function.
Modified: upstream/loop-aes/current/dkms.conf
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/dkms.conf?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/dkms.conf (original)
+++ upstream/loop-aes/current/dkms.conf Sun Feb 25 12:25: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.1d
+PACKAGE_VERSION=v3.1e
# Items below here should not have to change with each driver version
PACKAGE_NAME="loop-AES"
Copied: upstream/loop-aes/current/gnupg-1.4.5.diff (from r1370, upstream/loop-aes/current/gnupg-1.4.3.diff)
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/gnupg-1.4.5.diff?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/gnupg-1.4.3.diff (original)
+++ upstream/loop-aes/current/gnupg-1.4.5.diff Sun Feb 25 12:25:39 2007
@@ -1,5 +1,5 @@
---- 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
+--- gnupg-1.4.5/g10/passphrase.c.old 2006-07-31 13:57:07.000000000 +0300
++++ gnupg-1.4.5/g10/passphrase.c 2006-08-04 20:43:44.000000000 +0300
@@ -1036,7 +1036,7 @@
if( create && !pass ) {
randomize_buffer(s2k->salt, 8, 1);
Copied: upstream/loop-aes/current/kernel-2.4.33.diff (from r1370, 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.33.diff?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/kernel-2.4.32.diff (original)
+++ upstream/loop-aes/current/kernel-2.4.33.diff Sun Feb 25 12:25:39 2007
@@ -3,9 +3,9 @@
rm -f drivers/block/loop.c include/linux/loop.h
-diff -urN linux-2.4.32-noloop/Documentation/Configure.help linux-2.4.32-AES/Documentation/Configure.help
---- linux-2.4.32-noloop/Documentation/Configure.help 2005-11-18 17:42:38.000000000 +0200
-+++ linux-2.4.32-AES/Documentation/Configure.help 2005-11-18 18:12:25.000000000 +0200
+diff -urN linux-2.4.33-noloop/Documentation/Configure.help linux-2.4.33-AES/Documentation/Configure.help
+--- linux-2.4.33-noloop/Documentation/Configure.help 2006-08-12 19:04:12.000000000 +0300
++++ linux-2.4.33-AES/Documentation/Configure.help 2006-08-12 19:21:58.000000000 +0300
@@ -622,6 +622,27 @@
If unsure, say N.
@@ -34,9 +34,9 @@
ATA/IDE/MFM/RLL support
CONFIG_IDE
If you say Y here, your kernel will be able to manage low cost mass
-diff -urN linux-2.4.32-noloop/drivers/block/Config.in linux-2.4.32-AES/drivers/block/Config.in
---- linux-2.4.32-noloop/drivers/block/Config.in 2004-08-08 14:15:13.000000000 +0300
-+++ linux-2.4.32-AES/drivers/block/Config.in 2005-11-18 18:12:25.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/block/Config.in linux-2.4.33-AES/drivers/block/Config.in
+--- linux-2.4.33-noloop/drivers/block/Config.in 2004-08-08 14:15:13.000000000 +0300
++++ linux-2.4.33-AES/drivers/block/Config.in 2006-08-12 19:21:58.000000000 +0300
@@ -42,6 +42,15 @@
dep_tristate 'Promise SATA SX8 support' CONFIG_BLK_DEV_SX8 $CONFIG_PCI
@@ -53,9 +53,9 @@
dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET
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 2006-01-27 15:36:39.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/block/loop.c linux-2.4.33-AES/drivers/block/loop.c
+--- linux-2.4.33-noloop/drivers/block/loop.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/block/loop.c 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,2271 @@
+/*
+ * linux/drivers/block/loop.c
@@ -2328,9 +2328,9 @@
+}
+EXPORT_SYMBOL(loop_add_keyscrub_fn);
+#endif
-diff -urN linux-2.4.32-noloop/drivers/misc/Makefile linux-2.4.32-AES/drivers/misc/Makefile
---- linux-2.4.32-noloop/drivers/misc/Makefile 2000-12-30 00:07:22.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/Makefile 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/Makefile linux-2.4.33-AES/drivers/misc/Makefile
+--- linux-2.4.33-noloop/drivers/misc/Makefile 2000-12-30 00:07:22.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/Makefile 2006-08-12 19:21:58.000000000 +0300
@@ -9,8 +9,35 @@
# parent makes..
#
@@ -2367,9 +2367,9 @@
include $(TOPDIR)/Rules.make
fastdep:
-diff -urN linux-2.4.32-noloop/drivers/misc/aes-amd64.S linux-2.4.32-AES/drivers/misc/aes-amd64.S
---- linux-2.4.32-noloop/drivers/misc/aes-amd64.S 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/aes-amd64.S 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/aes-amd64.S linux-2.4.33-AES/drivers/misc/aes-amd64.S
+--- linux-2.4.33-noloop/drivers/misc/aes-amd64.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/aes-amd64.S 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,893 @@
+//
+// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
@@ -3264,9 +3264,9 @@
+ im_data5(v3)
+ im_data6(v3)
+ 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 2006-02-22 14:22:34.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/aes-x86.S linux-2.4.33-AES/drivers/misc/aes-x86.S
+--- linux-2.4.33-noloop/drivers/misc/aes-x86.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/aes-x86.S 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,923 @@
+//
+// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
@@ -4191,9 +4191,9 @@
+ im_data5(v3)
+ im_data6(v3)
+ im_data7(v3)
-diff -urN linux-2.4.32-noloop/drivers/misc/aes.c linux-2.4.32-AES/drivers/misc/aes.c
---- linux-2.4.32-noloop/drivers/misc/aes.c 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/aes.c 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/aes.c linux-2.4.33-AES/drivers/misc/aes.c
+--- linux-2.4.33-noloop/drivers/misc/aes.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/aes.c 2006-08-12 19:21:58.000000000 +0300
@@ -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
@@ -5674,9 +5674,9 @@
+
+ state_out(out_blk, b0);
+}
-diff -urN linux-2.4.32-noloop/drivers/misc/aes.h linux-2.4.32-AES/drivers/misc/aes.h
---- linux-2.4.32-noloop/drivers/misc/aes.h 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/aes.h 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/aes.h linux-2.4.33-AES/drivers/misc/aes.h
+--- linux-2.4.33-noloop/drivers/misc/aes.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/aes.h 2006-08-12 19:21:58.000000000 +0300
@@ -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
@@ -5791,9 +5791,9 @@
+// if their parameters have not changed.
+
+#endif // _AES_H
-diff -urN linux-2.4.32-noloop/drivers/misc/crypto-ksym.c linux-2.4.32-AES/drivers/misc/crypto-ksym.c
---- linux-2.4.32-noloop/drivers/misc/crypto-ksym.c 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/crypto-ksym.c 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/crypto-ksym.c linux-2.4.33-AES/drivers/misc/crypto-ksym.c
+--- linux-2.4.33-noloop/drivers/misc/crypto-ksym.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/crypto-ksym.c 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,7 @@
+#include <linux/module.h>
+#include "aes.h"
@@ -5802,9 +5802,9 @@
+EXPORT_SYMBOL_NOVERS(aes_encrypt);
+EXPORT_SYMBOL_NOVERS(aes_decrypt);
+EXPORT_SYMBOL_NOVERS(md5_transform_CPUbyteorder);
-diff -urN linux-2.4.32-noloop/drivers/misc/md5-amd64.S linux-2.4.32-AES/drivers/misc/md5-amd64.S
---- linux-2.4.32-noloop/drivers/misc/md5-amd64.S 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/md5-amd64.S 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/md5-amd64.S linux-2.4.33-AES/drivers/misc/md5-amd64.S
+--- linux-2.4.33-noloop/drivers/misc/md5-amd64.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/md5-amd64.S 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,200 @@
+//
+// md5-amd64.S
@@ -6006,9 +6006,9 @@
+ addl %ecx,8(%rdi)
+ addl %edx,12(%rdi)
+ ret
-diff -urN linux-2.4.32-noloop/drivers/misc/md5-x86.S linux-2.4.32-AES/drivers/misc/md5-x86.S
---- linux-2.4.32-noloop/drivers/misc/md5-x86.S 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/md5-x86.S 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/md5-x86.S linux-2.4.33-AES/drivers/misc/md5-x86.S
+--- linux-2.4.33-noloop/drivers/misc/md5-x86.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/md5-x86.S 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,207 @@
+//
+// md5-x86.S
@@ -6217,9 +6217,9 @@
+ pop %ebx
+ pop %ebp
+ ret
-diff -urN linux-2.4.32-noloop/drivers/misc/md5.c linux-2.4.32-AES/drivers/misc/md5.c
---- linux-2.4.32-noloop/drivers/misc/md5.c 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/md5.c 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/md5.c linux-2.4.33-AES/drivers/misc/md5.c
+--- linux-2.4.33-noloop/drivers/misc/md5.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/md5.c 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,106 @@
+/*
+ * MD5 Message Digest Algorithm (RFC1321).
@@ -6327,9 +6327,9 @@
+ hash[2] += c;
+ hash[3] += d;
+}
-diff -urN linux-2.4.32-noloop/drivers/misc/md5.h linux-2.4.32-AES/drivers/misc/md5.h
---- linux-2.4.32-noloop/drivers/misc/md5.h 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/drivers/misc/md5.h 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/drivers/misc/md5.h linux-2.4.33-AES/drivers/misc/md5.h
+--- linux-2.4.33-noloop/drivers/misc/md5.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/drivers/misc/md5.h 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,11 @@
+/* md5.h */
+
@@ -6342,9 +6342,9 @@
+ asmlinkage
+#endif
+extern void md5_transform_CPUbyteorder(u_int32_t *, u_int32_t const *);
-diff -urN linux-2.4.32-noloop/include/linux/loop.h linux-2.4.32-AES/include/linux/loop.h
---- linux-2.4.32-noloop/include/linux/loop.h 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.4.32-AES/include/linux/loop.h 2005-11-18 18:12:26.000000000 +0200
+diff -urN linux-2.4.33-noloop/include/linux/loop.h linux-2.4.33-AES/include/linux/loop.h
+--- linux-2.4.33-noloop/include/linux/loop.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.4.33-AES/include/linux/loop.h 2006-08-12 19:21:58.000000000 +0300
@@ -0,0 +1,195 @@
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
Copied: upstream/loop-aes/current/kernel-2.6.18.diff (from r1370, upstream/loop-aes/current/kernel-2.6.16.diff)
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/kernel-2.6.18.diff?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/kernel-2.6.16.diff (original)
+++ upstream/loop-aes/current/kernel-2.6.18.diff Sun Feb 25 12:25:39 2007
@@ -3,9 +3,9 @@
rm -f drivers/block/loop.c include/linux/loop.h
-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
+diff -urN linux-2.6.18-noloop/drivers/block/Kconfig linux-2.6.18-AES/drivers/block/Kconfig
+--- linux-2.6.18-noloop/drivers/block/Kconfig 2006-09-23 15:32:40.000000000 +0300
++++ linux-2.6.18-AES/drivers/block/Kconfig 2006-09-23 16:12:57.000000000 +0300
@@ -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.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
+diff -urN linux-2.6.18-noloop/drivers/block/Makefile linux-2.6.18-AES/drivers/block/Makefile
+--- linux-2.6.18-noloop/drivers/block/Makefile 2006-06-18 11:15:40.000000000 +0300
++++ linux-2.6.18-AES/drivers/block/Makefile 2006-09-23 16:12:57.000000000 +0300
@@ -1,6 +1,9 @@
#
# Makefile for the kernel block device drivers.
@@ -78,10 +78,10 @@
# 12 June 2000, Christoph Hellwig <hch at infradead.org>
# Rewritten to use lists instead of if-statements.
#
-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 @@
+diff -urN linux-2.6.18-noloop/drivers/block/loop.c linux-2.6.18-AES/drivers/block/loop.c
+--- linux-2.6.18-noloop/drivers/block/loop.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/block/loop.c 2006-10-15 19:44:33.000000000 +0300
+@@ -0,0 +1,2816 @@
+/*
+ * linux/drivers/block/loop.c
+ *
@@ -156,7 +156,6 @@
+ */
+
+#include <linux/version.h>
-+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/sched.h>
@@ -181,6 +180,9 @@
+#include <linux/writeback.h>
+#include <linux/buffer_head.h> /* for invalidate_bdev() */
+#include <linux/completion.h>
++#if LINUX_VERSION_CODE >= 0x20613
++# include <linux/kthread.h>
++#endif
+#if defined(CONFIG_COMPAT) && defined(HAVE_COMPAT_IOCTL)
+# include <linux/compat.h>
+#endif
@@ -1751,7 +1753,11 @@
+#else
+ memcpy(¤t->rlim[0], &loop_rlim_defaults[0], sizeof(current->rlim));
+#endif
++
++#if LINUX_VERSION_CODE < 0x20613
++ /* 2.6.18 and older kernels */
+ daemonize("loop%d", lo->lo_number);
++#endif
+
+ if(lo->lo_device)
+ backingQueue = bdev_get_queue(lo->lo_device);
@@ -2199,9 +2205,24 @@
+
+ loop_set_softblksz(lo, bdev);
+
++#if LINUX_VERSION_CODE < 0x20613
++ /* 2.6.18 and older kernels */
+ error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
+ if(error < 0)
+ goto out_mapping;
++#else
++ /* 2.6.19 and newer kernels */
++ {
++ struct task_struct *t;
++ t = kthread_create(loop_thread, lo, "loop%d", lo->lo_number);
++ if (IS_ERR(t)) {
++ error = PTR_ERR(t);
++ goto out_mapping;
++ }
++ wake_up_process(t);
++ }
++#endif
++
+ wait_for_completion(&lo->lo_done);
+ fput(file);
+#if defined(QUEUE_FLAG_PLUGGED)
@@ -2877,9 +2898,9 @@
+}
+EXPORT_SYMBOL(loop_add_keyscrub_fn);
+#endif
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/Makefile linux-2.6.18-AES/drivers/misc/Makefile
+--- linux-2.6.18-noloop/drivers/misc/Makefile 2005-06-18 11:22:48.000000000 +0300
++++ linux-2.6.18-AES/drivers/misc/Makefile 2006-09-23 16:12:57.000000000 +0300
@@ -1,6 +1,28 @@
#
# Makefile for misc devices that really don't fit anywhere else.
@@ -2909,9 +2930,9 @@
obj- := misc.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_IBM_ASM) += ibmasm/
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/aes-amd64.S linux-2.6.18-AES/drivers/misc/aes-amd64.S
+--- linux-2.6.18-noloop/drivers/misc/aes-amd64.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/aes-amd64.S 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,893 @@
+//
+// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
@@ -3806,9 +3827,9 @@
+ im_data5(v3)
+ im_data6(v3)
+ im_data7(v3)
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/aes-x86.S linux-2.6.18-AES/drivers/misc/aes-x86.S
+--- linux-2.6.18-noloop/drivers/misc/aes-x86.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/aes-x86.S 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,923 @@
+//
+// Copyright (c) 2001, Dr Brian Gladman <brg at gladman.uk.net>, Worcester, UK.
@@ -4733,9 +4754,9 @@
+ im_data5(v3)
+ im_data6(v3)
+ im_data7(v3)
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/aes.c linux-2.6.18-AES/drivers/misc/aes.c
+--- linux-2.6.18-noloop/drivers/misc/aes.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/aes.c 2006-09-23 16:12:57.000000000 +0300
@@ -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
@@ -6216,10 +6237,10 @@
+
+ state_out(out_blk, b0);
+}
-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 @@
+diff -urN linux-2.6.18-noloop/drivers/misc/aes.h linux-2.6.18-AES/drivers/misc/aes.h
+--- linux-2.6.18-noloop/drivers/misc/aes.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/aes.h 2006-10-08 18:00:21.000000000 +0300
+@@ -0,0 +1,112 @@
+// 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
+// happy to see it used in free and open source software. If you do use
@@ -6259,7 +6280,6 @@
+
+#include <linux/types.h>
+#include <linux/linkage.h>
-+#include <linux/config.h>
+#include <linux/module.h>
+
+// CONFIGURATION OPTIONS (see also aes.c)
@@ -6333,9 +6353,9 @@
+// if their parameters have not changed.
+
+#endif // _AES_H
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/crypto-ksym.c linux-2.6.18-AES/drivers/misc/crypto-ksym.c
+--- linux-2.6.18-noloop/drivers/misc/crypto-ksym.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/crypto-ksym.c 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,7 @@
+#include <linux/module.h>
+#include "aes.h"
@@ -6344,9 +6364,9 @@
+EXPORT_SYMBOL(aes_encrypt);
+EXPORT_SYMBOL(aes_decrypt);
+EXPORT_SYMBOL(md5_transform_CPUbyteorder);
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/md5-amd64.S linux-2.6.18-AES/drivers/misc/md5-amd64.S
+--- linux-2.6.18-noloop/drivers/misc/md5-amd64.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/md5-amd64.S 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,200 @@
+//
+// md5-amd64.S
@@ -6548,9 +6568,9 @@
+ addl %ecx,8(%rdi)
+ addl %edx,12(%rdi)
+ ret
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/md5-x86.S linux-2.6.18-AES/drivers/misc/md5-x86.S
+--- linux-2.6.18-noloop/drivers/misc/md5-x86.S 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/md5-x86.S 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,207 @@
+//
+// md5-x86.S
@@ -6759,9 +6779,9 @@
+ pop %ebx
+ pop %ebp
+ ret
-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
+diff -urN linux-2.6.18-noloop/drivers/misc/md5.c linux-2.6.18-AES/drivers/misc/md5.c
+--- linux-2.6.18-noloop/drivers/misc/md5.c 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/md5.c 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,106 @@
+/*
+ * MD5 Message Digest Algorithm (RFC1321).
@@ -6869,24 +6889,23 @@
+ hash[2] += c;
+ hash[3] += d;
+}
-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 @@
+diff -urN linux-2.6.18-noloop/drivers/misc/md5.h linux-2.6.18-AES/drivers/misc/md5.h
+--- linux-2.6.18-noloop/drivers/misc/md5.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/drivers/misc/md5.h 2006-10-08 18:00:21.000000000 +0300
+@@ -0,0 +1,10 @@
+/* md5.h */
+
+#include <linux/types.h>
+#include <linux/linkage.h>
-+#include <linux/config.h>
+#include <linux/module.h>
+
+#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
+ asmlinkage
+#endif
+extern void md5_transform_CPUbyteorder(u_int32_t *, u_int32_t const *);
-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
+diff -urN linux-2.6.18-noloop/include/linux/loop.h linux-2.6.18-AES/include/linux/loop.h
+--- linux-2.6.18-noloop/include/linux/loop.h 1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.18-AES/include/linux/loop.h 2006-09-23 16:12:57.000000000 +0300
@@ -0,0 +1,167 @@
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
Modified: upstream/loop-aes/current/loop.c-2.6.patched
URL: http://svn.debian.org/wsvn/pkg-loop-aes/upstream/loop-aes/current/loop.c-2.6.patched?rev=1372&op=diff
==============================================================================
--- upstream/loop-aes/current/loop.c-2.6.patched (original)
+++ upstream/loop-aes/current/loop.c-2.6.patched Sun Feb 25 12:25:39 2007
@@ -69,7 +69,6 @@
*/
#include <linux/version.h>
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/sched.h>
@@ -94,6 +93,9 @@
#include <linux/writeback.h>
#include <linux/buffer_head.h> /* for invalidate_bdev() */
#include <linux/completion.h>
+#if LINUX_VERSION_CODE >= 0x20613
+# include <linux/kthread.h>
+#endif
#if defined(CONFIG_COMPAT) && defined(HAVE_COMPAT_IOCTL)
# include <linux/compat.h>
#endif
@@ -964,7 +966,11 @@
#else
memcpy(¤t->rlim[0], &loop_rlim_defaults[0], sizeof(current->rlim));
#endif
+
+#if LINUX_VERSION_CODE < 0x20613
+ /* 2.6.18 and older kernels */
daemonize("loop%d", lo->lo_number);
+#endif
if(lo->lo_device)
backingQueue = bdev_get_queue(lo->lo_device);
@@ -1412,9 +1418,24 @@
loop_set_softblksz(lo, bdev);
+#if LINUX_VERSION_CODE < 0x20613
+ /* 2.6.18 and older kernels */
error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
if(error < 0)
goto out_mapping;
+#else
+ /* 2.6.19 and newer kernels */
+ {
+ struct task_struct *t;
+ t = kthread_create(loop_thread, lo, "loop%d", lo->lo_number);
+ if (IS_ERR(t)) {
+ error = PTR_ERR(t);
+ goto out_mapping;
+ }
+ wake_up_process(t);
+ }
+#endif
+
wait_for_completion(&LDE_lo_done);
fput(file);
#if defined(QUEUE_FLAG_PLUGGED)
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=1372&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:25: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 2006-04-09 09:45:15.000000000 +0300
++++ util-linux-2.12r-AES/mount/lomount.c 2006-10-15 20:14:07.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> */
@@ -488,7 +488,7 @@
#define LOOPMAJOR 7
-@@ -13,60 +24,79 @@
+@@ -13,60 +24,80 @@
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
@@ -505,6 +505,7 @@
+#include <locale.h>
+#include <sys/time.h>
+#include <sys/utsname.h>
++#include <signal.h>
#include "loop.h"
#include "lomount.h"
@@ -602,7 +603,7 @@
if ((fd = open(device, O_RDONLY)) < 0) {
int errsv = errno;
-@@ -74,73 +104,64 @@
+@@ -74,73 +105,64 @@
device, strerror (errsv));
return 2;
}
@@ -725,7 +726,7 @@
char *
find_unused_loop_device (void) {
/* Just creating a device, say in /tmp, is probably a bad idea -
-@@ -148,9 +169,8 @@
+@@ -148,9 +170,8 @@
So, we just try /dev/loop[0-7]. */
char dev[20];
char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
@@ -736,7 +737,7 @@
for (j = 0; j < SIZE(loop_formats); j++) {
for(i = 0; i < 256; i++) {
-@@ -159,16 +179,14 @@
+@@ -159,16 +180,14 @@
somedev++;
fd = open (dev, O_RDONLY);
if (fd >= 0) {
@@ -755,7 +756,7 @@
continue;/* continue trying as long as devices exist */
}
break;
-@@ -176,75 +194,609 @@
+@@ -176,75 +195,615 @@
}
if (!somedev)
@@ -920,6 +921,7 @@
+ char str[10], *a[16], *e[2], *h;
+ pid_t gpid;
+ struct passwd *p;
++ void *oldSigPipeHandler;
+
+ if((getuid() == 0) && gpgHomeDir && gpgHomeDir[0]) {
+ h = gpgHomeDir;
@@ -1067,8 +1069,13 @@
+ }
+
+ x = strlen(pass);
++
++ /* ignore possible SIGPIPE signal while writing to gpg */
++ oldSigPipeHandler = signal(SIGPIPE, SIG_IGN);
+ rd_wr_retry(pfdi[1], pass, x, 1);
+ rd_wr_retry(pfdi[1], "\n", 1, 1);
++ if(oldSigPipeHandler != SIG_ERR) signal(SIGPIPE, oldSigPipeHandler);
++
+ close(pfdi[1]);
+ memset(pass, 0, x);
+ x = 0;
@@ -1226,8 +1233,8 @@
+ 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];
@@ -1350,8 +1357,8 @@
+ close(fd);
+ memset(&b[0], 0, sizeof(b));
+ return 0;
-+}
-+
+ }
+
+#if !defined(MAIN)
+static int loop_fork_mkfs_command(char *device, char *fstype)
+{
@@ -1418,7 +1425,7 @@
mode = (*loopro ? O_RDONLY : O_RDWR);
if ((ffd = open(file, mode)) < 0) {
if (!*loopro && errno == EROFS)
-@@ -256,32 +808,25 @@
+@@ -256,32 +815,25 @@
}
if ((fd = open(device, mode)) < 0) {
perror (device);
@@ -1440,6 +1447,8 @@
- "%s", encryption);
- }
- }
+-
+- loopinfo64.lo_offset = offset;
+ memset (&loopinfo, 0, sizeof (loopinfo));
+ xstrncpy ((char *)loopinfo.lo_file_name, file, LO_NAME_SIZE);
+ if (loopEncryptionType)
@@ -1449,8 +1458,6 @@
+ if (loopSizeBytes)
+ loopinfo.lo_sizelimit = mystrtoull(loopSizeBytes, 0);
-- loopinfo64.lo_offset = offset;
--
-#ifdef MCL_FUTURE
+#ifdef MCL_FUTURE
/*
@@ -1462,7 +1469,7 @@
if(mlockall(MCL_CURRENT | MCL_FUTURE)) {
perror("memlock");
fprintf(stderr, _("Couldn't lock into memory, exiting.\n"));
-@@ -289,126 +834,223 @@
+@@ -289,126 +841,223 @@
}
#endif
@@ -1621,12 +1628,12 @@
return 1;
}
- close (ffd);
--
+
- i = ioctl(fd, LOOP_SET_STATUS64, &loopinfo64);
- if (i) {
- struct loop_info loopinfo;
- int errsv = errno;
-
+-
- i = loop_info64_to_old(&loopinfo64, &loopinfo);
- if (i) {
- errno = errsv;
@@ -1666,7 +1673,7 @@
+ }
}
- close (fd);
-
+-
- if (verbose > 1)
- printf(_("set_loop(%s,%s,%llu): success\n"),
- device, file, offset);
@@ -1676,7 +1683,7 @@
-int
-del_loop (const char *device) {
- int fd;
--
+
- if ((fd = open (device, O_RDONLY)) < 0) {
- int errsv = errno;
- fprintf(stderr, _("loop: can't delete device %s: %s\n"),
@@ -1775,7 +1782,7 @@
exit(1);
}
-@@ -439,107 +1081,247 @@
+@@ -439,107 +1088,247 @@
fprintf (stderr, "\n");
}
@@ -4076,7 +4083,7 @@
.B swapon
diff -urN util-linux-2.12r/mount/swapon.c util-linux-2.12r-AES/mount/swapon.c
--- util-linux-2.12r/mount/swapon.c 2004-12-22 11:50:19.000000000 +0200
-+++ util-linux-2.12r-AES/mount/swapon.c 2005-09-24 14:48:54.000000000 +0300
++++ util-linux-2.12r-AES/mount/swapon.c 2006-07-21 20:33:56.000000000 +0300
@@ -1,22 +1,45 @@
/*
* A swapon(8)/swapoff(8) for Linux 0.99.
@@ -4123,13 +4130,14 @@
#define streq(s, t) (strcmp ((s), (t)) == 0)
-@@ -297,6 +320,260 @@
+@@ -297,6 +320,262 @@
}
static int
+prepare_encrypted_swap(const char *partition, char *loop, char *encryption)
+{
+ int x, y, fd, ffd;
++ int page_size;
+ sha512_context s;
+ unsigned char b[4096], multiKeyBits[65][32];
+ char *a[10], *apiName;
@@ -4173,7 +4181,8 @@
+ fprintf(stderr, _("swapon: unable to open swap device %s\n"), partition);
+ goto errout0;
+ }
-+ fseek(f, (long)PAGE_SIZE, SEEK_SET);
++ page_size = getpagesize();
++ fseek(f, (long)page_size, SEEK_SET);
+ sha512_init(&s);
+ for(x = 0; x < 10; x++) {
+ if(fread(&b[0], sizeof(b), 1, f) != 1) break;
@@ -4192,7 +4201,7 @@
+ unsigned char h[64];
+ int x,y,z;
+ } j;
-+ if(fseek(f, (long)PAGE_SIZE, SEEK_SET)) break;
++ if(fseek(f, (long)page_size, SEEK_SET)) break;
+ memcpy(&j.h[0], &s.sha_out[0], 64);
+ gettimeofday(&j.tv, NULL);
+ j.y = y;
@@ -4251,7 +4260,7 @@
+ memset(&multiKeyBits[0][0], 0, sizeof(multiKeyBits));
+ return 0;
+ }
-+ loopinfo.lo_offset = PAGE_SIZE;
++ loopinfo.lo_offset = page_size;
+ /* single-key hash */
+ sha512_hash_buffer(&b[0], 64+32, &loopinfo.lo_encrypt_key[0], sizeof(loopinfo.lo_encrypt_key));
+ /* multi-key hash */
@@ -4384,7 +4393,7 @@
swapon_all(void) {
FILE *fp;
struct mntent *fstab;
-@@ -317,6 +594,8 @@
+@@ -317,6 +596,8 @@
const char *special;
int skip = 0;
int pri = priority;
@@ -4393,7 +4402,7 @@
if (!streq(fstab->mnt_type, MNTTYPE_SWAP))
continue;
-@@ -325,23 +604,39 @@
+@@ -325,23 +606,39 @@
if (!special)
continue;
@@ -4447,7 +4456,7 @@
return status;
}
-@@ -504,11 +799,49 @@
+@@ -504,11 +801,49 @@
exit(2);
}
while ((fstab = getmntent(fp)) != NULL) {
More information about the Pkg-loop-aes-commits
mailing list