Skip to content

Commit fee1ef3

Browse files
authored
Merge pull request #820 from fortanix/raoul/rte-573-patch_protobuf_vuln
[RTE-573] Patch protobuf vuln
2 parents df25bb0 + 9ca8a0f commit fee1ef3

File tree

7 files changed

+115
-155
lines changed

7 files changed

+115
-155
lines changed

Cargo.lock

Lines changed: 61 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ nix = { git = "https://github.com/fortanix/nix.git", branch = "raoul/fortanixvme
5757
rustc-serialize = { git = "https://github.com/fortanix/rustc-serialize.git", branch = "portability" }
5858
serde = { git = "https://github.com/fortanix/serde.git", branch = "master" }
5959
vsock = { git = "https://github.com/fortanix/vsock-rs.git", branch = "fortanixvme" }
60+
mbedtls = { git = "https://github.com/fortanix/rust-mbedtls.git", branch = "master" }

intel-sgx/aesm-client/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aesm-client"
3-
version = "0.6.1"
3+
version = "0.6.2"
44
authors = ["Fortanix, Inc."]
55
license = "MPL-2.0"
66
description = """
@@ -32,7 +32,7 @@ sgx-isa = { version = "0.4.0", path = "../sgx-isa"}
3232
# External dependencies
3333
byteorder = "1.0" # Unlicense/MIT
3434
lazy_static = "1" # MIT/Apache-2.0
35-
protobuf = "2.22.1" # MIT/Apache-2.0
35+
protobuf = "3" # MIT/Apache-2.0
3636
thiserror = "1.0" # MIT/Apache-2.0
3737
anyhow = "1.0" # MIT/Apache-2.0
3838

@@ -50,7 +50,7 @@ winapi = { version = "0.3.7", features = ["combaseapi", "enclaveapi", "memoryapi
5050
libloading = "0.5.2"
5151

5252
[build-dependencies]
53-
protoc-rust = "2.8.0" # MIT/Apache-2.0
53+
protobuf-codegen = "3" # MIT
5454

5555
[dev-dependencies]
5656
sgx-isa = { version = "0.4.0", path = "../sgx-isa" }

intel-sgx/aesm-client/build.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
#![deny(warnings)]
88

9-
extern crate protoc_rust;
10-
119
use std::env;
1210
use std::fs::File;
1311
use std::io::Write;
@@ -16,17 +14,17 @@ use std::path::PathBuf;
1614
fn main() {
1715
let out_dir = PathBuf::from(env::var("OUT_DIR").expect("cargo should set OUT_DIR"));
1816

19-
protoc_rust::Codegen::new()
20-
.out_dir(&out_dir)
17+
protobuf_codegen::Codegen::new()
18+
.includes(&["src/"])
2119
.input("src/aesm_proto.proto")
22-
.run()
23-
.expect("protoc");
20+
.cargo_out_dir("protos")
21+
.run_from_script();
2422

2523
// Because of https://github.com/rust-lang/rfcs/issues/752, we can't `include!` the generated
2624
// protobufs directly. Instead, we generate a second generated file that can be `include!`-ed.
2725
// This trick borrowed from rust-mbedtls.
2826

29-
let mod_aesm_proto = out_dir.join("mod_aesm_proto.rs");
27+
let mod_aesm_proto = out_dir.join("protos").join("mod_aesm_proto.rs");
3028
File::create(&mod_aesm_proto)
3129
// FIXME: get rid of `allow(bare_trait_objects)` by updateing protoc-rust
3230
.and_then(|mut f| f.write_all(b"#[allow(bare_trait_objects)] mod aesm_proto;\n"))

0 commit comments

Comments
 (0)