Patched Makefile with edits from Rune Magnus
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
CFLAGS = -Wall -Wextra -Wunused-parameter -std=c99 -O3 -I Keccak -I /usr/include/libftdi1
|
||||
CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -I Keccak -I /usr/include/libftdi1
|
||||
|
||||
all: infnoise
|
||||
|
||||
@@ -6,4 +6,4 @@ infnoise: infnoise.c infnoise.h healthcheck.c writeentropy.c daemon.c Keccak/Kec
|
||||
$(CC) $(CFLAGS) -o infnoise infnoise.c healthcheck.c writeentropy.c daemon.c Keccak/KeccakF-1600-reference.c -lftdi -lm -lrt
|
||||
|
||||
clean:
|
||||
$(RM) -f infnoise
|
||||
$(RM) infnoise
|
||||
|
||||
@@ -172,3 +172,15 @@ to /usr/local/bin, your udev file would like this:
|
||||
|
||||
$ cat /etc/udev/rules.d/75-infnoise.rules
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", RUN+="/usr/local/bin/infnoise --dev-random --daemon"
|
||||
|
||||
I personally run the infnoise tool by hand from a bash shell, typically to test devices like this:
|
||||
|
||||
$ sudo ./infnoise --debug --no-output
|
||||
|
||||
To avoid having to type 'sudo' each time, I created the following udev rules,
|
||||
which worked on my particular Ubuntu 14.04 based laptop:
|
||||
|
||||
$ cat 30-infnoise.rules
|
||||
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", GROUP="dialout", MODE="0664"
|
||||
|
||||
Note that my username is in the dialout group.
|
||||
|
||||
@@ -128,7 +128,11 @@ static bool initializeUSB(struct ftdi_context *ftdic, char **message) {
|
||||
ftdi_init(ftdic);
|
||||
// Open FTDI device based on FT240X vendor & product IDs
|
||||
if(ftdi_usb_open(ftdic, 0x0403, 0x6015) < 0) {
|
||||
*message = "Can't find Infinite Noise Multiplier\n";
|
||||
if(!isSuperUser()) {
|
||||
*message = "Can't find Infinite Noise Multiplier. Try running as super user?\n";
|
||||
} else {
|
||||
*message = "Can't find Infinite Noise Multiplier\n";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,11 +237,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if(!isSuperUser()) {
|
||||
fputs("Super user access needed.\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!multiplierAssigned && writeDevRandom) {
|
||||
outputMultiplier = 2u; // Don't throw away entropy when writing to /dev/random unless told to do so
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CFLAGS=-Wall -Wextra -Wunused-parameter -std=c99 -O3
|
||||
CFLAGS=-Wall -Wextra -Werror -std=c99 -O3
|
||||
|
||||
all: passgen healthcheck findlongest entcheck hex2bin bin2hex flipbits dice
|
||||
|
||||
|
||||
Reference in New Issue
Block a user