@@ -548,7 +548,7 @@ impl CipherView {
548
548
organization_id : OrganizationId ,
549
549
) -> Result < ( ) , CipherError > {
550
550
let old_key = self . key_identifier ( ) ;
551
- let new_key = SymmetricKeyId :: Organization ( organization_id. into ( ) ) ;
551
+ let new_key = SymmetricKeyId :: Organization ( organization_id) ;
552
552
553
553
// If any attachment is missing a key we can't reencrypt the attachment keys
554
554
if self . attachments . iter ( ) . flatten ( ) . any ( |a| a. key . is_none ( ) ) {
@@ -660,7 +660,7 @@ impl Decryptable<KeyIds, SymmetricKeyId, CipherListView> for Cipher {
660
660
impl IdentifyKey < SymmetricKeyId > for Cipher {
661
661
fn key_identifier ( & self ) -> SymmetricKeyId {
662
662
match self . organization_id {
663
- Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id. into ( ) ) ,
663
+ Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id) ,
664
664
None => SymmetricKeyId :: User ,
665
665
}
666
666
}
@@ -669,7 +669,7 @@ impl IdentifyKey<SymmetricKeyId> for Cipher {
669
669
impl IdentifyKey < SymmetricKeyId > for CipherView {
670
670
fn key_identifier ( & self ) -> SymmetricKeyId {
671
671
match self . organization_id {
672
- Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id. into ( ) ) ,
672
+ Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id) ,
673
673
None => SymmetricKeyId :: User ,
674
674
}
675
675
}
@@ -678,7 +678,7 @@ impl IdentifyKey<SymmetricKeyId> for CipherView {
678
678
impl IdentifyKey < SymmetricKeyId > for CipherListView {
679
679
fn key_identifier ( & self ) -> SymmetricKeyId {
680
680
match self . organization_id {
681
- Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id. into ( ) ) ,
681
+ Some ( organization_id) => SymmetricKeyId :: Organization ( organization_id) ,
682
682
None => SymmetricKeyId :: User ,
683
683
}
684
684
}
@@ -996,7 +996,7 @@ mod tests {
996
996
let org = OrganizationId :: new_v4 ( ) ;
997
997
let key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
998
998
let org_key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
999
- let key_store = create_test_crypto_with_user_and_org_key ( key, org. into ( ) , org_key) ;
999
+ let key_store = create_test_crypto_with_user_and_org_key ( key, org, org_key) ;
1000
1000
1001
1001
// Create a cipher with a user key
1002
1002
let mut cipher = generate_cipher ( ) ;
@@ -1021,7 +1021,7 @@ mod tests {
1021
1021
let org = OrganizationId :: new_v4 ( ) ;
1022
1022
let key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1023
1023
let org_key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1024
- let key_store = create_test_crypto_with_user_and_org_key ( key, org. into ( ) , org_key) ;
1024
+ let key_store = create_test_crypto_with_user_and_org_key ( key, org, org_key) ;
1025
1025
1026
1026
// Create a cipher with a user key
1027
1027
let mut cipher = generate_cipher ( ) ;
@@ -1041,7 +1041,7 @@ mod tests {
1041
1041
let org = OrganizationId :: new_v4 ( ) ;
1042
1042
let key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1043
1043
let org_key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1044
- let key_store = create_test_crypto_with_user_and_org_key ( key, org. into ( ) , org_key) ;
1044
+ let key_store = create_test_crypto_with_user_and_org_key ( key, org, org_key) ;
1045
1045
1046
1046
let mut cipher = generate_cipher ( ) ;
1047
1047
let attachment = AttachmentView {
@@ -1065,8 +1065,8 @@ mod tests {
1065
1065
let org = OrganizationId :: new_v4 ( ) ;
1066
1066
let key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1067
1067
let org_key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1068
- let key_store = create_test_crypto_with_user_and_org_key ( key, org. into ( ) , org_key) ;
1069
- let org_key = SymmetricKeyId :: Organization ( org. into ( ) ) ;
1068
+ let key_store = create_test_crypto_with_user_and_org_key ( key, org, org_key) ;
1069
+ let org_key = SymmetricKeyId :: Organization ( org) ;
1070
1070
1071
1071
// Attachment has a key that is encrypted with the user key, as the cipher has no key itself
1072
1072
let ( attachment_key_enc, attachment_key_val) = {
@@ -1133,8 +1133,8 @@ mod tests {
1133
1133
let org = OrganizationId :: new_v4 ( ) ;
1134
1134
let key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1135
1135
let org_key = SymmetricCryptoKey :: make_aes256_cbc_hmac_key ( ) ;
1136
- let key_store = create_test_crypto_with_user_and_org_key ( key, org. into ( ) , org_key) ;
1137
- let org_key = SymmetricKeyId :: Organization ( org. into ( ) ) ;
1136
+ let key_store = create_test_crypto_with_user_and_org_key ( key, org, org_key) ;
1137
+ let org_key = SymmetricKeyId :: Organization ( org) ;
1138
1138
1139
1139
let mut ctx = key_store. context ( ) ;
1140
1140
0 commit comments