Simplify crypto select func

This commit is contained in:
Matt Joiner 2018-02-08 23:52:31 +11:00
parent 5023dcaa3a
commit e3fdd4890e
1 changed files with 10 additions and 13 deletions

View File

@ -188,7 +188,6 @@ func handleEncryption(
}
headerEncrypted = true
ret, err = mse.ReceiveHandshake(rw, skeys, func(provides uint32) uint32 {
cryptoMethod = func() uint32 {
switch {
case policy.ForceEncryption:
return mse.CryptoMethodRC4
@ -199,8 +198,6 @@ func handleEncryption(
default:
return mse.DefaultCryptoSelector(provides)
}
}()
return cryptoMethod
})
return
}