4 ms·
Reviewing and improving literally every function in OpenSSL one at a time is a truly heroic effort. A part of me regrets that so much time and skill is being s
by mike_hearn 11y ago
Reviewing and improving literally every function in OpenSSL one at a time is a truly heroic effort.
A part of me regrets that so much time and skill is being sunk into a swamp like OpenSSL though. Surely by now it'd have been easier for Google to produce a much more modern C++ based SSL toolkit that doesn't have this ridiculous litany of problems to resolve? An OpenSSL API emulation could then have been layered on top. I realise a lot of C/C++ apps rely on the OpenSSL API, but I hope one day the industry finds a way to rip off the sticking plaster.
- sbierwagen 11y agoAn OpenSSL API emulation could then have been layered on top. I feel like a full OpenSSL API emulator (With ABI!) would be about as big as OpenSSL itself.
- swsieber 11y agoI feel like this would actually be a good project for a rust re-write. I like to think of rust as c or c++ except with memory "static type-checking". That seems like a huge incentive.
- dyladan 11y agoIt's difficult/impossible to write constant time functions in rust in it's current state afaik.
- arielby 11y agoNot more difficult than C - you write the crypto functions in asm. You could use a C compiler to handle the ABI but the code isn't really C code.
- MichaelGG 11y agoHow much code needs to be constant time? Compared to all the management code and parsing and so on?
- swsieber 11y agoI did not realize that; looking things up I can verify your claim. There is an RFC out there for the ability to write constant time functions. That would be great and I hope it makes it in. Thanks for informing me.
- viraptor 11y agoCould you link something relevant? I find it hard to believe - seems you could do it the same way every other language does. For example OR all the bytes XORed between two arrays, then compare to 0. Maidsafe seems to be implementing it somehow for example: http://maidsafe.net/sodiumoxide/master/maidsafe_sodiumoxide/crypto/auth/hmacsha512256/struct.Tag.html http://maidsafe.net/sodiumoxide/master/maidsafe_sodiumoxide/... (see comments about PartialEq)
- chris_wot 11y agoNot necessarily. A complete rewrite can often introduce more bugs than are solved. There's lots wrong with OpenSSL, but there's also a lot it does correctly. Refactoring code like this is actually a good way of doing things!
- masklinn 11y ago> An OpenSSL API emulation could then have been layered on top. Not really. OpenSSL exposes "internal" data structures in its API, leaking e.g. x.509 datastructures through[0]. The only way to expose an OpenSSL API emulation is to be OpenSSL. That's why the libressl project started libtls[1] (née ReSSL) as a clean-slate abstracted API. [0] http://www.tedunangst.com/flak/post/goreSSL http://www.tedunangst.com/flak/post/goreSSL [1] http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/tls_accept_fds.3?query=tls%5finit&sec=3 http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/...
- wnoise 11y agoOh thank goodness someone is making a saner API.
- AnthonyMouse 11y ago> An OpenSSL API emulation could then have been layered on top. A major problem with OpenSSL is the API. It's hard to use correctly and encourages bad code. Effort would be much better spent transitioning applications away from that API than trying to emulate it.