Anpassungen Variablen/Logik

This commit is contained in:
ja
2021-12-31 09:28:29 +01:00
parent 31d62f79d9
commit 284a7c26a1
10 changed files with 392 additions and 161 deletions

View File

@@ -129,7 +129,7 @@ Partial Class login_Change_PW
MsgBox("")
End Sub
Protected Sub btn_submitpw_Click(sender As Object, e As EventArgs)
Protected Async Sub btn_submitpw_Click(sender As Object, e As EventArgs)
Dim tempstr As String = ""
Dim UsernameDB As String = String.Empty
Dim pwDB As String = String.Empty
@@ -240,8 +240,8 @@ Partial Class login_Change_PW
ConnectionString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
End If
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
Dim isPasswDBhash As Byte() = gensaltPassw(UsernameDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
Dim isPasswhash As Byte() = Await gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
Dim isPasswDBhash As Byte() = Await gensaltPassw(UsernameDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
If regexval_txt_Pw.IsValid = True Then
If VERAG_VARIABLES.Verifyhash(txt_Pw.Text, salt, isPasswDBhash, intzahliterats, intzahl) = True And VERAG_VARIABLES.Verifyhash(txt_Pw_WH.Text, salt, VERAG_VARIABLES.HashPassword(txt_Pw.Text, salt, intzahliterats, intzahl), intzahliterats, intzahl) = True Then
Using con As New SqlConnection(ConnectionString)
@@ -356,7 +356,7 @@ Partial Class login_Change_PW
End If
End Sub
Protected Sub btn_submitpw_M_Click(sender As Object, e As EventArgs)
Protected Async Sub btn_submitpw_M_Click(sender As Object, e As EventArgs)
Dim tempstr As String = ""
Dim pwDB As String = String.Empty
Dim EmailDB As String = String.Empty
@@ -459,8 +459,8 @@ Partial Class login_Change_PW
End If
Using con As New SqlConnection(ConnectionString)
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
Dim isPasswDBhash As Byte() = gensaltPassw(usrnmDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
Dim isPasswhash As Byte() = Await gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
Dim isPasswDBhash As Byte() = Await gensaltPassw(usrnmDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
If regexval_txt_Pw.IsValid = True Then
If VERAG_VARIABLES.Verifyhash(tempstr, salt, isPasswhash, intzahliterats, intzahl) = True AndAlso VERAG_VARIABLES.Verifyhash(pwDB, salt, isPasswDBhash, intzahliterats, intzahl) = True Then
Using cmd As New SqlCommand("UPDATE [VERAG_HOMEPAGE].[dbo].[Users] SET Password=@Password WHERE Username=@Username AND UserId=@UserId")
@@ -528,12 +528,12 @@ Partial Class login_Change_PW
End If
End Sub
Function gensaltPassw(username As String, password As String, intzahliterats As Integer, intzahl As Integer, email As String, isnewSession As Boolean) As Byte()
Async Function gensaltPassw(username As String, password As String, intzahliterats As Integer, intzahl As Integer, email As String, isnewSession As Boolean) As Task(Of Byte())
If isnewSession = False Then
Dim token As Byte()
'Dim tok As Byte = Convert.ToBase64String(time.Concat(Key).ToArray())
Dim tok As String = password
token = VERAG_VARIABLES.HashPassword(password, salt, intzahliterats, intzahl)
token = Await VERAG_VARIABLES.HashPasswordAsync(password, salt, intzahliterats, intzahl)
Return token
End If
End Function