diff options
| author | 2009-09-24 18:03:42 -0700 | |
|---|---|---|
| committer | 2009-09-24 19:36:27 -0700 | |
| commit | 1a42cfac152faa98c2e3d9e9fd6889209de195fe (patch) | |
| tree | 93c98637f1e85a64d95cfc44f2cb77d88aabfc5a | |
| parent | 18b1e79a123b979d25bfa5d0b0ee5d0382dbd64b (diff) | |
Use LM_SECURE when auth && encrypt.
LM_SECURE enforces man in the middle (MITM) protection.
Change-Id: Ia800bb657b429f8872d72072f7c9450a74028af0
| -rw-r--r-- | core/jni/android_bluetooth_BluetoothSocket.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/jni/android_bluetooth_BluetoothSocket.cpp b/core/jni/android_bluetooth_BluetoothSocket.cpp index 51cf0cb9232c..70d74d52e7df 100644 --- a/core/jni/android_bluetooth_BluetoothSocket.cpp +++ b/core/jni/android_bluetooth_BluetoothSocket.cpp @@ -124,11 +124,13 @@ static void initSocketNative(JNIEnv *env, jobject obj) { switch (type) { case TYPE_RFCOMM: lm |= auth ? RFCOMM_LM_AUTH : 0; - lm |= encrypt? RFCOMM_LM_ENCRYPT : 0; + lm |= encrypt ? RFCOMM_LM_ENCRYPT : 0; + lm |= (auth && encrypt) ? RFCOMM_LM_SECURE : 0; break; case TYPE_L2CAP: lm |= auth ? L2CAP_LM_AUTH : 0; - lm |= encrypt? L2CAP_LM_ENCRYPT : 0; + lm |= encrypt ? L2CAP_LM_ENCRYPT : 0; + lm |= (auth && encrypt) ? L2CAP_LM_SECURE : 0; break; } |