Skip to content
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

Updating OpenSSL breaks Nextcloud server 23/24/25 side encryption due to RC4 deprecation #197726

Closed
AkechiShiro opened this issue Oct 25, 2022 · 4 comments

Comments

@AkechiShiro
Copy link
Contributor

Describe the bug

Updating openssl breaks Nextcloud server 24/25's (RC4 is deprecated and removed but used in Nextcloud) server side encryption,

PR being developed for a fix upstream : nextcloud/server#25551

Issue mentioning a workaround : nextcloud/server#32003

Workaround mentioned upstream :

[provider_sect]
default = default_sect
legacy = legacy_sect

[default_sect]
activate = 1

[legacy_sect]
activate = 1

I couldn't make this workaround work on NixOS, just yet, I've attempted:

  environment.etc = {
    # Creates /etc/openssl.conf
    "openssl.conf" = {
        text = ''
            [provider_sect]
            default = default_sect
            legacy = legacy_sect

            [default_sect]
            activate = 1

            [legacy_sect]
            activate = 1
            '';
            # The UNIX file mode bits
            mode = "0440";
            };
        };

Steps To Reproduce

Steps to reproduce the behavior:

  1. Updating openssl breaks Nextcloud 24/25's Server Side Encryption

Expected behavior

Server side encryption should just work.

Screenshots

Errors on the web interface or in the logs contains one or multiples of the following:

OCA\Encryption\Exceptions\MultiKeyDecryptException: multikeydecrypt with share key failed:error:0480006C:PEM routines::no start line
OCA\Encryption\Exceptions\MultiKeyDecryptException: multikeydecrypt with share key failed:error:0308010C:digital envelope routines::unsupported
Sabre\DAV\Exception\ServiceUnavailable: Encryption not ready: multikeydecrypt with share key failed:error:0308010C:digital envelope routines::unsupported

Additional context

Bug due to deprecation of RC4 in OpenSSL by default, not due to Nix/NixOS.

Notify maintainers

@schneefux @bachp @globin @fpletz

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

- system: `"x86_64-linux"`
 - host os: `Linux 5.15.64, NixOS, 22.11 (Raccoon), 22.11pre420607.969c3ccf30a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(root): `"nixos, nixos-old-20.09, nixos-unstable, nixpkgs-unstable"`
 - channels(user): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@ajs124
Copy link
Member

ajs124 commented Oct 25, 2022

ouch. We could maybe offer something like php_openssl_legacy? cc @NixOS/php

For that we'd need an openssl_3 with a openssl.conf containing those settings and override that into php.

@RaitoBezarius
Copy link
Member

@ajs124 I have some code that adds the workaround (1) above-mentioned for OpenSSL 3, that I am still testing, will do a PR soon.
Another workaround (2) is to use a OpenSSL extension linked against OpenSSL 1.1.1q for PHP, will do a PR for this soon too.

In all the cases, upgrading to NextCloud 25 is dangerous at the moment, I'd advise to:

  • either, apply workaround (1) by default for NextCloud (we are already building an environment on the top of the phpPackage, we can override openssl extension there)

  • either, apply workaround (2) by default for NextCloud

  • write a release note NOW regarding OpenSSL and RC4 NextCloud encryption (?)

  • make this issue a release blocker for 22.11? (cc @mweinelt)

@ajs124
Copy link
Member

ajs124 commented Oct 29, 2022

cc @Ma27

@mweinelt
Copy link
Member

Resolved in #198470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants