-
-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libressl's AEAD api #6474
Comments
Some background: A lot of people, including the LibreSSL people, OpenBSD's porters and upstream projects, invested a lot of effort to get LibreSSL to work with the hundreds of tools that exist. OpenBSD for example has ~11000 ports (including flavors and subpackages) of which ~800 use LibreSSL and only 6 explicitly require OpenSSL. Concerning your questions: Strictly taken it is possible to use OpenSSL on OpenBSD, though it is not preferred. I'm not sure about requirements from other platforms.
EVP_aead seems to be borrowed from BoringSSL, and the API for EVP_aead is completely incompatible with what Borg currently uses. It would be really cool if Borg keeps on supporting LibreSSL. However, in the end it is all about effort needed, and return on effort...
I do not want to start a discussion on crypto as I do not understand it. I'm wondering though why OCB is better than GCM. Is it because OCB is a bit less fragile than GCM against repeated nonces? Are there other reasons? Is there a hard reason not to use GCM? |
I am roughly aware about LibreSSL and other non-OpenSSL efforts (and had my own issues when working with OpenSSL). The OCB patents issue is long resolved for FOSS, see: https://en.wikipedia.org/wiki/OCB_mode and as a recent update also this: https://mailarchive.ietf.org/arch/msg/cfrg/qLTveWOdTJcLn4HP3ev-vrj05Vg/ I can not give you the details about the GCM concerns, but when searching for usable AEAD ciphers I got the impression that quite some cryptographers feel bad about GCM. Considering that OCB is also faster made it clear for me to choose OCB. Years ago, there was the availability issue, but this is also resolved for most platforms since openssl 1.1.0 (and all openssl versions without AES-OCB not receiving security support any more). So, if openssl is working on openbsd, maybe we should switch to that for borg 1.3+? Alternatively, maybe some openbsd python/cython developer who is into crypto stuff could work on |
good news: i have a vagrant based openbsd-current (future 7.1) test box now. all master tests passing currently. |
Update: The AES-OCB and chacha20-poly1305 based crypto is now in master branch (was #6463). |
I put this into 1.3.0b1 milestone (first beta release). @bket When the alpha releases get successful testing on openbsd with openssl, I guess we can close this because we'll just use openssl then. In case libressl catches up later regarding API and available algorithms, we can reopen this. |
@bket could you help fixing the Currently it tries building on libressl, which will fail the tests. |
@ThomasWaldmann, the
Unfortunately this is not enough as we need to explicity tell the build to link against
|
thanks for the info! pkg_add: ah, it needs a percent separator. I tried the renaming also explains why i did not even manually find the right setup.py: if there is no easier way, guess we need to add a platform check there and just switch these values based on the platform. |
#6593 removes LibreSSL support completely. So we currently have nothing holding us back from using AES-OCB and CHACHA20-POLY1305 with borg master (and maybe getting rid of AES-CTR and other old crypto completely). |
openbsd: use openssl, remove libressl support, fixes #6474
Be aware that using the OpenSSL shared libraries means that if you use Python extensions which use the LibreSSL shared libraries (including hashlib/ssl as well as external extensions) you'll have symbol conflicts and likely crashes at runtime. That is the reason for the non-standard library naming to prevent software from picking it up automatically in configure scripts etc. Using the static libraries instead should avoid that problem. (Care also needs to be taken to make sure the correct headers are used). BTW, EVP_chacha20_poly1305() is in -current OpenBSD now, so that will be in 7.2, but no OCB yet. |
I'm not sure to be honest, I haven't tried doing this with Python as everything else using Python in the ports tree is happy with LibreSSL. There are only about 5 ports which require openssl at all, and only one (postfix) needs static-linking so it can coexist with other libraries (as far as ports is concerned, pulling in openssl is a last resort, the preferred approach is to work with libressl devs to get the relevant support added if possible - postfix is about the worst case as they seem to be actively trying to use as much openssl-only functionality as they can ;-) I'll take a look at @bket's WIP port and see if there's anything I can figure out from there.. |
Avoid conflicting with shared libcrypto from the base OS pulled in via dependencies.
Avoid conflicting with shared libcrypto from the base OS pulled in via dependencies.
OpenBSD only - statically link OpenSSL (#6474)
https://www.openbsd.org/73.html
But still no AES-OCB AFAICS. |
Correct, no OCB yet. While I haven't checked with LibreSSL devs about it recently I don't think it is a priority to add. Very little software uses it - the only ones I know about are mosh (normally using an internal implementation rather than openssl's) and Borg. |
I chose it because I wanted a fast and secure AES-based AEAD cipher available via OpenSSL. I noticed that cryptographers have bad feelings about AES-GCM being "fragile" and that the "patent issues" that held back AES-OCB for long were resolved. Didn't find any other AES options. |
it seems that they don't support these ciphers via the same EVP api as openssl:
For borg 1.3+ it seems like a good idea if we would deprecate the crypto modes based on AES-CTR and recommend the new AEAD modes.
So, how's the situation on OpenBSD? Are there other platforms requiring LibreSSL support?
borg.crypto.low_level
module that uses LibreSSL's EVP_AEAD api (which does not exist in OpenSSL)? https://man.openbsd.org/EVP_AEAD_CTX_init.3The text was updated successfully, but these errors were encountered: