-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1261 from emanuele-f/cryptography-42-and-rust
Cryptography 42 and rust
- Loading branch information
Showing
8 changed files
with
66 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package: | ||
name: cffi | ||
version: "1.16.0" | ||
version: "1.17.1" | ||
|
||
build: | ||
number: 0 | ||
|
22 changes: 0 additions & 22 deletions
22
server/pypi/packages/cryptography/build-with-static-openssl.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,9 @@ | ||
package: | ||
name: cryptography | ||
version: "3.4.8" | ||
|
||
build: | ||
number: 2 | ||
script_env: | ||
- CRYPTOGRAPHY_DONT_BUILD_RUST=1 | ||
version: "42.0.8" | ||
|
||
requirements: | ||
build: | ||
- cffi 1.15.1 | ||
- setuptools-rust 0.11.6 | ||
- rust | ||
host: | ||
# This version of cryptography isn't compatible with OpenSSL 3. So to build it for | ||
# Python 3.9 and 3.10, we link it against OpenSSL 1.1. | ||
# | ||
# We don't do this by supplying an OpenSSL 1.1 wheel with a shared library, because | ||
# the Chaquopy runtime (perhaps unnecessarily) loads non-Python libraries using | ||
# RTLD_GLOBAL, which could cause conflicts with the OpenSSL 3 library which Chaquopy | ||
# loads on startup. | ||
# | ||
# Instead, we link against OpenSSL 1.1 statically, as follows: | ||
# * Download an OpenSSL 1.1 build from | ||
# https://github.com/beeware/cpython-android-source-deps/releases. | ||
# * For each combination of Python version and ABI, run build-with-static-openssl.sh | ||
# in this directory. | ||
# | ||
# Although this may cause some of OpenSSL's symbols to be exported by crytography's | ||
# Python modules, that's safe because Python modules are loaded using RTLD_LOCAL. And | ||
# although the GLOBAL/LOCAL distinction is only respected from API level 23, older | ||
# versions wouldn't include earlier libraries in the symbol search order for later | ||
# libraries anyway, unless they were listed in DT_NEEDED. | ||
# | ||
# More information: | ||
# * https://github.com/aosp-mirror/platform_bionic/blob/master/android-changes-for-ndk-developers.md | ||
# * https://github.com/android/ndk/issues/1244 | ||
- openssl |
16 changes: 16 additions & 0 deletions
16
server/pypi/packages/cryptography/patches/openssl_no_legacy.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- src-original/src/rust/src/lib.rs | ||
+++ src/src/rust/src/lib.rs | ||
@@ -45,9 +45,10 @@ | ||
// serialization), RC4, Blowfish, IDEA, SEED, etc. These things | ||
// are ugly legacy, but we aren't going to get rid of them | ||
// any time soon. | ||
- let load_legacy = env::var("CRYPTOGRAPHY_OPENSSL_NO_LEGACY") | ||
- .map(|v| v.is_empty() || v == "0") | ||
- .unwrap_or(true); | ||
+ | ||
+ // Chaquopy: the legacy provider is not available. | ||
+ let load_legacy = false; | ||
+ | ||
let legacy = if load_legacy { | ||
let legacy_result = provider::Provider::load(None, "legacy"); | ||
_legacy_provider_error(legacy_result.is_ok())?; |
14 changes: 14 additions & 0 deletions
14
server/pypi/packages/cryptography/patches/pyo3_no_interpreter.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- src-original/src/rust/Cargo.toml | ||
+++ src/src/rust/Cargo.toml | ||
@@ -10,7 +10,10 @@ | ||
[dependencies] | ||
once_cell = "1" | ||
cfg-if = "1" | ||
-pyo3 = { version = "0.20", features = ["abi3"] } | ||
+ | ||
+# Chaquopy: added abi3-py10 - see needs_rust in build-wheel.py. | ||
+pyo3 = { version = "0.20", features = ["abi3", "abi3-py310"] } | ||
+ | ||
asn1 = { version = "0.15.5", default-features = false } | ||
cryptography-cffi = { path = "cryptography-cffi" } | ||
cryptography-key-parsing = { path = "cryptography-key-parsing" } |