More secure key generation

This commit is contained in:
Laura Hausmann 2021-01-26 00:55:10 +01:00
parent 220ea3ad95
commit 55e299f8d8
Signed by: zotan
GPG Key ID: 5EC1D38FFC321311
3 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ namespace RTMPDash.Pages {
var db = new AppDb.DbConn();
if (Request.Form["action"] == "invite_generate")
db.Insert(new Invite {Code = Guid.NewGuid().ToString().Substring(9, 14)});
db.Insert(new Invite {Code = Guid.NewGuid().ToString()});
if (Request.Form["action"] == "invite_revoke")
db.Delete(db.Invites.First(p => p.Code == Request.Form["target"]));

View File

@ -76,7 +76,7 @@ namespace RTMPDash.Pages {
}
if (Request.Form["action"] == "streamkey_reset") {
user!.StreamKey = Guid.NewGuid().ToString().Substring(9, 14);
user!.StreamKey = Guid.NewGuid().ToString();
db.Update(user);
}
}

View File

@ -29,7 +29,7 @@ namespace RTMPDash.Pages {
user = new User {
Username = Request.Form["user"].ToString(),
Password = Request.Form["pass"].ToString().Sha256(),
StreamKey = Guid.NewGuid().ToString().Substring(9, 14),
StreamKey = Guid.NewGuid().ToString(),
PronounSubject = "they",
PronounPossessive = "their"
};