Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-crypt/ekeyd/files: ekeyd-1.1.4-gentoo.patch
Date: Mon, 05 Sep 2011 20:10:19
Message-Id: 20110905201009.5D37E20051@flycatcher.gentoo.org
1 flameeyes 11/09/05 20:10:09
2
3 Added: ekeyd-1.1.4-gentoo.patch
4 Log:
5 Bump to version 1.1.4; the patches have been collapsed into one, big gentoo patch for now.
6
7 (Portage version: 2.2.0_alpha53/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-crypt/ekeyd/files/ekeyd-1.1.4-gentoo.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/ekeyd/files/ekeyd-1.1.4-gentoo.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/ekeyd/files/ekeyd-1.1.4-gentoo.patch?rev=1.1&content-type=text/plain
14
15 Index: ekeyd-1.1.4-gentoo.patch
16 ===================================================================
17 Index: ekeyd-1.1.4/host/ekeyd.c
18 ===================================================================
19 --- ekeyd-1.1.4.orig/host/ekeyd.c
20 +++ ekeyd-1.1.4/host/ekeyd.c
21 @@ -209,7 +209,7 @@ open_foldback_output(void)
22 return (output_stream != NULL);
23 }
24
25 -static const char *usage=
26 +static const char usage[]=
27 "Usage: %s [-f <configfile>] [-p <pidfile>] [-v] [-h]\n"
28 "Entropy Key Daemon\n\n"
29 "\t-f Read configuration from configfile\n"
30 Index: ekeyd-1.1.4/host/ekey-setkey.c
31 ===================================================================
32 --- ekeyd-1.1.4.orig/host/ekey-setkey.c
33 +++ ekeyd-1.1.4/host/ekey-setkey.c
34 @@ -79,7 +79,7 @@ calc_mac(uint8_t *snum, uint8_t *mkey, u
35 return mac;
36 }
37
38 -static const char *usage =
39 +static const char usage[] =
40 "Usage: %s [-d] [-h] [-n] [-f <keyring>] [-m <master>]\n"
41 " [-s <serial>] <path>\n"
42 "Entropy key device long term session key tool\n\n"
43 Index: ekeyd-1.1.4/host/ekey-ulusbd.c
44 ===================================================================
45 --- ekeyd-1.1.4.orig/host/ekey-ulusbd.c
46 +++ ekeyd-1.1.4/host/ekey-ulusbd.c
47 @@ -100,7 +100,8 @@ find_usb_device(char *busmatch, char *de
48
49 #if LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
50 if ((r = usb_detach_kernel_driver_np(devh, EKEY_IFACE)) != 0) {
51 - if (r != -ENODATA) {
52 + /* libusb_compat-0.1.3 mistakenly translate ENODATA to ENOENT */
53 + if (r != -ENODATA && r != -ENOENT) {
54 fprintf(stderr,
55 "Unable to detach Entropy Key at %s/%s from kernel\n",
56 busmatch, devmatch);
57 Index: ekeyd-1.1.4/udev/entropykey.sh
58 ===================================================================
59 --- ekeyd-1.1.4.orig/udev/entropykey.sh
60 +++ ekeyd-1.1.4/udev/entropykey.sh
61 @@ -19,9 +19,9 @@ wait_for_usb () {
62 COUNTER=$(( ${COUNTER} + 1 ))
63 test ${COUNTER} -ge 10 && exit 1
64 done
65 - $BINPATH/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid -p/var/run/entropykeys/${ENTROPY_KEY_SERIAL} -D
66 + /usr/libexec/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid -p/dev/entropykey/${ENTROPY_KEY_SERIAL} -D
67 sleep 1
68 - $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
69 + $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
70 exit 0
71 }
72
73 @@ -34,18 +34,18 @@ else
74 if test "x${BUSNUM}" = "x" -o "x${DEVNUM}" = "x"; then
75 exit 0
76 fi
77 - if test -r "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid"; then
78 - kill $(cat "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid") || true
79 + if test -r "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid"; then
80 + kill $(< "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid") || true
81 fi
82 - mkdir -p /var/run/entropykeys
83 + mkdir -p /dev/entropykey /dev/.ekeyd-ulusb
84 wait_for_usb &
85 exit 0
86 fi
87 # Update ekeyd with device operation
88 - $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
89 + $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
90 if test "x$ACTION" = "xremove"; then
91 - rm "/var/run/ekey-ulusbd-${ENTROPYKEY_KEY_SERIAL}.pid"
92 - rm "/var/run/entropykeys/${ENTROPYKEY_KEY_SERIAL}"
93 + rm "/dev/.ekey-ulusbd/${ENTROPYKEY_KEY_SERIAL}.pid"
94 + rm "/dev/entropykey/${ENTROPYKEY_KEY_SERIAL}"
95 fi
96 fi
97
98 Index: ekeyd-1.1.4/udev/fedora15/60-entropykey.rules
99 ===================================================================
100 --- ekeyd-1.1.4.orig/udev/fedora15/60-entropykey.rules
101 +++ ekeyd-1.1.4/udev/fedora15/60-entropykey.rules
102 @@ -12,7 +12,7 @@
103 ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="usb_id --export %p"
104
105 # Detect an Entropy Key being inserted and extract serial number
106 -ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT}"
107 +ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/sh -c '/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT} | /bin/sed -e s:/:_:g'"
108
109 # Add the /dev/entropykey/<serialnumber> symbolic link
110 ENV{ENTROPY_KEY_SERIAL}!="", SYMLINK+="entropykey/$env{ENTROPY_KEY_SERIAL}"
111 Index: ekeyd-1.1.4/udev/fedora15/60-entropykey-uds.rules
112 ===================================================================
113 --- ekeyd-1.1.4.orig/udev/fedora15/60-entropykey-uds.rules
114 +++ ekeyd-1.1.4/udev/fedora15/60-entropykey-uds.rules
115 @@ -9,7 +9,7 @@
116 # For licence terms refer to the COPYING file.
117
118 # Detect an Entropy Key being inserted and extract serial number
119 -ACTION=="add|change|remove", SUBSYSTEM=="usb", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/echo ENTROPY_KEY_SERIAL=$attr{serial}"
120 +ACTION=="add|change|remove", SUBSYSTEM=="usb", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/sh -c '/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT} | /bin/sed -e s:/:_:g'"
121
122 # And tell the ekeyd about the device action.
123 ENV{ENTROPY_KEY_SERIAL}!="", RUN+="/lib/udev/entropykey.sh"
124 Index: ekeyd-1.1.4/host/Makefile
125 ===================================================================
126 --- ekeyd-1.1.4.orig/host/Makefile
127 +++ ekeyd-1.1.4/host/Makefile
128 @@ -107,7 +107,7 @@ OPT ?= -O2
129 CFLAGS += $(INCLUDES)
130 CFLAGS += -g -Wall $(OPT)
131 CFLAGS += -fno-strict-aliasing
132 -CFLAGS += -std=c99 -Wall -pedantic -Wshadow -Werror -D_GNU_SOURCE
133 +CFLAGS += -std=c99 -Wall -pedantic -Wshadow -D_GNU_SOURCE
134 CFLAGS += '-DCONFIGFILE="$(SYSCONFPREFIX)/ekeyd.conf"'
135 CFLAGS += '-DPIDFILE="$(RUNTIMEPREFIX)/ekeyd.pid"'
136 CFLAGS += '-DKEYRINGFILE="$(SYSCONFPREFIX)/keyring"'
137 @@ -148,7 +148,7 @@ daemonise_ulusbd.o: daemonise.c
138 $(COMPILE.c) $(OUTPUT_OPTION) $(PTHFLAGS) $^
139
140 egd-linux: egd-linux.o daemonise.o
141 - $(CC) $(CFLAGS) -o $@ $^
142 + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
143
144 ekeyd: ekeyd.o daemonise.o lstate.o connection.o stream.o frame.o packet.o keydb.o util.o fds.o krnlop.o foldback.o stats.o nonce.o ../device/frames/pem.o ../device/skeinwrap.o ../device/skein/skein.o ../device/skein/skein_block.o
145 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)