Introducing s2n, a New Open-Source TLS Implementation
blogs.aws.amazon.com
blogs.aws.amazon.com
OCaml TLS: ~4400 LoC
OCaml X509: ~1550 LoC
OCaml ASN1: ~1400 LoC
OCaml nocrypto: ~5250 LoC
Total ~12600 LoC but you get a fully self-contained implementation, having only some crypto code in C and the rest as pure OCaml:https://mirage.io/blog/why-ocaml-tls https://mirage.io/blog/announcing-mirage-25-release
"[...] security bounties can be a very effective way to show the presence of vulnerabilities, but they are hopelessly inadequate for showing their absence."
We really like the idea of continuing the self-service security bounties, irrespective of their size. One of the nice things about unikernels is that it makes it easy to link in logic like this -- in a conventional OS, it would mean faffing around with kernel modules in order to safely seal the Bitcoins away, whereas here it's just normal high-level language code.
Incidentally, we're working on exposing a C interface to the OCaml TLS stack so that it can be used as a normal shared library as well. The approach is to use the OCaml Ctypes library (which is normally used to bind to C libraries from OCaml), but deploy it in inverted mode. This means that we expose a C ABI from OCaml code instead.
See https://github.com/yallop/ocaml-ctypes-inverted-stubs-exampl... for an example that exposes a C parsing interface to the OCaml XMLM library. The TLS stack isn't much more complex, but is pending us looking into libtls that are easier to expose than OpenSSL's. The s2n release here is thus nice and timely...
Would self-service security bounties enable a distributed bounty ? where each site developer puts a relatively small bounty in his site and his bounty offers him a certain qualification in the eyes of customers , but from the hacker standpoint , if you hacked one , you hacked them all and hence you can collect multiple bounties ?
Also , pinata exposes all hacks in public, unlike today.
No amount of prize money can ever really tell you how secure something is. We knew this before we announced it (see background at [1]).
I think the dream is there for many but as other comments have pointed out, getting to the battle tested level of OpenSSL is really really hard.
At first I was really surprised/impressed/worried that they managed to pull off an ASN.1 parser in C along with TLS is just 6,000 lines of code. Alas, they did not.
So, when they mention the 500,000 lines of OpenSSL, they are probably actually using a good 20,000+ of it for ASN.1 and all of the ciphers.
Yay marketing!
However, he does not want to give it away.
ASN.1 is a rather hairy standard overall, but AFAIK only a part of it is needed for TLS.
Where is the OCaml source / repo?
"Yo sn2, I'm really happy for you, Imma let you finish but Ocaml had one of the best TLS stacks of all time ... one of the best TLS stacks of all time!"
"I love s2n!"
[edit: oh, c'mon with the downvotes, it was a follow-up kanye ref about beck!]
At the moment, I'm not that impressed with the testing since even making it build actually requires patching it! This is just due to one of the examples, but from the git history it's been broken since January.
So for every case I've seen, they'd have been ahead to issue credentials themselves and just skip client certs.
If you have a bunch of micro services that need to communicate with each other securely, client cert validation solves a big problem.
TLS is the right solution iff you need to communicate with third parties whom you can't securely share code or keys with in advance.
PKI is used to build a chain of trust. Whether it involves third parties or not is not the point.
The fact that they are focusing on the TLS protocol itself and not the actual encryption implementation is a good way to start; the "extraneous complexity" is not really in algorithms like RSA/ECDSA/AES since those are specified mathematically, but in the handling of the protocol messages and states. That is also where most of the bugs tend to be.
It reminds me of this Hoare quote: "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."
My biggest issue with OpenSSL is that it also tries to do IO, but does it in a not too well-performing and non cross-platform way.
Looks like currently you must set a file descriptor (though the docs mention the possibility of using a pipe). Once an FD is set, you do control pulling/pushing data to s2n.
Can you elaborate more on "not too well-performing"?
Both are bad, but I'd say that "remote root" trumps "side channel attack".
Or any file in that directory.
I really thought OpenSSL was in a much better shape.
Why?
"Today s2n supports OpenSSL, LibreSSL, BoringSSL".
"Our pill has been clinically tested."
What were the results?
Anyone else think this was a contraction of the a11y, i18n, a16z or f6s variety?
sawn scan seen sewn shin shun sign skin soon sown span spin spun stun swan
"Yeh, we're not vulnerable, because we've been using the swan library"
Woodchipper, Bad-scan, NSA has seen your secrets, Hands sewn together, Shin kicker, shunned2death, Sign fail, Skin flogger, Too soon, SownPwn, Span Wham, Spinning in place, Spun out of control, Stunned, Birdcatcher
Yeah, who would name a crypto implementation something stupid like "swan". Oh wait... https://en.wikipedia.org/wiki/Openswan
N = number of https sites M = number of tls implementations