3 ms·
They called it OpenSSL Valhalla Rampage, and the comments are hilarious. https://opensslrampage.org/ https://opensslrampage.org/
by sillywalk 3y ago
They called it OpenSSL Valhalla Rampage, and the comments are hilarious.
https://opensslrampage.org/ https://opensslrampage.org/
- mananaysiempre 3y agoNot all of the things they cut out are nonsensical, though. They laughed at the ifdowhile loop, for example, if (C) { do { /* THINGS */ } while (C); } but on a puny compiler and/or CPU this seems like a fairly reasonable way to express that C is unlikely to be true, but if it happens to be we’re going to spend a while to turning it false. Whether such code belongs in a TLS implementation is a different question. (Cutting out inline assembly for rotation operations is even more obviously dependent on the presence of a modern, heavyweight compiler, as only those have—or can afford—an explicit list of idiomatic AST templates they match against your code.)
- jiggawatts 3y agoSecurity code must be correct above all else. Too-clever tricks for tiny performance gains that interfere with readability are the polar opposite of what an SSL library ought to be doing. Such libraries ought to never trust compilers because compilers are ever changing, untrusted things. The right approach is clear readable high level code interspersed with inline assembly for critical sections such as constant-time operations. Speaking of which: OpenSSL did that wrong too. They merged some AES NI optimisations without having the CPUs to test it on. This lead to the one and only crash I’ve ever experienced due to a CPU upgrade! Stop justifying what is clearly a trash fire.