Package: cryptsetup
Version: 2:1.0.6-3-jh1
Severity: important
Tags: patch

The askpass program, used to get the passphrase for decryption, doesn't 
know how to talk to splashy.  If splashy is configured in the initramfs 
then the boot hangs at the point where crypsetup prompts for the 
passprhrase to decrypt the root filesystem.

A simple patch to make askpass work with splashy is attached.  Another, 
possibly preferrable way of doing this would be to use the 
/sbin/splashy_update program, via popen, to get the password.  This does 
imply some horrid shell quoting problems however.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cryptsetup depends on:
ii  dmsetup                      2:1.02.27-3 The Linux Kernel Device Mapper use
ii  libc6                        2.7-12      GNU C Library: Shared libraries
ii  libdevmapper1.02.1           2:1.02.27-3 The Linux Kernel Device Mapper use
ii  libpopt0                     1.14-4      lib for parsing cmdline parameters
ii  libuuid1                     1.41.0-3    universally unique id library

cryptsetup recommends no packages.

Versions of packages cryptsetup suggests:
pn  dosfstools                    <none>     (no description available)
ii  initramfs-tools [linux-initra 0.92e      tools for generating an initramfs
ii  udev                          0.124-4    /dev/ and hotplug management daemo

-- no debconf information
--- cryptsetup-1.0.6/debian/askpass.c	2008-07-26 10:20:13.000000000 +0200
+++ cryptsetup-1.0.6-jh/debian/askpass.c	2008-07-26 10:09:56.000000000 +0200
@@ -40,6 +40,9 @@
 #include <signal.h>
 #include <dirent.h>
 #include <linux/vt.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/uio.h>
 
 #define DEBUG 0
 
@@ -361,6 +364,68 @@
 }
 
 /*****************************************************************************
+ * splashy functions                                                         *
+ *****************************************************************************/
+
+/* It might be better style to just do a popen of splashy_update ? */
+
+#define SPLASHY_SOCK	"\0/splashy"
+static size_t splashyused = 0;
+static size_t splashysize = 0;
+static char *splashybuf = NULL;
+
+static int
+splashy_prepare(const char *prompt)
+{
+	int fd;
+	struct sockaddr addr = {AF_UNIX, SPLASHY_SOCK};
+	struct iovec iov[2];
+
+	if ((fd = socket (PF_UNIX, SOCK_STREAM, 0)) == -1) {
+		return -1;
+	}
+
+	if (connect (fd, &addr, sizeof addr) == -1) {
+		close (fd);
+		return -1;
+	}
+
+	iov[0].iov_base = "getpass ";
+	iov[0].iov_len = strlen ("getpass ");
+	iov[1].iov_base = prompt;
+	iov[1].iov_len = strlen (prompt) + 1;
+
+	if (writev (fd, iov, 2) == -1) {
+		close (fd);
+		return -1;
+	}
+
+	/* Shutdown write? */
+
+	return fd;
+}
+
+static bool
+splashy_read(int fd, char **buf, size_t *size)
+{
+	debug("In splashy_read\n");
+	if (fifo_common_read(fd, &splashybuf, &splashyused, &splashysize)) {
+		*buf = splashybuf;
+		*size = splashyused;
+		return true;
+	}
+
+	return false;
+}
+
+
+static void
+splashy_finish(int fd)
+{
+	fifo_common_finish (fd, &splashybuf, &splashyused, &splashysize);
+}
+
+/*****************************************************************************
  * fifo functions                                                            *
  *****************************************************************************/
 #define FIFO_PATH "/lib/cryptsetup/passfifo"
@@ -512,6 +577,7 @@
 
 static struct method methods[] = {
 	{ "usplash", usplash_prepare, usplash_read, usplash_finish, false, true, -1 },
+	{ "splashy", splashy_prepare, splashy_read, splashy_finish, false, true, -1 },
 	{ "fifo", fifo_prepare, fifo_read, fifo_finish, false, true, -1 },
 	{ "console", console_prepare, console_read, console_finish, false, true, -1 }
 };

Reply via email to