2 ms·
Oh, and in case you're wondering why was the constant time implementation put behind a flag anyway, the paper explains it's because the constant-time algorithm
by zaroth 10y ago
Oh, and in case you're wondering why was the constant time implementation put behind a flag anyway, the paper explains it's because the constant-time algorithm is slower than the alternate implementation, so constant-time is only supposed to be used when it's actually needed to protect a secret. Of course that opens the potential for not using constant-time when you were supposed to, which is exactly what happened here.
I'm not sure how it was missed that the constant-time code path wasn't actually being used in this case. If you put your security-critical DSA bugfix behind a flag, wouldn't you check the flag actually propagated to the internal function for DSA operations?
- cwillu 10y agoWhat I don't get is why the _default_ isn't made the safe choice, with the more performant option being available for when it actually matters?
- joosters 10y agoYou might be misinterpreting the code. Not all algorithms are vulnerable to this attack, so OpenSSL might be picking the faster version for those specific algorithms, and the constant time version for the others.
- zaroth 10y agoI think this would have been a much smarter way to code it! Default slow and safe, require an added flag for more performance. That would make it much harder to end up on the timing-sensitive / high performance implementation by mistake. Probably the trap was since the constant-time algorithm was the new code, "backward compatibility" would suggest adding a flag to select the new algorithm.