Live data from Hacker News

OpenSSL is written by monkeys (2009)

peereboom.us

171–180 of 188 posts

Re: OpenSSL is written by monkeys (2009)

#171
post #106

Earlier quoted context omitted.

Maybe he is saying by removing trusted root certificates he will trade the possibility of receiving a fraudulent certificate the first time he uses a site for the possibility of not being warned if a certificate changes because the trusted roots are compromised. If he needs to worry about state actors there is an argument to be made for this trade-off, but really if he was worried about that he would be delivering ce…

There are extensions to warn you about certificate changes even if the new is signed by a CA, so that's a terrible reason.

Ah, yes, certificate patrol[0]. However, your argument, I think, is not valid. Sure, it's technically possible for him to know if any cert changes, but in reality very few people are going to install the extension and those that do might not even notice the message because it notifies the user so frequently (fully desensitizing them I imagine).

I don't think that his choice not to install an extension invalidates his argument.

[0]: https://addons.mozilla.org/en-us/firefox/addon/certificate-p...

Re: OpenSSL is written by monkeys (2009)

#172
post #159
post #146

Having worked with OpenSSL on only one occasion. I figured something was up when they have a function named SHA1_Update and SHA_Update that has the exact same signature and creates different outputs. A library designed by incompetents.

SHA_Update is for the SHA-0 hash, and SHA1_Update is for the SHA-1 hash, so it's hardly completely illogical. The main issue here, is that people that don't know the difference between SHA-0 and SHA-1 should likely not be in charge of computing hashes by themselves. Crypto requires some expertise or it goes awry very fast, but then the educational system is producing plenty people with good crypto knowledge, it's har…

The problem was that the names are too close to each other and was one typo away from mysterious bugs. The non-existence of documentation didn't help either.

Re: OpenSSL is written by monkeys (2009)

#173
post #171

Earlier quoted context omitted.

There are extensions to warn you about certificate changes even if the new is signed by a CA, so that's a terrible reason.

Ah, yes, certificate patrol[0]. However, your argument, I think, is not valid. Sure, it's technically possible for him to know if any cert changes, but in reality very few people are going to install the extension and those that do might not even notice the message because it notifies the user so frequently (fully desensitizing them I imagine). I don't think that his choice not to install an extension invalidates his…

very few people are going to install the extension

My argument is, pinning certs is a bad reason for removing the root certs from the browser, since you can pin them without breaking the CA chains.

I'm not sure how does that work as a counter-argument; We're discussing a decision of a particular person, not some broad policy. How is the number of people who install the extension relevant?

those that do might not even notice the message because it notifies the user so frequently (fully desensitizing them I imagine)

So does the browser, if you remove the root CA certs.

Re: OpenSSL is written by monkeys (2009)

#174
post #172
post #159

Earlier quoted context omitted.

SHA_Update is for the SHA-0 hash, and SHA1_Update is for the SHA-1 hash, so it's hardly completely illogical. The main issue here, is that people that don't know the difference between SHA-0 and SHA-1 should likely not be in charge of computing hashes by themselves. Crypto requires some expertise or it goes awry very fast, but then the educational system is producing plenty people with good crypto knowledge, it's har…

The problem was that the names are too close to each other and was one typo away from mysterious bugs. The non-existence of documentation didn't help either.

If you go that way there is also MD2_Update, MD4_Update and MD5_Update, that are also one typo away of a bug you can't miss at all if you test anything.

Of the many many faults of the OpenSSL API you just didn't chose the right one.

Re: OpenSSL is written by monkeys (2009)

#175
post #61

Earlier quoted context omitted.

O.K. This is probably a stupid question but if it was apparent to many that the code of OpenSSL was horrible why people kept using it and nobody tried to re-factor it? How it is possible that such a popular and critical piece of opensource software survived the years without a complete face-lift and nobody wrote thorogh documentation?

1. Other libraries do exist -- NSS, GnuTLS, etc. 2. Do you have time for a rewrite? What makes you think anyone else would? 3. The (generally correct) mindset is don't implement your own crypto . This is particularly true of something like TLS, which is complicated and has subtle requirements that are easy to screw up. Unfortunately, this means that even people who have time are discouraged from doing an OpenSSL rewr…

> The (generally correct) mindset is don't implement your own crypto

That sounds like bad advice. The huge impact of Heartbleed is precisely because of the monoculture in SSL/TLS implementations. Shit happens but this vulnerability is such a catastrophe because an estimated half a million of the top Internet websites have been vulnerable since 2012, including popular services that everybody is using and the vulnerability once discovered, is easy to use and far reaching, allowing one to steal sessions, passwords, the domain's private keys and anything important.

It really can't get any worse than this. At the very least we found out about it, better late than never and we can discuss the source-code, but it does make one wonder ... if SSL/TLS is such an important piece of infrastructure and if we need a monoculture (because apparently it's bad advice to reimplement crypto), why aren't we using a library that's the reference and that's peer reviewed by a standards committee, instead of relying on a library for which commits don't necessarily trigger sounds?

Re: OpenSSL is written by monkeys (2009)

#176
post #127

Earlier quoted context omitted.

It is really difficult to refactor such things at the public API layer once they are widely adopted by 3rd party projects. Take the aforementioned error return inconsistencies -- how do you possibly deal with refactoring that for consistency when so many other projects are consuming OpenSSL as a library? You're trading one big problem (new clients are likely to get error return handling wrong) with another (if you mo…

> how do you possibly deal with refactoring that for consistency when so many other projects are consuming OpenSSL as a library? You split your project into two components: 1. a new, clean, minimal core with a nice, shiny, new API; and 2. an "OpenSSL emulation layer" that loads your core library, and wraps it in OpenSSL-compatible cruft. It'd be very similar to, say, replacing Direct3D with OpenGL, and then writing a…

it sounds so easy when you break it out like that but it is a considerable investment of time and money. Convincing people to spend either of those on refactoring vs adding new features is a constant battle. No one ever really understands it and typically responds with "you want to go back and do what you already did, just differently?"

Re: OpenSSL is written by monkeys (2009)

#177
post #156

Earlier quoted context omitted.

1. Other libraries do exist -- NSS, GnuTLS, etc. 2. Do you have time for a rewrite? What makes you think anyone else would? 3. The (generally correct) mindset is don't implement your own crypto . This is particularly true of something like TLS, which is complicated and has subtle requirements that are easy to screw up. Unfortunately, this means that even people who have time are discouraged from doing an OpenSSL rewr…

Historically GnuTLS had even more security trouble than OpenSSL (like that bug where it was trusting a self signed root certificate even if not in the certificate store that went undetected for years). And NSS is pretty light on the server code IIRC... In my past as professional code auditor, I've seen OpenSSL shipped with products quite a bit, and in 99% of the cases it was openssl the command line tool that was use…

NSS has enough server code that it was possible to implement mod_nss, a replacement for mod_ssl in Apache:

http://directory.fedoraproject.org/wiki/Mod_nss#What_feature...

Re: OpenSSL is written by monkeys (2009)

#178
post #114
post #46

Earlier quoted context omitted.

Yes. You arp poison the default gateway and route traffic through your own host instead.

Or spoof DNS responses to point to a machine under your control.

Or spoof a disassociation frame, then impersonate the access point so the victim connects to your computer instead.

Re: OpenSSL is written by monkeys (2009)

#179
post #174
post #172

Earlier quoted context omitted.

The problem was that the names are too close to each other and was one typo away from mysterious bugs. The non-existence of documentation didn't help either.

If you go that way there is also MD2_Update, MD4_Update and MD5_Update, that are also one typo away of a bug you can't miss at all if you test anything . Of the many many faults of the OpenSSL API you just didn't chose the right one.

Having been bitten by SHA1_Update with no expectation that SHA_Update would work as well. I'm sort of bitter about that.

Re: OpenSSL is written by monkeys (2009)

#180
post #167

Earlier quoted context omitted.

The NSA wrote SELinux.

Has that been audited independently? A quick Google search didn't cough up anything.

You mean, has anyone formally audited SELinux to make sure the NSA didn't load it with backdoors? No idea, but it was accepted into mainline Linux kernel ten years ago. So if you don't trust SELinux, you can't trust Linux.
Post reply on HN