File: README.FreeBSD

package info (click to toggle)
ekeyd 1.1.5-6.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 760 kB
  • ctags: 982
  • sloc: ansic: 5,259; sh: 333; makefile: 262; perl: 150
file content (169 lines) | stat: -rw-r--r-- 5,007 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Entropy Key - FreeBSD 
=====================

Overview
--------

Although FreeBSD is not a directly supported Operating System there
have been numerous reports of success compiling and using the Entropy
Key tools from source.

The main issues appear to be getting the kernel USB tty driver to
recognise the Entropy key. 

Ekey source changes
-------------------



FreeBSD 8.0-RELEASE
-------------------

Rob Neal notes that on 8.0 No source changes were required to the
kernel to get teh Entropy Key USB tty device to appear. The options
'device ucom' and 'device umodem' were needed in the kernel because
they are not in GENERIC.


FreeBSD 7.1-STABLE
------------------

Rob Neal has kindly provided the following notes to get the Entropy
Key working on this release.


--- /usr/src/sys/dev/usb/old.umodem.c	2010-01-25 20:40:59.000000000 -0700
+++ /usr/src/sys/dev/usb/umodem.c	2010-01-25 21:10:34.000000000 -0700
@@ -127,6 +127,7 @@
 	{ USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 0 },
 	{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 0 },
 	{ USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_PC5740, 0 },
+	{ USB_VENDOR_SIMTEC, USB_PRODUCT_SIMTEC_EKEY, 0 },
 	{ 0, 0, 0 },
 };
 
@@ -249,6 +250,9 @@
 		    umodem_products[i].product == UGETW(dd->idProduct) &&
 		    umodem_products[i].interface == id->bInterfaceNumber) {
 			ret = UMATCH_VENDOR_PRODUCT;
+		if ((UGETW(dd->idVendor) == USB_VENDOR_SIMTEC) &&   
+			(UGETW(dd->idProduct) == USB_PRODUCT_SIMTEC_EKEY))
+			return(UMATCH_VENDOR_PRODUCT);
 			break;
 		}
 	}


 Driver: 
/usr/src/sys/dev/usb/usbdevs
		Add Simtec vendor id and product id entries in the appropriate
		alphabetical locations:

		vendor SIMTEC       0x20df  Simtec Electronics

		/* Simtec Electronics */
		product SIMTEC EKEY 0x0001 Ekey Entropy Device

/usr/src/sys/dev/usb/umodem.c
	see diffs in umodem.diff. Modify to recognize the Simtec vendor id 
	and product id, and ignore the missing bulk data in. Which was 
	erratic on my box, sometimes it found it, sometimes not.

	The ucom driver is also required, if not already present.
	Loading the umodem driver will result in /dev/cuaUx and /dev/ttyUx
	entries being created. Use the /dev/cuaUx entry to represent the 
	key. /dev/ttyUx barked loudly, cblock issue. 
/etc/devd.conf:
	attach 100 { /* 100 or whatever priority rank you like */
    	match "vendor" "0x20df";
    	match "product" "0x0001";
    	action "logger Ekey $sernum vendor $vendor product $product";
    	action "ln -fs /dev/cuaU0 /var/run/entropykeys/M.9rBjBLNzFWQCFD";
	// note: $device-name (ucom0 in this case) could be parsed to 
	// auto-construct the /dev/cuaUx entry. I'm lazy. 
    	action "/usr/sbin/ekeyd"; 
	};

	detach 100 {
    	match "vendor" "0x20df";
    	match "product" "0x0001";
		action "ekeydctl stats $sernum | logger";
		action "ekeydctl shutdown";
		action "logger Ekey $sernum removed from system";
	};
	
/ekey/src/daemon/Makefile
	LUA include location is wrong:
	LUA_INC ?= -I/usr/local/include/lua5.1
/ekey/src/daemon/crc8.h
	add
	typedef int ssize_t;
	before the crc8() definition
/etc/entropykeys/xxx
	careful, they get whacked by gmake install.
	
use gmake instead of make.                      

/etc/entropykey/ekeyd.conf
	lua and luasockets are needed for the ulusbd, but AF_UNIX support isn't
	part of the package, so things fall down. Use TCPControlSocket, comment
	out the UnixControlSocket

ulusbd refused to find the usb device, but usbdev was happy:
root@bulldog~: usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000)
, rev 1.00
 port 1 addr 2: full speed, power 76 mA, config 1, Entropy Key(0x0001), Simtec E
lectronics(0x20df), rev 2.00
 port 2 addr 3: full speed, power 98 mA, config 1, Geek Squad(0x0031), Geek Squa
d(0x154b), rev 1.00

root@bulldog~: ekey-ulusbd -b0 -d2 -p/dev
Scanning for USB device 0/2
MRN bus->/dev/usb0<-found
Error locating Simtec Entropy Key at 0/2
root@bulldog~: ekey-ulusbd -b0 -d1 -p/dev
Scanning for USB device 0/1
MRN bus->/dev/usb0<-found
Error locating Simtec Entropy Key at 0/1
root@bulldog~: ekey-ulusbd -b0 -d3 -p/dev
Scanning for USB device 0/3
MRN bus->/dev/usb0<-found
Error locating Simtec Entropy Key at 0/3

I hacked in a fprintf to display what bus it thought it was finding. 

but things are fine in ekeyville:
root@bulldog~: ekeydctl list
NR,OK,Status,Path,SerialNo
1,YES,Running OK,/var/run/entropykeys/M.9rBjBLNzFWQCFD,M/9rBjBLNzFWQCFD

root@bulldog~: ekeydctl stats $SER
BytesRead=11532416
BytesWritten=794
ConnectionNonces=44
ConnectionPackets=180194
ConnectionRekeys=44
ConnectionResets=2
ConnectionTime=1432
EntropyRate=32128
FipsFrameRate=1.61
FrameByteLast=11532352
FramesOk=180194
FramingErrors=0
KeyDbsdShannonPerByteL=2.91
KeyDbsdShannonPerByteR=3.03
KeyRawShannonPerByteL=2.84
KeyRawShannonPerByteR=2.86
KeyRawShannonPerByteX=2.83
KeyTemperatureC=31.75
KeyTemperatureF=89.15
KeyTemperatureK=304.9
KeyVoltage=3.302
PacketErrors=1
PacketOK=180193
ReadRate=64426
TotalEntropy=5750912
WriteRate=4