11 ms·
Introducing s2n, a New Open-Source TLS Implementation
- borplk 11y agoVery impressive, thanks Amazon!
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- agazso 11y agoCan you use this library without having to use its IO capabilities? 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.
- pquerna 11y agohttps://github.com/awslabs/s2n/blob/master/docs/USAGE-GUIDE.md#io-functions https://github.com/awslabs/s2n/blob/master/docs/USAGE-GUIDE.... 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"?
- bodyfour 11y agoAt least with OpenSSL you can implement your own BIO objects and do the I/O yourself if you want/need to. It's not the cleanest or best-documented interface in the world, but it's certainly usable.
- harshaw 11y agoit is usable. But I think you would be hard pressed to find a more widely used piece of software that has absolute terrible documentation. The only real way to figure it out is to read the code or read the examples.
- indutny 11y agoYou can use OpenSSL without IO APIs. Just use SSL_set_bio ;)
- userbinator 11y agoI wonder if this could motivate others to try making even simpler implementations of TLS - essentially, an effort toward the bare minimum necessary to be secure. 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."
- deleted 11y ago[deleted]
- richm44 11y agoNote that this library is currently only providing server functionality, and doesn't do certificate validation (in fact it appears to not do any of the X.509 parts of SSL/TLS). It's certainly interesting, but one of the reasons it's so small is that it's missing critical functionality for many use cases.
- cperciva 11y agoI think that's kind of the point. If your web server's TLS stack is trying to validate client certificates, you're doing it wrong.
- richm44 11y agoThere's nothing wrong with client certs (other than insane complexity). However ultimately s2n is likely to need to support operation as a client too at which point things like certificate validation etc. will be needed and the amount of code will increase.
- cperciva 11y agoInsane complexity is exactly why supporting client certs is a bad idea.
- richm44 11y agoCertainly true if you don't need them. However since code using the library as a TLS client is already partially present, support for certificate verification is definitely going to need to be added. 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.
- marcosdumay 11y agoNo, sorry. The insane complexity is on the requirements. If you need client certs, anything you do to satisfy the need will be at least as complex.
- VeejayRampay 11y agoGlad to see that some of the big players are starting to get into the habit of giving back to the communities building the bricks their success was built upon. Facebook, Google, Apple, Amazon, Twitter, all of them have contributed major pieces of the web fabric in the past few years. The power and money they can divert to such operations is a key factor in producing mature tools which will help foster the web ecosystem in the end.
- nailer 11y ago> s2n is short for “signal to noise” Anyone else think this was a contraction of the a11y, i18n, a16z or f6s variety?
- DanWaterworth 11y agoHere are your options: 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"
- rubiquity 11y ago"Sign" was the first one that came to my mind.
- McElroy 11y agoCorresponding marketing names and slogans for vulns: 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
- jnky 11y ago> "Yeh, we're not vulnerable, because we've been using the swan library" Yeah, who would name a crypto implementation something stupid like "swan". Oh wait... https://en.wikipedia.org/wiki/Openswan https://en.wikipedia.org/wiki/Openswan
- eddyg 11y agoTIL that the technical term for those is "numeronyms"[1]. [1] https://en.wikipedia.org/wiki/Numeronym https://en.wikipedia.org/wiki/Numeronym
- devy 11y agoI thought s2n stands for "secure end to end(two ends)".
- xvilka 11y agoI wonder why do implement SSLv3 in the new product, while others already deprecating and removing it?
- geertj 11y agoUnfortunately this still uses libcrypto from OpenSSL. This isn't a fully self-contained implementation of TLS.
- tyho 11y agoNobody is particularly worried about libcrypto. There would be little point in reimplementing it's functionality.
- tptacek 11y agoThey aren't?
- cperciva 11y agoDepends who "they" are. Bugs in the crypto code will compromise the cryptographic strength of the connection, revealing data or keys. Bugs in the protocol code will compromise the host which is running it. Both are bad, but I'd say that "remote root" trumps "side channel attack".
- alricb 11y agolibcrypto includes the OpenSSL ASN.1 code, which is worrying as all hell, e.g.: https://git.openssl.org/?p=openssl.git;a=blob;f=crypto/asn1/tasn_dec.c;h=7a6414ad04761b5b355869c4fd8d095ce5ddbe6c;hb=HEAD https://git.openssl.org/?p=openssl.git;a=blob;f=crypto/asn1/... Or any file in that directory.
- imaginenore 11y agoOh man, that code is just horrible. No comments on some of the functions, no comments on the input parameters and return values pretty much throughout. I really thought OpenSSL was in a much better shape.
- deleted 11y ago[deleted]
- zymhan 11y agoI wonder if they will include it in Amazon Linux at some point.
- edwintorok 11y agoIf I counted right: 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/why-ocaml-tls https://mirage.io/blog/announcing-mirage-25-release https://mirage.io/blog/announcing-mirage-25-release
- reycharles 11y agoThe bitcoin piñata recently ended, and they wrote a blog post about it: https://mirage.io/blog/bitcoin-pinata-results https://mirage.io/blog/bitcoin-pinata-results
- minthd 11y agoIt's interesting, but isn't 10BTC($2500) prize too low to tell us anything about how secure is this ?
- LukeHoersten 11y agoAgreed. I think they offered the bounty with that expectation. A quote form their blog: "[...] security bounties can be a very effective way to show the presence of vulnerabilities, but they are hopelessly inadequate for showing their absence."
- avsm 11y agoSadly, we're not so flush with cash that we can significantly up the prize, which was itself a donation from the user community. It was quite amusing when some kind users donated Bitcoins into the piñata though :-) 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-example 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...
- mwcampbell 11y agoI hope libcurl supports this soon.
- deleted 11y ago[deleted]
- cperciva 11y agoJust in case you're serious: Not using autotools is a feature, not a bug.
- feld 11y agoman, I hope he's not serious
- istvan__ 11y agoCould not agree more. I hope somebody write a sane toolchain for open source once.
- lmm 11y agoFor a library that wants to be ubiquitous (and therefore wants to be cross-platform) it's a bug. Can I expect this to build cleanly on GNU/kFreeBSD, or windows SUA? If it were autotools I would.
- cperciva 11y agoStandards-compliant C is more portable than autotools. Autotools is a workaround for non-portable code.
- __david__ 11y agoThat's a nice ideal, but reality is that it's really easy to need POSIX APIs and then you're firmly in autotools land. That said, I don't like autotools because it encourages #ifdef style nonsense, but not using it requires a lot more thought and more than a little rolling-your-own code and techniques.
- cperciva 11y agoreality is that it's really easy to need POSIX APIs Sure. and then you're firmly in autotools land Not at all. If you need the send(2) POSIX system call, what are you going to do if autotools detects that you're on a platform which doesn't have the send(2) system call?
- devy 11y agoSo I bet there will be a rust implementation before long :)
- kibwen 11y agoThere are some Mozilla security folks feeling out the waters as we speak.
- yellowapple 11y ago> As a result of this, we’ve found that it is easier to review s2n; we have already completed three external security evaluations and penetration tests on s2n, a practice we will be continuing. "Our pill has been clinically tested." What were the results?
- kvb 11y agoHow does this compare to miTLS[1]? [1] - http://www.mitls.org/wsgi/home http://www.mitls.org/wsgi/home
- mattbillenstein 11y agoI think another implementation is not necessarily a bad thing, but it's a shame that this effort couldn't be combined with LibreSSL and BoringSSL or even OpenSSL under a single project. Having more eyes on one thing would be better it would seem.
- cwp 11y agoNo! Let's have many implementations all with completely separate code bases. Then when the next security bug is found it won't affect the whole internet.
- mattbillenstein 11y agoI can see that side of it, but when N >> M I don't really see how that helps things significantly. N = number of https sites M = number of tls implementations
- cwp 11y agoYou don't think N(M-1)/M sites not being affected by the next heartbleed wouldn't be significant?
- mback2k 11y agoSounds great. I hope that Windows support without an additional crypto library dependency is added soon, e.g. using Windows CryptoAPI or Windows Cryptography API: Next Generation (CNG).
- s2m 11y agoIs it me, or is Amazon s2n (signal to noise) logo very similar to our company (signal2meaning) logo? https://signal2meaning.com/ https://signal2meaning.com/