From 26bb5d0cc3badbea05ea1fef8d4cd6c9919588c5 Mon Sep 17 00:00:00 2001 From: Jiaqi Gao Date: Thu, 30 Nov 2023 03:23:53 -0500 Subject: [PATCH] deps/ring: upgrade to `0.17.6` Signed-off-by: Jiaqi Gao --- Cargo.lock | 2 +- cc-measurement/Cargo.toml | 2 +- library/patches/ring.diff | 35 +------------------------------- library/ring | 2 +- sh_script/preparation.sh | 2 +- td-shim-tools/Cargo.toml | 2 +- td-shim/Cargo.toml | 2 +- tests/test-td-payload/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 288b04db..9a053263 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -978,7 +978,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" -version = "0.17.5" +version = "0.17.6" dependencies = [ "cc", "getrandom", diff --git a/cc-measurement/Cargo.toml b/cc-measurement/Cargo.toml index ec6ce360..338aaa79 100644 --- a/cc-measurement/Cargo.toml +++ b/cc-measurement/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] sha2 = { version = "0.10.6", default-features = false, features = ["force-soft"], optional = true } -ring = { version = "0.17.5", default-features = false, features = ["alloc"], optional = true } +ring = { version = "0.17.6", default-features = false, features = ["alloc"], optional = true } zerocopy = "0.6.0" [features] diff --git a/library/patches/ring.diff b/library/patches/ring.diff index d9d2ae0b..e942cc50 100644 --- a/library/patches/ring.diff +++ b/library/patches/ring.diff @@ -1,5 +1,5 @@ diff --git a/Cargo.toml b/Cargo.toml -index 3378dc84b..f65fd70bd 100644 +index 2c8ba6964..209c3d4a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -171,7 +171,7 @@ all-features = true @@ -74,36 +74,3 @@ index f7b94108b..3bdc8cd29 100644 let _ = c .arg("-o") .arg(out_file.to_str().expect("Invalid path")) -diff --git a/src/rand.rs b/src/rand.rs -index 78f4bdc3c..2d1028b84 100644 ---- a/src/rand.rs -+++ b/src/rand.rs -@@ -148,6 +148,7 @@ impl crate::sealed::Sealed for SystemRandom {} - all(target_os = "unknown", feature = "wasm32_unknown_unknown_js") - ) - ), -+ all(target_arch = "x86_64", target_os = "none"), - ))] - impl sealed::SecureRandom for SystemRandom { - #[inline(always)] -diff --git a/third_party/fiat/curve25519_64_adx.h b/third_party/fiat/curve25519_64_adx.h -index 9dcbb69fa..0906fda81 100644 ---- a/third_party/fiat/curve25519_64_adx.h -+++ b/third_party/fiat/curve25519_64_adx.h -@@ -1,7 +1,6 @@ - #include - #include - #include --#include - - typedef uint64_t fe4[4]; - typedef uint8_t fiat_uint1; -@@ -469,7 +468,7 @@ __attribute__((target("adx,bmi2"))) - void x25519_scalar_mult_adx(uint8_t out[32], const uint8_t scalar[32], - const uint8_t point[32]) { - uint8_t e[32]; -- memcpy(e, scalar, 32); -+ OPENSSL_memcpy(e, scalar, 32); - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; diff --git a/library/ring b/library/ring index c3fda8b4..464d3672 160000 --- a/library/ring +++ b/library/ring @@ -1 +1 @@ -Subproject commit c3fda8b4dd57d658923c397c6cfaa33591f6f256 +Subproject commit 464d367252354418a2c17feb806876d4d89a8508 diff --git a/sh_script/preparation.sh b/sh_script/preparation.sh index 1fcc173d..abc9245d 100755 --- a/sh_script/preparation.sh +++ b/sh_script/preparation.sh @@ -3,7 +3,7 @@ preparation() { # apply the patch set for ring pushd library/ring - git reset --hard c3fda8b4dd57d658923c397c6cfaa33591f6f256 + git reset --hard 464d367252354418a2c17feb806876d4d89a8508 git clean -f -d patch -p 1 -i ../patches/ring.diff popd diff --git a/td-shim-tools/Cargo.toml b/td-shim-tools/Cargo.toml index 9b31c6e3..a03b3176 100644 --- a/td-shim-tools/Cargo.toml +++ b/td-shim-tools/Cargo.toml @@ -52,7 +52,7 @@ der = { version = "0.4.5", features = ["oid"], optional = true } env_logger = { version = "0.9.0", optional = true } log = { version = "0.4.5", optional = true } td-loader = { path = "../td-loader", optional = true } -ring = { version = "0.17.5", optional = true } +ring = { version = "0.17.6", optional = true } serde_json = { version = "1.0", optional = true } serde = { version = "1.0", features = ["derive"], optional = true } hex = { version = "0.4", features = ["serde"], optional = true } diff --git a/td-shim/Cargo.toml b/td-shim/Cargo.toml index 7dc663d7..943ca9b6 100644 --- a/td-shim/Cargo.toml +++ b/td-shim/Cargo.toml @@ -30,7 +30,7 @@ zerocopy = "0.6.0" td-loader = { path = "../td-loader", optional = true } linked_list_allocator = { version = "0.10", optional = true } log = { version = "0.4.13", features = ["release_max_level_off"], optional = true } -ring = { version = "0.17.5", default-features = false, features = ["alloc"], optional = true } +ring = { version = "0.17.6", default-features = false, features = ["alloc"], optional = true } spin = { version = "0.9.2", optional = true } td-exception = { path = "../td-exception", features = ["tdx"], optional = true } td-logger = { path = "../td-logger", optional = true } diff --git a/tests/test-td-payload/Cargo.toml b/tests/test-td-payload/Cargo.toml index 3c1543e6..e4527b91 100644 --- a/tests/test-td-payload/Cargo.toml +++ b/tests/test-td-payload/Cargo.toml @@ -22,7 +22,7 @@ scroll = { version = "0.10.0", default-features = false, features = ["derive"]} serde = { version = "1.0", default-features = false, features = ["derive"]} serde_json = { version = "1.0", default-features = false, features = ["alloc"] } x86 = { version = "0.47.0" } -ring = { version = "0.17.5", default-features = false, features = ["alloc"] } +ring = { version = "0.17.6", default-features = false, features = ["alloc"] } td-shim = { path = "../../td-shim" } td-payload = { path = "../../td-payload", features = ["tdx","cet-shstk","stack-guard"] } zerocopy = "0.6.0"