Patched Makefile with edits from Rune Magnus

This commit is contained in:
Bill Cox
2016-07-01 09:22:50 -07:00
parent b26b1e9f6b
commit 4f135647f2
4 changed files with 20 additions and 9 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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
}

View File

@@ -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