Upload files to "rustdesk-session-permission-pocs/session-downgrade"
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "rustdesk_session_downgrade_poc"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
bytes = "1.10"
|
||||
hex = "0.4"
|
||||
protobuf = { version = "3.7", features = ["with-bytes"] }
|
||||
sha2 = "0.10"
|
||||
|
||||
[build-dependencies]
|
||||
protobuf-codegen = "3.7"
|
||||
@@ -0,0 +1,40 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let manifest = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
|
||||
let repo_root = std::env::var("RUSTDESK_REPO_ROOT")
|
||||
.map(PathBuf::from)
|
||||
.ok()
|
||||
.or_else(|| {
|
||||
manifest.ancestors().find_map(|ancestor| {
|
||||
for candidate in [
|
||||
ancestor.join("rustdesk"),
|
||||
ancestor.join("work").join("rustdesk"),
|
||||
ancestor.parent().unwrap_or(ancestor).join("work").join("rustdesk"),
|
||||
] {
|
||||
if candidate.join("libs/hbb_common/protos/message.proto").exists() {
|
||||
return Some(candidate);
|
||||
}
|
||||
}
|
||||
None
|
||||
})
|
||||
})
|
||||
.expect("set RUSTDESK_REPO_ROOT or place this PoC near a rustdesk checkout")
|
||||
.join("libs")
|
||||
.join("hbb_common")
|
||||
.join("protos");
|
||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("protos");
|
||||
std::fs::create_dir_all(&out_dir).unwrap();
|
||||
|
||||
protobuf_codegen::Codegen::new()
|
||||
.pure()
|
||||
.out_dir(&out_dir)
|
||||
.inputs([
|
||||
repo_root.join("rendezvous.proto"),
|
||||
repo_root.join("message.proto"),
|
||||
])
|
||||
.include(&repo_root)
|
||||
.customize(protobuf_codegen::Customize::default().tokio_bytes(true))
|
||||
.run()
|
||||
.expect("protobuf codegen failed");
|
||||
}
|
||||
Reference in New Issue
Block a user