Skip to content

Commit

Permalink
Upgrade basic credential (openmls#1397)
Browse files Browse the repository at this point in the history
* Upgrade P256

* Bump version & remove patches
  • Loading branch information
raphaelrobert authored May 31, 2023
1 parent e6a8a56 commit eaad113
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 35 deletions.
12 changes: 0 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,3 @@ resolver = "2"
# Patching unreleased crates
[workspace.dependencies]
tls_codec = { version = "0.3.0-pre.3", features = ["derive", "serde", "mls"] }

[patch.crates-io.hpke-rs]
git = "https://github.com/franziskuskiefer/hpke-rs.git"

[patch.crates-io.hpke-rs-crypto]
git = "https://github.com/franziskuskiefer/hpke-rs.git"

[patch.crates-io.hpke-rs-evercrypt]
git = "https://github.com/franziskuskiefer/hpke-rs.git"

[patch.crates-io.hpke-rs-rust-crypto]
git = "https://github.com/franziskuskiefer/hpke-rs.git"
6 changes: 3 additions & 3 deletions basic_credential/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openmls_basic_credential"
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
authors = ["OpenMLS Authors"]
edition = "2021"
description = "A Basic Credential implementation for OpenMLS"
Expand All @@ -10,13 +10,13 @@ repository = "https://github.com/openmls/openmls/tree/main/basic_credential"
readme = "README.md"

[dependencies]
openmls_traits = { version = "0.2.0-pre.0", path = "../traits" }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits" }
tls_codec = { workspace = true }
serde = "1.0"

# Rust Crypto
ed25519-dalek = { version = "1.0" }
p256 = { version = "0.11" }
p256 = { version = "0.13" }
rand-07 = {version = "0.7", package = "rand" } # only needed because of ed25519-dalek
rand = "0.8"

Expand Down
7 changes: 4 additions & 3 deletions basic_credential/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use openmls_traits::{
types::{CryptoError, Error, SignatureScheme},
};

use p256::ecdsa::SigningKey;
use p256::ecdsa::{signature::Signer as P256Signer, Signature, SigningKey};

// See https://github.com/rust-analyzer/rust-analyzer/issues/7243
// for the rust-analyzer issue with the following line.
Expand Down Expand Up @@ -46,8 +46,9 @@ impl Signer for SignatureKeyPair {
fn sign(&self, payload: &[u8]) -> Result<Vec<u8>, Error> {
match self.signature_scheme {
SignatureScheme::ECDSA_SECP256R1_SHA256 => {
let k = SigningKey::from_bytes(&self.private).map_err(|_| Error::SigningError)?;
let signature = k.sign(payload);
let k = SigningKey::from_bytes(self.private.as_slice().into())
.map_err(|_| Error::SigningError)?;
let signature: Signature = k.sign(payload);
Ok(signature.to_der().to_bytes().into())
}
SignatureScheme::ED25519 => {
Expand Down
6 changes: 3 additions & 3 deletions evercrypt_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "openmls_evercrypt"
authors = ["OpenMLS Authors"]
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
edition = "2018"
description = "A crypto backend for OpenMLS implementing openmls_traits using HACL/Evercrypt."
license = "MIT"
Expand All @@ -10,9 +10,9 @@ repository = "https://github.com/openmls/openmls/tree/main/evercrypt_backend"
readme = "README.md"

[dependencies]
openmls_traits = { version = "0.2.0-pre.0", path = "../traits" }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits" }
evercrypt = { version = "0.0.11", features = ["serialization"] }
openmls_memory_keystore = { version = "0.2.0-pre.0", path = "../memory_keystore", package = "openmls_memory_keystore" }
openmls_memory_keystore = { version = "0.2.0-pre.1", path = "../memory_keystore", package = "openmls_memory_keystore" }
rand = "0.8"
rand_chacha = { version = "0.3" }
hpke = { version = "0.1.0", package = "hpke-rs", features = ["hazmat", "serialization"] }
Expand Down
4 changes: 2 additions & 2 deletions interop_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "interop_client"
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
authors = ["OpenMLS Authors"]
edition = "2021"

Expand All @@ -24,6 +24,6 @@ clap_derive = "4.1"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
tls_codec = { workspace = true }
openmls_basic_credential = { version = "0.2.0-pre.0", path = "../basic_credential" }
openmls_basic_credential = { version = "0.2.0-pre.1", path = "../basic_credential" }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
4 changes: 2 additions & 2 deletions memory_keystore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "openmls_memory_keystore"
authors = ["OpenMLS Authors"]
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
edition = "2021"
description = "A very basic key store for OpenMLS implementing openmls_traits."
license = "MIT"
Expand All @@ -10,6 +10,6 @@ repository = "https://github.com/openmls/openmls/tree/main/memory_keystore"
readme = "README.md"

[dependencies]
openmls_traits = { version = "0.2.0-pre.0", path = "../traits" }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits" }
thiserror = "1.0"
serde_json = "1.0"
12 changes: 6 additions & 6 deletions openmls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openmls"
version = "0.5.0-pre.0"
version = "0.5.0-pre.1"
authors = ["OpenMLS Authors"]
edition = "2021"
description = "A Rust implementation of the Messaging Layer Security (MLS) protocol."
Expand All @@ -10,7 +10,7 @@ repository = "https://github.com/openmls/openmls/"
readme = "../README.md"

[dependencies]
openmls_traits = { version = "0.2.0-pre.0", path = "../traits" }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits" }
serde = { version = "^1.0", features = ["derive"] }
log = { version = "0.4", features = ["std"] }
tls_codec = { workspace = true }
Expand All @@ -22,9 +22,9 @@ rand = { version = "0.8", optional = true }
serde_json = { version = "1.0", optional = true }
# Crypto backends required for KAT and testing - "test-utils" feature
itertools = { version = "0.10", optional = true }
openmls_rust_crypto = { version = "0.2.0-pre.0", path = "../openmls_rust_crypto", optional = true }
openmls_evercrypt = { version = "0.2.0-pre.0", path = "../evercrypt_backend", optional = true }
openmls_basic_credential = { version = "0.2.0-pre.0", path = "../basic_credential", optional = true, features = ["clonable", "test-utils"] }
openmls_rust_crypto = { version = "0.2.0-pre.1", path = "../openmls_rust_crypto", optional = true }
openmls_evercrypt = { version = "0.2.0-pre.1", path = "../evercrypt_backend", optional = true }
openmls_basic_credential = { version = "0.2.0-pre.1", path = "../basic_credential", optional = true, features = ["clonable", "test-utils"] }
rstest = { version = "^0.16", optional = true }
rstest_reuse = { version = "0.4", optional = true }

Expand All @@ -51,7 +51,7 @@ hex = { version = "0.4", features = ["serde"] }
itertools = "0.10"
lazy_static = "1.4"
openmls = { path = ".", features = ["test-utils"] }
openmls_traits = { version = "0.2.0-pre.0", path = "../traits", features = ["test-utils"] }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits", features = ["test-utils"] }
pretty_env_logger = "0.4"
rstest = "^0.16"
rstest_reuse = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions openmls_rust_crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "openmls_rust_crypto"
authors = ["OpenMLS Authors"]
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
edition = "2021"
description = "A crypto backend for OpenMLS implementing openmls_traits using RustCrypto primitives."
license = "MIT"
Expand All @@ -10,8 +10,8 @@ repository = "https://github.com/openmls/openmls/tree/main/openmls_rust_crypto"
readme = "README.md"

[dependencies]
openmls_traits = { version = "0.2.0-pre.0", path = "../traits" }
openmls_memory_keystore = { version = "0.2.0-pre.0", path = "../memory_keystore" }
openmls_traits = { version = "0.2.0-pre.1", path = "../traits" }
openmls_memory_keystore = { version = "0.2.0-pre.1", path = "../memory_keystore" }
# Rust Crypto dependencies
sha2 = { version = "0.10" }
aes-gcm = { version = "0.9" }
Expand Down
2 changes: 1 addition & 1 deletion traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openmls_traits"
version = "0.2.0-pre.0"
version = "0.2.0-pre.1"
authors = ["OpenMLS Authors"]
edition = "2021"
description = "Traits used by OpenMLS"
Expand Down

0 comments on commit eaad113

Please sign in to comment.