Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Beeep] [Do not merge] Add signing module #113

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
116 changes: 80 additions & 36 deletions Cargo.lock

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

12 changes: 12 additions & 0 deletions crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,32 @@ argon2 = { version = ">=0.5.0, <0.6", features = [
"zeroize",
], default-features = false }
base64 = ">=0.22.1, <0.23"
blake3 = { version = "1.5.5", features = ["zeroize"] }
cbc = { version = ">=0.1.2, <0.2", features = ["alloc", "zeroize"] }
ed25519-dalek = { version = "2.1.1", features = [
"alloc",
"digest",
"pem",
"pkcs8",
"rand_core",
"signature",
] }
generic-array = { version = ">=0.14.7, <1.0", features = ["zeroize"] }
hkdf = ">=0.12.3, <0.13"
hmac = ">=0.12.1, <0.13"
num-bigint = ">=0.4, <0.5"
num-traits = ">=0.2.15, <0.3"
pbkdf2 = { version = ">=0.12.1, <0.13", default-features = false }
pkcs8 = "0.10.2"
rand = ">=0.8.5, <0.9"
rayon = ">=1.8.1, <2.0"
rsa = ">=0.9.2, <0.10"
schemars = { workspace = true }
serde = { workspace = true }
serde_json.workspace = true
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
signature = "2.2.0"
subtle = ">=2.5.0, <3.0"
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
Expand Down
11 changes: 11 additions & 0 deletions crates/bitwarden-crypto/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ pub enum CryptoError {

#[error("Number is zero")]
ZeroNumber,

#[error("Invalid signature algorithm")]
InvalidSignatureAlgorithm,
#[error("Signature Parse Error")]
SignatureParseError,
#[error("Invalid hash algorithm")]
InvalidHashAlgorithm,
#[error("Hash Parse Error")]
HashParseError,
#[error("Invalid signature")]
InvalidSignature,
}

#[derive(Debug, Error)]
Expand Down
Loading
Loading