Added command to add master password
This commit is contained in:
@ -11,7 +11,7 @@ pub struct Model {
|
||||
pub user_id: u64,
|
||||
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(64)))")]
|
||||
pub salt: Vec<u8>,
|
||||
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(128)))")]
|
||||
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(64)))")]
|
||||
pub password_hash: Vec<u8>,
|
||||
}
|
||||
|
||||
@ -28,9 +28,9 @@ impl ActiveModel {
|
||||
Params::RECOMMENDED_LOG_N,
|
||||
Params::RECOMMENDED_R,
|
||||
Params::RECOMMENDED_P,
|
||||
128,
|
||||
64,
|
||||
)?;
|
||||
let mut password_hash = vec![0; 128];
|
||||
let mut password_hash = vec![0; 64];
|
||||
scrypt(password.as_ref(), &salt, ¶ms, &mut password_hash)?;
|
||||
Ok(Self {
|
||||
user_id: Set(user_id),
|
||||
|
Reference in New Issue
Block a user