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:
Artemy
2026-10-24 22:19:08 +07:00
parent 55cc9538f7
commit a3401ceedf
29 changed files with 4322 additions and 36 deletions
@@ -0,0 +1,12 @@
namespace Govor.Domain.Models.Users.Crypto;
public sealed class E2eeIdentityChange
{
public Guid UserId { get; set; }
public long Epoch { get; set; }
public string PreviousIdentityKey { get; set; } = "";
public string IdentityKey { get; set; } = "";
public long ChangedAt { get; set; }
public Guid? PreviousSessionId { get; set; }
public string? PreviousDeviceKeyJson { get; set; }
}
@@ -7,4 +7,8 @@ public sealed class E2eeRecoveryVault
public string IdentityKey { get; set; } = "";
public string Ciphertext { get; set; } = "";
public string Signature { get; set; } = "";
public long Epoch { get; set; }
public long PasswordCredentialVersion { get; set; }
public string? PasswordCiphertext { get; set; }
public string? PasswordSignature { get; set; }
}
+5 -1
View File
@@ -8,6 +8,10 @@ public class User
public string Username {get; set;}
public string Description {get; set;}
public string PasswordHash {get; set;}
public string? SrpSalt { get; set; }
public string? SrpIdentity { get; set; }
public string? SrpVerifier { get; set; }
public long CredentialVersion { get; set; }
public Guid IconId {get; set;}
public DateOnly CreatedOn {get; set;}
public DateTime WasOnline {get; set;}
@@ -22,4 +26,4 @@ public class User
return Id == user.Id;
}
}
}