Skip to content

Commit 02edf2b

Browse files
authored
Merge pull request #167 from t-ae/follow-crypt-api-change
Follow API change in Crypto
2 parents f9b81e1 + 5cb4407 commit 02edf2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/MySQL/Connection/MySQLConnection+Authenticate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extension MySQLConnection {
3333
throw MySQLError(identifier: "salt", reason: "Server-supplied salt too short.", source: .capture())
3434
}
3535
let salt = Data(handshake.authPluginData[..<20])
36-
let passwordHash = try SHA1.digest(password)
37-
let passwordDoubleHash = try SHA1.digest(passwordHash)
38-
var hash = try SHA1.digest(salt + passwordDoubleHash)
36+
let passwordHash = try SHA1.hash(password)
37+
let passwordDoubleHash = try SHA1.hash(passwordHash)
38+
var hash = try SHA1.hash(salt + passwordDoubleHash)
3939
for i in 0..<20 {
4040
hash[i] = hash[i] ^ passwordHash[i]
4141
}

0 commit comments

Comments
 (0)