2 ms·
I know Colin likes to keep commenting that the simplicity of spiped makes it inherently more secure than more complex alternatives. I haven't evaluated the code
by peterwwillis 13y ago
I know Colin likes to keep commenting that the simplicity of spiped makes it inherently more secure than more complex alternatives. I haven't evaluated the code, nor done a study to see if the number of lines of code always correlates to number of security holes, or if the complexity of the operations compared to the number of lines is related to the number of security holes, and what the bounds of that are. But I just took a brief look at one file and saw this:
/* Generate a 32-byte connection nonce. */
if (crypto_entropy_read(H->nonce_local, 32))
goto err1;
/* Send our nonce. */
if ((H->write_cookie = network_write(s, H->nonce_local, 32, 32,
callback_nonce_write, H)) == NULL)
goto err1;
/* Read the other party's nonce. */
if ((H->read_cookie = network_read(s, H->nonce_remote, 32, 32,
callback_nonce_read, H)) == NULL)
goto err2;
The gotos themselves aren't harmful (even though I don't get why people still use gotos). What strikes me as really funny about this code is its over-simplicity is what caused a huge crypto bug to be missed in Apple's iOS 7 recently. Take a look at the above code and then this security hole[1], and tell me if you can't spot a potential problem.
[1] http://www.wired.com/2014/02/gotofail/ http://www.wired.com/2014/02/gotofail/