mirror of https://github.com/cbeuw/Cloak
Avoid unnecessary pass by pointer
This commit is contained in:
parent
2bf7df0eb0
commit
a51d45f41a
|
|
@ -137,8 +137,8 @@ func MakeDeobfs(salsaKey [32]byte, payloadCipher cipher.AEAD) Deobfser {
|
|||
return deobfs
|
||||
}
|
||||
|
||||
func MakeObfuscator(encryptionMethod byte, sessionKey [32]byte) (obfuscator *Obfuscator, err error) {
|
||||
obfuscator = &Obfuscator{
|
||||
func MakeObfuscator(encryptionMethod byte, sessionKey [32]byte) (obfuscator Obfuscator, err error) {
|
||||
obfuscator = Obfuscator{
|
||||
SessionKey: sessionKey,
|
||||
}
|
||||
var payloadCipher cipher.AEAD
|
||||
|
|
@ -164,7 +164,7 @@ func MakeObfuscator(encryptionMethod byte, sessionKey [32]byte) (obfuscator *Obf
|
|||
}
|
||||
obfuscator.minOverhead = payloadCipher.Overhead()
|
||||
default:
|
||||
return nil, errors.New("Unknown encryption method")
|
||||
return obfuscator, errors.New("Unknown encryption method")
|
||||
}
|
||||
|
||||
obfuscator.Obfs = MakeObfs(sessionKey, payloadCipher)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ var errRepeatSessionClosing = errors.New("trying to close a closed session")
|
|||
type switchboardStrategy int
|
||||
|
||||
type SessionConfig struct {
|
||||
*Obfuscator
|
||||
Obfuscator
|
||||
|
||||
Valve
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue