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

Build failure on Mariner (azurelinux) because of unsupported cipher chacha20_poly1305 #12258

Closed
GalBr opened this issue Jan 9, 2025 · 5 comments
Labels
Stale waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

Comments

@GalBr
Copy link

GalBr commented Jan 9, 2025

When trying to build cryptography from source on Mariner (azurelinux), the build fails:

  error[E0599]: no function or associated item named `chacha20_poly1305` found for struct `openssl::cipher::Cipher` in the current scope
     --> src/backend/aead.rs:459:50
      |
  459 |                         openssl::cipher::Cipher::chacha20_poly1305(),
      |                                                  ^^^^^^^^^^^^^^^^^ function or associated item not found in `Cipher`

Apparently Mariner doesn't support chaha20_poly1305. It seems that Azure patched the problematic code in order to work around this issue. (source)
The package was installed with pip install --no-binary ":all:".
Is this a known issue? Are there plans to integrate something more robust to the build? Some way to avoid this issue aside from changing the source code or using a wheel?

@alex
Copy link
Member

alex commented Jan 9, 2025

Is the OpenSSL that mariner has built with OPENSSL_NO_CHACHA? We don't currently support that build configuration, but we'd accept a patch to build correctly with it.

@alex alex added the waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply. label Jan 12, 2025
@GalBr
Copy link
Author

GalBr commented Jan 12, 2025

Yes, as per the openssl.spec file found here: https://github.com/microsoft/azurelinux/blob/2.0/SPECS/openssl/openssl.spec
It seems that they use ./config no-chacha (among other things).
For mariner 2.0 (which we currently use), they use cryptography version 3.3.2 and then apply a patch to solve CVE-2023-49083 (here).
For azurelinux (mariner 3.0), they use cryptography version 42.0.5 and apply a patch to remove the relevant Rust code (here).
We install and use our own packages, so we don't use the cryptography package that they have installed, but we can't install the version we want (43.0.1 currently).

I'm not sure we have the capacity to help develop the support for this build configuration currenly, but I'll check. In any case, can I get a rough estimate of how complicated this is going to be for someone that isn't familiar with the codebase?

@alex
Copy link
Member

alex commented Jan 12, 2025

I'd probably estimate it at a couple of hours for someone not familiar with the codebase. I can give you a brief tour of what'd be involved:

So the main task would be finding the places that rely on chacha being available and adding the approprirate cfg() handling.

Copy link

This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days.

@github-actions github-actions bot added the Stale label Jan 16, 2025
Copy link

This issue has not received a reporter response and has been auto-closed. If the issue is still relevant please leave a comment and we can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.
Development

No branches or pull requests

2 participants