logoalt Hacker News

socketcluster • today at 6:42 AM • 11 replies • view on HN

> BTW, OpenSSL seems to be a rather low quality implementation of a very low quality set of APIs.

Fully agree with your assessment above that line, but damn, this is a strong statement for a library this ubiquitous. You wonder; how could this happen? And yet, as an open source developer myself, I know how little people care about code quality.


Replies

Gigachad • today at 6:45 AM

We have known this since at least heartbleed. The answer was that basically no one funds the project and it had only one developer.

All these trillion dollar tech companies have been leaching off open source for free and never contributed back to the projects they rely on.

➕ show 5 replies
rwmj • today at 8:29 AM

If you've ever tried using OpenSSL you'll know that it's true.

The API is a fractal of bad design. Not just that, but because of the API refusing to make sensible choices, it forces everyone using it to be an expert in cryptography, with predictable results for those programs that use it.

perbu • today at 10:28 AM

How it happened? A lot of features in OpenSSL was written as part of a PhD and dumped in the repo without any thought about long term maintainability or quality. Now, during the last 5 years or so, people have been trying to straighten it out, but this is a pretty daunting task.

➕ show 1 reply
yayachiken • today at 9:11 AM

SSL/TLS has always been a wonky and complicated standard built upon other wonky standards like x509 and ASN.1 (for PKI) that nobody would touch unless they are forced to.

There is a reason why people did not do a lot of TLS (outside of anything involving monetary transactions) before Firesheep, the NSA leaks were the final nail in the coffin for unencrypted HTTP. On top of that Let's Encrypt and ACME did not exist, so TLS was behind a paywall on top of that.

And then everything proliferated relatively quick even for tech standards. I guess people grabbed onto the next available tooling just like a drowning person would take any piece of driftwood.

Not so fun fact: AFAIK the openssl binary was initially explicitly meant to be only used for testing. That is why its command line is so strange. It was initially meant to expose a couple of low-level primitives, not to implement workflows. One example would be the openssl-ca man page, which explicitly mentions this. People didn't care because unfortunately you could somehow do everything you could ever want with the openssl binary and I guess that is also something how the impression stuck that openssl is the most advanced library.

➕ show 1 reply
asveikau • today at 4:58 PM

Many people are using forks that are mostly API compatible. So the ubiquity is not as huge a problem as it used to be.

throwaway2037 • today at 8:35 AM

    > And yet, as an open source developer myself, I know how little people care about code quality.
This is a weird statement. I am someone who has worked on closed-source internal enterprise software for my entire career. Universally, the internal source is worse that the numerous open source libraries that we use. If anything, open source has "more eyeballs" than closed source, so the code quality will be better.
➕ show 1 reply
bjackman • today at 11:10 AM

I'd like to point you to: https://www.haproxy.com/blog/state-of-ssl-stacks

Among the deeply technical and highly credible and detailed articles I've read in my life, it's definitely the spiciest. At the end:

> It is often said that fixing a problem requires smarter minds than those who created that problem. When the problem was architected by a team with strong convictions about the solution‘s correctness, it seems extremely unlikely that the resolution will come from the team that created that problem in the first place. The lack of progress in the latest releases tends to confirm these unfortunate hypotheses. The only path forward seems to be for the team to revert some of the major changes that plague the 3.x versions, but discussions suggest that this is out of the equation for them.

IOW this extremely strong claim does seem to be supported by extremely credible actors.

StilesCrisis • today at 1:17 PM

Google forked OpenSSL in 2014 (BoringSSL) with a pretty similar rationale, stated more diplomatically.

➕ show 1 reply
alienbaby • today at 8:36 AM

I remember a long time ago reading openssl was dumpster file code quality wise. I guess it was just built that way and never improved.

➕ show 1 reply
topspin • today at 9:04 AM

> You wonder; how could this happen?

It all came from a bad place. OpenSSL grew from primitives created by cryptographers. Cryptographers are great, and they make fabulous things. But almost none of the understand software development or care a great deal about the mundane matters of API design, or the obnoxious limitations of naively designed processing elements.

Others have cited the documentation for EVP_EncodeBlock(). In the mind of a cryptographer, the text is perfectly clear and trivial, and they likely haven't exposed themselves for many years to anyone that can't read that exactly once and not immediately and correctly visualize the necessary formulae. Nothing wrong here at all. The fact that on real computers, numbers don't just scale to whatever value a computation requires is merely a defect in the design of the machine.

➕ show 1 reply
cowlevel • today at 9:57 AM

Because you don't roll your own SSL.