r/programming • • Apr 09 '14

Theo de Raadt: "OpenSSL has exploit mitigation countermeasures to make sure it's exploitable"

[deleted] — view deleted post

2.0k Upvotes

661 comments sorted by

View all comments

84

u/ACTAadACTA Apr 09 '14

There should be an alternative to OpenSSL that is easy to use, formally verified and as small as possible.

I know, I'm a dreamer.

97

u/KitsuneKnight Apr 09 '14

There's several alternatives, including NSS (used by Firefox & Chrome), cryptlib, polarSSL, and even GnuTLS (I wouldn't suggest migrating to that last one :P). Likely none of them are particularly easy to use (which is a major issue that people tend to overlook...), and probably none that are even slightly widely used are formally verified.

Fedora is actually working to migrate things over to using NSS, and has been for a while. At least as things stand right now, NSS seems like a far better option than OpenSSL (plus, there's less issues with the license).

37

u/[deleted] Apr 09 '14

Not like OpenSSL is particularly easy to use.

This has been linked a bunch but it agrees with my experience and random looks at the source have been, if anything, worse than what's in there.

2

u/KitsuneKnight Apr 09 '14

Oh, I didn't mean to imply OpenSSL is easy to use- more so that "easy to use" is not something that's generally used with any of those libraries (OpenSSL seems to take it to a whole different level, though).

31

u/chiniwini Apr 09 '14

I once took a look at the NSS code and after a few hours I wanted to shower myself in napalm. I don't know how bad OpenSSL code is, but I would bet my right hand NSS isn't much better.

5

u/TMaster Apr 09 '14

Chrome is said to be switching to OpenSSL.

I know, I have goosebumps too. The bad kind.

→ More replies (1)

3

u/RealDeuce Apr 09 '14

I actually find cryptlib to be insanely simple to use.

→ More replies (1)

7

u/Hashiota Apr 09 '14

http://en.wikipedia.org/wiki/Comparison_of_TLS_implementations
The implementations targeting embedded systems are usually small and written in readable ANSI C, without many dependencies (some corners of OpenSSL need even Perl to run).

5

u/FUZxxl Apr 09 '14

IMHO it would be a great idea to write a library that puts the encryption keys into a different address space (i.e. a different process) as to make it impossible for any flaw to read it out.

15

u/exscape Apr 09 '14

So this may sound naive, but... If a flaw can't read them from a separate process, how can the program itself? Or can you really write it such that the separate process handles all the encryption/decryption in safe(r) manner?

12

u/FUZxxl Apr 09 '14

The main program cannot read out the key but it can perform cryptographic operations with it, for instance it can tell the key-process to encrypt or decrypt a piece of data for him. Even though an attacker could still do nasty things in such a model, he could not get the key.

5

u/shub Apr 09 '14

Unless the key process is itself vulnerable. But it would still be an improvement.

8

u/FUZxxl Apr 09 '14

That's right. But a process with a well-defined command interface is much less vulnerable than a function that is part of a large process with tons of functionality.

3

u/mindbleach Apr 09 '14

Interesting. Done correctly, you'd limit your attack surface to the messaging and de/allocation methods of the operating system.

As a rule, though, I'd still zero out any keys before freeing their memory. Or maybe use a canonical "dummy" key, and occasionally check for that key in freshly-allocated memory as an indication that a leak has occurred.

2

u/nwf Apr 10 '14

You are describing the Plan 9 factotum process. It truly is an excellent design which places the untrustworthy server and client processes as merely men in the middle in the authentication and session-key-derivation games. See, for example, http://man.cat-v.org/p9p/4/factotum for details.

→ More replies (1)

2

u/frezik Apr 09 '14

This is basically how qmail works. Bunch of little daemons who barely trust each other.

2

u/[deleted] Apr 09 '14

That would have prevented part of this attack, but not all of it. There's plenty of damage done here that doesn't have to do with crypto keys.

→ More replies (4)

3

u/until0 Apr 09 '14

I sit here reading all these articles and all I can think is that I wish I had a better understanding of the inner workings of cryptography so I could make an attempt.

Unfortunately, I don't care much for math. Comp Sci maybe wasn't the smartest idea...

1

u/mgrandi Apr 09 '14

mac os x is transitioning to something other then openssl in the latest version (mavericks)

→ More replies (4)