by jjnoakes · 9y ago · 0 comments
Ignoring timing attacks, they should have used strcmp(), not strncmp(). strncmp() is for testing if one string is a prefix of another; they wanted to test if some string equaled another.
Since this is crypto related stuff, though, they should be using a strcmp()-like routine that works in a content-independent timing fashion.
But normally strncmp isn't safer than strcmp. They just do different things.