Skip to content

Commit 6862761

Browse files
authored
Merge pull request #525 from 7flying/dev-dependencies
Dev dependencies
2 parents 9250791 + 8d1d1b2 commit 6862761

12 files changed

Lines changed: 40 additions & 50 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ jobs:
107107
with:
108108
toolchain: stable
109109
- name: Build
110-
run: cargo build
110+
run: cargo build --workspace
111111
- name: Run tests
112112
env:
113113
FDO_PRIVILEGED: true
114114
PER_DEVICE_SERVICEINFO: false
115-
run: cargo test
115+
run: cargo test --workspace
116116
- name: Check aio
117117
run: |
118118
mkdir aio-dir/
@@ -167,4 +167,4 @@ jobs:
167167
- name: Build devcontainer
168168
run: devcontainer build --image-name devcontainer-fdo-rs .
169169
- name: Test building in devcontainer
170-
run: docker run --rm -v `pwd`:/code:z --workdir /code --user root devcontainer-fdo-rs cargo build --verbose
170+
run: docker run --rm -v `pwd`:/code:z --workdir /code --user root devcontainer-fdo-rs cargo build --workspace --verbose

Cargo.lock

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

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,20 @@ members = [
1717

1818
"integration-tests",
1919
]
20+
21+
default-members = [
22+
"libfdo-data",
23+
"data-formats",
24+
"http-wrapper",
25+
"store",
26+
"util",
27+
28+
"client-linuxapp",
29+
"owner-onboarding-server",
30+
"owner-tool",
31+
"rendezvous-server",
32+
"manufacturing-server",
33+
"manufacturing-client",
34+
"serviceinfo-api-server",
35+
"admin-tool",
36+
]

admin-tool/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ time = "0.3"
1515
clap = { version = "4.2", features = ["derive"] }
1616
futures = "0.3"
1717
reqwest = "0.11"
18-
tera = "1"
1918
serde = "1"
2019
serde_yaml = "0.9"
2120
pretty_env_logger = "0.4"

client-linuxapp/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ libcryptsetup-rs = { version = "0.8.0", features = ["mutex"] }
2121
secrecy = "0.8"
2222
devicemapper = "0.33"
2323
openssl = "0.10.55"
24-
sha-crypt = "0.5.0"
25-
logtest = "2.0.0"
2624

2725
fdo-data-formats = { path = "../data-formats", version = "0.4.11" }
2826
fdo-http-wrapper = { path = "../http-wrapper", version = "0.4.11", features = ["client"] }

client-linuxapp/src/serviceinfo.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::process::Command;
1+
use std::process::{Command, Stdio};
22
use std::{
33
collections::HashSet,
44
fs::{File, Permissions},
@@ -21,8 +21,6 @@ use fdo_data_formats::{
2121
};
2222
use fdo_http_wrapper::client::{RequestResult, ServiceClient};
2323

24-
use sha_crypt::{sha256_check, sha256_simple, Sha256Params};
25-
2624
const MAX_SERVICE_INFO_LOOPS: u32 = 1000;
2725

2826
fn find_available_modules() -> Result<Vec<ServiceInfoModule>> {
@@ -111,9 +109,24 @@ fn create_user_with_password(user: &str, password: &str) -> Result<()> {
111109
log::info!("Checking for password encryption");
112110
if !is_password_encrypted(password) {
113111
log::info!("Encrypting password");
114-
let default_params: Sha256Params = Default::default();
115-
str_encrypted_pw = sha256_simple(password, &default_params).expect("Hashing failed");
116-
assert!(sha256_check(password, &str_encrypted_pw).is_ok());
112+
let echo = Command::new("echo")
113+
.arg(password)
114+
.stdout(Stdio::piped())
115+
.spawn()
116+
.expect("Error spawning echo");
117+
let hasher = Command::new("openssl")
118+
.arg("passwd")
119+
.arg("-6")
120+
.arg("-stdin")
121+
.stdin(Stdio::from(
122+
echo.stdout.expect("Error getting stdout from echo"),
123+
))
124+
.output()
125+
.expect("Error getting output of openssl");
126+
str_encrypted_pw = str::from_utf8(&hasher.stdout)
127+
.expect("Error converting [u8] to string")
128+
.trim_end()
129+
.to_string();
117130
}
118131
// Creates new user if user not present
119132
log::info!("Creating user {user} with password");

data-formats/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ tss-esapi = { version = "7.2", features = ["generate-bindings"] }
2727
byteorder = "1"
2828

2929
http = "0.2"
30-
hyper = "0.14"
3130

3231
openssl-kdf = { version = "0.4.1", features = ["allow_custom"] }
3332

integration-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ path = "tests/di_diun.rs"
1616
name = "to-tests"
1717
path = "tests/to.rs"
1818

19-
[dependencies]
19+
[dev-dependencies]
2020
anyhow = "1"
2121
hex = "0.4"
2222
tempfile = "3"

integration-tests/tests/e2e.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
mod common;
22
use std::env;
3-
#[allow(unused_imports)]
43
use std::{fs, io::Write, process::Command, time::Duration};
54

65
use common::{Binary, LogSide, TestContext};
@@ -412,7 +411,6 @@ ssh-ed25519 sshkey_default user@example.com
412411
false,
413412
"Password not created during onboarding"
414413
);
415-
assert!(sha256_check("testpassword", &test_user.password).is_ok());
416414
}
417415
} else {
418416
L.l("Skipped create initial user validation

integration-tests/tests/service_info.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ ssh-ed25519 sshkey_default user@example.com
289289
false,
290290
"Password not created during onboarding"
291291
);
292-
assert!(sha256_check("testpassword", &test_user.password).is_ok());
293292
}
294293
} else {
295294
L.l("Skipped create initial user validation

0 commit comments

Comments
 (0)