Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[advisories]
ignore = []
ignore = ["RUSTSEC-2020-0159", # Issue has been documented here: https://github.com/parallaxsecond/parsec/security/advisories/GHSA-45w3-v3g4-54pm
"RUSTSEC-2020-0071"] # Issue has been documented here: https://github.com/parallaxsecond/parsec/security/advisories/GHSA-45w3-v3g4-54pm
informational_warnings = ["unmaintained"] # warn for categories of informational advisories
severity_threshold = "low" # CVSS severity ("none", "low", "medium", "high", "critical")

Expand All @@ -19,7 +20,6 @@ show_tree = true # Show inverse dependency trees along with advisories

# Target Configuration
[target]
arch = "x86_64" # Ignore advisories for CPU architectures other than this one
os = "linux" # Ignore advisories for operating systems other than this one

[packages]
Expand Down
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pkcs11-provider = ["cryptoki", "picky-asn1-der", "picky-asn1", "picky-asn1-x509"
tpm-provider = ["tss-esapi", "picky-asn1-der", "picky-asn1", "picky-asn1-x509", "hex"]
cryptoauthlib-provider = ["rust-cryptoauthlib"]
trusted-service-provider = ["psa-crypto", "bindgen", "prost-build", "prost"]
all-providers = ["tpm-provider", "pkcs11-provider", "mbed-crypto-provider", "cryptoauthlib-provider", "trusted-service-provider"]
all-providers = ["tpm-provider", "pkcs11-provider", "mbed-crypto-provider", "trusted-service-provider"]

# Authenticators
direct-authenticator = []
Expand Down
21 changes: 17 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ disclosure of security problems are greatly appreciated and your contributions w
Currently only the most recent version of the Parsec service is eligible for patching. This could
change in the future.

| Version | Supported |
|-----------------|-----------|
| 0.7.0 | ✅ |
| 0.6.0 and lower | ❌ |
| Version | Supported |
|------------------|-----------|
| 0.7.0 and higher | ✅ |
| 0.6.0 and lower | ❌ |

## Our disclosure policy

All security vulnerabilities affecting the Parsec service - including those reported using the steps
highlighted below, those discovered during routine testing, and those found in our dependency tree
either through `cargo-audit` or otherwise - will receive [security
advisories](https://github.com/parallaxsecond/parsec/security/advisories) in a timely manner. The
advisories should include sufficient information about the cause, effect, and possible mitigations
for the vulnerability. If any information is missing, or you would like to raise a question about
the advisories, please open an issue in [our repo](https://github.com/parallaxsecond/parsec).

Efforts to mitigate for the reported vulnerabilities will be tracked using Github issues linked to
the corresponding advisories.

## Reporting a vulnerability

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
# SPDX-License-Identifier: Apache-2.0
FROM ghcr.io/parallaxsecond/parsec-service-test-all

# Install aarch64-none-linux-gnu cross compilation toolchain
RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz?revision=61c3be5d-5175-4db6-9030-b565aae9f766 -O aarch64-gcc.tar.xz
RUN tar --strip-components=1 -C /usr/ -xvf aarch64-gcc.tar.xz
RUN rm aarch64-gcc.tar.xz

# Install Trusted Services lib compiled for aarch64
# Setup git config for patching dependencies
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "Parsec Team"
RUN git clone https://git.trustedfirmware.org/TS/trusted-services.git --branch integration \
&& cd trusted-services \
&& git reset --hard 389b50624f25dae860bbbf8b16f75b32f1589c8d
# Install correct python dependencies
RUN pip3 install -r trusted-services/requirements.txt
RUN cd trusted-services/deployments/libts/arm-linux/ \
&& cmake . \
&& make \
&& cp libts.so* /usr/local/lib/
RUN rm -rf trusted-services

# Install cross-compilers
RUN apt install -y gcc-multilib
RUN apt install -y gcc-arm-linux-gnueabihf
Expand Down
12 changes: 7 additions & 5 deletions e2e_tests/provider_cfg/all/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ user_pin = "123456"
# The slot_number mandatory field is going to replace the following line with a valid number
# slot_number

[[provider]]
provider_type = "CryptoAuthLib"
key_info_manager = "sqlite-manager"
device_type = "always-success"
iface_type = "test-interface"

# CAL provider and hardware abstraction crate are unmaintained; See #585
# [[provider]]
# provider_type = "CryptoAuthLib"
# key_info_manager = "sqlite-manager"
# device_type = "always-success"
# iface_type = "test-interface"
# wake_delay = 1500
# rx_retries = 20
# # i2c parameters for i2c-pseudo proxy
Expand Down
11 changes: 6 additions & 5 deletions e2e_tests/provider_cfg/all/on-disk-kim-all-providers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ user_pin = "123456"
# The slot_number mandatory field is going to replace the following line with a valid number
# slot_number

[[provider]]
provider_type = "CryptoAuthLib"
key_info_manager = "on-disk-manager"
device_type = "always-success"
iface_type = "test-interface"
# CAL provider and hardware abstraction crate are unmaintained; See #585
# [[provider]]
# provider_type = "CryptoAuthLib"
# key_info_manager = "on-disk-manager"
# device_type = "always-success"
# iface_type = "test-interface"
# wake_delay = 1500
# rx_retries = 20
# # i2c parameters for i2c-pseudo proxy
Expand Down
6 changes: 4 additions & 2 deletions e2e_tests/tests/all_providers/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ fn list_providers() {
Uuid::parse_str("1c1139dc-ad7c-47dc-ad6b-db6fdb466552").unwrap(), // Mbed crypto provider
Uuid::parse_str("1e4954a4-ff21-46d3-ab0c-661eeb667e1d").unwrap(), // Tpm provider
Uuid::parse_str("30e39502-eba6-4d60-a4af-c518b7f5e38f").unwrap(), // Pkcs11 provider
Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap(), // CryptoAuthLib provider
// CAL provider and hardware abstraction crate are unmaintained; See #585
// Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap(), // CryptoAuthLib provider
Uuid::parse_str("47049873-2a43-4845-9d72-831eab668784").unwrap(), // Core provider
]
);
Expand All @@ -78,7 +79,8 @@ fn list_providers() {
Uuid::parse_str("30e39502-eba6-4d60-a4af-c518b7f5e38f").unwrap(), // Pkcs11 provider
Uuid::parse_str("1c1139dc-ad7c-47dc-ad6b-db6fdb466552").unwrap(), // Mbed crypto provider
Uuid::parse_str("1e4954a4-ff21-46d3-ab0c-661eeb667e1d").unwrap(), // Tpm provider
Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap(), // CryptoAuthLib provider
// CAL provider and hardware abstraction crate are unmaintained; See #585
// Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap(), // CryptoAuthLib provider
Uuid::parse_str("47049873-2a43-4845-9d72-831eab668784").unwrap(), // Core provider
]
);
Expand Down
23 changes: 12 additions & 11 deletions e2e_tests/tests/all_providers/config/tomls/list_providers_1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ user_pin = "123456"
# The slot_number mandatory field is going to replace the following line with a valid number
# slot_number

[[provider]]
provider_type = "CryptoAuthLib"
key_info_manager = "sqlite-manager"
device_type = "always-success"
iface_type = "test-interface"
wake_delay = 1500
rx_retries = 20
# i2c parameters for i2c-pseudo proxy
slave_address = 0xc0
bus = 1
baud = 400000
# CAL provider and hardware abstraction crate are unmaintained; See #585
# [[provider]]
# provider_type = "CryptoAuthLib"
# key_info_manager = "sqlite-manager"
# device_type = "always-success"
# iface_type = "test-interface"
# wake_delay = 1500
# rx_retries = 20
# # i2c parameters for i2c-pseudo proxy
# slave_address = 0xc0
# bus = 1
# baud = 400000
23 changes: 12 additions & 11 deletions e2e_tests/tests/all_providers/config/tomls/list_providers_2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ key_info_manager = "sqlite-manager"
tcti = "mssim"
owner_hierarchy_auth = "tpm_pass"

[[provider]]
provider_type = "CryptoAuthLib"
key_info_manager = "sqlite-manager"
device_type = "always-success"
iface_type = "test-interface"
wake_delay = 1500
rx_retries = 20
# i2c parameters for i2c-pseudo proxy
slave_address = 0xc0
bus = 1
baud = 400000
# CAL provider and hardware abstraction crate are unmaintained; See #585
# [[provider]]
# provider_type = "CryptoAuthLib"
# key_info_manager = "sqlite-manager"
# device_type = "always-success"
# iface_type = "test-interface"
# wake_delay = 1500
# rx_retries = 20
# # i2c parameters for i2c-pseudo proxy
# slave_address = 0xc0
# bus = 1
# baud = 400000
36 changes: 20 additions & 16 deletions e2e_tests/tests/all_providers/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::iter::FromIterator;
fn list_providers() {
let mut client = TestClient::new();
let providers = client.list_providers().expect("list providers failed");
assert_eq!(providers.len(), 5);
assert_eq!(providers.len(), 4);
let uuids: HashSet<Uuid> = providers.iter().map(|p| p.uuid).collect();
// Core provider
assert!(uuids.contains(&Uuid::parse_str("47049873-2a43-4845-9d72-831eab668784").unwrap()));
Expand All @@ -25,8 +25,9 @@ fn list_providers() {
assert!(uuids.contains(&Uuid::parse_str("30e39502-eba6-4d60-a4af-c518b7f5e38f").unwrap()));
// TPM provider
assert!(uuids.contains(&Uuid::parse_str("1e4954a4-ff21-46d3-ab0c-661eeb667e1d").unwrap()));
// CryptoAuthLib provider
assert!(uuids.contains(&Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap()));
// CAL provider and hardware abstraction crate are unmaintained; See #585
// // CryptoAuthLib provider
// assert!(uuids.contains(&Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap()));
}

#[test]
Expand All @@ -45,12 +46,13 @@ fn list_providers_order_respected() {
providers[2].uuid,
Uuid::parse_str("30e39502-eba6-4d60-a4af-c518b7f5e38f").unwrap()
);
// CAL provider and hardware abstraction crate are unmaintained; See #585
// assert_eq!(
// providers[3].uuid,
// Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap()
// );
assert_eq!(
providers[3].uuid,
Uuid::parse_str("b8ba81e2-e9f7-4bdd-b096-a29d0019960c").unwrap()
);
assert_eq!(
providers[4].uuid,
Uuid::parse_str("47049873-2a43-4845-9d72-831eab668784").unwrap()
);
}
Expand Down Expand Up @@ -101,9 +103,10 @@ fn list_opcodes() {

let core_provider_opcodes = HashSet::from_iter(core_opcodes);

let mut crypto_providers_cal = HashSet::new();
// Not that much to be tested with test-interface
let _ = crypto_providers_cal.insert(Opcode::PsaGenerateRandom);
// CAL provider and hardware abstraction crate are unmaintained; See #585
// let mut crypto_providers_cal = HashSet::new();
// // Not that much to be tested with test-interface
// let _ = crypto_providers_cal.insert(Opcode::PsaGenerateRandom);

let mut crypto_providers_tpm = HashSet::from_iter(common_opcodes.clone());
let _ = crypto_providers_tpm.insert(Opcode::CanDoCrypto);
Expand Down Expand Up @@ -139,12 +142,13 @@ fn list_opcodes() {
.expect("list providers failed"),
crypto_providers_mbed_crypto
);
assert_eq!(
client
.list_opcodes(ProviderId::CryptoAuthLib)
.expect("list providers failed"),
crypto_providers_cal
);
// CAL provider and hardware abstraction crate are unmaintained; See #585
// assert_eq!(
// client
// .list_opcodes(ProviderId::CryptoAuthLib)
// .expect("list providers failed"),
// crypto_providers_cal
// );
}

#[cfg(feature = "testing")]
Expand Down
3 changes: 1 addition & 2 deletions e2e_tests/tests/per_provider/normal_tests/import_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ fn create_and_import_rsa_key() -> Result<()> {
return Ok(());
}

let status;
client.generate_rsa_sign_key(key_name.clone())?;
status = client
let status = client
.import_rsa_public_key(key_name, KEY_DATA.to_vec())
.expect_err("Key should have already existed");
assert_eq!(status, ResponseStatus::PsaErrorAlreadyExists);
Expand Down
Loading