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

Switch to offical release rustls and add no_std support #302

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "deps/td-shim"]
path = deps/td-shim
url = https://github.com/confidential-containers/td-shim
[submodule "deps/rustls"]
path = deps/rustls
url = https://github.com/rustls/rustls.git
19 changes: 11 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resolver = "2"
panic = "abort" # disable stack unwinding on panic
opt-level = "z"
lto = true
strip = true

# the profile used for `cargo build --release`
[profile.release]
Expand All @@ -40,4 +41,3 @@ lto = true

[patch.crates-io]
ring = { path = "deps/td-shim/library/ring" }
rustls = { path = "deps/rustls/rustls" }
268 changes: 0 additions & 268 deletions deps/patches/rustls.diff

This file was deleted.

1 change: 0 additions & 1 deletion deps/rustls
Submodule rustls deleted from ae277b
6 changes: 0 additions & 6 deletions sh_script/preparation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ preparation() {
pushd deps/td-shim
bash sh_script/preparation.sh
popd

pushd deps/rustls
git reset --hard ae277befb5061bbd4c44fea1c2697f2da5b2f6fa
git clean -f -d
patch -p 1 -i ../patches/rustls.diff
popd
}

preparation
5 changes: 3 additions & 2 deletions src/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ cfg-if = "1.0"
der = {version = "0.7.9", features = ["oid", "alloc", "derive"]}
pki-types = { package = "rustls-pki-types", version = "1" }
rust_std_stub = { path = "../std-support/rust-std-stub" }
rustls = { path = "../../deps/rustls/rustls", default-features = false, features = ["no_std"], optional = true }
rustls = { version = "=0.23.12", default-features = false, features = ["ring" ], optional = true }
rustls-pemfile = { version = "2.0.0", default-features = false }
ring = { path = "../../deps/td-shim/library/ring", default-features = false, features = ["alloc"], optional = true }
ring = { path = "../../deps/td-shim/library/ring", default-features = false, features = ["alloc", "less-safe-getrandom-custom-or-rdrand"], optional = true }
sys_time = { path = "../std-support/sys_time" }
zeroize = "1.5.7"

[features]
Expand Down
3 changes: 3 additions & 0 deletions src/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ pub enum Error {
/// Unable to verify the TLS peer's certificates
TlsVerifyPeerCert(String),

/// Error occurs during processing the tls connection
TlsConnection,

/// Pem certificate parsing error
DecodePemCert,

Expand Down
Loading
Loading