243 points · by ddb · 6y ago · 104 comments
(Specifically, OpenSSL is now compatible with anything licensed "GPLv3", "GPLv3 or later", or "GPLv2 or later". It's not compatible with "GPLv2 only", but that's a relatively small amount of software.)
Other major improvements: TLS1.3 support, Linux kernel TLS support (hand off crypto to the kernel and then read/write as though you had a normal file descriptor and let the kernel handle the crypto), and opaque low-level structures (no more dependencies on OpenSSL internals).
As for gnutls, apache 2.0 license is still incompatible with (L)GPL 2.x, so projects under those licenses without the "or later" clause can't use openssl 3.x->. And of course, the gnutls and openssl API's are different, users can't just link against one or the other without code changes.
OpenSSL 1.1.1 already supports TLS 1.3
There are a few other notable codebases that are GPLv2-only, but most projects using the GPL use either "v2 or later" or "v3 or later".
TLS 1.3 support was already added in OpenSSL 1.1.1
Is this referring to kernel TLS offload (using linux kernel's TLS connection ooffload infrastrucuture)?
https://github.com/openssl/openssl/blob/43a70f02022ebbc29aa7...
`SOL_TLS` referenced here
https://github.com/openssl/openssl/blob/f059e4cc435b7b850cfc...
as defined here:
https://github.com/torvalds/linux/commit/3c4d7559159bfe1e3b9...
[1] https://www.kernel.org/doc/html/latest/networking/tls-offloa...
It definitely should be the reason now!
This goes both ways, “GPLv2 or later” cannot be changed to either GPLv2 or GPLv3 only without permission from everybody that has ever contributed to the codebase.
The FSF requires copyright attribution from cotributors, that’s why they were able to switch their projects to GPLv3-only.
> IANAL, but “GPLv2 or later” allows you (the recipient of the license) to choose either GPLv2 or GPLv3 (i.e. the one that’s more convenient to you) but does not allow you to prevent others (the recipients of your modified version) from having the same choice. > This goes both ways, “GPLv2 or later” cannot be changed to either GPLv2 or GPLv3 only without permission from everybody that has ever contributed to the codebase.
This is not the case. A dual license allows you to redistribute under one or the other license, or both. "GPLv2 or later" must necessarily allow distributing under GPLv2 or GPLv3, because otherwise it wouldn't be compatible with GPLv2 or GPLv3. You're also free to combine it with GPLv2-only code (in which case you must distribute under GPLv2-only), or GPLv3-or-later code (in which case you must distribute under GPLv3-or-later).
> The FSF requires copyright attribution from cotributors, that’s why they were able to switch their projects to GPLv3-only.
The FSF requires copyright assignment, but that's not why; any project under GPLv2-or-later may be changed to GPLv3-or-later. And new code would then be contributed under GPLv3-or-later.
Also, the FSF doesn't like to use "GPLv3 only", for the same reason they don't like to use "GPLv2 only". FSF projects under GPLv2-or-later switched to GPLv3-or-later.
What? Of course it can be changed to either. It literally says so in the license name.
Your parent comment said no such thing. It says, that you need GPL v3 to be compatible with Apache 2. "Or later" clause on GPL 2-licensed project offers you a way to re-license the project under GPL v3.
Does this mean I cannot use openssl in my gpl-2.0-only program? How does that work? Doesn't gpl-2.0-later imply that I can also take the code and use it in gpl-2.0-only?
Is there some tldr on this topic somewhere? I'm not good with these legal things to ELI5 would be nice :/
Correct.
> How does that work?
The GPL 2.0 and Apache-2.0 licenses contain terms which are incompatible with each other.
> Doesn't gpl-2.0-later imply that I can also take the code and use it in gpl-2.0-only?
Yes, in that case you can choose whether you use the code subject to the gpl 2.0, 3.0 or any later version. If you combine that code with some gpl-2.0-only code then you're choosing to use the first code under 2.0, and the combined work is then gpl-2.0-only.
> Is there some tldr on this topic somewhere? I'm not good with these legal things to ELI5 would be nice :/
The GNU project maintains a list of licenses and some comments about them, and conveniently categorizes them according to their GPL compatibility.
https://www.gnu.org/licenses/license-list.html
See also the chart at http://gplv3.fsf.org/dd3-faq for compatibility between the different GPL versions and variants.
> Correct.
Wait, I've tried to do some more reading and there are some things I do not understand:
1. I've done quick search over pacman database, and there are lot of packages that are either gpl or gpl2 that link against openssl. Does that mean that archlinux should be in deep legal trouble and it needs to drop few hundred packages (including coreutils, libgit2, kmod and others). Hell, even git itself links again openssl and that is gpl-2.0-only project. Does this make git illegal?
2. Are the "legal issues" comming from gpl-2.0-only side or from the openssl side? If from the gpl-2.0-only side, cannot I just add linking exception to the license to explicitely allow linking to openssl?
> Correct.
Well that sucks. I guess I'll need to look into libressl.
Finally!
> A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts
Is this really necessary? If you want a 'real' http client, you're probably using libcurl anyway (which is permissively licensed, more stable, and supports http/3).
I'd guess it's there to support cryptographic protocols that require downloading/checking keys via HTTPS. Right before that line is "Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)".
And yes, use curl.
Not sure if this fixes it, but if you include functionality that relies on HTTP then you better support HTTP.
Of course, there's all the traditional bug surface of any code that talks to the network to consider as well.
Defining an interface for calling back into another HTTP library might be doable, but there's still a question of scope creep.
The motivation seems to be this fork and pull request:
- https://github.com/mpeylo/cmpossl
- https://github.com/openssl/openssl/issues/5926
The use case is far away from what most users of OpenSSL need, and could quite easily be tackled outside OpenSSL.
Smaller projects that aim for minimalism and robustness probably suffer from a lack of peer review with a more niche community backing them. Trade-offs trade-offs. I also wish I understood where they compete:
OpenSSL <-> WolfSSL <-> mbedtls
Apparently the crypto modules are pretty well made according to the OpenBSD developers.
LibreSSL: The first 30 days, and what the Future Holds: https://www.youtube.com/watch?v=oM6S7FEUfkU
I tried to use a single algorithm from OpenSSL for an embedded project and seems like it needs hacking for all the dependencies to be met. I gave up. With mbedTLS it was done within a minute (simpler to build and read IMO).
There aren't many differences between mbedTLS and WolfSSL. Both are small libraries designed for embedded use. The latter supports TLS 1.3.
Today OpenSSL probably has the best support for hardware acceleration and secure elements.
[1]: https://bearssl.org
This link should be named OpenSSL release 3.0
I would prefer my security libraries to scream bloody murder if I am using them in a deprecated way.
On Linux if I go to system provided 1.2.x openssl version and try to build against that my code breaks with thousands of mysterious errors about undefined types (in openssl headers).
I mean Openssl solves a big problem but from engineering perspective the library is one giant problem. And I haven't even remarked on the horrible API design yet.
On one hand, I absolutely hate a library which breaks its API (I think lack of stability in interfaces is one of the bigger bane of the software industry and causes numerous issues down the line).
But in the specific case with OpenSSL, the breakages are legitimate imho. Most of the breakages I have seen are to clean-up interfaces and have a clear boundary between OpenSSL internals and items controlled by third party apps.
Concretely, they are switching from an API which exposed the internal structures directly to a getter/setter pattern.
Example in from one of my project:
old:
ts_response->tst_info->serial
new: TS_TST_INFO_get_serial(TS_RESP_get_tst_info(ts_response))
Breaking APIs is always a balancing act, it's not something which must happen willy-nilly, but it's sometimes a necessary evil, and in the specific case of OpenSSL, if the project wants to go forward and improve in quality and stability, they are kind of forced to do it, it's just a bit regrettable that better design decisions had not be made from the start.2018-09-11: 1.1.1-> 1.1.2
https://github.com/openssl/openssl/commit/a4a90a8a3bdcb9336b...
2018-09-27: 1.1.2 -> 3.0.0
https://github.com/openssl/openssl/commit/3a63dbef15b62b121c...
There weren't any releases numbered 1.1.2
They want to use the same version numbers for OpenSSL and a FIPS module, and the FIPS module was already versioned at 2.X.X.
> The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:
> MAJOR.MINOR.PATCH
Yay. OpenSSL finally switches to semantic versioning. \o/
> Given a version number MAJOR.MINOR.PATCH, increment the:
> MAJOR version when you make incompatible API changes, > MINOR version when you add functionality in a backwards compatible manner, and > PATCH version when you make backwards compatible bug fixes.
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
Seems like semantic versioning to me! At least the major, minor, and patch will mean something now.
The only thing that OpenSSL claims to enforce about their versioning policy is
> A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.
It was messy then, it will be messy now, though when you took the 1.1 opportunity to modernize your code to current best-practice as requested by the library rather than just fixing the minimum, you might be pretty ok this time around