mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-17 04:58:46 +00:00
Add SRP password recovery and E2EE reset
Add proof-based password registration, login, enrollment, and change flows, with rate limiting and encrypted recovery-key envelopes. Support explicit E2EE identity resets while preserving historical signer verification, and document and test the new recovery workflows.
This commit is contained in:
@@ -33,6 +33,19 @@ public class UsersService : IUsersAdministration
|
||||
return;
|
||||
|
||||
user.PasswordHash = _passwordHasher.Hash(password);
|
||||
user.SrpVerifier = null;
|
||||
user.SrpSalt = null;
|
||||
user.SrpIdentity = null;
|
||||
user.CredentialVersion++;
|
||||
var recovery = await _context.E2eeRecoveryVaults.SingleOrDefaultAsync(v => v.UserId == userId);
|
||||
if (recovery is not null)
|
||||
{
|
||||
// An administrator can reset authentication, but cannot rewrap an
|
||||
// encryption key without knowing a client-side recovery secret.
|
||||
recovery.PasswordCiphertext = null;
|
||||
recovery.PasswordSignature = null;
|
||||
recovery.PasswordCredentialVersion = 0;
|
||||
}
|
||||
|
||||
var sessions = await _context.UserSessions.Where(s => s.UserId == userId && !s.IsRevoked).ToListAsync();
|
||||
foreach (var session in sessions)
|
||||
|
||||
Reference in New Issue
Block a user