Skip to content

Commit 8632f80

Browse files
authored
Merge pull request #122 from linux-credentials/push-pvqrkwszowyp
- Remove unused dependency on aws-lc-sys - Add option to control cargo --locked flag. - Remove libwebauthn dependency from common and ui packages for faster compile times on slower hardware
2 parents 5cbc7fc + 02700f3 commit 8632f80

19 files changed

Lines changed: 133 additions & 185 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
workspaces: ". -> build/target"
2929
cache-workspace-crates: true
3030

31-
3231
- name: Update apt cache
3332
run: sudo apt update
3433
- name: Install system dependencies
@@ -45,7 +44,7 @@ jobs:
4544
# Newer version needed for --interactive flag needed below
4645
python3 -m pip install --user -v 'meson==1.5.0'
4746
- name: Setup meson project
48-
run: meson setup -Dprofile=development build
47+
run: meson setup -Dprofile=development -Dcargo_locked=true build
4948

5049
- name: Build
5150
run: ninja -C build

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ lto = true
77

88
[workspace.dependencies]
99
futures-lite = "2.6.0"
10-
# libwebauthn = "0.2"
11-
libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="9e4e5d7", features = ["libnfc","pcsc"] }
1210
serde = { version = "1.0.219", features = ["derive"] }
1311
tracing = "0.1.41"
1412
tracing-subscriber = "0.3.19"

credentialsd-common/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ license = "LGPL-3.0-only"
77

88
[dependencies]
99
futures-lite.workspace = true
10-
libwebauthn.workspace = true
1110
serde = { workspace = true, features = ["derive"] }
1211
zvariant.workspace = true

credentialsd-common/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ cargo_options = [
88
'--manifest-path', meson.project_source_root() / meson.current_source_dir() / 'Cargo.toml',
99
]
1010
cargo_options += ['--target-dir', cargo_target_dir]
11-
cargo_options += '--locked'
11+
if get_option('cargo_locked') == true
12+
cargo_options += '--locked'
13+
endif
1214
if get_option('cargo_offline') == true
1315
cargo_options += ['--offline']
1416
endif

credentialsd-common/src/model.rs

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,87 +3,13 @@ use std::{fmt::Display, path::PathBuf};
33
use serde::{Deserialize, Serialize};
44
use zvariant::{SerializeDict, Type};
55

6-
pub use libwebauthn::ops::webauthn::{
7-
Assertion, GetAssertionRequest, MakeCredentialRequest, MakeCredentialResponse,
8-
};
9-
106
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
117
pub struct Credential {
128
pub id: String,
139
pub name: String,
1410
pub username: Option<String>,
1511
}
1612

17-
#[derive(Clone, Debug)]
18-
pub enum CredentialRequest {
19-
CreatePublicKeyCredentialRequest(MakeCredentialRequest),
20-
GetPublicKeyCredentialRequest(GetAssertionRequest),
21-
}
22-
23-
#[derive(Clone, Debug)]
24-
pub enum CredentialResponse {
25-
CreatePublicKeyCredentialResponse(Box<MakeCredentialResponseInternal>),
26-
GetPublicKeyCredentialResponse(Box<GetAssertionResponseInternal>),
27-
}
28-
29-
impl CredentialResponse {
30-
pub fn from_make_credential(
31-
response: &MakeCredentialResponse,
32-
transports: &[&str],
33-
modality: &str,
34-
) -> CredentialResponse {
35-
CredentialResponse::CreatePublicKeyCredentialResponse(Box::new(
36-
MakeCredentialResponseInternal::new(
37-
response.clone(),
38-
transports.iter().map(|s| s.to_string()).collect(),
39-
modality.to_string(),
40-
),
41-
))
42-
}
43-
44-
pub fn from_get_assertion(assertion: &Assertion, modality: &str) -> CredentialResponse {
45-
CredentialResponse::GetPublicKeyCredentialResponse(Box::new(
46-
GetAssertionResponseInternal::new(assertion.clone(), modality.to_string()),
47-
))
48-
}
49-
}
50-
51-
#[derive(Clone, Debug)]
52-
pub struct MakeCredentialResponseInternal {
53-
pub ctap: MakeCredentialResponse,
54-
pub transport: Vec<String>,
55-
pub attachment_modality: String,
56-
}
57-
58-
impl MakeCredentialResponseInternal {
59-
pub fn new(
60-
response: MakeCredentialResponse,
61-
transport: Vec<String>,
62-
attachment_modality: String,
63-
) -> Self {
64-
Self {
65-
ctap: response,
66-
transport,
67-
attachment_modality,
68-
}
69-
}
70-
}
71-
72-
#[derive(Clone, Debug)]
73-
pub struct GetAssertionResponseInternal {
74-
pub ctap: Assertion,
75-
pub attachment_modality: String,
76-
}
77-
78-
impl GetAssertionResponseInternal {
79-
pub fn new(ctap: Assertion, attachment_modality: String) -> Self {
80-
Self {
81-
ctap,
82-
attachment_modality,
83-
}
84-
}
85-
}
86-
8713
#[derive(SerializeDict, Type)]
8814
#[zvariant(signature = "dict", rename_all = "camelCase")]
8915
pub struct GetClientCapabilitiesResponse {

credentialsd-ui/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ cargo_options = [
6565
'--manifest-path', meson.project_source_root() / gui_source_dir / 'Cargo.toml',
6666
]
6767
cargo_options += ['--target-dir', cargo_target_dir]
68-
cargo_options += '--locked'
68+
if get_option('cargo_locked') == true
69+
cargo_options += '--locked'
70+
endif
6971
if get_option('cargo_offline') == true
7072
cargo_options += ['--offline']
7173
endif

credentialsd/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ async-stream = "0.3.6"
1010
base64 = "0.22.1"
1111
credentialsd-common = { path = "../credentialsd-common" }
1212
futures-lite.workspace = true
13-
libwebauthn.workspace = true
13+
libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="80545bff16c4e89a930221e90d3141a76303b84b", features = ["libnfc","pcsc"] }
1414
# TODO: split nfc and pcsc into separate features
1515
# Also, 0.6.1 fails to build with non-vendored library.
1616
# https://github.com/alexrsagen/rs-nfc1/issues/15
1717
nfc1 = { version = "=0.6.0", default-features = false }
1818
rand = "0.9.2"
1919
ring = "0.17.14"
20-
rustls = { version = "0.23.27", default-features = false, features = ["std", "tls12", "ring", "log", "logging", "prefer-post-quantum"] }
2120
serde.workspace = true
2221
serde_json = "1.0.140"
2322
tokio = { version = "1.45.0", features = ["rt-multi-thread"] }

credentialsd/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ cargo_options = [
4848
cargo_options += [
4949
'--target-dir', cargo_target_dir,
5050
]
51-
cargo_options += '--locked'
51+
if get_option('cargo_locked') == true
52+
cargo_options += '--locked'
53+
endif
5254
if get_option('cargo_offline') == true
5355
cargo_options += ['--offline']
5456
endif

credentialsd/src/credential_service/hybrid.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ use libwebauthn::transport::cable::qr_code_device::{CableQrCodeDevice, QrCodeOpe
1212
use libwebauthn::transport::{Channel, Device};
1313
use libwebauthn::webauthn::{Error as WebAuthnError, WebAuthn};
1414

15-
use credentialsd_common::model::{CredentialRequest, Error};
15+
use credentialsd_common::model::Error;
16+
17+
use crate::model::CredentialRequest;
1618

1719
use super::AuthenticatorResponse;
1820

@@ -262,7 +264,7 @@ pub(super) mod test {
262264
proto::ctap2::{Ctap2PublicKeyCredentialDescriptor, Ctap2Transport},
263265
};
264266

265-
use credentialsd_common::model::CredentialRequest;
267+
use crate::model::CredentialRequest;
266268

267269
use super::{HybridEvent, HybridHandler, HybridStateInternal};
268270
#[derive(Debug)]

0 commit comments

Comments
 (0)