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

add clone and partialeq to derives, version bump #9

Merged
merged 1 commit into from
Aug 27, 2023
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dco3_crypto"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
authors = ["Octavio Simone"]
repository = "https://github.com/unbekanntes-pferd/dco3-crypto"
Expand Down
10 changes: 5 additions & 5 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::str::Utf8Error;
/// Represents the version of the encrypted file key
/// Indicates which asymmetric keypair version is required
/// Standard is 4096 bit (2048 bit for compatibility only)
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub enum FileKeyVersion {
#[serde(rename = "A")]
RSA2048_AES256GCM,
Expand Down Expand Up @@ -40,7 +40,7 @@ pub enum UserKeyPairVersion {
/// Contains key, iv and tag used for decryption
/// key, iv, and tag are base64 encoded bytes
/// The key is additonally encrypted with public keypair encryption
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FileKey {
pub key: String,
pub iv: String,
Expand Down Expand Up @@ -230,7 +230,7 @@ impl PlainFileKey {
}

/// Possible states of rescue keys in a room
#[derive(Serialize, Debug)]
#[derive(Serialize, Debug, Clone, PartialEq)]
pub enum KeyState {
#[serde(rename = "none")]
None,
Expand All @@ -241,14 +241,14 @@ pub enum KeyState {
}

/// Represents the state of the rescue keys in a room
#[derive(Serialize, Debug)]
#[derive(Serialize, Debug, Clone, PartialEq)]
pub struct EncryptionInfo {
user_key_state: KeyState,
room_key_state: KeyState,
dataspace_key_state: KeyState,
}

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq)]
pub enum DracoonCryptoError {
RsaOperationFailed,
RsaImportFailed,
Expand Down