]> Sergey Matveev's repositories - btrtrc.git/commitdiff
mse: Make plaintext mode the default when protocol header encryption is in use
authorMatt Joiner <anacrolix@gmail.com>
Fri, 15 Sep 2017 02:54:29 +0000 (12:54 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 15 Sep 2017 02:54:29 +0000 (12:54 +1000)
mse/mse.go

index 57fcc0582a672af2ae1b03ab35da5c1d1bdecb50..e257175b9ecd1cfe1759f8ce8c6ed44e7e6969db 100644 (file)
@@ -563,10 +563,10 @@ func sliceIter(skeys [][]byte) SecretKeyIter {
 type SecretKeyIter func(callback func(skey []byte) (more bool))
 
 func DefaultCryptoSelector(provided uint32) uint32 {
-       if provided&CryptoMethodRC4 != 0 {
-               return CryptoMethodRC4
+       if provided&CryptoMethodPlaintext != 0 {
+               return CryptoMethodPlaintext
        }
-       return CryptoMethodPlaintext
+       return CryptoMethodRC4
 }
 
 type CryptoSelector func(uint32) uint32