bwalex/tc-play — pull request #8 by jmesmon (2012-06-18 04:33:11+00:00)
Title: 3 Changes: use variable in make, change tty handling, and remove undefined behavior wrt memcpy

- Notes on the tty handling changes: I didn't understand why you where doing ```open("/dev/tty", O_RDONLY)```, so the changes may be wrong.
The goal was to allow me to pipe a password into tcplay via standard in. `isatty` is used to determine whether to prompt the user or simply read from input. I suppose this could cause issues if the user (for some reason) lacks a tty. Let me know what you think.

- In the makefile, I use variables in the test and clean target instead of hardcoded programs.

- tcplay memcpy's to the same buffer when doing cipher chaning (in = out, in the cipher chaining loop). This eventually gets to a function which memcpy's in to out. memcpy is not technically allowed to do this (pointers must point to independed memory regions), so I check for that case and remove it.
Thoughts: It would probably be cleaner to remove the memcpy between buffers entirely by somehow hoisting it out of this function. I honestly didn't look to hard at this option yet.