feat(server::db): add share_salt column to operator table
Each operator row now stores a 32-byte random salt used to derive the per-operator share encryption key from their passphrase (Argon2 KDF).
This commit is contained in:
@@ -56,6 +56,7 @@ create table if not exists operator (
|
|||||||
|
|
||||||
share blob not null,
|
share blob not null,
|
||||||
share_nonce blob not null,
|
share_nonce blob not null,
|
||||||
|
share_salt blob not null default (randomblob(32)),
|
||||||
|
|
||||||
created_at integer not null default(unixepoch ('now')),
|
created_at integer not null default(unixepoch ('now')),
|
||||||
updated_at integer not null default(unixepoch ('now'))
|
updated_at integer not null default(unixepoch ('now'))
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ pub struct Operator {
|
|||||||
pub id: OperatorId,
|
pub id: OperatorId,
|
||||||
pub share: Vec<u8>,
|
pub share: Vec<u8>,
|
||||||
pub share_nonce: Vec<u8>,
|
pub share_nonce: Vec<u8>,
|
||||||
|
pub share_salt: Vec<u8>,
|
||||||
pub created_at: SqliteTimestamp,
|
pub created_at: SqliteTimestamp,
|
||||||
pub updated_at: SqliteTimestamp,
|
pub updated_at: SqliteTimestamp,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ diesel::table! {
|
|||||||
id -> Nullable<Integer>,
|
id -> Nullable<Integer>,
|
||||||
share -> Binary,
|
share -> Binary,
|
||||||
share_nonce -> Binary,
|
share_nonce -> Binary,
|
||||||
|
share_salt -> Binary,
|
||||||
created_at -> Integer,
|
created_at -> Integer,
|
||||||
updated_at -> Integer,
|
updated_at -> Integer,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user