Skip to content

Commit

Permalink
Remove outdated identity warning API
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleavy committed Dec 4, 2023
1 parent 56c5848 commit 1bdcd89
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 248 deletions.
2 changes: 1 addition & 1 deletion mls-rs-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-core"
version = "0.15.0"
version = "0.16.0"
edition = "2021"
description = "Core components and traits for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand Down
39 changes: 1 addition & 38 deletions mls-rs-core/src/identity/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,13 @@
// Copyright by contributors to this project.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)

use crate::{error::IntoAnyError, extension::ExtensionList, group::RosterUpdate, time::MlsTime};
use crate::{error::IntoAnyError, extension::ExtensionList, time::MlsTime};
#[cfg(mls_build_async)]
use alloc::boxed::Box;
use alloc::vec::Vec;

use super::{CredentialType, SigningIdentity};

#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
/// Customizable identity warning returned by an [`IdentityProvider`].
pub struct IdentityWarning {
member_index: u32,
code: u64,
}

impl IdentityWarning {
/// Create a new identity warning.
pub fn new(member_index: u32, code: u64) -> IdentityWarning {
IdentityWarning { member_index, code }
}

/// Index in the group roster associated with this warning.
pub fn member_index(&self) -> u32 {
self.member_index
}

/// Code to indicate the reason for the warning.
pub fn code(&self) -> u64 {
self.code
}
}

/// Identity system that can be used to validate a
/// [`SigningIdentity`](mls-rs-core::identity::SigningIdentity)
#[cfg_attr(not(mls_build_async), maybe_async::must_be_sync)]
Expand Down Expand Up @@ -87,16 +62,4 @@ pub trait IdentityProvider: Send + Sync {

/// Credential types that are supported by this provider.
fn supported_types(&self) -> Vec<CredentialType>;

/// Throw warnings based on changes to a group roster.
///
/// For example, if a credential consists of only a public key an
/// application may want to issue a warning the key has changed to
/// existing members rather than say the new credential is invalid.
async fn identity_warnings(
&self,
update: &RosterUpdate,
) -> Result<Vec<IdentityWarning>, Self::Error>
where
Self: Sized;
}
14 changes: 7 additions & 7 deletions mls-rs-crypto-awslc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-awslc"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
description = "AWS-LC based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -11,18 +11,18 @@ license = "Apache-2.0 OR MIT"
[dependencies]
aws-lc-rs = "1.5.1"
aws-lc-sys = { version = "0.12.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.6.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.7.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.8.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.7.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.8.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.9.0" }
thiserror = "1.0.40"
zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.7"

[dev-dependencies]
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.6.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.7.0", features = ["test_utils"] }
futures-test = "0.3.25"

[target.'cfg(mls_build_async)'.dependencies]
Expand Down
8 changes: 4 additions & 4 deletions mls-rs-crypto-hpke/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-hpke"
version = "0.6.0"
version = "0.7.0"
edition = "2021"
description = "HPKE implementation based on mls-rs-crypto-traits used by mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -15,8 +15,8 @@ std = ["mls-rs-core/std", "mls-rs-crypto-traits/std", "dep:thiserror", "zeroize/
test_utils = ["mls-rs-core/test_suite"]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.15.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.7.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.16.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.8.0" }
thiserror = { version = "1.0.40", optional = true }
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }
cfg-if = "^1"
Expand All @@ -28,7 +28,7 @@ serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mockall = "0.11"
hex = { version = "^0.4.3", features = ["serde"] }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", features = ["mock"], version = "0.7.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", features = ["mock"], version = "0.8.0" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.26", default-features = false }
Expand Down
14 changes: 7 additions & 7 deletions mls-rs-crypto-openssl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-openssl"
version = "0.6.0"
version = "0.7.0"
edition = "2021"
description = "OpenSSL based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,10 +14,10 @@ default = ["x509"]

[dependencies]
openssl = { version = "0.10.40" }
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.8.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.6.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.7.0" }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0" }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", optional = true, version = "0.9.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.7.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", version = "0.8.0" }
thiserror = "1.0.40"
enum-iterator = "1.1.2"
zeroize = { version = "1", features = ["zeroize_derive"] }
Expand All @@ -28,8 +28,8 @@ hex = { version = "^0.4.3", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.6.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", version = "0.7.0", features = ["test_utils"] }

[target.'cfg(mls_build_async)'.dependencies]
async-trait = "0.1.74"
12 changes: 4 additions & 8 deletions mls-rs-crypto-openssl/src/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use mls_rs_core::{
identity::{CertificateChain, SigningIdentity},
};
use mls_rs_identity_x509::{
CertificateRequestParameters, DerCertificate, DerCertificateRequest, NoOpWarningProvider,
SubjectAltName, SubjectComponent, SubjectIdentityExtractor, X509CredentialValidator,
X509IdentityProvider, X509RequestWriter,
CertificateRequestParameters, DerCertificate, DerCertificateRequest, SubjectAltName,
SubjectComponent, SubjectIdentityExtractor, X509CredentialValidator, X509IdentityProvider,
X509RequestWriter,
};
use openssl::{
bn::BigNumContext,
Expand Down Expand Up @@ -527,10 +527,7 @@ pub fn signing_identity_from_certificate(certificate: &[u8]) -> Result<SigningId
/// Returns a X509 identity provider from a root CA certificate in DER or PEM format
pub fn identity_provider_from_certificate(
certificate: &[u8],
) -> Result<
X509IdentityProvider<SubjectIdentityExtractor<X509Reader>, X509Validator, NoOpWarningProvider>,
X509Error,
> {
) -> Result<X509IdentityProvider<SubjectIdentityExtractor<X509Reader>, X509Validator>, X509Error> {
let certificate = if looks_like_der(certificate) {
X509::from_der(certificate)
} else {
Expand All @@ -541,7 +538,6 @@ pub fn identity_provider_from_certificate(
Ok(X509IdentityProvider::new(
SubjectIdentityExtractor::new(0, X509Reader::new()),
X509Validator::new(vec![certificate.into()])?,
NoOpWarningProvider::new(),
))
}

Expand Down
12 changes: 6 additions & 6 deletions mls-rs-crypto-rustcrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-rustcrypto"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
description = "RustCrypto based CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand Down Expand Up @@ -29,9 +29,9 @@ std = [
]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.15.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.6.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.7.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, version = "0.16.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.7.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, version = "0.8.0" }

thiserror = { version = "1.0.40", optional = true }
zeroize = { version = "1", default-features = false, features = ["alloc", "zeroize_derive"] }
Expand Down Expand Up @@ -71,8 +71,8 @@ hex = { version = "^0.4.3", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
assert_matches = "1.5.0"
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.6.0", features = ["test_utils"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0", features = ["test_suite"] }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, version = "0.7.0", features = ["test_utils"] }

[target.'cfg(mls_build_async)'.dependencies]
async-trait = "0.1.74"
4 changes: 2 additions & 2 deletions mls-rs-crypto-traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-traits"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
description = "Crypto traits required to create a CryptoProvider for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,7 +14,7 @@ std = ["mls-rs-core/std"]
default = ["std"]

[dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0", default-features = false }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0", default-features = false }
mockall = { version = "^0.11", optional = true }
maybe-async = "0.2.7"

Expand Down
10 changes: 5 additions & 5 deletions mls-rs-crypto-webcrypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-crypto-webcrypto"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
description = "SubtleCrypto based CryptoProvider for supporting mls-rs in a browser"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -9,9 +9,9 @@ keywords = ["mls", "mls-rs"]
license = "Apache-2.0 OR MIT"

[dependencies]
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["std"], version = "0.15.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, features = ["std"], version = "0.6.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, features = ["std"], version = "0.7.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["std"], version = "0.16.0" }
mls-rs-crypto-hpke = { path = "../mls-rs-crypto-hpke", default-features = false, features = ["std"], version = "0.7.0" }
mls-rs-crypto-traits = { path = "../mls-rs-crypto-traits", default-features = false, features = ["std"], version = "0.8.0" }
thiserror = "1.0.40"
zeroize = { version = "1", features = ["zeroize_derive"] }
maybe-async = "0.2.7"
Expand All @@ -26,7 +26,7 @@ web-sys = { version = "0.3.64", features = ["Window", "CryptoKey", "CryptoKeyPai
const-oid = { version = "0.9", features = ["db"] }

[dev-dependencies]
mls-rs-core = { path = "../mls-rs-core", version = "0.15.0", features = ["test_suite"] }
mls-rs-core = { path = "../mls-rs-core", version = "0.16.0", features = ["test_suite"] }
wasm-bindgen-test = { version = "0.3.26", default-features = false }
futures-test = "0.3.25"
serde_json = "^1.0"
Expand Down
10 changes: 5 additions & 5 deletions mls-rs-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-ffi"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
description = "Helper crate to generate FFI definitions for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -19,9 +19,9 @@ std = ["mls-rs/std", "safer-ffi-gen/std"]
x509 = ["mls-rs-identity-x509"]

[dependencies]
mls-rs = { path = "../mls-rs", version = "0.35.0", features = ["ffi"] }
mls-rs-crypto-openssl = { path = "../mls-rs-crypto-openssl", version = "0.6.0", optional = true }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.8.0", optional = true }
mls-rs-provider-sqlite = { path = "../mls-rs-provider-sqlite", version = "0.8.0", default-features = false, optional = true }
mls-rs = { path = "../mls-rs", version = "0.36.0", features = ["ffi"] }
mls-rs-crypto-openssl = { path = "../mls-rs-crypto-openssl", version = "0.7.0", optional = true }
mls-rs-identity-x509 = { path = "../mls-rs-identity-x509", version = "0.9.0", optional = true }
mls-rs-provider-sqlite = { path = "../mls-rs-provider-sqlite", version = "0.9.0", default-features = false, optional = true }
safer-ffi = { version = "0.1.3", default-features = false }
safer-ffi-gen = { version = "0.9.2", default-features = false }
10 changes: 2 additions & 8 deletions mls-rs-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ mod openssl_sqlite {
x509::{X509Reader, X509Validator},
OpensslCryptoProvider,
};
use mls_rs_identity_x509::{
NoOpWarningProvider, SubjectIdentityExtractor, X509IdentityProvider,
};
use mls_rs_identity_x509::{SubjectIdentityExtractor, X509IdentityProvider};

pub type OpensslSqlMlsConfig = WithIdentityProvider<
X509IdentityProvider<
SubjectIdentityExtractor<X509Reader>,
X509Validator,
NoOpWarningProvider,
>,
X509IdentityProvider<SubjectIdentityExtractor<X509Reader>, X509Validator>,
WithCryptoProvider<OpensslCryptoProvider, BaseConfig>,
>;

Expand Down
4 changes: 2 additions & 2 deletions mls-rs-identity-x509/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mls-rs-identity-x509"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
description = "X509 Identity utilities for mls-rs"
homepage = "https://github.com/awslabs/mls-rs"
Expand All @@ -14,7 +14,7 @@ std = ["mls-rs-core/std", "dep:thiserror"]

[dependencies]
async-trait = "0.1.74"
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["x509"], version = "0.15.0" }
mls-rs-core = { path = "../mls-rs-core", default-features = false, features = ["x509"], version = "0.16.0" }
maybe-async = "0.2.7"
thiserror = { version = "1.0.40", optional = true }

Expand Down
Loading

0 comments on commit 1bdcd89

Please sign in to comment.