1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-16 18:30:01 +00:00
This commit is contained in:
kepler155c@gmail.com 2019-06-30 17:40:57 -04:00
parent 86e918667c
commit 159dc622fd

View File

@ -106,14 +106,15 @@ local function newSocket(isLoopback)
end end
local function setupCrypto(socket, isClient) local function setupCrypto(socket, isClient)
socket.sharedKey = ECC.exchange(socket.privKey, socket.remotePubKey)
socket.enckey = SHA.pbkdf2(socket.sharedKey, "1enc", 1)
--self.hmackey = SHA.pbkdf2(self.sharedKey, "2hmac", 1)
socket.rrng = Crypto.newRNG( socket.rrng = Crypto.newRNG(
SHA.pbkdf2(socket.sharedKey, isClient and "3rseed" or "4sseed", 1)) SHA.pbkdf2(socket.sharedKey, isClient and "3rseed" or "4sseed", 1))
socket.wrng = Crypto.newRNG( socket.wrng = Crypto.newRNG(
SHA.pbkdf2(socket.sharedKey, isClient and "4sseed" or "3rseed", 1)) SHA.pbkdf2(socket.sharedKey, isClient and "4sseed" or "3rseed", 1))
socket.sharedKey = ECC.exchange(socket.privKey, socket.remotePubKey)
socket.enckey = SHA.pbkdf2(socket.sharedKey, "1enc", 1)
--self.hmackey = SHA.pbkdf2(self.sharedKey, "2hmac", 1)
socket.rseq = socket.rrng:nextInt(5) socket.rseq = socket.rrng:nextInt(5)
socket.wseq = socket.wrng:nextInt(5) socket.wseq = socket.wrng:nextInt(5)
end end