Hello community,
here is the log from the commit of package util-linux-crypto
checked in at Fri Apr 27 16:55:17 CEST 2007.
--------
--- util-linux-crypto/util-linux-crypto.changes 2007-04-24 23:28:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/util-linux-crypto/util-linux-crypto.changes 2007-04-27 15:54:31.000000000 +0200
@@ -1,0 +2,14 @@
+Fri Apr 27 15:46:05 CEST 2007 - lnussel(a)suse.de
+
+- upgrade cryptsetup to current svn revision 26. Does no longer hang
+ when a file is specified instead of a device.
+- remove obsolete cryptsetup.sh script
+- boot.crypto:
+ * drop support for cryptoloop, use cryptsetup also for cryptotab
+ * refactor code and create reusable components for use in cryptotab
+ and crypttab code path
+ * run sulogin only during boot if fsck failed
+ * support crypttab's 'tries' option
+- add crypttab manpage based on Debian one
+
+-------------------------------------------------------------------
Old:
----
cryptsetup-luks-1.0.4.tar.bz2
cryptsetup.sh
New:
----
cryptsetup-luks-1.0.4_SVN26.tar.bz2
cryptsetup-luks-ctrl-d.diff
cryptsetup-luks-fixretries.diff
cryptsetup-luks-libnostderr.diff
cryptsetup-mktar
crypttab.5
crypttab.5.txt
Makefile.doc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ util-linux-crypto.spec ++++++
--- /var/tmp/diff_new_pack.Q28337/_old 2007-04-27 16:55:02.000000000 +0200
+++ /var/tmp/diff_new_pack.Q28337/_new 2007-04-27 16:55:02.000000000 +0200
@@ -13,7 +13,7 @@
Name: util-linux-crypto
BuildRequires: device-mapper-devel e2fsprogs-devel libgcrypt-devel popt-devel
# cryptsetup version
-%define csver 1.0.4
+%define csver 1.0.4_SVN26
# hashalot version
%define haver 0.3
# dmconvert version
@@ -22,17 +22,27 @@
Group: System/Base
Autoreqprov: on
Version: 2.12r
-Release: 23
+Release: 26
Summary: A Collection of Basic File System Encryption Utilities
-Source: cryptsetup.sh
-Source1: cryptsetup-luks-%csver.tar.bz2
-Source2: hashalot-%haver.tar.bz2
-Source3: dmconvert-%dcver.tar.bz2
-Source4: boot.crypto
+Source: cryptsetup-luks-%csver.tar.bz2
+Source1: hashalot-%haver.tar.bz2
+Source2: dmconvert-%dcver.tar.bz2
+Source3: boot.crypto
+Source90: Makefile.doc
+Source91: crypttab.5.txt
+# make -f Makefile.doc
+Source92: crypttab.5
+# use this to create the tarball from svn
+Source99: cryptsetup-mktar
Patch0: dmconvert-0.2-uninitialized.patch
Patch1: cryptsetup-luks-1.0.4-loop_fish2_compat.diff
+Patch2: cryptsetup-luks-fixretries.diff
+Patch3: cryptsetup-luks-ctrl-d.diff
+Patch4: cryptsetup-luks-libnostderr.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: aaa_base:/etc/init.d/boot.crypto
+# we need losetup
+Requires: util-linux
%description
This package contains a variety of low-level system utilities for
@@ -63,14 +73,19 @@
Ben Slusky <sluskyb(a)paranoiacs.org>
%prep
-%setup -q -T -c -a 1 -a 2 -a 3
+%setup -q -T -c -a 0 -a 1 -a 2
%patch0
-%patch1
+cd cryptsetup-luks-%csver
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
# cryptsetup build
cd cryptsetup-luks-%csver
%{?suse_update_config:%{suse_update_config}}
+autoreconf -f -i
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%_prefix --mandir=%_mandir \
--libdir=/%_lib \
--bindir=/sbin --sbindir=/sbin \
@@ -92,8 +107,6 @@
cd ..
%install
-# cryptsetup script install
-install -D %{S:0} $RPM_BUILD_ROOT/sbin/cryptsetup.sh
# cryptsetup install
cd cryptsetup-luks-%csver
make install DESTDIR=$RPM_BUILD_ROOT
@@ -116,10 +129,13 @@
cd ..
# boot.crypto
install -d -m 755 %{buildroot}/etc/init.d
-install -m 755 %{SOURCE4} %{buildroot}/etc/init.d/boot.crypto
+install -m 755 %{SOURCE3} %{buildroot}/etc/init.d/boot.crypto
# maybe install templates instead?
install -m 644 /dev/null %{buildroot}/etc/cryptotab
install -m 644 /dev/null %{buildroot}/etc/crypttab
+# man page
+install -d -m755 %{buildroot}%{_mandir}/man5
+install -m644 %{SOURCE92} %{buildroot}%{_mandir}/man5
%post
/sbin/ldconfig
@@ -136,7 +152,6 @@
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/crypttab
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/cryptotab
/etc/init.d/boot.crypto
-/sbin/cryptsetup.sh
/sbin/cryptsetup
/usr/sbin/dmconvert
/sbin/hashalot
@@ -144,6 +159,7 @@
%_datadir/locale/de/LC_MESSAGES/dmconvert.mo
%_mandir/man1/hashalot.1.gz
%_mandir/man8/cryptsetup.8.gz
+%_mandir/man5/crypttab.5.gz
/%_lib/libcryptsetup.so.0
/%_lib/libcryptsetup.so.0.0.0
@@ -153,6 +169,17 @@
%{_libdir}/libcryptsetup.so
%changelog
+* Fri Apr 27 2007 - lnussel(a)suse.de
+- upgrade cryptsetup to current svn revision 26. Does no longer hang
+ when a file is specified instead of a device.
+- remove obsolete cryptsetup.sh script
+- boot.crypto:
+ * drop support for cryptoloop, use cryptsetup also for cryptotab
+ * refactor code and create reusable components for use in cryptotab
+ and crypttab code path
+ * run sulogin only during boot if fsck failed
+ * support crypttab's 'tries' option
+- add crypttab manpage based on Debian one
* Tue Apr 24 2007 - lnussel(a)suse.de
- add boot.crypto (#257884)
- add crypttab and cryptotab as %%ghost to filelist
++++++ boot.crypto ++++++
++++ 861 lines (skipped)
++++ between boot.crypto
++++ and /mounts/work_src_done/STABLE/util-linux-crypto/boot.crypto
++++++ cryptsetup-luks-ctrl-d.diff ++++++
fail if user enters ^D at password prompt instead of trying to use
uninitialized memory as password.
Signed-off-by: Ludwig Nussel <ludwig.nussel(a)suse.de>
Index: cryptsetup-luks-1.0.4_SVN26/lib/setup.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/lib/setup.c
+++ cryptsetup-luks-1.0.4_SVN26/lib/setup.c
@@ -77,6 +77,9 @@ static int untimed_read(int fd, char *pa
if (i > 0) {
pass[i-1] = '\0';
i = 0;
+ } else if (i == 0) { /* EOF */
+ *pass = 0;
+ i = -1;
}
return i;
}
@@ -672,6 +675,7 @@ start:
safe_free(password);
out:
LUKS_dealloc_masterkey(mk);
+ mk = NULL;
if (r == -EPERM && tries > 0)
goto start;
++++++ cryptsetup-luks-fixretries.diff ++++++
actually ask for passphrase multiple times when multiple tries are requested
Signed-off-by: Ludwig Nussel <ludwig.nussel(a)suse.de>
Index: cryptsetup-luks-1.0.4_SVN26/lib/setup.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/lib/setup.c
+++ cryptsetup-luks-1.0.4_SVN26/lib/setup.c
@@ -639,7 +639,7 @@ start:
if(!password) {
r = -EINVAL; goto out;
}
- if((r = LUKS_open_any_key(options->device, password, passwordLen, &hdr, &mk, backend) < 0)) {
+ if((r = LUKS_open_any_key(options->device, password, passwordLen, &hdr, &mk, backend)) < 0) {
set_error("No key available with this passphrase.\n");
goto out1;
}
++++++ cryptsetup-luks-libnostderr.diff ++++++
use set_error instead of printf in library to report errors about why
LUKS_open_any_key failed.
Signed-off-by: Ludwig Nussel <ludwig.nussel(a)suse.de>
Index: cryptsetup-luks-1.0.4_SVN26/lib/setup.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/lib/setup.c
+++ cryptsetup-luks-1.0.4_SVN26/lib/setup.c
@@ -98,7 +98,7 @@ static int timed_read(int fd, char *pass
if (select(fd+1, &fds, NULL, NULL, &t) > 0)
failed = untimed_read(fd, pass, maxlen);
else
- fprintf(stderr, "Operation timed out.\n");
+ set_error("Operation timed out");
return failed;
}
@@ -197,14 +197,16 @@ static int get_key(struct crypt_options
pass = safe_alloc(512);
if (!pass || (i = interactive_pass(prompt, pass, 512, options->timeout))) {
- set_error("Error reading passphrase");
+ if(!get_error())
+ set_error("Error reading passphrase");
goto out_err;
}
if (verify || verify_if_possible) {
char pass_verify[512];
i = interactive_pass("Verify passphrase: ", pass_verify, sizeof(pass_verify), options->timeout);
if (i || strcmp(pass, pass_verify) != 0) {
- set_error("Passphrases do not match");
+ if(!get_error())
+ set_error("Passphrases do not match");
goto out_err;
}
memset(pass_verify, 0, sizeof(pass_verify));
@@ -385,7 +387,7 @@ static int parse_into_name_and_mode(cons
strncpy(mode,"cbc-plain",10);
}
else {
- fprintf(stderr, "no known cipher-spec pattern detected\n");
+ set_error("no known cipher-spec pattern detected");
return -EINVAL;
}
}
@@ -643,7 +645,6 @@ start:
r = -EINVAL; goto out;
}
if((r = LUKS_open_any_key(options->device, password, passwordLen, &hdr, &mk, backend)) < 0) {
- set_error("No key available with this passphrase.\n");
goto out1;
}
Index: cryptsetup-luks-1.0.4_SVN26/luks/keymanage.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/luks/keymanage.c
+++ cryptsetup-luks-1.0.4_SVN26/luks/keymanage.c
@@ -76,20 +76,20 @@ int LUKS_read_phdr(const char *device, s
devfd = open(device,O_RDONLY | O_DIRECT | O_SYNC);
if(-1 == devfd) {
- fprintf(stderr, _("Can't open device: %s\n"), device);
+ set_error(_("Can't open device %s"), device);
return -EINVAL;
}
if(read_blockwise(devfd, hdr, sizeof(struct luks_phdr)) < sizeof(struct luks_phdr)) {
r = -EIO;
} else if(memcmp(hdr->magic, luksMagic, LUKS_MAGIC_L)) { /* Check magic */
- fprintf(stderr, _("%s is not a LUKS partition\n"), device);
+ set_error(_("%s is not a LUKS partition\n"), device);
r = -EINVAL;
} else if(memcmp(hdr->hashSpec, "sha1", 4)) { /* Check for SHA1 - other hashspecs are not implemented ATM */
- fputs(_("unknown hash spec in phdr"), stderr);
+ set_error(_("unknown hash spec in phdr"));
r = -EINVAL;
} else if((hdr->version = ntohs(hdr->version)) != 1) { /* Convert every uint16/32_t item from network byte order */
- fprintf(stderr, _("unknown version %d\n"), hdr->version);
+ set_error( _("unknown LUKS version %d\n"), hdr->version);
r = -EINVAL;
} else {
hdr->payloadOffset = ntohl(hdr->payloadOffset);
@@ -117,7 +117,7 @@ int LUKS_write_phdr(const char *device,
devfd = open(device,O_RDWR | O_DIRECT | O_SYNC);
if(-1 == devfd) {
- fprintf(stderr, _("Can't open device: %s\n"), device);
+ set_error(_("Can't open device %s"), device);
return -EINVAL;
}
@@ -210,12 +210,12 @@ int LUKS_set_key(const char *device, uns
int r;
if(hdr->keyblock[keyIndex].active != LUKS_KEY_DISABLED) {
- fprintf(stderr, _("key %d active, purge first.\n"), keyIndex);
+ set_error( _("key %d active, purge first"), keyIndex);
return -EINVAL;
}
if(hdr->keyblock[keyIndex].stripes < LUKS_STRIPES) {
- fprintf(stderr,_("key material section %d includes too few stripes. Header manipulation?\n"),keyIndex);
+ set_error(_("key material section %d includes too few stripes. Header manipulation?"),keyIndex);
return -EINVAL;
}
r = getRandom(hdr->keyblock[keyIndex].passwordSalt, LUKS_SALTSIZE);
@@ -247,7 +247,8 @@ int LUKS_set_key(const char *device, uns
hdr->keyblock[keyIndex].keyMaterialOffset,
backend);
if(r < 0) {
- fprintf(stderr,"Failed to write to key storage.\n");
+ if(!get_error())
+ set_error("Failed to write to key storage");
goto out;
}
@@ -303,7 +304,8 @@ int LUKS_open_key(const char *device,
hdr->keyblock[keyIndex].keyMaterialOffset,
backend);
if(r < 0) {
- fprintf(stderr,"Failed to read from key storage\n");
+ if(!get_error())
+ set_error("Failed to read from key storage");
goto out;
}
@@ -388,7 +390,7 @@ static int wipe(const char *device, unsi
devfd = open(device, O_RDWR | O_DIRECT);
if(devfd == -1) {
- fprintf(stderr, _("Can't open device: %s\n"), device);
+ set_error(_("Can't open device %s"), device);
return -EINVAL;
}
Index: cryptsetup-luks-1.0.4_SVN26/lib/utils.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/lib/utils.c
+++ cryptsetup-luks-1.0.4_SVN26/lib/utils.c
@@ -225,7 +225,7 @@ ssize_t read_blockwise(int fd, void *ori
while(count) {
r = read(fd,padbuf,bsize);
if(r < 0 || r != bsize) {
- fprintf(stderr, "read failed in read_blockwise.\n");
+ set_error("read failed in read_blockwise()");
goto out;
}
step = count<bsize?count:bsize;
Index: cryptsetup-luks-1.0.4_SVN26/luks/keyencryption.c
===================================================================
--- cryptsetup-luks-1.0.4_SVN26.orig/luks/keyencryption.c
+++ cryptsetup-luks-1.0.4_SVN26/luks/keyencryption.c
@@ -58,7 +58,7 @@ static int setup_mapping(const char *cip
* device's sector size, otherwise the mapping will be refused.
*/
if(device_sector_size < 0) {
- fprintf(stderr,_("Unable to obtain sector size for %s"),device);
+ set_error(_("Unable to obtain sector size for %s"),device);
return -EINVAL;
}
options->size = round_up_modulo(srcLength,device_sector_size)/SECTOR_SIZE;
@@ -118,7 +118,8 @@ static int LUKS_endec_template(char *src
r = setup_mapping(dmCipherSpec,name,device,hdr->payloadOffset,key,keyLength,sector,srcLength,backend,mode);
if(r < 0) {
- fprintf(stderr,"Failed to setup dm-crypt key mapping.\nCheck kernel for support for the %s cipher spec and verify that %s contains at least %d sectors.\n",
+ if(!get_error())
+ set_error("Failed to setup dm-crypt key mapping.\nCheck kernel for support for the %s cipher spec and verify that %s contains at least %d sectors",
dmCipherSpec,
device,
sector + div_round_up(srcLength,SECTOR_SIZE));
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org