Skip to content

Commit

Permalink
feat(Account): don't create an unused hash when signing up with key
Browse files Browse the repository at this point in the history
The hash is only used to generate the main_key when signing up/logging
in with a password; when main_key is supplied directly, it is unused.
  • Loading branch information
Xiretza committed May 23, 2022
1 parent daf79c3 commit 5c6ae1f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use super::{
LoginChallange, LoginResponseUser, User, UserProfile,
},
utils::{
buffer_unpad, from_base64, randombytes, randombytes_array, to_base64, MsgPackSerilization,
StrBase64, SYMMETRIC_KEY_SIZE,
buffer_unpad, from_base64, randombytes_array, to_base64, MsgPackSerilization, StrBase64,
SYMMETRIC_KEY_SIZE,
},
};

Expand Down Expand Up @@ -124,9 +124,7 @@ impl Account {
.try_into()
.map_err(|_| Error::ProgrammingError("Key should be exactly 32 bytes long."))?;

let salt = randombytes(32);

Self::signup_common(client, user, main_key, &salt)
Self::signup_common(client, user, main_key, &[])
}

fn signup_common(
Expand Down

0 comments on commit 5c6ae1f

Please sign in to comment.