RNCryptor/RNCryptor — pull request #126 by carllindberg (2014-06-22 19:07:49+00:00)
Title: Fix minor issue in the rnc_isEqualInConsistentTime: NSData method.

Fix minor issue in the rnc_isEqualInConsistentTime: NSData method. I'm pretty sure it's not a problem for RNCryptor's usage, but in general use it was possible for two NSDatas, where one was a prefix of the other and their lengths differ by exactly 256, to compare as equal when they were not. I added a unit test to exhibit the problem.

The bug was simply using "-" instead of "!=", and truncating the result into an 8-bit value. This problem would be flagged if the suspicious implicit conversions warning was turned on, so I added that to the project (and quieted some unit test code which was flagged though that was not a bug). I found the issue when using the source files in another project which did have that warning turned on. It's possible some other warnings should be enabled.