Reset rather than nil out Authenticator
For reuse in control channel.
This commit is contained in:
parent
a7aa78141e
commit
f6d915e6dd
|
@ -62,9 +62,9 @@ extension OpenVPN {
|
||||||
|
|
||||||
private(set) var serverRandom2: ZeroingData?
|
private(set) var serverRandom2: ZeroingData?
|
||||||
|
|
||||||
let username: ZeroingData?
|
private(set) var username: ZeroingData?
|
||||||
|
|
||||||
let password: ZeroingData?
|
private(set) var password: ZeroingData?
|
||||||
|
|
||||||
var withLocalOptions: Bool
|
var withLocalOptions: Bool
|
||||||
|
|
||||||
|
@ -87,6 +87,17 @@ extension OpenVPN {
|
||||||
controlBuffer = Z()
|
controlBuffer = Z()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func reset() {
|
||||||
|
controlBuffer.zero()
|
||||||
|
preMaster.zero()
|
||||||
|
random1.zero()
|
||||||
|
random2.zero()
|
||||||
|
serverRandom1?.zero()
|
||||||
|
serverRandom2?.zero()
|
||||||
|
username = nil
|
||||||
|
password = nil
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: Authentication request
|
// MARK: Authentication request
|
||||||
|
|
||||||
// Ruby: on_tls_connect
|
// Ruby: on_tls_connect
|
||||||
|
|
|
@ -745,7 +745,7 @@ public class OpenVPNSession: Session {
|
||||||
|
|
||||||
private func completeConnection() {
|
private func completeConnection() {
|
||||||
setupEncryption()
|
setupEncryption()
|
||||||
authenticator = nil
|
authenticator?.reset()
|
||||||
negotiationKey.controlState = .connected
|
negotiationKey.controlState = .connected
|
||||||
connectedDate = Date()
|
connectedDate = Date()
|
||||||
transitionKeys()
|
transitionKeys()
|
||||||
|
|
Loading…
Reference in New Issue